diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1e42b05..cae404d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: build-library-and-examples: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Prepare run: | sudo apt-get update @@ -48,7 +48,7 @@ jobs: cd examples/ make - name: Create k8s kind cluster - uses: helm/kind-action@v1.10.0 + uses: helm/kind-action@v1.13.0 - name: Test examples run: | kubectl cluster-info --context kind-chart-testing @@ -61,3 +61,10 @@ jobs: kubectl describe node cd examples/ LD_LIBRARY_PATH=$GITHUB_WORKSPACE/kubernetes/build/:/usr/local/lib make memcheck + - name: use bazel for examples + run: | + curl -LO "https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64" + chmod +x bazelisk-linux-amd64 + sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel + bazel build kube_c_library + \ No newline at end of file diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index 0275b2e5..5a022af6 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -10,7 +10,7 @@ jobs: code-static-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Prepare run: | sudo apt-get update @@ -22,7 +22,7 @@ jobs: code-style-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Prepare run: | sudo apt-get update diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 65142917..a56d43a1 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -29,8 +29,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout C - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 + uses: actions/checkout@v5 + - uses: actions/setup-java@v5 with: distribution: 'temurin' java-version: '17' @@ -78,8 +78,8 @@ jobs: - name: Commit and push run: | # Commit and push - git config user.email "k8s.ci.robot@gmail.com" - git config user.name "Kubernetes Prow Robot" + git config user.email "k8s-publishing-bot@users.noreply.github.com" + git config user.name "Kubernetes Publisher" git checkout -b "$BRANCH" git add . git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c805828..7dcc6260 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,15 +22,15 @@ jobs: echo "${{ github.ref_name }}" | perl -ne 'die unless m/^release-\d+\.\d+$/' echo "${{ github.event.inputs.releaseVersion }}" | perl -ne 'die unless m/^\d+\.\d+\.\d+$/' - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Check Actor run: | # Release actor should be in the OWNER list cat OWNERS | grep ${{ github.actor }} - name: Prepare run: | - git config user.email "k8s.ci.robot@gmail.com" - git config user.name "Kubernetes Prow Robot" + git config user.email "k8s-publishing-bot@users.noreply.github.com" + git config user.name "Kubernetes Publisher" - name: Release Prepare run: | git tag -a v${{ github.event.inputs.releaseVersion }} -m "version ${{ github.event.inputs.releaseVersion }}" diff --git a/BUILD b/BUILD new file mode 100644 index 00000000..7e04f3cd --- /dev/null +++ b/BUILD @@ -0,0 +1,88 @@ +# Added BUILD file in the kubernetes c client repository helps integrating the library to external Bazel users. +# Following are the changes required from the external Bazel users to do. + +# WORKSPACE + +# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +# http_archive( +# name = "rules_foreign_cc", +# sha256 = "a2e6fb56e649c1ee79703e99aa0c9d13c6cc53c8d7a0cbb8797ab2888bbc99a3", +# strip_prefix = "rules_foreign_cc-0.12.0", +# url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.12.0/rules_foreign_cc-0.12.0.tar.gz", +# ) + +# load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") + +# # This sets up some common toolchains for building targets. For more details, please see +# # https://bazelbuild.github.io/rules_foreign_cc/0.12.0/flatten.html#rules_foreign_cc_dependencies +# rules_foreign_cc_dependencies() + +# load("@bazel_features//:deps.bzl", "bazel_features_deps") + +# bazel_features_deps() + +# http_archive( +# name = "kubernetes_c_client", +# sha256 = "10d0c5af1a52a1d2da379e8e45b53978b9dedc90ff195bdff171ae17c1f1dd50", +# strip_prefix = "c-0.11.0", +# url = "https://github.com/kubernetes-client/c/archive/refs/tags/v0.11.0.zip", +# ) + +# BUILD file: + +# load("@rules_cc//cc:defs.bzl", "cc_binary") +# load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") +# load("@rules_foreign_cc//foreign_cc:defs.bzl", "make") +# cmake( +# name = "kube_c", +# build_args = [ +# "--verbose", +# "--", # <- Pass remaining options to the native tool. +# "-j 1", +# ], +# lib_source = "@kubernetes_c_client//:kubernetes", +# out_shared_libs = ["libkubernetes.so"], +# ) + +# cc_binary( +# name = "create_pod", +# srcs = ["create_pod.c"], +# deps = [":kube_c"], +# ) + +# cc_binary( +# name = "list_pod", +# srcs = ["list_pod.c"], +# deps = [":kube_c"], +# ) + +# Make sure you install the pre-requisites (libyaml,libwebsocket etc.) beforehand. A working example can be found in the example directory. + +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") +load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake", "make") + +filegroup( + name = "kubernetes", + srcs = glob(["kubernetes/**"]), + visibility = ["//visibility:public"], +) + +cmake( + name = "kube_c", + build_args = [ + "--verbose", + "--", # <- Pass remaining options to the native tool. + "-j 1", + ], + lib_source = ":kubernetes", + out_shared_libs = ["libkubernetes.so"], +) + +# create lib files (.so or .a) +cc_library( + name = "kube_c_library", + hdrs = [":kubernetes"], # Explicitly add headers if needed + strip_include_prefix = "kubernetes", + visibility = ["//visibility:public"], + deps = [":kube_c"], +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 00000000..98d73afb --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,2 @@ +bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "rules_foreign_cc", version = "0.13.0") \ No newline at end of file diff --git a/README.md b/README.md index 31921d1c..80381669 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ git clone https://github.com/kubernetes-client/c CLIENT_REPO_ROOT=${PWD}/c # Install pre-requisites -sudo apt-get install libssl-dev libcurl4-openssl-dev libwebsockets-dev uncrustify +sudo apt-get install libssl-dev libcurl4-openssl-dev libwebsockets-dev uncrustify cmake # Build pre-requisite: libyaml git clone https://github.com/yaml/libyaml --depth 1 --branch release/0.2.5 @@ -33,6 +33,10 @@ mkdir build cd build # If you don't need to debug the C client library: cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. + +# To build a static linked client library: +# cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_STATIC_LIBS=ON .. + # If you want to use `gdb` to debug the C client library, add `-DCMAKE_BUILD_TYPE=Debug` to the cmake command line, e.g. # cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local .. make diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 00000000..e69de29b diff --git a/docs/versioning-and-compatibility.md b/docs/versioning-and-compatibility.md index 6a345cf5..b3bce576 100644 --- a/docs/versioning-and-compatibility.md +++ b/docs/versioning-and-compatibility.md @@ -6,19 +6,14 @@ The C client uses Semantic Versioning. We increment the major version number whe ## Compatibility -| client version | 1.17 | 1.18 | 1.19 | 1.20 | 1.21 | 1.22 | 1.23 | 1.24 | 1.25 | 1.26 | 1.27 | 1.28 | 1.29 | 1.30 | -|------------------|-----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------| -| 0.1.0 | ✓ | - | - | x | x | x | x | x | x | x | x | x | x | x | -| 0.2.0 | + | + | + | + | + | ✓ | - | - | x | x | x | x | x | x | -| 0.3.0 | + | + | + | + | + | + | ✓ | - | - | x | x | x | x | x | -| 0.4.0 | + | + | + | + | + | + | + | ✓ | - | - | x | x | x | x | -| 0.5.0 | + | + | + | + | + | + | + | + | ✓ | - | - | x | x | x | -| 0.6.0 | + | + | + | + | + | + | + | + | + | ✓ | - | - | x | x | -| 0.7.0 | + | + | + | + | + | + | + | + | + | + | ✓ | - | - | x | -| 0.8.0 | + | + | + | + | + | + | + | + | + | + | + | ✓ | - | - | -| 0.9.0 | + | + | + | + | + | + | + | + | + | + | + | + | ✓ | - | -| 0.10.0 | + | + | + | + | + | + | + | + | + | + | + | + | + | ✓ | -| HEAD | + | + | + | + | + | + | + | + | + | + | + | + | + | ✓ | +| client version | 1.28 | 1.29 | 1.30 | 1.31 | 1.32 | 1.33 | 1.34 | +|------------------|----------|----------|-----------|-----------|-----------|-----------|-----------| +| 0.10.0 | + | + | ✓ | - | - | x | x | +| 0.11.0 | + | + | + | ✓ | - | - | x | +| 0.12.0 | + | + | + | + | ✓ | - | - | +| 0.13.0 | + | + | + | + | + | ✓ | - | +| 0.14.0 | + | + | + | + | + | + | ✓ | +| HEAD | + | + | + | + | + | + | ✓ | Key: diff --git a/examples/BUILD b/examples/BUILD new file mode 100644 index 00000000..e4145005 --- /dev/null +++ b/examples/BUILD @@ -0,0 +1,20 @@ +# Example of using bazel rules on the existing examples. + +load("@rules_cc//cc:defs.bzl", "cc_binary") + +# create and run executable file. +# Run: bazel run //examples:list_pod +cc_binary( + name = "list_pod", + srcs = [ + "list_pod/main.c", + ], + deps = ["//:kube_c_library"], #imported from BUILD file of root directory +) + +# Run: bazel run //examples:list_event +cc_binary( + name = "list_event", + srcs = ["list_event/main.c"], + deps = ["//:kube_c_library"], #imported from BUILD file of root directory +) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3c622898..ae5c85e2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required (VERSION 2.6...3.10.2) project(examples) +enable_language(C) +enable_language(CXX) + set(pkgName "kubernetes") -add_subdirectory(list_pod) \ No newline at end of file +add_subdirectory(list_pod) diff --git a/examples/Makefile b/examples/Makefile index 65fcf94f..c3a0eafe 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -2,6 +2,7 @@ all: cd create_pod; make cd list_pod_with_invalid_kubeconfig; make cd list_pod; make + cd list_pod_buffer; make cd list_pod_incluster; make cd delete_pod; make cd exec_provider; make @@ -18,6 +19,7 @@ clean: cd create_pod; make clean cd list_pod_with_invalid_kubeconfig; make clean cd list_pod; make clean + cd list_pod_buffer; make clean cd list_pod_incluster; make clean cd delete_pod; make clean cd exec_provider; make clean @@ -35,6 +37,7 @@ test: kubectl wait --for=condition=ready --all pod -n default --timeout=60s cd list_pod_with_invalid_kubeconfig; make test cd list_pod; make test + cd list_pod_buffer; make test cd delete_pod; make test kubectl wait --for=delete pod/test-pod-6 -n default --timeout=120s cd list_secret; make test @@ -51,6 +54,7 @@ memcheck: kubectl wait --for=condition=ready --all pod -n default --timeout=60s cd list_pod_with_invalid_kubeconfig; make memcheck cd list_pod; make memcheck + cd list_pod_buffer; make memcheck cd delete_pod; make memcheck kubectl wait --for=delete pod/test-pod-6 -n default --timeout=120s cd list_secret; make memcheck diff --git a/examples/configmap/main.c b/examples/configmap/main.c index 0c3f431d..08776ebd 100644 --- a/examples/configmap/main.c +++ b/examples/configmap/main.c @@ -122,6 +122,7 @@ void delete_configmap(apiClient_t * apiClient, char *name, char *namespace_) NULL, // char *pretty NULL, // char *dryRun NULL, // int *gracePeriodSeconds + NULL, // int *ignoreStoreReadErrorWithClusterBreakingPotential NULL, // int *orphanDependents NULL, // char *propagationPolicy NULL // v1_delete_options_t *body diff --git a/examples/delete_pod/main.c b/examples/delete_pod/main.c index 026e8807..369c37b2 100644 --- a/examples/delete_pod/main.c +++ b/examples/delete_pod/main.c @@ -13,6 +13,7 @@ void delete_a_pod(apiClient_t * apiClient) NULL, // char *pretty NULL, // char *dryRun NULL, // int *gracePeriodSeconds + NULL, // int* ignoreStoreReadErrorWithClusterBreakingPotential NULL, // int *orphanDependents NULL, // char *propagationPolicy NULL // v1_delete_options_t *body diff --git a/examples/list_pod_buffer/.gitignore b/examples/list_pod_buffer/.gitignore new file mode 100644 index 00000000..48417105 --- /dev/null +++ b/examples/list_pod_buffer/.gitignore @@ -0,0 +1 @@ +list_pod_buffer_bin diff --git a/examples/list_pod_buffer/CMakeLists.txt b/examples/list_pod_buffer/CMakeLists.txt new file mode 100644 index 00000000..46a76bab --- /dev/null +++ b/examples/list_pod_buffer/CMakeLists.txt @@ -0,0 +1,4 @@ +find_package(${pkgName} CONFIG REQUIRED COMPONENTS ${pkgName}) + +add_executable(list_pod_buffer main.c) +target_link_libraries(list_pod_buffer PRIVATE ${pkgName}::${pkgName}) \ No newline at end of file diff --git a/examples/list_pod_buffer/Makefile b/examples/list_pod_buffer/Makefile new file mode 100644 index 00000000..efaafc58 --- /dev/null +++ b/examples/list_pod_buffer/Makefile @@ -0,0 +1,17 @@ +INCLUDE:=-I../../kubernetes/ -I/usr/local/include/kubernetes/ +LIBS:=-L../../kubernetes/build -lyaml -lwebsockets -lkubernetes -L/usr/local/lib +CFLAGS:=-g +BIN:=list_pod_buffer_bin + +.PHONY : all clean test memcheck +all: + gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN) + +test: + ./$(BIN) + +memcheck: + valgrind --tool=memcheck --leak-check=full ./$(BIN) + +clean: + rm ./$(BIN) diff --git a/examples/list_pod_buffer/main.c b/examples/list_pod_buffer/main.c new file mode 100644 index 00000000..0906f946 --- /dev/null +++ b/examples/list_pod_buffer/main.c @@ -0,0 +1,135 @@ +#include +#include +#include + +#define ENV_KUBECONFIG "KUBECONFIG" +#ifndef _WIN32 +#define ENV_HOME "HOME" +#else +#define ENV_HOME "USERPROFILE" +#endif + +#define KUBE_CONFIG_DEFAULT_LOCATION "%s/.kube/config" + +static char *getWorkingConfigFile(const char *configFileNamePassedIn) +{ + char *configFileName = NULL; + const char *kubeconfig_env = NULL; + const char *homedir_env = NULL; + + if (configFileNamePassedIn) { + configFileName = strdup(configFileNamePassedIn); + } else { + homedir_env = getenv(ENV_HOME); + if (homedir_env) { + int configFileNameSize = strlen(homedir_env) + strlen(KUBE_CONFIG_DEFAULT_LOCATION) + 1; + configFileName = calloc(configFileNameSize, sizeof(char)); + if (configFileName) { + snprintf(configFileName, configFileNameSize, KUBE_CONFIG_DEFAULT_LOCATION, homedir_env); + } + } + } + + return configFileName; +} + +static char *getFileData(const char *filePath) +{ + char *data = NULL; + char *kubeConfigFile = getWorkingConfigFile(filePath); + if (kubeConfigFile) { + FILE *kubeFile = fopen(kubeConfigFile, "r"); + if (kubeFile) { + fseek(kubeFile, 0, SEEK_END); + long fsize = ftell(kubeFile); + fseek(kubeFile, 0, SEEK_SET); + + data = calloc(1, fsize + 1); + if (data) { + fread(data, 1, fsize, kubeFile); + } + + fclose(kubeFile); + } else { + printf("Could not open %s!\n", kubeConfigFile); + } + + free(kubeConfigFile); + } else { + printf("Could not determine the path to kubernetes configuration file! Tried: ENV_KUBECONFIG = %s and ENV_HOME = %s\n", + getenv(ENV_KUBECONFIG), getenv(ENV_HOME) ); + } + + + return data; +} + +void list_pod(apiClient_t * apiClient) +{ + v1_pod_list_t *pod_list = NULL; + pod_list = CoreV1API_listNamespacedPod(apiClient, "default", /*namespace */ + NULL, /* pretty */ + NULL, /* allowWatchBookmarks */ + NULL, /* continue */ + NULL, /* fieldSelector */ + NULL, /* labelSelector */ + NULL, /* limit */ + NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ + NULL, /* sendInitialEvents */ + NULL, /* timeoutSeconds */ + NULL /* watch */ + ); + printf("The return code of HTTP request=%ld\n", apiClient->response_code); + if (pod_list) { + printf("Get pod list:\n"); + listEntry_t *listEntry = NULL; + v1_pod_t *pod = NULL; + list_ForEach(listEntry, pod_list->items) { + pod = listEntry->data; + printf("\tThe pod name: %s\n", pod->metadata->name); + } + v1_pod_list_free(pod_list); + pod_list = NULL; + } else { + printf("Cannot get any pod.\n"); + } +} + +int main() +{ + char *basePath = NULL; + sslConfig_t *sslConfig = NULL; + list_t *apiKeys = NULL; + + char *dataBuffer = getFileData(NULL); /* NULL means loading configuration from $HOME/.kube/config */ + if (dataBuffer == NULL) { + printf("Cannot get kubernetes configuration from file.\n"); + return -1; + } + + int rc = load_kube_config_buffer(&basePath, &sslConfig, &apiKeys, dataBuffer); + if (rc != 0) { + printf("Cannot load kubernetes configuration.\n"); + return -1; + } + apiClient_t *apiClient = apiClient_create_with_base_path(basePath, sslConfig, apiKeys); + if (!apiClient) { + printf("Cannot create a kubernetes client.\n"); + return -1; + } + + list_pod(apiClient); + + apiClient_free(apiClient); + apiClient = NULL; + free_client_config(basePath, sslConfig, apiKeys); + basePath = NULL; + sslConfig = NULL; + apiKeys = NULL; + apiClient_unsetupGlobalEnv(); + free(dataBuffer); + dataBuffer = NULL; + + return 0; +} diff --git a/kubernetes/.openapi-generator/COMMIT b/kubernetes/.openapi-generator/COMMIT index 7191bd3b..e81feaec 100644 --- a/kubernetes/.openapi-generator/COMMIT +++ b/kubernetes/.openapi-generator/COMMIT @@ -1,2 +1,2 @@ Requested Commit/Tag : master -Actual Commit : 57dceae4ad22a5ff76fd5b2e1fc7e801f6f4eaaf +Actual Commit : 93d782128112b915487f7df823d5c4bfb9f2e3ba diff --git a/kubernetes/.openapi-generator/FILES b/kubernetes/.openapi-generator/FILES index e8795f97..9e906035 100644 --- a/kubernetes/.openapi-generator/FILES +++ b/kubernetes/.openapi-generator/FILES @@ -1,4 +1,5 @@ CMakeLists.txt +Config.cmake.in Packing.cmake README.md api/AdmissionregistrationAPI.c @@ -27,10 +28,6 @@ api/AuthenticationAPI.c api/AuthenticationAPI.h api/AuthenticationV1API.c api/AuthenticationV1API.h -api/AuthenticationV1alpha1API.c -api/AuthenticationV1alpha1API.h -api/AuthenticationV1beta1API.c -api/AuthenticationV1beta1API.h api/AuthorizationAPI.c api/AuthorizationAPI.h api/AuthorizationV1API.c @@ -51,10 +48,16 @@ api/CertificatesV1API.c api/CertificatesV1API.h api/CertificatesV1alpha1API.c api/CertificatesV1alpha1API.h +api/CertificatesV1beta1API.c +api/CertificatesV1beta1API.h api/CoordinationAPI.c api/CoordinationAPI.h api/CoordinationV1API.c api/CoordinationV1API.h +api/CoordinationV1alpha2API.c +api/CoordinationV1alpha2API.h +api/CoordinationV1beta1API.c +api/CoordinationV1beta1API.h api/CoreAPI.c api/CoreAPI.h api/CoreV1API.c @@ -73,8 +76,6 @@ api/FlowcontrolApiserverAPI.c api/FlowcontrolApiserverAPI.h api/FlowcontrolApiserverV1API.c api/FlowcontrolApiserverV1API.h -api/FlowcontrolApiserverV1beta3API.c -api/FlowcontrolApiserverV1beta3API.h api/InternalApiserverAPI.c api/InternalApiserverAPI.h api/InternalApiserverV1alpha1API.c @@ -85,8 +86,8 @@ api/NetworkingAPI.c api/NetworkingAPI.h api/NetworkingV1API.c api/NetworkingV1API.h -api/NetworkingV1alpha1API.c -api/NetworkingV1alpha1API.h +api/NetworkingV1beta1API.c +api/NetworkingV1beta1API.h api/NodeAPI.c api/NodeAPI.h api/NodeV1API.c @@ -103,8 +104,14 @@ api/RbacAuthorizationV1API.c api/RbacAuthorizationV1API.h api/ResourceAPI.c api/ResourceAPI.h -api/ResourceV1alpha2API.c -api/ResourceV1alpha2API.h +api/ResourceV1API.c +api/ResourceV1API.h +api/ResourceV1alpha3API.c +api/ResourceV1alpha3API.h +api/ResourceV1beta1API.c +api/ResourceV1beta1API.h +api/ResourceV1beta2API.c +api/ResourceV1beta2API.h api/SchedulingAPI.c api/SchedulingAPI.h api/SchedulingV1API.c @@ -115,6 +122,8 @@ api/StorageV1API.c api/StorageV1API.h api/StorageV1alpha1API.c api/StorageV1alpha1API.h +api/StorageV1beta1API.c +api/StorageV1beta1API.h api/StoragemigrationAPI.c api/StoragemigrationAPI.h api/StoragemigrationV1alpha1API.c @@ -136,8 +145,6 @@ docs/AppsAPI.md docs/AppsV1API.md docs/AuthenticationAPI.md docs/AuthenticationV1API.md -docs/AuthenticationV1alpha1API.md -docs/AuthenticationV1beta1API.md docs/AuthorizationAPI.md docs/AuthorizationV1API.md docs/AutoscalingAPI.md @@ -148,8 +155,11 @@ docs/BatchV1API.md docs/CertificatesAPI.md docs/CertificatesV1API.md docs/CertificatesV1alpha1API.md +docs/CertificatesV1beta1API.md docs/CoordinationAPI.md docs/CoordinationV1API.md +docs/CoordinationV1alpha2API.md +docs/CoordinationV1beta1API.md docs/CoreAPI.md docs/CoreV1API.md docs/CustomObjectsAPI.md @@ -159,13 +169,12 @@ docs/EventsAPI.md docs/EventsV1API.md docs/FlowcontrolApiserverAPI.md docs/FlowcontrolApiserverV1API.md -docs/FlowcontrolApiserverV1beta3API.md docs/InternalApiserverAPI.md docs/InternalApiserverV1alpha1API.md docs/LogsAPI.md docs/NetworkingAPI.md docs/NetworkingV1API.md -docs/NetworkingV1alpha1API.md +docs/NetworkingV1beta1API.md docs/NodeAPI.md docs/NodeV1API.md docs/OpenidAPI.md @@ -174,12 +183,16 @@ docs/PolicyV1API.md docs/RbacAuthorizationAPI.md docs/RbacAuthorizationV1API.md docs/ResourceAPI.md -docs/ResourceV1alpha2API.md +docs/ResourceV1API.md +docs/ResourceV1alpha3API.md +docs/ResourceV1beta1API.md +docs/ResourceV1beta2API.md docs/SchedulingAPI.md docs/SchedulingV1API.md docs/StorageAPI.md docs/StorageV1API.md docs/StorageV1alpha1API.md +docs/StorageV1beta1API.md docs/StoragemigrationAPI.md docs/StoragemigrationV1alpha1API.md docs/VersionAPI.md @@ -194,15 +207,19 @@ docs/core_v1_endpoint_port.md docs/core_v1_event.md docs/core_v1_event_list.md docs/core_v1_event_series.md +docs/core_v1_resource_claim.md docs/discovery_v1_endpoint_port.md docs/events_v1_event.md docs/events_v1_event_list.md docs/events_v1_event_series.md docs/flowcontrol_v1_subject.md docs/rbac_v1_subject.md +docs/resource_v1_resource_claim.md docs/storage_v1_token_request.md docs/v1_affinity.md docs/v1_aggregation_rule.md +docs/v1_allocated_device_status.md +docs/v1_allocation_result.md docs/v1_api_group.md docs/v1_api_group_list.md docs/v1_api_resource.md @@ -223,6 +240,10 @@ docs/v1_azure_file_volume_source.md docs/v1_binding.md docs/v1_bound_object_reference.md docs/v1_capabilities.md +docs/v1_capacity_request_policy.md +docs/v1_capacity_request_policy_range.md +docs/v1_capacity_requirements.md +docs/v1_cel_device_selector.md docs/v1_ceph_fs_persistent_volume_source.md docs/v1_ceph_fs_volume_source.md docs/v1_certificate_signing_request.md @@ -232,7 +253,6 @@ docs/v1_certificate_signing_request_spec.md docs/v1_certificate_signing_request_status.md docs/v1_cinder_persistent_volume_source.md docs/v1_cinder_volume_source.md -docs/v1_claim_source.md docs/v1_client_ip_config.md docs/v1_cluster_role.md docs/v1_cluster_role_binding.md @@ -251,16 +271,22 @@ docs/v1_config_map_node_config_source.md docs/v1_config_map_projection.md docs/v1_config_map_volume_source.md docs/v1_container.md +docs/v1_container_extended_resource_request.md docs/v1_container_image.md docs/v1_container_port.md docs/v1_container_resize_policy.md +docs/v1_container_restart_rule.md +docs/v1_container_restart_rule_on_exit_codes.md docs/v1_container_state.md docs/v1_container_state_running.md docs/v1_container_state_terminated.md docs/v1_container_state_waiting.md docs/v1_container_status.md +docs/v1_container_user.md docs/v1_controller_revision.md docs/v1_controller_revision_list.md +docs/v1_counter.md +docs/v1_counter_set.md docs/v1_cron_job.md docs/v1_cron_job_list.md docs/v1_cron_job_spec.md @@ -303,6 +329,25 @@ docs/v1_deployment_list.md docs/v1_deployment_spec.md docs/v1_deployment_status.md docs/v1_deployment_strategy.md +docs/v1_device.md +docs/v1_device_allocation_configuration.md +docs/v1_device_allocation_result.md +docs/v1_device_attribute.md +docs/v1_device_capacity.md +docs/v1_device_claim.md +docs/v1_device_claim_configuration.md +docs/v1_device_class.md +docs/v1_device_class_configuration.md +docs/v1_device_class_list.md +docs/v1_device_class_spec.md +docs/v1_device_constraint.md +docs/v1_device_counter_consumption.md +docs/v1_device_request.md +docs/v1_device_request_allocation_result.md +docs/v1_device_selector.md +docs/v1_device_sub_request.md +docs/v1_device_taint.md +docs/v1_device_toleration.md docs/v1_downward_api_projection.md docs/v1_downward_api_volume_file.md docs/v1_downward_api_volume_source.md @@ -323,11 +368,15 @@ docs/v1_ephemeral_container.md docs/v1_ephemeral_volume_source.md docs/v1_event_source.md docs/v1_eviction.md +docs/v1_exact_device_request.md docs/v1_exec_action.md docs/v1_exempt_priority_level_configuration.md docs/v1_expression_warning.md docs/v1_external_documentation.md docs/v1_fc_volume_source.md +docs/v1_field_selector_attributes.md +docs/v1_field_selector_requirement.md +docs/v1_file_key_selector.md docs/v1_flex_persistent_volume_source.md docs/v1_flex_volume_source.md docs/v1_flocker_volume_source.md @@ -337,6 +386,7 @@ docs/v1_flow_schema_condition.md docs/v1_flow_schema_list.md docs/v1_flow_schema_spec.md docs/v1_flow_schema_status.md +docs/v1_for_node.md docs/v1_for_zone.md docs/v1_gce_persistent_disk_volume_source.md docs/v1_git_repo_volume_source.md @@ -356,6 +406,7 @@ docs/v1_http_get_action.md docs/v1_http_header.md docs/v1_http_ingress_path.md docs/v1_http_ingress_rule_value.md +docs/v1_image_volume_source.md docs/v1_ingress.md docs/v1_ingress_backend.md docs/v1_ingress_class.md @@ -371,6 +422,9 @@ docs/v1_ingress_service_backend.md docs/v1_ingress_spec.md docs/v1_ingress_status.md docs/v1_ingress_tls.md +docs/v1_ip_address.md +docs/v1_ip_address_list.md +docs/v1_ip_address_spec.md docs/v1_ip_block.md docs/v1_iscsi_persistent_volume_source.md docs/v1_iscsi_volume_source.md @@ -383,6 +437,7 @@ docs/v1_job_template_spec.md docs/v1_json_schema_props.md docs/v1_key_to_path.md docs/v1_label_selector.md +docs/v1_label_selector_attributes.md docs/v1_label_selector_requirement.md docs/v1_lease.md docs/v1_lease_list.md @@ -395,6 +450,7 @@ docs/v1_limit_range_list.md docs/v1_limit_range_spec.md docs/v1_limit_response.md docs/v1_limited_priority_level_configuration.md +docs/v1_linux_container_user.md docs/v1_list_meta.md docs/v1_load_balancer_ingress.md docs/v1_load_balancer_status.md @@ -414,6 +470,7 @@ docs/v1_namespace_condition.md docs/v1_namespace_list.md docs/v1_namespace_spec.md docs/v1_namespace_status.md +docs/v1_network_device_data.md docs/v1_network_policy.md docs/v1_network_policy_egress_rule.md docs/v1_network_policy_ingress_rule.md @@ -429,6 +486,7 @@ docs/v1_node_condition.md docs/v1_node_config_source.md docs/v1_node_config_status.md docs/v1_node_daemon_endpoints.md +docs/v1_node_features.md docs/v1_node_list.md docs/v1_node_runtime_handler.md docs/v1_node_runtime_handler_features.md @@ -437,6 +495,7 @@ docs/v1_node_selector_requirement.md docs/v1_node_selector_term.md docs/v1_node_spec.md docs/v1_node_status.md +docs/v1_node_swap_status.md docs/v1_node_system_info.md docs/v1_non_resource_attributes.md docs/v1_non_resource_policy_rule.md @@ -444,10 +503,12 @@ docs/v1_non_resource_rule.md docs/v1_object_field_selector.md docs/v1_object_meta.md docs/v1_object_reference.md +docs/v1_opaque_device_configuration.md docs/v1_overhead.md docs/v1_owner_reference.md docs/v1_param_kind.md docs/v1_param_ref.md +docs/v1_parent_reference.md docs/v1_persistent_volume.md docs/v1_persistent_volume_claim.md docs/v1_persistent_volume_claim_condition.md @@ -464,6 +525,7 @@ docs/v1_pod.md docs/v1_pod_affinity.md docs/v1_pod_affinity_term.md docs/v1_pod_anti_affinity.md +docs/v1_pod_certificate_projection.md docs/v1_pod_condition.md docs/v1_pod_disruption_budget.md docs/v1_pod_disruption_budget_list.md @@ -471,6 +533,7 @@ docs/v1_pod_disruption_budget_spec.md docs/v1_pod_disruption_budget_status.md docs/v1_pod_dns_config.md docs/v1_pod_dns_config_option.md +docs/v1_pod_extended_resource_claim_status.md docs/v1_pod_failure_policy.md docs/v1_pod_failure_policy_on_exit_codes_requirement.md docs/v1_pod_failure_policy_on_pod_conditions_pattern.md @@ -519,15 +582,27 @@ docs/v1_replication_controller_list.md docs/v1_replication_controller_spec.md docs/v1_replication_controller_status.md docs/v1_resource_attributes.md -docs/v1_resource_claim.md +docs/v1_resource_claim_consumer_reference.md +docs/v1_resource_claim_list.md +docs/v1_resource_claim_spec.md +docs/v1_resource_claim_status.md +docs/v1_resource_claim_template.md +docs/v1_resource_claim_template_list.md +docs/v1_resource_claim_template_spec.md docs/v1_resource_field_selector.md +docs/v1_resource_health.md docs/v1_resource_policy_rule.md +docs/v1_resource_pool.md docs/v1_resource_quota.md docs/v1_resource_quota_list.md docs/v1_resource_quota_spec.md docs/v1_resource_quota_status.md docs/v1_resource_requirements.md docs/v1_resource_rule.md +docs/v1_resource_slice.md +docs/v1_resource_slice_list.md +docs/v1_resource_slice_spec.md +docs/v1_resource_status.md docs/v1_role.md docs/v1_role_binding.md docs/v1_role_binding_list.md @@ -571,6 +646,10 @@ docs/v1_service_account_list.md docs/v1_service_account_subject.md docs/v1_service_account_token_projection.md docs/v1_service_backend_port.md +docs/v1_service_cidr.md +docs/v1_service_cidr_list.md +docs/v1_service_cidr_spec.md +docs/v1_service_cidr_status.md docs/v1_service_list.md docs/v1_service_port.md docs/v1_service_spec.md @@ -635,6 +714,8 @@ docs/v1_volume_attachment_list.md docs/v1_volume_attachment_source.md docs/v1_volume_attachment_spec.md docs/v1_volume_attachment_status.md +docs/v1_volume_attributes_class.md +docs/v1_volume_attributes_class_list.md docs/v1_volume_device.md docs/v1_volume_error.md docs/v1_volume_mount.md @@ -648,29 +729,30 @@ docs/v1_watch_event.md docs/v1_webhook_conversion.md docs/v1_weighted_pod_affinity_term.md docs/v1_windows_security_context_options.md -docs/v1alpha1_audit_annotation.md +docs/v1alpha1_apply_configuration.md docs/v1alpha1_cluster_trust_bundle.md docs/v1alpha1_cluster_trust_bundle_list.md docs/v1alpha1_cluster_trust_bundle_spec.md -docs/v1alpha1_expression_warning.md docs/v1alpha1_group_version_resource.md -docs/v1alpha1_ip_address.md -docs/v1alpha1_ip_address_list.md -docs/v1alpha1_ip_address_spec.md +docs/v1alpha1_json_patch.md docs/v1alpha1_match_condition.md docs/v1alpha1_match_resources.md docs/v1alpha1_migration_condition.md +docs/v1alpha1_mutating_admission_policy.md +docs/v1alpha1_mutating_admission_policy_binding.md +docs/v1alpha1_mutating_admission_policy_binding_list.md +docs/v1alpha1_mutating_admission_policy_binding_spec.md +docs/v1alpha1_mutating_admission_policy_list.md +docs/v1alpha1_mutating_admission_policy_spec.md +docs/v1alpha1_mutation.md docs/v1alpha1_named_rule_with_operations.md docs/v1alpha1_param_kind.md docs/v1alpha1_param_ref.md -docs/v1alpha1_parent_reference.md -docs/v1alpha1_self_subject_review.md -docs/v1alpha1_self_subject_review_status.md +docs/v1alpha1_pod_certificate_request.md +docs/v1alpha1_pod_certificate_request_list.md +docs/v1alpha1_pod_certificate_request_spec.md +docs/v1alpha1_pod_certificate_request_status.md docs/v1alpha1_server_storage_version.md -docs/v1alpha1_service_cidr.md -docs/v1alpha1_service_cidr_list.md -docs/v1alpha1_service_cidr_spec.md -docs/v1alpha1_service_cidr_status.md docs/v1alpha1_storage_version.md docs/v1alpha1_storage_version_condition.md docs/v1alpha1_storage_version_list.md @@ -679,99 +761,134 @@ docs/v1alpha1_storage_version_migration_list.md docs/v1alpha1_storage_version_migration_spec.md docs/v1alpha1_storage_version_migration_status.md docs/v1alpha1_storage_version_status.md -docs/v1alpha1_type_checking.md -docs/v1alpha1_validating_admission_policy.md -docs/v1alpha1_validating_admission_policy_binding.md -docs/v1alpha1_validating_admission_policy_binding_list.md -docs/v1alpha1_validating_admission_policy_binding_spec.md -docs/v1alpha1_validating_admission_policy_list.md -docs/v1alpha1_validating_admission_policy_spec.md -docs/v1alpha1_validating_admission_policy_status.md -docs/v1alpha1_validation.md docs/v1alpha1_variable.md docs/v1alpha1_volume_attributes_class.md docs/v1alpha1_volume_attributes_class_list.md -docs/v1alpha2_allocation_result.md -docs/v1alpha2_driver_allocation_result.md -docs/v1alpha2_driver_requests.md -docs/v1alpha2_named_resources_allocation_result.md -docs/v1alpha2_named_resources_attribute.md -docs/v1alpha2_named_resources_filter.md -docs/v1alpha2_named_resources_instance.md -docs/v1alpha2_named_resources_int_slice.md -docs/v1alpha2_named_resources_request.md -docs/v1alpha2_named_resources_resources.md -docs/v1alpha2_named_resources_string_slice.md -docs/v1alpha2_pod_scheduling_context.md -docs/v1alpha2_pod_scheduling_context_list.md -docs/v1alpha2_pod_scheduling_context_spec.md -docs/v1alpha2_pod_scheduling_context_status.md -docs/v1alpha2_resource_claim.md -docs/v1alpha2_resource_claim_consumer_reference.md -docs/v1alpha2_resource_claim_list.md -docs/v1alpha2_resource_claim_parameters.md -docs/v1alpha2_resource_claim_parameters_list.md -docs/v1alpha2_resource_claim_parameters_reference.md -docs/v1alpha2_resource_claim_scheduling_status.md -docs/v1alpha2_resource_claim_spec.md -docs/v1alpha2_resource_claim_status.md -docs/v1alpha2_resource_claim_template.md -docs/v1alpha2_resource_claim_template_list.md -docs/v1alpha2_resource_claim_template_spec.md -docs/v1alpha2_resource_class.md -docs/v1alpha2_resource_class_list.md -docs/v1alpha2_resource_class_parameters.md -docs/v1alpha2_resource_class_parameters_list.md -docs/v1alpha2_resource_class_parameters_reference.md -docs/v1alpha2_resource_filter.md -docs/v1alpha2_resource_handle.md -docs/v1alpha2_resource_request.md -docs/v1alpha2_resource_slice.md -docs/v1alpha2_resource_slice_list.md -docs/v1alpha2_structured_resource_handle.md -docs/v1alpha2_vendor_parameters.md -docs/v1beta1_audit_annotation.md -docs/v1beta1_expression_warning.md +docs/v1alpha2_lease_candidate.md +docs/v1alpha2_lease_candidate_list.md +docs/v1alpha2_lease_candidate_spec.md +docs/v1alpha3_cel_device_selector.md +docs/v1alpha3_device_selector.md +docs/v1alpha3_device_taint.md +docs/v1alpha3_device_taint_rule.md +docs/v1alpha3_device_taint_rule_list.md +docs/v1alpha3_device_taint_rule_spec.md +docs/v1alpha3_device_taint_selector.md +docs/v1beta1_allocated_device_status.md +docs/v1beta1_allocation_result.md +docs/v1beta1_apply_configuration.md +docs/v1beta1_basic_device.md +docs/v1beta1_capacity_request_policy.md +docs/v1beta1_capacity_request_policy_range.md +docs/v1beta1_capacity_requirements.md +docs/v1beta1_cel_device_selector.md +docs/v1beta1_cluster_trust_bundle.md +docs/v1beta1_cluster_trust_bundle_list.md +docs/v1beta1_cluster_trust_bundle_spec.md +docs/v1beta1_counter.md +docs/v1beta1_counter_set.md +docs/v1beta1_device.md +docs/v1beta1_device_allocation_configuration.md +docs/v1beta1_device_allocation_result.md +docs/v1beta1_device_attribute.md +docs/v1beta1_device_capacity.md +docs/v1beta1_device_claim.md +docs/v1beta1_device_claim_configuration.md +docs/v1beta1_device_class.md +docs/v1beta1_device_class_configuration.md +docs/v1beta1_device_class_list.md +docs/v1beta1_device_class_spec.md +docs/v1beta1_device_constraint.md +docs/v1beta1_device_counter_consumption.md +docs/v1beta1_device_request.md +docs/v1beta1_device_request_allocation_result.md +docs/v1beta1_device_selector.md +docs/v1beta1_device_sub_request.md +docs/v1beta1_device_taint.md +docs/v1beta1_device_toleration.md +docs/v1beta1_ip_address.md +docs/v1beta1_ip_address_list.md +docs/v1beta1_ip_address_spec.md +docs/v1beta1_json_patch.md +docs/v1beta1_lease_candidate.md +docs/v1beta1_lease_candidate_list.md +docs/v1beta1_lease_candidate_spec.md docs/v1beta1_match_condition.md docs/v1beta1_match_resources.md +docs/v1beta1_mutating_admission_policy.md +docs/v1beta1_mutating_admission_policy_binding.md +docs/v1beta1_mutating_admission_policy_binding_list.md +docs/v1beta1_mutating_admission_policy_binding_spec.md +docs/v1beta1_mutating_admission_policy_list.md +docs/v1beta1_mutating_admission_policy_spec.md +docs/v1beta1_mutation.md docs/v1beta1_named_rule_with_operations.md +docs/v1beta1_network_device_data.md +docs/v1beta1_opaque_device_configuration.md docs/v1beta1_param_kind.md docs/v1beta1_param_ref.md -docs/v1beta1_self_subject_review.md -docs/v1beta1_self_subject_review_status.md -docs/v1beta1_type_checking.md -docs/v1beta1_validating_admission_policy.md -docs/v1beta1_validating_admission_policy_binding.md -docs/v1beta1_validating_admission_policy_binding_list.md -docs/v1beta1_validating_admission_policy_binding_spec.md -docs/v1beta1_validating_admission_policy_list.md -docs/v1beta1_validating_admission_policy_spec.md -docs/v1beta1_validating_admission_policy_status.md -docs/v1beta1_validation.md +docs/v1beta1_parent_reference.md +docs/v1beta1_resource_claim.md +docs/v1beta1_resource_claim_consumer_reference.md +docs/v1beta1_resource_claim_list.md +docs/v1beta1_resource_claim_spec.md +docs/v1beta1_resource_claim_status.md +docs/v1beta1_resource_claim_template.md +docs/v1beta1_resource_claim_template_list.md +docs/v1beta1_resource_claim_template_spec.md +docs/v1beta1_resource_pool.md +docs/v1beta1_resource_slice.md +docs/v1beta1_resource_slice_list.md +docs/v1beta1_resource_slice_spec.md +docs/v1beta1_service_cidr.md +docs/v1beta1_service_cidr_list.md +docs/v1beta1_service_cidr_spec.md +docs/v1beta1_service_cidr_status.md docs/v1beta1_variable.md -docs/v1beta3_exempt_priority_level_configuration.md -docs/v1beta3_flow_distinguisher_method.md -docs/v1beta3_flow_schema.md -docs/v1beta3_flow_schema_condition.md -docs/v1beta3_flow_schema_list.md -docs/v1beta3_flow_schema_spec.md -docs/v1beta3_flow_schema_status.md -docs/v1beta3_group_subject.md -docs/v1beta3_limit_response.md -docs/v1beta3_limited_priority_level_configuration.md -docs/v1beta3_non_resource_policy_rule.md -docs/v1beta3_policy_rules_with_subjects.md -docs/v1beta3_priority_level_configuration.md -docs/v1beta3_priority_level_configuration_condition.md -docs/v1beta3_priority_level_configuration_list.md -docs/v1beta3_priority_level_configuration_reference.md -docs/v1beta3_priority_level_configuration_spec.md -docs/v1beta3_priority_level_configuration_status.md -docs/v1beta3_queuing_configuration.md -docs/v1beta3_resource_policy_rule.md -docs/v1beta3_service_account_subject.md -docs/v1beta3_subject.md -docs/v1beta3_user_subject.md +docs/v1beta1_volume_attributes_class.md +docs/v1beta1_volume_attributes_class_list.md +docs/v1beta2_allocated_device_status.md +docs/v1beta2_allocation_result.md +docs/v1beta2_capacity_request_policy.md +docs/v1beta2_capacity_request_policy_range.md +docs/v1beta2_capacity_requirements.md +docs/v1beta2_cel_device_selector.md +docs/v1beta2_counter.md +docs/v1beta2_counter_set.md +docs/v1beta2_device.md +docs/v1beta2_device_allocation_configuration.md +docs/v1beta2_device_allocation_result.md +docs/v1beta2_device_attribute.md +docs/v1beta2_device_capacity.md +docs/v1beta2_device_claim.md +docs/v1beta2_device_claim_configuration.md +docs/v1beta2_device_class.md +docs/v1beta2_device_class_configuration.md +docs/v1beta2_device_class_list.md +docs/v1beta2_device_class_spec.md +docs/v1beta2_device_constraint.md +docs/v1beta2_device_counter_consumption.md +docs/v1beta2_device_request.md +docs/v1beta2_device_request_allocation_result.md +docs/v1beta2_device_selector.md +docs/v1beta2_device_sub_request.md +docs/v1beta2_device_taint.md +docs/v1beta2_device_toleration.md +docs/v1beta2_exact_device_request.md +docs/v1beta2_network_device_data.md +docs/v1beta2_opaque_device_configuration.md +docs/v1beta2_resource_claim.md +docs/v1beta2_resource_claim_consumer_reference.md +docs/v1beta2_resource_claim_list.md +docs/v1beta2_resource_claim_spec.md +docs/v1beta2_resource_claim_status.md +docs/v1beta2_resource_claim_template.md +docs/v1beta2_resource_claim_template_list.md +docs/v1beta2_resource_claim_template_spec.md +docs/v1beta2_resource_pool.md +docs/v1beta2_resource_slice.md +docs/v1beta2_resource_slice_list.md +docs/v1beta2_resource_slice_spec.md docs/v2_container_resource_metric_source.md docs/v2_container_resource_metric_status.md docs/v2_cross_version_object_reference.md @@ -809,6 +926,7 @@ model/admissionregistration_v1_service_reference.c model/admissionregistration_v1_service_reference.h model/admissionregistration_v1_webhook_client_config.c model/admissionregistration_v1_webhook_client_config.h +model/any_type.h model/apiextensions_v1_service_reference.c model/apiextensions_v1_service_reference.h model/apiextensions_v1_webhook_client_config.c @@ -825,6 +943,8 @@ model/core_v1_event_list.c model/core_v1_event_list.h model/core_v1_event_series.c model/core_v1_event_series.h +model/core_v1_resource_claim.c +model/core_v1_resource_claim.h model/discovery_v1_endpoint_port.c model/discovery_v1_endpoint_port.h model/events_v1_event.c @@ -839,12 +959,18 @@ model/object.c model/object.h model/rbac_v1_subject.c model/rbac_v1_subject.h +model/resource_v1_resource_claim.c +model/resource_v1_resource_claim.h model/storage_v1_token_request.c model/storage_v1_token_request.h model/v1_affinity.c model/v1_affinity.h model/v1_aggregation_rule.c model/v1_aggregation_rule.h +model/v1_allocated_device_status.c +model/v1_allocated_device_status.h +model/v1_allocation_result.c +model/v1_allocation_result.h model/v1_api_group.c model/v1_api_group.h model/v1_api_group_list.c @@ -885,6 +1011,14 @@ model/v1_bound_object_reference.c model/v1_bound_object_reference.h model/v1_capabilities.c model/v1_capabilities.h +model/v1_capacity_request_policy.c +model/v1_capacity_request_policy.h +model/v1_capacity_request_policy_range.c +model/v1_capacity_request_policy_range.h +model/v1_capacity_requirements.c +model/v1_capacity_requirements.h +model/v1_cel_device_selector.c +model/v1_cel_device_selector.h model/v1_ceph_fs_persistent_volume_source.c model/v1_ceph_fs_persistent_volume_source.h model/v1_ceph_fs_volume_source.c @@ -903,8 +1037,6 @@ model/v1_cinder_persistent_volume_source.c model/v1_cinder_persistent_volume_source.h model/v1_cinder_volume_source.c model/v1_cinder_volume_source.h -model/v1_claim_source.c -model/v1_claim_source.h model/v1_client_ip_config.c model/v1_client_ip_config.h model/v1_cluster_role.c @@ -941,12 +1073,18 @@ model/v1_config_map_volume_source.c model/v1_config_map_volume_source.h model/v1_container.c model/v1_container.h +model/v1_container_extended_resource_request.c +model/v1_container_extended_resource_request.h model/v1_container_image.c model/v1_container_image.h model/v1_container_port.c model/v1_container_port.h model/v1_container_resize_policy.c model/v1_container_resize_policy.h +model/v1_container_restart_rule.c +model/v1_container_restart_rule.h +model/v1_container_restart_rule_on_exit_codes.c +model/v1_container_restart_rule_on_exit_codes.h model/v1_container_state.c model/v1_container_state.h model/v1_container_state_running.c @@ -957,10 +1095,16 @@ model/v1_container_state_waiting.c model/v1_container_state_waiting.h model/v1_container_status.c model/v1_container_status.h +model/v1_container_user.c +model/v1_container_user.h model/v1_controller_revision.c model/v1_controller_revision.h model/v1_controller_revision_list.c model/v1_controller_revision_list.h +model/v1_counter.c +model/v1_counter.h +model/v1_counter_set.c +model/v1_counter_set.h model/v1_cron_job.c model/v1_cron_job.h model/v1_cron_job_list.c @@ -1045,6 +1189,44 @@ model/v1_deployment_status.c model/v1_deployment_status.h model/v1_deployment_strategy.c model/v1_deployment_strategy.h +model/v1_device.c +model/v1_device.h +model/v1_device_allocation_configuration.c +model/v1_device_allocation_configuration.h +model/v1_device_allocation_result.c +model/v1_device_allocation_result.h +model/v1_device_attribute.c +model/v1_device_attribute.h +model/v1_device_capacity.c +model/v1_device_capacity.h +model/v1_device_claim.c +model/v1_device_claim.h +model/v1_device_claim_configuration.c +model/v1_device_claim_configuration.h +model/v1_device_class.c +model/v1_device_class.h +model/v1_device_class_configuration.c +model/v1_device_class_configuration.h +model/v1_device_class_list.c +model/v1_device_class_list.h +model/v1_device_class_spec.c +model/v1_device_class_spec.h +model/v1_device_constraint.c +model/v1_device_constraint.h +model/v1_device_counter_consumption.c +model/v1_device_counter_consumption.h +model/v1_device_request.c +model/v1_device_request.h +model/v1_device_request_allocation_result.c +model/v1_device_request_allocation_result.h +model/v1_device_selector.c +model/v1_device_selector.h +model/v1_device_sub_request.c +model/v1_device_sub_request.h +model/v1_device_taint.c +model/v1_device_taint.h +model/v1_device_toleration.c +model/v1_device_toleration.h model/v1_downward_api_projection.c model/v1_downward_api_projection.h model/v1_downward_api_volume_file.c @@ -1085,6 +1267,8 @@ model/v1_event_source.c model/v1_event_source.h model/v1_eviction.c model/v1_eviction.h +model/v1_exact_device_request.c +model/v1_exact_device_request.h model/v1_exec_action.c model/v1_exec_action.h model/v1_exempt_priority_level_configuration.c @@ -1095,6 +1279,12 @@ model/v1_external_documentation.c model/v1_external_documentation.h model/v1_fc_volume_source.c model/v1_fc_volume_source.h +model/v1_field_selector_attributes.c +model/v1_field_selector_attributes.h +model/v1_field_selector_requirement.c +model/v1_field_selector_requirement.h +model/v1_file_key_selector.c +model/v1_file_key_selector.h model/v1_flex_persistent_volume_source.c model/v1_flex_persistent_volume_source.h model/v1_flex_volume_source.c @@ -1113,6 +1303,8 @@ model/v1_flow_schema_spec.c model/v1_flow_schema_spec.h model/v1_flow_schema_status.c model/v1_flow_schema_status.h +model/v1_for_node.c +model/v1_for_node.h model/v1_for_zone.c model/v1_for_zone.h model/v1_gce_persistent_disk_volume_source.c @@ -1151,6 +1343,8 @@ model/v1_http_ingress_path.c model/v1_http_ingress_path.h model/v1_http_ingress_rule_value.c model/v1_http_ingress_rule_value.h +model/v1_image_volume_source.c +model/v1_image_volume_source.h model/v1_ingress.c model/v1_ingress.h model/v1_ingress_backend.c @@ -1181,6 +1375,12 @@ model/v1_ingress_status.c model/v1_ingress_status.h model/v1_ingress_tls.c model/v1_ingress_tls.h +model/v1_ip_address.c +model/v1_ip_address.h +model/v1_ip_address_list.c +model/v1_ip_address_list.h +model/v1_ip_address_spec.c +model/v1_ip_address_spec.h model/v1_ip_block.c model/v1_ip_block.h model/v1_iscsi_persistent_volume_source.c @@ -1205,6 +1405,8 @@ model/v1_key_to_path.c model/v1_key_to_path.h model/v1_label_selector.c model/v1_label_selector.h +model/v1_label_selector_attributes.c +model/v1_label_selector_attributes.h model/v1_label_selector_requirement.c model/v1_label_selector_requirement.h model/v1_lease.c @@ -1229,6 +1431,8 @@ model/v1_limit_response.c model/v1_limit_response.h model/v1_limited_priority_level_configuration.c model/v1_limited_priority_level_configuration.h +model/v1_linux_container_user.c +model/v1_linux_container_user.h model/v1_list_meta.c model/v1_list_meta.h model/v1_load_balancer_ingress.c @@ -1267,6 +1471,8 @@ model/v1_namespace_spec.c model/v1_namespace_spec.h model/v1_namespace_status.c model/v1_namespace_status.h +model/v1_network_device_data.c +model/v1_network_device_data.h model/v1_network_policy.c model/v1_network_policy.h model/v1_network_policy_egress_rule.c @@ -1297,6 +1503,8 @@ model/v1_node_config_status.c model/v1_node_config_status.h model/v1_node_daemon_endpoints.c model/v1_node_daemon_endpoints.h +model/v1_node_features.c +model/v1_node_features.h model/v1_node_list.c model/v1_node_list.h model/v1_node_runtime_handler.c @@ -1313,6 +1521,8 @@ model/v1_node_spec.c model/v1_node_spec.h model/v1_node_status.c model/v1_node_status.h +model/v1_node_swap_status.c +model/v1_node_swap_status.h model/v1_node_system_info.c model/v1_node_system_info.h model/v1_non_resource_attributes.c @@ -1327,6 +1537,8 @@ model/v1_object_meta.c model/v1_object_meta.h model/v1_object_reference.c model/v1_object_reference.h +model/v1_opaque_device_configuration.c +model/v1_opaque_device_configuration.h model/v1_overhead.c model/v1_overhead.h model/v1_owner_reference.c @@ -1335,6 +1547,8 @@ model/v1_param_kind.c model/v1_param_kind.h model/v1_param_ref.c model/v1_param_ref.h +model/v1_parent_reference.c +model/v1_parent_reference.h model/v1_persistent_volume.c model/v1_persistent_volume.h model/v1_persistent_volume_claim.c @@ -1367,6 +1581,8 @@ model/v1_pod_affinity_term.c model/v1_pod_affinity_term.h model/v1_pod_anti_affinity.c model/v1_pod_anti_affinity.h +model/v1_pod_certificate_projection.c +model/v1_pod_certificate_projection.h model/v1_pod_condition.c model/v1_pod_condition.h model/v1_pod_disruption_budget.c @@ -1381,6 +1597,8 @@ model/v1_pod_dns_config.c model/v1_pod_dns_config.h model/v1_pod_dns_config_option.c model/v1_pod_dns_config_option.h +model/v1_pod_extended_resource_claim_status.c +model/v1_pod_extended_resource_claim_status.h model/v1_pod_failure_policy.c model/v1_pod_failure_policy.h model/v1_pod_failure_policy_on_exit_codes_requirement.c @@ -1477,12 +1695,28 @@ model/v1_replication_controller_status.c model/v1_replication_controller_status.h model/v1_resource_attributes.c model/v1_resource_attributes.h -model/v1_resource_claim.c -model/v1_resource_claim.h +model/v1_resource_claim_consumer_reference.c +model/v1_resource_claim_consumer_reference.h +model/v1_resource_claim_list.c +model/v1_resource_claim_list.h +model/v1_resource_claim_spec.c +model/v1_resource_claim_spec.h +model/v1_resource_claim_status.c +model/v1_resource_claim_status.h +model/v1_resource_claim_template.c +model/v1_resource_claim_template.h +model/v1_resource_claim_template_list.c +model/v1_resource_claim_template_list.h +model/v1_resource_claim_template_spec.c +model/v1_resource_claim_template_spec.h model/v1_resource_field_selector.c model/v1_resource_field_selector.h +model/v1_resource_health.c +model/v1_resource_health.h model/v1_resource_policy_rule.c model/v1_resource_policy_rule.h +model/v1_resource_pool.c +model/v1_resource_pool.h model/v1_resource_quota.c model/v1_resource_quota.h model/v1_resource_quota_list.c @@ -1495,6 +1729,14 @@ model/v1_resource_requirements.c model/v1_resource_requirements.h model/v1_resource_rule.c model/v1_resource_rule.h +model/v1_resource_slice.c +model/v1_resource_slice.h +model/v1_resource_slice_list.c +model/v1_resource_slice_list.h +model/v1_resource_slice_spec.c +model/v1_resource_slice_spec.h +model/v1_resource_status.c +model/v1_resource_status.h model/v1_role.c model/v1_role.h model/v1_role_binding.c @@ -1581,6 +1823,14 @@ model/v1_service_account_token_projection.c model/v1_service_account_token_projection.h model/v1_service_backend_port.c model/v1_service_backend_port.h +model/v1_service_cidr.c +model/v1_service_cidr.h +model/v1_service_cidr_list.c +model/v1_service_cidr_list.h +model/v1_service_cidr_spec.c +model/v1_service_cidr_spec.h +model/v1_service_cidr_status.c +model/v1_service_cidr_status.h model/v1_service_list.c model/v1_service_list.h model/v1_service_port.c @@ -1709,6 +1959,10 @@ model/v1_volume_attachment_spec.c model/v1_volume_attachment_spec.h model/v1_volume_attachment_status.c model/v1_volume_attachment_status.h +model/v1_volume_attributes_class.c +model/v1_volume_attributes_class.h +model/v1_volume_attributes_class_list.c +model/v1_volume_attributes_class_list.h model/v1_volume_device.c model/v1_volume_device.h model/v1_volume_error.c @@ -1735,52 +1989,54 @@ model/v1_weighted_pod_affinity_term.c model/v1_weighted_pod_affinity_term.h model/v1_windows_security_context_options.c model/v1_windows_security_context_options.h -model/v1alpha1_audit_annotation.c -model/v1alpha1_audit_annotation.h +model/v1alpha1_apply_configuration.c +model/v1alpha1_apply_configuration.h model/v1alpha1_cluster_trust_bundle.c model/v1alpha1_cluster_trust_bundle.h model/v1alpha1_cluster_trust_bundle_list.c model/v1alpha1_cluster_trust_bundle_list.h model/v1alpha1_cluster_trust_bundle_spec.c model/v1alpha1_cluster_trust_bundle_spec.h -model/v1alpha1_expression_warning.c -model/v1alpha1_expression_warning.h model/v1alpha1_group_version_resource.c model/v1alpha1_group_version_resource.h -model/v1alpha1_ip_address.c -model/v1alpha1_ip_address.h -model/v1alpha1_ip_address_list.c -model/v1alpha1_ip_address_list.h -model/v1alpha1_ip_address_spec.c -model/v1alpha1_ip_address_spec.h +model/v1alpha1_json_patch.c +model/v1alpha1_json_patch.h model/v1alpha1_match_condition.c model/v1alpha1_match_condition.h model/v1alpha1_match_resources.c model/v1alpha1_match_resources.h model/v1alpha1_migration_condition.c model/v1alpha1_migration_condition.h +model/v1alpha1_mutating_admission_policy.c +model/v1alpha1_mutating_admission_policy.h +model/v1alpha1_mutating_admission_policy_binding.c +model/v1alpha1_mutating_admission_policy_binding.h +model/v1alpha1_mutating_admission_policy_binding_list.c +model/v1alpha1_mutating_admission_policy_binding_list.h +model/v1alpha1_mutating_admission_policy_binding_spec.c +model/v1alpha1_mutating_admission_policy_binding_spec.h +model/v1alpha1_mutating_admission_policy_list.c +model/v1alpha1_mutating_admission_policy_list.h +model/v1alpha1_mutating_admission_policy_spec.c +model/v1alpha1_mutating_admission_policy_spec.h +model/v1alpha1_mutation.c +model/v1alpha1_mutation.h model/v1alpha1_named_rule_with_operations.c model/v1alpha1_named_rule_with_operations.h model/v1alpha1_param_kind.c model/v1alpha1_param_kind.h model/v1alpha1_param_ref.c model/v1alpha1_param_ref.h -model/v1alpha1_parent_reference.c -model/v1alpha1_parent_reference.h -model/v1alpha1_self_subject_review.c -model/v1alpha1_self_subject_review.h -model/v1alpha1_self_subject_review_status.c -model/v1alpha1_self_subject_review_status.h +model/v1alpha1_pod_certificate_request.c +model/v1alpha1_pod_certificate_request.h +model/v1alpha1_pod_certificate_request_list.c +model/v1alpha1_pod_certificate_request_list.h +model/v1alpha1_pod_certificate_request_spec.c +model/v1alpha1_pod_certificate_request_spec.h +model/v1alpha1_pod_certificate_request_status.c +model/v1alpha1_pod_certificate_request_status.h model/v1alpha1_server_storage_version.c model/v1alpha1_server_storage_version.h -model/v1alpha1_service_cidr.c -model/v1alpha1_service_cidr.h -model/v1alpha1_service_cidr_list.c -model/v1alpha1_service_cidr_list.h -model/v1alpha1_service_cidr_spec.c -model/v1alpha1_service_cidr_spec.h -model/v1alpha1_service_cidr_status.c -model/v1alpha1_service_cidr_status.h model/v1alpha1_storage_version.c model/v1alpha1_storage_version.h model/v1alpha1_storage_version_condition.c @@ -1797,192 +2053,262 @@ model/v1alpha1_storage_version_migration_status.c model/v1alpha1_storage_version_migration_status.h model/v1alpha1_storage_version_status.c model/v1alpha1_storage_version_status.h -model/v1alpha1_type_checking.c -model/v1alpha1_type_checking.h -model/v1alpha1_validating_admission_policy.c -model/v1alpha1_validating_admission_policy.h -model/v1alpha1_validating_admission_policy_binding.c -model/v1alpha1_validating_admission_policy_binding.h -model/v1alpha1_validating_admission_policy_binding_list.c -model/v1alpha1_validating_admission_policy_binding_list.h -model/v1alpha1_validating_admission_policy_binding_spec.c -model/v1alpha1_validating_admission_policy_binding_spec.h -model/v1alpha1_validating_admission_policy_list.c -model/v1alpha1_validating_admission_policy_list.h -model/v1alpha1_validating_admission_policy_spec.c -model/v1alpha1_validating_admission_policy_spec.h -model/v1alpha1_validating_admission_policy_status.c -model/v1alpha1_validating_admission_policy_status.h -model/v1alpha1_validation.c -model/v1alpha1_validation.h model/v1alpha1_variable.c model/v1alpha1_variable.h model/v1alpha1_volume_attributes_class.c model/v1alpha1_volume_attributes_class.h model/v1alpha1_volume_attributes_class_list.c model/v1alpha1_volume_attributes_class_list.h -model/v1alpha2_allocation_result.c -model/v1alpha2_allocation_result.h -model/v1alpha2_driver_allocation_result.c -model/v1alpha2_driver_allocation_result.h -model/v1alpha2_driver_requests.c -model/v1alpha2_driver_requests.h -model/v1alpha2_named_resources_allocation_result.c -model/v1alpha2_named_resources_allocation_result.h -model/v1alpha2_named_resources_attribute.c -model/v1alpha2_named_resources_attribute.h -model/v1alpha2_named_resources_filter.c -model/v1alpha2_named_resources_filter.h -model/v1alpha2_named_resources_instance.c -model/v1alpha2_named_resources_instance.h -model/v1alpha2_named_resources_int_slice.c -model/v1alpha2_named_resources_int_slice.h -model/v1alpha2_named_resources_request.c -model/v1alpha2_named_resources_request.h -model/v1alpha2_named_resources_resources.c -model/v1alpha2_named_resources_resources.h -model/v1alpha2_named_resources_string_slice.c -model/v1alpha2_named_resources_string_slice.h -model/v1alpha2_pod_scheduling_context.c -model/v1alpha2_pod_scheduling_context.h -model/v1alpha2_pod_scheduling_context_list.c -model/v1alpha2_pod_scheduling_context_list.h -model/v1alpha2_pod_scheduling_context_spec.c -model/v1alpha2_pod_scheduling_context_spec.h -model/v1alpha2_pod_scheduling_context_status.c -model/v1alpha2_pod_scheduling_context_status.h -model/v1alpha2_resource_claim.c -model/v1alpha2_resource_claim.h -model/v1alpha2_resource_claim_consumer_reference.c -model/v1alpha2_resource_claim_consumer_reference.h -model/v1alpha2_resource_claim_list.c -model/v1alpha2_resource_claim_list.h -model/v1alpha2_resource_claim_parameters.c -model/v1alpha2_resource_claim_parameters.h -model/v1alpha2_resource_claim_parameters_list.c -model/v1alpha2_resource_claim_parameters_list.h -model/v1alpha2_resource_claim_parameters_reference.c -model/v1alpha2_resource_claim_parameters_reference.h -model/v1alpha2_resource_claim_scheduling_status.c -model/v1alpha2_resource_claim_scheduling_status.h -model/v1alpha2_resource_claim_spec.c -model/v1alpha2_resource_claim_spec.h -model/v1alpha2_resource_claim_status.c -model/v1alpha2_resource_claim_status.h -model/v1alpha2_resource_claim_template.c -model/v1alpha2_resource_claim_template.h -model/v1alpha2_resource_claim_template_list.c -model/v1alpha2_resource_claim_template_list.h -model/v1alpha2_resource_claim_template_spec.c -model/v1alpha2_resource_claim_template_spec.h -model/v1alpha2_resource_class.c -model/v1alpha2_resource_class.h -model/v1alpha2_resource_class_list.c -model/v1alpha2_resource_class_list.h -model/v1alpha2_resource_class_parameters.c -model/v1alpha2_resource_class_parameters.h -model/v1alpha2_resource_class_parameters_list.c -model/v1alpha2_resource_class_parameters_list.h -model/v1alpha2_resource_class_parameters_reference.c -model/v1alpha2_resource_class_parameters_reference.h -model/v1alpha2_resource_filter.c -model/v1alpha2_resource_filter.h -model/v1alpha2_resource_handle.c -model/v1alpha2_resource_handle.h -model/v1alpha2_resource_request.c -model/v1alpha2_resource_request.h -model/v1alpha2_resource_slice.c -model/v1alpha2_resource_slice.h -model/v1alpha2_resource_slice_list.c -model/v1alpha2_resource_slice_list.h -model/v1alpha2_structured_resource_handle.c -model/v1alpha2_structured_resource_handle.h -model/v1alpha2_vendor_parameters.c -model/v1alpha2_vendor_parameters.h -model/v1beta1_audit_annotation.c -model/v1beta1_audit_annotation.h -model/v1beta1_expression_warning.c -model/v1beta1_expression_warning.h +model/v1alpha2_lease_candidate.c +model/v1alpha2_lease_candidate.h +model/v1alpha2_lease_candidate_list.c +model/v1alpha2_lease_candidate_list.h +model/v1alpha2_lease_candidate_spec.c +model/v1alpha2_lease_candidate_spec.h +model/v1alpha3_cel_device_selector.c +model/v1alpha3_cel_device_selector.h +model/v1alpha3_device_selector.c +model/v1alpha3_device_selector.h +model/v1alpha3_device_taint.c +model/v1alpha3_device_taint.h +model/v1alpha3_device_taint_rule.c +model/v1alpha3_device_taint_rule.h +model/v1alpha3_device_taint_rule_list.c +model/v1alpha3_device_taint_rule_list.h +model/v1alpha3_device_taint_rule_spec.c +model/v1alpha3_device_taint_rule_spec.h +model/v1alpha3_device_taint_selector.c +model/v1alpha3_device_taint_selector.h +model/v1beta1_allocated_device_status.c +model/v1beta1_allocated_device_status.h +model/v1beta1_allocation_result.c +model/v1beta1_allocation_result.h +model/v1beta1_apply_configuration.c +model/v1beta1_apply_configuration.h +model/v1beta1_basic_device.c +model/v1beta1_basic_device.h +model/v1beta1_capacity_request_policy.c +model/v1beta1_capacity_request_policy.h +model/v1beta1_capacity_request_policy_range.c +model/v1beta1_capacity_request_policy_range.h +model/v1beta1_capacity_requirements.c +model/v1beta1_capacity_requirements.h +model/v1beta1_cel_device_selector.c +model/v1beta1_cel_device_selector.h +model/v1beta1_cluster_trust_bundle.c +model/v1beta1_cluster_trust_bundle.h +model/v1beta1_cluster_trust_bundle_list.c +model/v1beta1_cluster_trust_bundle_list.h +model/v1beta1_cluster_trust_bundle_spec.c +model/v1beta1_cluster_trust_bundle_spec.h +model/v1beta1_counter.c +model/v1beta1_counter.h +model/v1beta1_counter_set.c +model/v1beta1_counter_set.h +model/v1beta1_device.c +model/v1beta1_device.h +model/v1beta1_device_allocation_configuration.c +model/v1beta1_device_allocation_configuration.h +model/v1beta1_device_allocation_result.c +model/v1beta1_device_allocation_result.h +model/v1beta1_device_attribute.c +model/v1beta1_device_attribute.h +model/v1beta1_device_capacity.c +model/v1beta1_device_capacity.h +model/v1beta1_device_claim.c +model/v1beta1_device_claim.h +model/v1beta1_device_claim_configuration.c +model/v1beta1_device_claim_configuration.h +model/v1beta1_device_class.c +model/v1beta1_device_class.h +model/v1beta1_device_class_configuration.c +model/v1beta1_device_class_configuration.h +model/v1beta1_device_class_list.c +model/v1beta1_device_class_list.h +model/v1beta1_device_class_spec.c +model/v1beta1_device_class_spec.h +model/v1beta1_device_constraint.c +model/v1beta1_device_constraint.h +model/v1beta1_device_counter_consumption.c +model/v1beta1_device_counter_consumption.h +model/v1beta1_device_request.c +model/v1beta1_device_request.h +model/v1beta1_device_request_allocation_result.c +model/v1beta1_device_request_allocation_result.h +model/v1beta1_device_selector.c +model/v1beta1_device_selector.h +model/v1beta1_device_sub_request.c +model/v1beta1_device_sub_request.h +model/v1beta1_device_taint.c +model/v1beta1_device_taint.h +model/v1beta1_device_toleration.c +model/v1beta1_device_toleration.h +model/v1beta1_ip_address.c +model/v1beta1_ip_address.h +model/v1beta1_ip_address_list.c +model/v1beta1_ip_address_list.h +model/v1beta1_ip_address_spec.c +model/v1beta1_ip_address_spec.h +model/v1beta1_json_patch.c +model/v1beta1_json_patch.h +model/v1beta1_lease_candidate.c +model/v1beta1_lease_candidate.h +model/v1beta1_lease_candidate_list.c +model/v1beta1_lease_candidate_list.h +model/v1beta1_lease_candidate_spec.c +model/v1beta1_lease_candidate_spec.h model/v1beta1_match_condition.c model/v1beta1_match_condition.h model/v1beta1_match_resources.c model/v1beta1_match_resources.h +model/v1beta1_mutating_admission_policy.c +model/v1beta1_mutating_admission_policy.h +model/v1beta1_mutating_admission_policy_binding.c +model/v1beta1_mutating_admission_policy_binding.h +model/v1beta1_mutating_admission_policy_binding_list.c +model/v1beta1_mutating_admission_policy_binding_list.h +model/v1beta1_mutating_admission_policy_binding_spec.c +model/v1beta1_mutating_admission_policy_binding_spec.h +model/v1beta1_mutating_admission_policy_list.c +model/v1beta1_mutating_admission_policy_list.h +model/v1beta1_mutating_admission_policy_spec.c +model/v1beta1_mutating_admission_policy_spec.h +model/v1beta1_mutation.c +model/v1beta1_mutation.h model/v1beta1_named_rule_with_operations.c model/v1beta1_named_rule_with_operations.h +model/v1beta1_network_device_data.c +model/v1beta1_network_device_data.h +model/v1beta1_opaque_device_configuration.c +model/v1beta1_opaque_device_configuration.h model/v1beta1_param_kind.c model/v1beta1_param_kind.h model/v1beta1_param_ref.c model/v1beta1_param_ref.h -model/v1beta1_self_subject_review.c -model/v1beta1_self_subject_review.h -model/v1beta1_self_subject_review_status.c -model/v1beta1_self_subject_review_status.h -model/v1beta1_type_checking.c -model/v1beta1_type_checking.h -model/v1beta1_validating_admission_policy.c -model/v1beta1_validating_admission_policy.h -model/v1beta1_validating_admission_policy_binding.c -model/v1beta1_validating_admission_policy_binding.h -model/v1beta1_validating_admission_policy_binding_list.c -model/v1beta1_validating_admission_policy_binding_list.h -model/v1beta1_validating_admission_policy_binding_spec.c -model/v1beta1_validating_admission_policy_binding_spec.h -model/v1beta1_validating_admission_policy_list.c -model/v1beta1_validating_admission_policy_list.h -model/v1beta1_validating_admission_policy_spec.c -model/v1beta1_validating_admission_policy_spec.h -model/v1beta1_validating_admission_policy_status.c -model/v1beta1_validating_admission_policy_status.h -model/v1beta1_validation.c -model/v1beta1_validation.h +model/v1beta1_parent_reference.c +model/v1beta1_parent_reference.h +model/v1beta1_resource_claim.c +model/v1beta1_resource_claim.h +model/v1beta1_resource_claim_consumer_reference.c +model/v1beta1_resource_claim_consumer_reference.h +model/v1beta1_resource_claim_list.c +model/v1beta1_resource_claim_list.h +model/v1beta1_resource_claim_spec.c +model/v1beta1_resource_claim_spec.h +model/v1beta1_resource_claim_status.c +model/v1beta1_resource_claim_status.h +model/v1beta1_resource_claim_template.c +model/v1beta1_resource_claim_template.h +model/v1beta1_resource_claim_template_list.c +model/v1beta1_resource_claim_template_list.h +model/v1beta1_resource_claim_template_spec.c +model/v1beta1_resource_claim_template_spec.h +model/v1beta1_resource_pool.c +model/v1beta1_resource_pool.h +model/v1beta1_resource_slice.c +model/v1beta1_resource_slice.h +model/v1beta1_resource_slice_list.c +model/v1beta1_resource_slice_list.h +model/v1beta1_resource_slice_spec.c +model/v1beta1_resource_slice_spec.h +model/v1beta1_service_cidr.c +model/v1beta1_service_cidr.h +model/v1beta1_service_cidr_list.c +model/v1beta1_service_cidr_list.h +model/v1beta1_service_cidr_spec.c +model/v1beta1_service_cidr_spec.h +model/v1beta1_service_cidr_status.c +model/v1beta1_service_cidr_status.h model/v1beta1_variable.c model/v1beta1_variable.h -model/v1beta3_exempt_priority_level_configuration.c -model/v1beta3_exempt_priority_level_configuration.h -model/v1beta3_flow_distinguisher_method.c -model/v1beta3_flow_distinguisher_method.h -model/v1beta3_flow_schema.c -model/v1beta3_flow_schema.h -model/v1beta3_flow_schema_condition.c -model/v1beta3_flow_schema_condition.h -model/v1beta3_flow_schema_list.c -model/v1beta3_flow_schema_list.h -model/v1beta3_flow_schema_spec.c -model/v1beta3_flow_schema_spec.h -model/v1beta3_flow_schema_status.c -model/v1beta3_flow_schema_status.h -model/v1beta3_group_subject.c -model/v1beta3_group_subject.h -model/v1beta3_limit_response.c -model/v1beta3_limit_response.h -model/v1beta3_limited_priority_level_configuration.c -model/v1beta3_limited_priority_level_configuration.h -model/v1beta3_non_resource_policy_rule.c -model/v1beta3_non_resource_policy_rule.h -model/v1beta3_policy_rules_with_subjects.c -model/v1beta3_policy_rules_with_subjects.h -model/v1beta3_priority_level_configuration.c -model/v1beta3_priority_level_configuration.h -model/v1beta3_priority_level_configuration_condition.c -model/v1beta3_priority_level_configuration_condition.h -model/v1beta3_priority_level_configuration_list.c -model/v1beta3_priority_level_configuration_list.h -model/v1beta3_priority_level_configuration_reference.c -model/v1beta3_priority_level_configuration_reference.h -model/v1beta3_priority_level_configuration_spec.c -model/v1beta3_priority_level_configuration_spec.h -model/v1beta3_priority_level_configuration_status.c -model/v1beta3_priority_level_configuration_status.h -model/v1beta3_queuing_configuration.c -model/v1beta3_queuing_configuration.h -model/v1beta3_resource_policy_rule.c -model/v1beta3_resource_policy_rule.h -model/v1beta3_service_account_subject.c -model/v1beta3_service_account_subject.h -model/v1beta3_subject.c -model/v1beta3_subject.h -model/v1beta3_user_subject.c -model/v1beta3_user_subject.h +model/v1beta1_volume_attributes_class.c +model/v1beta1_volume_attributes_class.h +model/v1beta1_volume_attributes_class_list.c +model/v1beta1_volume_attributes_class_list.h +model/v1beta2_allocated_device_status.c +model/v1beta2_allocated_device_status.h +model/v1beta2_allocation_result.c +model/v1beta2_allocation_result.h +model/v1beta2_capacity_request_policy.c +model/v1beta2_capacity_request_policy.h +model/v1beta2_capacity_request_policy_range.c +model/v1beta2_capacity_request_policy_range.h +model/v1beta2_capacity_requirements.c +model/v1beta2_capacity_requirements.h +model/v1beta2_cel_device_selector.c +model/v1beta2_cel_device_selector.h +model/v1beta2_counter.c +model/v1beta2_counter.h +model/v1beta2_counter_set.c +model/v1beta2_counter_set.h +model/v1beta2_device.c +model/v1beta2_device.h +model/v1beta2_device_allocation_configuration.c +model/v1beta2_device_allocation_configuration.h +model/v1beta2_device_allocation_result.c +model/v1beta2_device_allocation_result.h +model/v1beta2_device_attribute.c +model/v1beta2_device_attribute.h +model/v1beta2_device_capacity.c +model/v1beta2_device_capacity.h +model/v1beta2_device_claim.c +model/v1beta2_device_claim.h +model/v1beta2_device_claim_configuration.c +model/v1beta2_device_claim_configuration.h +model/v1beta2_device_class.c +model/v1beta2_device_class.h +model/v1beta2_device_class_configuration.c +model/v1beta2_device_class_configuration.h +model/v1beta2_device_class_list.c +model/v1beta2_device_class_list.h +model/v1beta2_device_class_spec.c +model/v1beta2_device_class_spec.h +model/v1beta2_device_constraint.c +model/v1beta2_device_constraint.h +model/v1beta2_device_counter_consumption.c +model/v1beta2_device_counter_consumption.h +model/v1beta2_device_request.c +model/v1beta2_device_request.h +model/v1beta2_device_request_allocation_result.c +model/v1beta2_device_request_allocation_result.h +model/v1beta2_device_selector.c +model/v1beta2_device_selector.h +model/v1beta2_device_sub_request.c +model/v1beta2_device_sub_request.h +model/v1beta2_device_taint.c +model/v1beta2_device_taint.h +model/v1beta2_device_toleration.c +model/v1beta2_device_toleration.h +model/v1beta2_exact_device_request.c +model/v1beta2_exact_device_request.h +model/v1beta2_network_device_data.c +model/v1beta2_network_device_data.h +model/v1beta2_opaque_device_configuration.c +model/v1beta2_opaque_device_configuration.h +model/v1beta2_resource_claim.c +model/v1beta2_resource_claim.h +model/v1beta2_resource_claim_consumer_reference.c +model/v1beta2_resource_claim_consumer_reference.h +model/v1beta2_resource_claim_list.c +model/v1beta2_resource_claim_list.h +model/v1beta2_resource_claim_spec.c +model/v1beta2_resource_claim_spec.h +model/v1beta2_resource_claim_status.c +model/v1beta2_resource_claim_status.h +model/v1beta2_resource_claim_template.c +model/v1beta2_resource_claim_template.h +model/v1beta2_resource_claim_template_list.c +model/v1beta2_resource_claim_template_list.h +model/v1beta2_resource_claim_template_spec.c +model/v1beta2_resource_claim_template_spec.h +model/v1beta2_resource_pool.c +model/v1beta2_resource_pool.h +model/v1beta2_resource_slice.c +model/v1beta2_resource_slice.h +model/v1beta2_resource_slice_list.c +model/v1beta2_resource_slice_list.h +model/v1beta2_resource_slice_spec.c +model/v1beta2_resource_slice_spec.h model/v2_container_resource_metric_source.c model/v2_container_resource_metric_source.h model/v2_container_resource_metric_status.c @@ -2048,15 +2374,19 @@ unit-test/test_core_v1_endpoint_port.c unit-test/test_core_v1_event.c unit-test/test_core_v1_event_list.c unit-test/test_core_v1_event_series.c +unit-test/test_core_v1_resource_claim.c unit-test/test_discovery_v1_endpoint_port.c unit-test/test_events_v1_event.c unit-test/test_events_v1_event_list.c unit-test/test_events_v1_event_series.c unit-test/test_flowcontrol_v1_subject.c unit-test/test_rbac_v1_subject.c +unit-test/test_resource_v1_resource_claim.c unit-test/test_storage_v1_token_request.c unit-test/test_v1_affinity.c unit-test/test_v1_aggregation_rule.c +unit-test/test_v1_allocated_device_status.c +unit-test/test_v1_allocation_result.c unit-test/test_v1_api_group.c unit-test/test_v1_api_group_list.c unit-test/test_v1_api_resource.c @@ -2077,6 +2407,10 @@ unit-test/test_v1_azure_file_volume_source.c unit-test/test_v1_binding.c unit-test/test_v1_bound_object_reference.c unit-test/test_v1_capabilities.c +unit-test/test_v1_capacity_request_policy.c +unit-test/test_v1_capacity_request_policy_range.c +unit-test/test_v1_capacity_requirements.c +unit-test/test_v1_cel_device_selector.c unit-test/test_v1_ceph_fs_persistent_volume_source.c unit-test/test_v1_ceph_fs_volume_source.c unit-test/test_v1_certificate_signing_request.c @@ -2086,7 +2420,6 @@ unit-test/test_v1_certificate_signing_request_spec.c unit-test/test_v1_certificate_signing_request_status.c unit-test/test_v1_cinder_persistent_volume_source.c unit-test/test_v1_cinder_volume_source.c -unit-test/test_v1_claim_source.c unit-test/test_v1_client_ip_config.c unit-test/test_v1_cluster_role.c unit-test/test_v1_cluster_role_binding.c @@ -2105,16 +2438,22 @@ unit-test/test_v1_config_map_node_config_source.c unit-test/test_v1_config_map_projection.c unit-test/test_v1_config_map_volume_source.c unit-test/test_v1_container.c +unit-test/test_v1_container_extended_resource_request.c unit-test/test_v1_container_image.c unit-test/test_v1_container_port.c unit-test/test_v1_container_resize_policy.c +unit-test/test_v1_container_restart_rule.c +unit-test/test_v1_container_restart_rule_on_exit_codes.c unit-test/test_v1_container_state.c unit-test/test_v1_container_state_running.c unit-test/test_v1_container_state_terminated.c unit-test/test_v1_container_state_waiting.c unit-test/test_v1_container_status.c +unit-test/test_v1_container_user.c unit-test/test_v1_controller_revision.c unit-test/test_v1_controller_revision_list.c +unit-test/test_v1_counter.c +unit-test/test_v1_counter_set.c unit-test/test_v1_cron_job.c unit-test/test_v1_cron_job_list.c unit-test/test_v1_cron_job_spec.c @@ -2157,6 +2496,25 @@ unit-test/test_v1_deployment_list.c unit-test/test_v1_deployment_spec.c unit-test/test_v1_deployment_status.c unit-test/test_v1_deployment_strategy.c +unit-test/test_v1_device.c +unit-test/test_v1_device_allocation_configuration.c +unit-test/test_v1_device_allocation_result.c +unit-test/test_v1_device_attribute.c +unit-test/test_v1_device_capacity.c +unit-test/test_v1_device_claim.c +unit-test/test_v1_device_claim_configuration.c +unit-test/test_v1_device_class.c +unit-test/test_v1_device_class_configuration.c +unit-test/test_v1_device_class_list.c +unit-test/test_v1_device_class_spec.c +unit-test/test_v1_device_constraint.c +unit-test/test_v1_device_counter_consumption.c +unit-test/test_v1_device_request.c +unit-test/test_v1_device_request_allocation_result.c +unit-test/test_v1_device_selector.c +unit-test/test_v1_device_sub_request.c +unit-test/test_v1_device_taint.c +unit-test/test_v1_device_toleration.c unit-test/test_v1_downward_api_projection.c unit-test/test_v1_downward_api_volume_file.c unit-test/test_v1_downward_api_volume_source.c @@ -2177,11 +2535,15 @@ unit-test/test_v1_ephemeral_container.c unit-test/test_v1_ephemeral_volume_source.c unit-test/test_v1_event_source.c unit-test/test_v1_eviction.c +unit-test/test_v1_exact_device_request.c unit-test/test_v1_exec_action.c unit-test/test_v1_exempt_priority_level_configuration.c unit-test/test_v1_expression_warning.c unit-test/test_v1_external_documentation.c unit-test/test_v1_fc_volume_source.c +unit-test/test_v1_field_selector_attributes.c +unit-test/test_v1_field_selector_requirement.c +unit-test/test_v1_file_key_selector.c unit-test/test_v1_flex_persistent_volume_source.c unit-test/test_v1_flex_volume_source.c unit-test/test_v1_flocker_volume_source.c @@ -2191,6 +2553,7 @@ unit-test/test_v1_flow_schema_condition.c unit-test/test_v1_flow_schema_list.c unit-test/test_v1_flow_schema_spec.c unit-test/test_v1_flow_schema_status.c +unit-test/test_v1_for_node.c unit-test/test_v1_for_zone.c unit-test/test_v1_gce_persistent_disk_volume_source.c unit-test/test_v1_git_repo_volume_source.c @@ -2210,6 +2573,7 @@ unit-test/test_v1_http_get_action.c unit-test/test_v1_http_header.c unit-test/test_v1_http_ingress_path.c unit-test/test_v1_http_ingress_rule_value.c +unit-test/test_v1_image_volume_source.c unit-test/test_v1_ingress.c unit-test/test_v1_ingress_backend.c unit-test/test_v1_ingress_class.c @@ -2225,6 +2589,9 @@ unit-test/test_v1_ingress_service_backend.c unit-test/test_v1_ingress_spec.c unit-test/test_v1_ingress_status.c unit-test/test_v1_ingress_tls.c +unit-test/test_v1_ip_address.c +unit-test/test_v1_ip_address_list.c +unit-test/test_v1_ip_address_spec.c unit-test/test_v1_ip_block.c unit-test/test_v1_iscsi_persistent_volume_source.c unit-test/test_v1_iscsi_volume_source.c @@ -2237,6 +2604,7 @@ unit-test/test_v1_job_template_spec.c unit-test/test_v1_json_schema_props.c unit-test/test_v1_key_to_path.c unit-test/test_v1_label_selector.c +unit-test/test_v1_label_selector_attributes.c unit-test/test_v1_label_selector_requirement.c unit-test/test_v1_lease.c unit-test/test_v1_lease_list.c @@ -2249,6 +2617,7 @@ unit-test/test_v1_limit_range_list.c unit-test/test_v1_limit_range_spec.c unit-test/test_v1_limit_response.c unit-test/test_v1_limited_priority_level_configuration.c +unit-test/test_v1_linux_container_user.c unit-test/test_v1_list_meta.c unit-test/test_v1_load_balancer_ingress.c unit-test/test_v1_load_balancer_status.c @@ -2268,6 +2637,7 @@ unit-test/test_v1_namespace_condition.c unit-test/test_v1_namespace_list.c unit-test/test_v1_namespace_spec.c unit-test/test_v1_namespace_status.c +unit-test/test_v1_network_device_data.c unit-test/test_v1_network_policy.c unit-test/test_v1_network_policy_egress_rule.c unit-test/test_v1_network_policy_ingress_rule.c @@ -2283,6 +2653,7 @@ unit-test/test_v1_node_condition.c unit-test/test_v1_node_config_source.c unit-test/test_v1_node_config_status.c unit-test/test_v1_node_daemon_endpoints.c +unit-test/test_v1_node_features.c unit-test/test_v1_node_list.c unit-test/test_v1_node_runtime_handler.c unit-test/test_v1_node_runtime_handler_features.c @@ -2291,6 +2662,7 @@ unit-test/test_v1_node_selector_requirement.c unit-test/test_v1_node_selector_term.c unit-test/test_v1_node_spec.c unit-test/test_v1_node_status.c +unit-test/test_v1_node_swap_status.c unit-test/test_v1_node_system_info.c unit-test/test_v1_non_resource_attributes.c unit-test/test_v1_non_resource_policy_rule.c @@ -2298,10 +2670,12 @@ unit-test/test_v1_non_resource_rule.c unit-test/test_v1_object_field_selector.c unit-test/test_v1_object_meta.c unit-test/test_v1_object_reference.c +unit-test/test_v1_opaque_device_configuration.c unit-test/test_v1_overhead.c unit-test/test_v1_owner_reference.c unit-test/test_v1_param_kind.c unit-test/test_v1_param_ref.c +unit-test/test_v1_parent_reference.c unit-test/test_v1_persistent_volume.c unit-test/test_v1_persistent_volume_claim.c unit-test/test_v1_persistent_volume_claim_condition.c @@ -2318,6 +2692,7 @@ unit-test/test_v1_pod.c unit-test/test_v1_pod_affinity.c unit-test/test_v1_pod_affinity_term.c unit-test/test_v1_pod_anti_affinity.c +unit-test/test_v1_pod_certificate_projection.c unit-test/test_v1_pod_condition.c unit-test/test_v1_pod_disruption_budget.c unit-test/test_v1_pod_disruption_budget_list.c @@ -2325,6 +2700,7 @@ unit-test/test_v1_pod_disruption_budget_spec.c unit-test/test_v1_pod_disruption_budget_status.c unit-test/test_v1_pod_dns_config.c unit-test/test_v1_pod_dns_config_option.c +unit-test/test_v1_pod_extended_resource_claim_status.c unit-test/test_v1_pod_failure_policy.c unit-test/test_v1_pod_failure_policy_on_exit_codes_requirement.c unit-test/test_v1_pod_failure_policy_on_pod_conditions_pattern.c @@ -2373,15 +2749,27 @@ unit-test/test_v1_replication_controller_list.c unit-test/test_v1_replication_controller_spec.c unit-test/test_v1_replication_controller_status.c unit-test/test_v1_resource_attributes.c -unit-test/test_v1_resource_claim.c +unit-test/test_v1_resource_claim_consumer_reference.c +unit-test/test_v1_resource_claim_list.c +unit-test/test_v1_resource_claim_spec.c +unit-test/test_v1_resource_claim_status.c +unit-test/test_v1_resource_claim_template.c +unit-test/test_v1_resource_claim_template_list.c +unit-test/test_v1_resource_claim_template_spec.c unit-test/test_v1_resource_field_selector.c +unit-test/test_v1_resource_health.c unit-test/test_v1_resource_policy_rule.c +unit-test/test_v1_resource_pool.c unit-test/test_v1_resource_quota.c unit-test/test_v1_resource_quota_list.c unit-test/test_v1_resource_quota_spec.c unit-test/test_v1_resource_quota_status.c unit-test/test_v1_resource_requirements.c unit-test/test_v1_resource_rule.c +unit-test/test_v1_resource_slice.c +unit-test/test_v1_resource_slice_list.c +unit-test/test_v1_resource_slice_spec.c +unit-test/test_v1_resource_status.c unit-test/test_v1_role.c unit-test/test_v1_role_binding.c unit-test/test_v1_role_binding_list.c @@ -2425,6 +2813,10 @@ unit-test/test_v1_service_account_list.c unit-test/test_v1_service_account_subject.c unit-test/test_v1_service_account_token_projection.c unit-test/test_v1_service_backend_port.c +unit-test/test_v1_service_cidr.c +unit-test/test_v1_service_cidr_list.c +unit-test/test_v1_service_cidr_spec.c +unit-test/test_v1_service_cidr_status.c unit-test/test_v1_service_list.c unit-test/test_v1_service_port.c unit-test/test_v1_service_spec.c @@ -2489,6 +2881,8 @@ unit-test/test_v1_volume_attachment_list.c unit-test/test_v1_volume_attachment_source.c unit-test/test_v1_volume_attachment_spec.c unit-test/test_v1_volume_attachment_status.c +unit-test/test_v1_volume_attributes_class.c +unit-test/test_v1_volume_attributes_class_list.c unit-test/test_v1_volume_device.c unit-test/test_v1_volume_error.c unit-test/test_v1_volume_mount.c @@ -2502,29 +2896,30 @@ unit-test/test_v1_watch_event.c unit-test/test_v1_webhook_conversion.c unit-test/test_v1_weighted_pod_affinity_term.c unit-test/test_v1_windows_security_context_options.c -unit-test/test_v1alpha1_audit_annotation.c +unit-test/test_v1alpha1_apply_configuration.c unit-test/test_v1alpha1_cluster_trust_bundle.c unit-test/test_v1alpha1_cluster_trust_bundle_list.c unit-test/test_v1alpha1_cluster_trust_bundle_spec.c -unit-test/test_v1alpha1_expression_warning.c unit-test/test_v1alpha1_group_version_resource.c -unit-test/test_v1alpha1_ip_address.c -unit-test/test_v1alpha1_ip_address_list.c -unit-test/test_v1alpha1_ip_address_spec.c +unit-test/test_v1alpha1_json_patch.c unit-test/test_v1alpha1_match_condition.c unit-test/test_v1alpha1_match_resources.c unit-test/test_v1alpha1_migration_condition.c +unit-test/test_v1alpha1_mutating_admission_policy.c +unit-test/test_v1alpha1_mutating_admission_policy_binding.c +unit-test/test_v1alpha1_mutating_admission_policy_binding_list.c +unit-test/test_v1alpha1_mutating_admission_policy_binding_spec.c +unit-test/test_v1alpha1_mutating_admission_policy_list.c +unit-test/test_v1alpha1_mutating_admission_policy_spec.c +unit-test/test_v1alpha1_mutation.c unit-test/test_v1alpha1_named_rule_with_operations.c unit-test/test_v1alpha1_param_kind.c unit-test/test_v1alpha1_param_ref.c -unit-test/test_v1alpha1_parent_reference.c -unit-test/test_v1alpha1_self_subject_review.c -unit-test/test_v1alpha1_self_subject_review_status.c +unit-test/test_v1alpha1_pod_certificate_request.c +unit-test/test_v1alpha1_pod_certificate_request_list.c +unit-test/test_v1alpha1_pod_certificate_request_spec.c +unit-test/test_v1alpha1_pod_certificate_request_status.c unit-test/test_v1alpha1_server_storage_version.c -unit-test/test_v1alpha1_service_cidr.c -unit-test/test_v1alpha1_service_cidr_list.c -unit-test/test_v1alpha1_service_cidr_spec.c -unit-test/test_v1alpha1_service_cidr_status.c unit-test/test_v1alpha1_storage_version.c unit-test/test_v1alpha1_storage_version_condition.c unit-test/test_v1alpha1_storage_version_list.c @@ -2533,99 +2928,134 @@ unit-test/test_v1alpha1_storage_version_migration_list.c unit-test/test_v1alpha1_storage_version_migration_spec.c unit-test/test_v1alpha1_storage_version_migration_status.c unit-test/test_v1alpha1_storage_version_status.c -unit-test/test_v1alpha1_type_checking.c -unit-test/test_v1alpha1_validating_admission_policy.c -unit-test/test_v1alpha1_validating_admission_policy_binding.c -unit-test/test_v1alpha1_validating_admission_policy_binding_list.c -unit-test/test_v1alpha1_validating_admission_policy_binding_spec.c -unit-test/test_v1alpha1_validating_admission_policy_list.c -unit-test/test_v1alpha1_validating_admission_policy_spec.c -unit-test/test_v1alpha1_validating_admission_policy_status.c -unit-test/test_v1alpha1_validation.c unit-test/test_v1alpha1_variable.c unit-test/test_v1alpha1_volume_attributes_class.c unit-test/test_v1alpha1_volume_attributes_class_list.c -unit-test/test_v1alpha2_allocation_result.c -unit-test/test_v1alpha2_driver_allocation_result.c -unit-test/test_v1alpha2_driver_requests.c -unit-test/test_v1alpha2_named_resources_allocation_result.c -unit-test/test_v1alpha2_named_resources_attribute.c -unit-test/test_v1alpha2_named_resources_filter.c -unit-test/test_v1alpha2_named_resources_instance.c -unit-test/test_v1alpha2_named_resources_int_slice.c -unit-test/test_v1alpha2_named_resources_request.c -unit-test/test_v1alpha2_named_resources_resources.c -unit-test/test_v1alpha2_named_resources_string_slice.c -unit-test/test_v1alpha2_pod_scheduling_context.c -unit-test/test_v1alpha2_pod_scheduling_context_list.c -unit-test/test_v1alpha2_pod_scheduling_context_spec.c -unit-test/test_v1alpha2_pod_scheduling_context_status.c -unit-test/test_v1alpha2_resource_claim.c -unit-test/test_v1alpha2_resource_claim_consumer_reference.c -unit-test/test_v1alpha2_resource_claim_list.c -unit-test/test_v1alpha2_resource_claim_parameters.c -unit-test/test_v1alpha2_resource_claim_parameters_list.c -unit-test/test_v1alpha2_resource_claim_parameters_reference.c -unit-test/test_v1alpha2_resource_claim_scheduling_status.c -unit-test/test_v1alpha2_resource_claim_spec.c -unit-test/test_v1alpha2_resource_claim_status.c -unit-test/test_v1alpha2_resource_claim_template.c -unit-test/test_v1alpha2_resource_claim_template_list.c -unit-test/test_v1alpha2_resource_claim_template_spec.c -unit-test/test_v1alpha2_resource_class.c -unit-test/test_v1alpha2_resource_class_list.c -unit-test/test_v1alpha2_resource_class_parameters.c -unit-test/test_v1alpha2_resource_class_parameters_list.c -unit-test/test_v1alpha2_resource_class_parameters_reference.c -unit-test/test_v1alpha2_resource_filter.c -unit-test/test_v1alpha2_resource_handle.c -unit-test/test_v1alpha2_resource_request.c -unit-test/test_v1alpha2_resource_slice.c -unit-test/test_v1alpha2_resource_slice_list.c -unit-test/test_v1alpha2_structured_resource_handle.c -unit-test/test_v1alpha2_vendor_parameters.c -unit-test/test_v1beta1_audit_annotation.c -unit-test/test_v1beta1_expression_warning.c +unit-test/test_v1alpha2_lease_candidate.c +unit-test/test_v1alpha2_lease_candidate_list.c +unit-test/test_v1alpha2_lease_candidate_spec.c +unit-test/test_v1alpha3_cel_device_selector.c +unit-test/test_v1alpha3_device_selector.c +unit-test/test_v1alpha3_device_taint.c +unit-test/test_v1alpha3_device_taint_rule.c +unit-test/test_v1alpha3_device_taint_rule_list.c +unit-test/test_v1alpha3_device_taint_rule_spec.c +unit-test/test_v1alpha3_device_taint_selector.c +unit-test/test_v1beta1_allocated_device_status.c +unit-test/test_v1beta1_allocation_result.c +unit-test/test_v1beta1_apply_configuration.c +unit-test/test_v1beta1_basic_device.c +unit-test/test_v1beta1_capacity_request_policy.c +unit-test/test_v1beta1_capacity_request_policy_range.c +unit-test/test_v1beta1_capacity_requirements.c +unit-test/test_v1beta1_cel_device_selector.c +unit-test/test_v1beta1_cluster_trust_bundle.c +unit-test/test_v1beta1_cluster_trust_bundle_list.c +unit-test/test_v1beta1_cluster_trust_bundle_spec.c +unit-test/test_v1beta1_counter.c +unit-test/test_v1beta1_counter_set.c +unit-test/test_v1beta1_device.c +unit-test/test_v1beta1_device_allocation_configuration.c +unit-test/test_v1beta1_device_allocation_result.c +unit-test/test_v1beta1_device_attribute.c +unit-test/test_v1beta1_device_capacity.c +unit-test/test_v1beta1_device_claim.c +unit-test/test_v1beta1_device_claim_configuration.c +unit-test/test_v1beta1_device_class.c +unit-test/test_v1beta1_device_class_configuration.c +unit-test/test_v1beta1_device_class_list.c +unit-test/test_v1beta1_device_class_spec.c +unit-test/test_v1beta1_device_constraint.c +unit-test/test_v1beta1_device_counter_consumption.c +unit-test/test_v1beta1_device_request.c +unit-test/test_v1beta1_device_request_allocation_result.c +unit-test/test_v1beta1_device_selector.c +unit-test/test_v1beta1_device_sub_request.c +unit-test/test_v1beta1_device_taint.c +unit-test/test_v1beta1_device_toleration.c +unit-test/test_v1beta1_ip_address.c +unit-test/test_v1beta1_ip_address_list.c +unit-test/test_v1beta1_ip_address_spec.c +unit-test/test_v1beta1_json_patch.c +unit-test/test_v1beta1_lease_candidate.c +unit-test/test_v1beta1_lease_candidate_list.c +unit-test/test_v1beta1_lease_candidate_spec.c unit-test/test_v1beta1_match_condition.c unit-test/test_v1beta1_match_resources.c +unit-test/test_v1beta1_mutating_admission_policy.c +unit-test/test_v1beta1_mutating_admission_policy_binding.c +unit-test/test_v1beta1_mutating_admission_policy_binding_list.c +unit-test/test_v1beta1_mutating_admission_policy_binding_spec.c +unit-test/test_v1beta1_mutating_admission_policy_list.c +unit-test/test_v1beta1_mutating_admission_policy_spec.c +unit-test/test_v1beta1_mutation.c unit-test/test_v1beta1_named_rule_with_operations.c +unit-test/test_v1beta1_network_device_data.c +unit-test/test_v1beta1_opaque_device_configuration.c unit-test/test_v1beta1_param_kind.c unit-test/test_v1beta1_param_ref.c -unit-test/test_v1beta1_self_subject_review.c -unit-test/test_v1beta1_self_subject_review_status.c -unit-test/test_v1beta1_type_checking.c -unit-test/test_v1beta1_validating_admission_policy.c -unit-test/test_v1beta1_validating_admission_policy_binding.c -unit-test/test_v1beta1_validating_admission_policy_binding_list.c -unit-test/test_v1beta1_validating_admission_policy_binding_spec.c -unit-test/test_v1beta1_validating_admission_policy_list.c -unit-test/test_v1beta1_validating_admission_policy_spec.c -unit-test/test_v1beta1_validating_admission_policy_status.c -unit-test/test_v1beta1_validation.c +unit-test/test_v1beta1_parent_reference.c +unit-test/test_v1beta1_resource_claim.c +unit-test/test_v1beta1_resource_claim_consumer_reference.c +unit-test/test_v1beta1_resource_claim_list.c +unit-test/test_v1beta1_resource_claim_spec.c +unit-test/test_v1beta1_resource_claim_status.c +unit-test/test_v1beta1_resource_claim_template.c +unit-test/test_v1beta1_resource_claim_template_list.c +unit-test/test_v1beta1_resource_claim_template_spec.c +unit-test/test_v1beta1_resource_pool.c +unit-test/test_v1beta1_resource_slice.c +unit-test/test_v1beta1_resource_slice_list.c +unit-test/test_v1beta1_resource_slice_spec.c +unit-test/test_v1beta1_service_cidr.c +unit-test/test_v1beta1_service_cidr_list.c +unit-test/test_v1beta1_service_cidr_spec.c +unit-test/test_v1beta1_service_cidr_status.c unit-test/test_v1beta1_variable.c -unit-test/test_v1beta3_exempt_priority_level_configuration.c -unit-test/test_v1beta3_flow_distinguisher_method.c -unit-test/test_v1beta3_flow_schema.c -unit-test/test_v1beta3_flow_schema_condition.c -unit-test/test_v1beta3_flow_schema_list.c -unit-test/test_v1beta3_flow_schema_spec.c -unit-test/test_v1beta3_flow_schema_status.c -unit-test/test_v1beta3_group_subject.c -unit-test/test_v1beta3_limit_response.c -unit-test/test_v1beta3_limited_priority_level_configuration.c -unit-test/test_v1beta3_non_resource_policy_rule.c -unit-test/test_v1beta3_policy_rules_with_subjects.c -unit-test/test_v1beta3_priority_level_configuration.c -unit-test/test_v1beta3_priority_level_configuration_condition.c -unit-test/test_v1beta3_priority_level_configuration_list.c -unit-test/test_v1beta3_priority_level_configuration_reference.c -unit-test/test_v1beta3_priority_level_configuration_spec.c -unit-test/test_v1beta3_priority_level_configuration_status.c -unit-test/test_v1beta3_queuing_configuration.c -unit-test/test_v1beta3_resource_policy_rule.c -unit-test/test_v1beta3_service_account_subject.c -unit-test/test_v1beta3_subject.c -unit-test/test_v1beta3_user_subject.c +unit-test/test_v1beta1_volume_attributes_class.c +unit-test/test_v1beta1_volume_attributes_class_list.c +unit-test/test_v1beta2_allocated_device_status.c +unit-test/test_v1beta2_allocation_result.c +unit-test/test_v1beta2_capacity_request_policy.c +unit-test/test_v1beta2_capacity_request_policy_range.c +unit-test/test_v1beta2_capacity_requirements.c +unit-test/test_v1beta2_cel_device_selector.c +unit-test/test_v1beta2_counter.c +unit-test/test_v1beta2_counter_set.c +unit-test/test_v1beta2_device.c +unit-test/test_v1beta2_device_allocation_configuration.c +unit-test/test_v1beta2_device_allocation_result.c +unit-test/test_v1beta2_device_attribute.c +unit-test/test_v1beta2_device_capacity.c +unit-test/test_v1beta2_device_claim.c +unit-test/test_v1beta2_device_claim_configuration.c +unit-test/test_v1beta2_device_class.c +unit-test/test_v1beta2_device_class_configuration.c +unit-test/test_v1beta2_device_class_list.c +unit-test/test_v1beta2_device_class_spec.c +unit-test/test_v1beta2_device_constraint.c +unit-test/test_v1beta2_device_counter_consumption.c +unit-test/test_v1beta2_device_request.c +unit-test/test_v1beta2_device_request_allocation_result.c +unit-test/test_v1beta2_device_selector.c +unit-test/test_v1beta2_device_sub_request.c +unit-test/test_v1beta2_device_taint.c +unit-test/test_v1beta2_device_toleration.c +unit-test/test_v1beta2_exact_device_request.c +unit-test/test_v1beta2_network_device_data.c +unit-test/test_v1beta2_opaque_device_configuration.c +unit-test/test_v1beta2_resource_claim.c +unit-test/test_v1beta2_resource_claim_consumer_reference.c +unit-test/test_v1beta2_resource_claim_list.c +unit-test/test_v1beta2_resource_claim_spec.c +unit-test/test_v1beta2_resource_claim_status.c +unit-test/test_v1beta2_resource_claim_template.c +unit-test/test_v1beta2_resource_claim_template_list.c +unit-test/test_v1beta2_resource_claim_template_spec.c +unit-test/test_v1beta2_resource_pool.c +unit-test/test_v1beta2_resource_slice.c +unit-test/test_v1beta2_resource_slice_list.c +unit-test/test_v1beta2_resource_slice_spec.c unit-test/test_v2_container_resource_metric_source.c unit-test/test_v2_container_resource_metric_status.c unit-test/test_v2_cross_version_object_reference.c diff --git a/kubernetes/.openapi-generator/VERSION b/kubernetes/.openapi-generator/VERSION index ecb21862..2fb556b6 100644 --- a/kubernetes/.openapi-generator/VERSION +++ b/kubernetes/.openapi-generator/VERSION @@ -1 +1 @@ -7.6.0-SNAPSHOT +7.18.0-SNAPSHOT diff --git a/kubernetes/.openapi-generator/swagger.json-default.sha256 b/kubernetes/.openapi-generator/swagger.json-default.sha256 index 563a584e..264c9886 100644 --- a/kubernetes/.openapi-generator/swagger.json-default.sha256 +++ b/kubernetes/.openapi-generator/swagger.json-default.sha256 @@ -1 +1 @@ -c204ed91fd2c1c0d188588abfc26722743d02dce0446c9cb405e9bab16369be2 \ No newline at end of file +73f1e9252a5c5d1f5e74e7f6595d34831ce1925007ff994714f38a2be30140b1 \ No newline at end of file diff --git a/kubernetes/CMakeLists.txt b/kubernetes/CMakeLists.txt index 0dd4cf8f..811ebe4a 100644 --- a/kubernetes/CMakeLists.txt +++ b/kubernetes/CMakeLists.txt @@ -1,30 +1,26 @@ cmake_minimum_required (VERSION 2.6...3.10.2) -project (CGenerator) +project (CGenerator C) cmake_policy(SET CMP0063 NEW) set(CMAKE_C_VISIBILITY_PRESET default) -set(CMAKE_CXX_VISIBILITY_PRESET default) set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=missing-declarations") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion") option(BUILD_SHARED_LIBS "Build using shared libraries" ON) find_package(OpenSSL) if (OPENSSL_FOUND) - message (STATUS "OPENSSL found") - - set(CMAKE_C_FLAGS "-DOPENSSL") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL") if(CMAKE_VERSION VERSION_LESS 3.4) include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENSSL_INCLUDE_DIRS}) link_directories(${OPENSSL_LIBRARIES}) endif() - - message(STATUS "Using OpenSSL ${OPENSSL_VERSION}") -else() - message (STATUS "OpenSSL Not found.") endif() set(pkgName "kubernetes") @@ -42,8 +38,6 @@ else() if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIR}) set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) - else(CURL_FOUND) - message(FATAL_ERROR "Could not find the CURL library and development files.") endif() endif() @@ -64,15 +58,19 @@ set(SRCS model/core_v1_event.c model/core_v1_event_list.c model/core_v1_event_series.c + model/core_v1_resource_claim.c model/discovery_v1_endpoint_port.c model/events_v1_event.c model/events_v1_event_list.c model/events_v1_event_series.c model/flowcontrol_v1_subject.c model/rbac_v1_subject.c + model/resource_v1_resource_claim.c model/storage_v1_token_request.c model/v1_affinity.c model/v1_aggregation_rule.c + model/v1_allocated_device_status.c + model/v1_allocation_result.c model/v1_api_group.c model/v1_api_group_list.c model/v1_api_resource.c @@ -93,6 +91,10 @@ set(SRCS model/v1_binding.c model/v1_bound_object_reference.c model/v1_capabilities.c + model/v1_capacity_request_policy.c + model/v1_capacity_request_policy_range.c + model/v1_capacity_requirements.c + model/v1_cel_device_selector.c model/v1_ceph_fs_persistent_volume_source.c model/v1_ceph_fs_volume_source.c model/v1_certificate_signing_request.c @@ -102,7 +104,6 @@ set(SRCS model/v1_certificate_signing_request_status.c model/v1_cinder_persistent_volume_source.c model/v1_cinder_volume_source.c - model/v1_claim_source.c model/v1_client_ip_config.c model/v1_cluster_role.c model/v1_cluster_role_binding.c @@ -121,16 +122,22 @@ set(SRCS model/v1_config_map_projection.c model/v1_config_map_volume_source.c model/v1_container.c + model/v1_container_extended_resource_request.c model/v1_container_image.c model/v1_container_port.c model/v1_container_resize_policy.c + model/v1_container_restart_rule.c + model/v1_container_restart_rule_on_exit_codes.c model/v1_container_state.c model/v1_container_state_running.c model/v1_container_state_terminated.c model/v1_container_state_waiting.c model/v1_container_status.c + model/v1_container_user.c model/v1_controller_revision.c model/v1_controller_revision_list.c + model/v1_counter.c + model/v1_counter_set.c model/v1_cron_job.c model/v1_cron_job_list.c model/v1_cron_job_spec.c @@ -173,6 +180,25 @@ set(SRCS model/v1_deployment_spec.c model/v1_deployment_status.c model/v1_deployment_strategy.c + model/v1_device.c + model/v1_device_allocation_configuration.c + model/v1_device_allocation_result.c + model/v1_device_attribute.c + model/v1_device_capacity.c + model/v1_device_claim.c + model/v1_device_claim_configuration.c + model/v1_device_class.c + model/v1_device_class_configuration.c + model/v1_device_class_list.c + model/v1_device_class_spec.c + model/v1_device_constraint.c + model/v1_device_counter_consumption.c + model/v1_device_request.c + model/v1_device_request_allocation_result.c + model/v1_device_selector.c + model/v1_device_sub_request.c + model/v1_device_taint.c + model/v1_device_toleration.c model/v1_downward_api_projection.c model/v1_downward_api_volume_file.c model/v1_downward_api_volume_source.c @@ -193,11 +219,15 @@ set(SRCS model/v1_ephemeral_volume_source.c model/v1_event_source.c model/v1_eviction.c + model/v1_exact_device_request.c model/v1_exec_action.c model/v1_exempt_priority_level_configuration.c model/v1_expression_warning.c model/v1_external_documentation.c model/v1_fc_volume_source.c + model/v1_field_selector_attributes.c + model/v1_field_selector_requirement.c + model/v1_file_key_selector.c model/v1_flex_persistent_volume_source.c model/v1_flex_volume_source.c model/v1_flocker_volume_source.c @@ -207,6 +237,7 @@ set(SRCS model/v1_flow_schema_list.c model/v1_flow_schema_spec.c model/v1_flow_schema_status.c + model/v1_for_node.c model/v1_for_zone.c model/v1_gce_persistent_disk_volume_source.c model/v1_git_repo_volume_source.c @@ -226,6 +257,7 @@ set(SRCS model/v1_http_header.c model/v1_http_ingress_path.c model/v1_http_ingress_rule_value.c + model/v1_image_volume_source.c model/v1_ingress.c model/v1_ingress_backend.c model/v1_ingress_class.c @@ -241,6 +273,9 @@ set(SRCS model/v1_ingress_spec.c model/v1_ingress_status.c model/v1_ingress_tls.c + model/v1_ip_address.c + model/v1_ip_address_list.c + model/v1_ip_address_spec.c model/v1_ip_block.c model/v1_iscsi_persistent_volume_source.c model/v1_iscsi_volume_source.c @@ -253,6 +288,7 @@ set(SRCS model/v1_json_schema_props.c model/v1_key_to_path.c model/v1_label_selector.c + model/v1_label_selector_attributes.c model/v1_label_selector_requirement.c model/v1_lease.c model/v1_lease_list.c @@ -265,6 +301,7 @@ set(SRCS model/v1_limit_range_spec.c model/v1_limit_response.c model/v1_limited_priority_level_configuration.c + model/v1_linux_container_user.c model/v1_list_meta.c model/v1_load_balancer_ingress.c model/v1_load_balancer_status.c @@ -284,6 +321,7 @@ set(SRCS model/v1_namespace_list.c model/v1_namespace_spec.c model/v1_namespace_status.c + model/v1_network_device_data.c model/v1_network_policy.c model/v1_network_policy_egress_rule.c model/v1_network_policy_ingress_rule.c @@ -299,6 +337,7 @@ set(SRCS model/v1_node_config_source.c model/v1_node_config_status.c model/v1_node_daemon_endpoints.c + model/v1_node_features.c model/v1_node_list.c model/v1_node_runtime_handler.c model/v1_node_runtime_handler_features.c @@ -307,6 +346,7 @@ set(SRCS model/v1_node_selector_term.c model/v1_node_spec.c model/v1_node_status.c + model/v1_node_swap_status.c model/v1_node_system_info.c model/v1_non_resource_attributes.c model/v1_non_resource_policy_rule.c @@ -314,10 +354,12 @@ set(SRCS model/v1_object_field_selector.c model/v1_object_meta.c model/v1_object_reference.c + model/v1_opaque_device_configuration.c model/v1_overhead.c model/v1_owner_reference.c model/v1_param_kind.c model/v1_param_ref.c + model/v1_parent_reference.c model/v1_persistent_volume.c model/v1_persistent_volume_claim.c model/v1_persistent_volume_claim_condition.c @@ -334,6 +376,7 @@ set(SRCS model/v1_pod_affinity.c model/v1_pod_affinity_term.c model/v1_pod_anti_affinity.c + model/v1_pod_certificate_projection.c model/v1_pod_condition.c model/v1_pod_disruption_budget.c model/v1_pod_disruption_budget_list.c @@ -341,6 +384,7 @@ set(SRCS model/v1_pod_disruption_budget_status.c model/v1_pod_dns_config.c model/v1_pod_dns_config_option.c + model/v1_pod_extended_resource_claim_status.c model/v1_pod_failure_policy.c model/v1_pod_failure_policy_on_exit_codes_requirement.c model/v1_pod_failure_policy_on_pod_conditions_pattern.c @@ -389,15 +433,27 @@ set(SRCS model/v1_replication_controller_spec.c model/v1_replication_controller_status.c model/v1_resource_attributes.c - model/v1_resource_claim.c + model/v1_resource_claim_consumer_reference.c + model/v1_resource_claim_list.c + model/v1_resource_claim_spec.c + model/v1_resource_claim_status.c + model/v1_resource_claim_template.c + model/v1_resource_claim_template_list.c + model/v1_resource_claim_template_spec.c model/v1_resource_field_selector.c + model/v1_resource_health.c model/v1_resource_policy_rule.c + model/v1_resource_pool.c model/v1_resource_quota.c model/v1_resource_quota_list.c model/v1_resource_quota_spec.c model/v1_resource_quota_status.c model/v1_resource_requirements.c model/v1_resource_rule.c + model/v1_resource_slice.c + model/v1_resource_slice_list.c + model/v1_resource_slice_spec.c + model/v1_resource_status.c model/v1_role.c model/v1_role_binding.c model/v1_role_binding_list.c @@ -441,6 +497,10 @@ set(SRCS model/v1_service_account_subject.c model/v1_service_account_token_projection.c model/v1_service_backend_port.c + model/v1_service_cidr.c + model/v1_service_cidr_list.c + model/v1_service_cidr_spec.c + model/v1_service_cidr_status.c model/v1_service_list.c model/v1_service_port.c model/v1_service_spec.c @@ -505,6 +565,8 @@ set(SRCS model/v1_volume_attachment_source.c model/v1_volume_attachment_spec.c model/v1_volume_attachment_status.c + model/v1_volume_attributes_class.c + model/v1_volume_attributes_class_list.c model/v1_volume_device.c model/v1_volume_error.c model/v1_volume_mount.c @@ -518,29 +580,30 @@ set(SRCS model/v1_webhook_conversion.c model/v1_weighted_pod_affinity_term.c model/v1_windows_security_context_options.c - model/v1alpha1_audit_annotation.c + model/v1alpha1_apply_configuration.c model/v1alpha1_cluster_trust_bundle.c model/v1alpha1_cluster_trust_bundle_list.c model/v1alpha1_cluster_trust_bundle_spec.c - model/v1alpha1_expression_warning.c model/v1alpha1_group_version_resource.c - model/v1alpha1_ip_address.c - model/v1alpha1_ip_address_list.c - model/v1alpha1_ip_address_spec.c + model/v1alpha1_json_patch.c model/v1alpha1_match_condition.c model/v1alpha1_match_resources.c model/v1alpha1_migration_condition.c + model/v1alpha1_mutating_admission_policy.c + model/v1alpha1_mutating_admission_policy_binding.c + model/v1alpha1_mutating_admission_policy_binding_list.c + model/v1alpha1_mutating_admission_policy_binding_spec.c + model/v1alpha1_mutating_admission_policy_list.c + model/v1alpha1_mutating_admission_policy_spec.c + model/v1alpha1_mutation.c model/v1alpha1_named_rule_with_operations.c model/v1alpha1_param_kind.c model/v1alpha1_param_ref.c - model/v1alpha1_parent_reference.c - model/v1alpha1_self_subject_review.c - model/v1alpha1_self_subject_review_status.c + model/v1alpha1_pod_certificate_request.c + model/v1alpha1_pod_certificate_request_list.c + model/v1alpha1_pod_certificate_request_spec.c + model/v1alpha1_pod_certificate_request_status.c model/v1alpha1_server_storage_version.c - model/v1alpha1_service_cidr.c - model/v1alpha1_service_cidr_list.c - model/v1alpha1_service_cidr_spec.c - model/v1alpha1_service_cidr_status.c model/v1alpha1_storage_version.c model/v1alpha1_storage_version_condition.c model/v1alpha1_storage_version_list.c @@ -549,99 +612,134 @@ set(SRCS model/v1alpha1_storage_version_migration_spec.c model/v1alpha1_storage_version_migration_status.c model/v1alpha1_storage_version_status.c - model/v1alpha1_type_checking.c - model/v1alpha1_validating_admission_policy.c - model/v1alpha1_validating_admission_policy_binding.c - model/v1alpha1_validating_admission_policy_binding_list.c - model/v1alpha1_validating_admission_policy_binding_spec.c - model/v1alpha1_validating_admission_policy_list.c - model/v1alpha1_validating_admission_policy_spec.c - model/v1alpha1_validating_admission_policy_status.c - model/v1alpha1_validation.c model/v1alpha1_variable.c model/v1alpha1_volume_attributes_class.c model/v1alpha1_volume_attributes_class_list.c - model/v1alpha2_allocation_result.c - model/v1alpha2_driver_allocation_result.c - model/v1alpha2_driver_requests.c - model/v1alpha2_named_resources_allocation_result.c - model/v1alpha2_named_resources_attribute.c - model/v1alpha2_named_resources_filter.c - model/v1alpha2_named_resources_instance.c - model/v1alpha2_named_resources_int_slice.c - model/v1alpha2_named_resources_request.c - model/v1alpha2_named_resources_resources.c - model/v1alpha2_named_resources_string_slice.c - model/v1alpha2_pod_scheduling_context.c - model/v1alpha2_pod_scheduling_context_list.c - model/v1alpha2_pod_scheduling_context_spec.c - model/v1alpha2_pod_scheduling_context_status.c - model/v1alpha2_resource_claim.c - model/v1alpha2_resource_claim_consumer_reference.c - model/v1alpha2_resource_claim_list.c - model/v1alpha2_resource_claim_parameters.c - model/v1alpha2_resource_claim_parameters_list.c - model/v1alpha2_resource_claim_parameters_reference.c - model/v1alpha2_resource_claim_scheduling_status.c - model/v1alpha2_resource_claim_spec.c - model/v1alpha2_resource_claim_status.c - model/v1alpha2_resource_claim_template.c - model/v1alpha2_resource_claim_template_list.c - model/v1alpha2_resource_claim_template_spec.c - model/v1alpha2_resource_class.c - model/v1alpha2_resource_class_list.c - model/v1alpha2_resource_class_parameters.c - model/v1alpha2_resource_class_parameters_list.c - model/v1alpha2_resource_class_parameters_reference.c - model/v1alpha2_resource_filter.c - model/v1alpha2_resource_handle.c - model/v1alpha2_resource_request.c - model/v1alpha2_resource_slice.c - model/v1alpha2_resource_slice_list.c - model/v1alpha2_structured_resource_handle.c - model/v1alpha2_vendor_parameters.c - model/v1beta1_audit_annotation.c - model/v1beta1_expression_warning.c + model/v1alpha2_lease_candidate.c + model/v1alpha2_lease_candidate_list.c + model/v1alpha2_lease_candidate_spec.c + model/v1alpha3_cel_device_selector.c + model/v1alpha3_device_selector.c + model/v1alpha3_device_taint.c + model/v1alpha3_device_taint_rule.c + model/v1alpha3_device_taint_rule_list.c + model/v1alpha3_device_taint_rule_spec.c + model/v1alpha3_device_taint_selector.c + model/v1beta1_allocated_device_status.c + model/v1beta1_allocation_result.c + model/v1beta1_apply_configuration.c + model/v1beta1_basic_device.c + model/v1beta1_capacity_request_policy.c + model/v1beta1_capacity_request_policy_range.c + model/v1beta1_capacity_requirements.c + model/v1beta1_cel_device_selector.c + model/v1beta1_cluster_trust_bundle.c + model/v1beta1_cluster_trust_bundle_list.c + model/v1beta1_cluster_trust_bundle_spec.c + model/v1beta1_counter.c + model/v1beta1_counter_set.c + model/v1beta1_device.c + model/v1beta1_device_allocation_configuration.c + model/v1beta1_device_allocation_result.c + model/v1beta1_device_attribute.c + model/v1beta1_device_capacity.c + model/v1beta1_device_claim.c + model/v1beta1_device_claim_configuration.c + model/v1beta1_device_class.c + model/v1beta1_device_class_configuration.c + model/v1beta1_device_class_list.c + model/v1beta1_device_class_spec.c + model/v1beta1_device_constraint.c + model/v1beta1_device_counter_consumption.c + model/v1beta1_device_request.c + model/v1beta1_device_request_allocation_result.c + model/v1beta1_device_selector.c + model/v1beta1_device_sub_request.c + model/v1beta1_device_taint.c + model/v1beta1_device_toleration.c + model/v1beta1_ip_address.c + model/v1beta1_ip_address_list.c + model/v1beta1_ip_address_spec.c + model/v1beta1_json_patch.c + model/v1beta1_lease_candidate.c + model/v1beta1_lease_candidate_list.c + model/v1beta1_lease_candidate_spec.c model/v1beta1_match_condition.c model/v1beta1_match_resources.c + model/v1beta1_mutating_admission_policy.c + model/v1beta1_mutating_admission_policy_binding.c + model/v1beta1_mutating_admission_policy_binding_list.c + model/v1beta1_mutating_admission_policy_binding_spec.c + model/v1beta1_mutating_admission_policy_list.c + model/v1beta1_mutating_admission_policy_spec.c + model/v1beta1_mutation.c model/v1beta1_named_rule_with_operations.c + model/v1beta1_network_device_data.c + model/v1beta1_opaque_device_configuration.c model/v1beta1_param_kind.c model/v1beta1_param_ref.c - model/v1beta1_self_subject_review.c - model/v1beta1_self_subject_review_status.c - model/v1beta1_type_checking.c - model/v1beta1_validating_admission_policy.c - model/v1beta1_validating_admission_policy_binding.c - model/v1beta1_validating_admission_policy_binding_list.c - model/v1beta1_validating_admission_policy_binding_spec.c - model/v1beta1_validating_admission_policy_list.c - model/v1beta1_validating_admission_policy_spec.c - model/v1beta1_validating_admission_policy_status.c - model/v1beta1_validation.c + model/v1beta1_parent_reference.c + model/v1beta1_resource_claim.c + model/v1beta1_resource_claim_consumer_reference.c + model/v1beta1_resource_claim_list.c + model/v1beta1_resource_claim_spec.c + model/v1beta1_resource_claim_status.c + model/v1beta1_resource_claim_template.c + model/v1beta1_resource_claim_template_list.c + model/v1beta1_resource_claim_template_spec.c + model/v1beta1_resource_pool.c + model/v1beta1_resource_slice.c + model/v1beta1_resource_slice_list.c + model/v1beta1_resource_slice_spec.c + model/v1beta1_service_cidr.c + model/v1beta1_service_cidr_list.c + model/v1beta1_service_cidr_spec.c + model/v1beta1_service_cidr_status.c model/v1beta1_variable.c - model/v1beta3_exempt_priority_level_configuration.c - model/v1beta3_flow_distinguisher_method.c - model/v1beta3_flow_schema.c - model/v1beta3_flow_schema_condition.c - model/v1beta3_flow_schema_list.c - model/v1beta3_flow_schema_spec.c - model/v1beta3_flow_schema_status.c - model/v1beta3_group_subject.c - model/v1beta3_limit_response.c - model/v1beta3_limited_priority_level_configuration.c - model/v1beta3_non_resource_policy_rule.c - model/v1beta3_policy_rules_with_subjects.c - model/v1beta3_priority_level_configuration.c - model/v1beta3_priority_level_configuration_condition.c - model/v1beta3_priority_level_configuration_list.c - model/v1beta3_priority_level_configuration_reference.c - model/v1beta3_priority_level_configuration_spec.c - model/v1beta3_priority_level_configuration_status.c - model/v1beta3_queuing_configuration.c - model/v1beta3_resource_policy_rule.c - model/v1beta3_service_account_subject.c - model/v1beta3_subject.c - model/v1beta3_user_subject.c + model/v1beta1_volume_attributes_class.c + model/v1beta1_volume_attributes_class_list.c + model/v1beta2_allocated_device_status.c + model/v1beta2_allocation_result.c + model/v1beta2_capacity_request_policy.c + model/v1beta2_capacity_request_policy_range.c + model/v1beta2_capacity_requirements.c + model/v1beta2_cel_device_selector.c + model/v1beta2_counter.c + model/v1beta2_counter_set.c + model/v1beta2_device.c + model/v1beta2_device_allocation_configuration.c + model/v1beta2_device_allocation_result.c + model/v1beta2_device_attribute.c + model/v1beta2_device_capacity.c + model/v1beta2_device_claim.c + model/v1beta2_device_claim_configuration.c + model/v1beta2_device_class.c + model/v1beta2_device_class_configuration.c + model/v1beta2_device_class_list.c + model/v1beta2_device_class_spec.c + model/v1beta2_device_constraint.c + model/v1beta2_device_counter_consumption.c + model/v1beta2_device_request.c + model/v1beta2_device_request_allocation_result.c + model/v1beta2_device_selector.c + model/v1beta2_device_sub_request.c + model/v1beta2_device_taint.c + model/v1beta2_device_toleration.c + model/v1beta2_exact_device_request.c + model/v1beta2_network_device_data.c + model/v1beta2_opaque_device_configuration.c + model/v1beta2_resource_claim.c + model/v1beta2_resource_claim_consumer_reference.c + model/v1beta2_resource_claim_list.c + model/v1beta2_resource_claim_spec.c + model/v1beta2_resource_claim_status.c + model/v1beta2_resource_claim_template.c + model/v1beta2_resource_claim_template_list.c + model/v1beta2_resource_claim_template_spec.c + model/v1beta2_resource_pool.c + model/v1beta2_resource_slice.c + model/v1beta2_resource_slice_list.c + model/v1beta2_resource_slice_spec.c model/v2_container_resource_metric_source.c model/v2_container_resource_metric_status.c model/v2_cross_version_object_reference.c @@ -680,8 +778,6 @@ set(SRCS api/AppsV1API.c api/AuthenticationAPI.c api/AuthenticationV1API.c - api/AuthenticationV1alpha1API.c - api/AuthenticationV1beta1API.c api/AuthorizationAPI.c api/AuthorizationV1API.c api/AutoscalingAPI.c @@ -692,8 +788,11 @@ set(SRCS api/CertificatesAPI.c api/CertificatesV1API.c api/CertificatesV1alpha1API.c + api/CertificatesV1beta1API.c api/CoordinationAPI.c api/CoordinationV1API.c + api/CoordinationV1alpha2API.c + api/CoordinationV1beta1API.c api/CoreAPI.c api/CoreV1API.c api/CustomObjectsAPI.c @@ -703,13 +802,12 @@ set(SRCS api/EventsV1API.c api/FlowcontrolApiserverAPI.c api/FlowcontrolApiserverV1API.c - api/FlowcontrolApiserverV1beta3API.c api/InternalApiserverAPI.c api/InternalApiserverV1alpha1API.c api/LogsAPI.c api/NetworkingAPI.c api/NetworkingV1API.c - api/NetworkingV1alpha1API.c + api/NetworkingV1beta1API.c api/NodeAPI.c api/NodeV1API.c api/OpenidAPI.c @@ -718,12 +816,16 @@ set(SRCS api/RbacAuthorizationAPI.c api/RbacAuthorizationV1API.c api/ResourceAPI.c - api/ResourceV1alpha2API.c + api/ResourceV1API.c + api/ResourceV1alpha3API.c + api/ResourceV1beta1API.c + api/ResourceV1beta2API.c api/SchedulingAPI.c api/SchedulingV1API.c api/StorageAPI.c api/StorageV1API.c api/StorageV1alpha1API.c + api/StorageV1beta1API.c api/StoragemigrationAPI.c api/StoragemigrationV1alpha1API.c api/VersionAPI.c @@ -738,6 +840,7 @@ set(HDRS include/keyValuePair.h external/cJSON.h model/object.h + model/any_type.h model/admissionregistration_v1_service_reference.h model/admissionregistration_v1_webhook_client_config.h model/apiextensions_v1_service_reference.h @@ -748,15 +851,19 @@ set(HDRS model/core_v1_event.h model/core_v1_event_list.h model/core_v1_event_series.h + model/core_v1_resource_claim.h model/discovery_v1_endpoint_port.h model/events_v1_event.h model/events_v1_event_list.h model/events_v1_event_series.h model/flowcontrol_v1_subject.h model/rbac_v1_subject.h + model/resource_v1_resource_claim.h model/storage_v1_token_request.h model/v1_affinity.h model/v1_aggregation_rule.h + model/v1_allocated_device_status.h + model/v1_allocation_result.h model/v1_api_group.h model/v1_api_group_list.h model/v1_api_resource.h @@ -777,6 +884,10 @@ set(HDRS model/v1_binding.h model/v1_bound_object_reference.h model/v1_capabilities.h + model/v1_capacity_request_policy.h + model/v1_capacity_request_policy_range.h + model/v1_capacity_requirements.h + model/v1_cel_device_selector.h model/v1_ceph_fs_persistent_volume_source.h model/v1_ceph_fs_volume_source.h model/v1_certificate_signing_request.h @@ -786,7 +897,6 @@ set(HDRS model/v1_certificate_signing_request_status.h model/v1_cinder_persistent_volume_source.h model/v1_cinder_volume_source.h - model/v1_claim_source.h model/v1_client_ip_config.h model/v1_cluster_role.h model/v1_cluster_role_binding.h @@ -805,16 +915,22 @@ set(HDRS model/v1_config_map_projection.h model/v1_config_map_volume_source.h model/v1_container.h + model/v1_container_extended_resource_request.h model/v1_container_image.h model/v1_container_port.h model/v1_container_resize_policy.h + model/v1_container_restart_rule.h + model/v1_container_restart_rule_on_exit_codes.h model/v1_container_state.h model/v1_container_state_running.h model/v1_container_state_terminated.h model/v1_container_state_waiting.h model/v1_container_status.h + model/v1_container_user.h model/v1_controller_revision.h model/v1_controller_revision_list.h + model/v1_counter.h + model/v1_counter_set.h model/v1_cron_job.h model/v1_cron_job_list.h model/v1_cron_job_spec.h @@ -857,6 +973,25 @@ set(HDRS model/v1_deployment_spec.h model/v1_deployment_status.h model/v1_deployment_strategy.h + model/v1_device.h + model/v1_device_allocation_configuration.h + model/v1_device_allocation_result.h + model/v1_device_attribute.h + model/v1_device_capacity.h + model/v1_device_claim.h + model/v1_device_claim_configuration.h + model/v1_device_class.h + model/v1_device_class_configuration.h + model/v1_device_class_list.h + model/v1_device_class_spec.h + model/v1_device_constraint.h + model/v1_device_counter_consumption.h + model/v1_device_request.h + model/v1_device_request_allocation_result.h + model/v1_device_selector.h + model/v1_device_sub_request.h + model/v1_device_taint.h + model/v1_device_toleration.h model/v1_downward_api_projection.h model/v1_downward_api_volume_file.h model/v1_downward_api_volume_source.h @@ -877,11 +1012,15 @@ set(HDRS model/v1_ephemeral_volume_source.h model/v1_event_source.h model/v1_eviction.h + model/v1_exact_device_request.h model/v1_exec_action.h model/v1_exempt_priority_level_configuration.h model/v1_expression_warning.h model/v1_external_documentation.h model/v1_fc_volume_source.h + model/v1_field_selector_attributes.h + model/v1_field_selector_requirement.h + model/v1_file_key_selector.h model/v1_flex_persistent_volume_source.h model/v1_flex_volume_source.h model/v1_flocker_volume_source.h @@ -891,6 +1030,7 @@ set(HDRS model/v1_flow_schema_list.h model/v1_flow_schema_spec.h model/v1_flow_schema_status.h + model/v1_for_node.h model/v1_for_zone.h model/v1_gce_persistent_disk_volume_source.h model/v1_git_repo_volume_source.h @@ -910,6 +1050,7 @@ set(HDRS model/v1_http_header.h model/v1_http_ingress_path.h model/v1_http_ingress_rule_value.h + model/v1_image_volume_source.h model/v1_ingress.h model/v1_ingress_backend.h model/v1_ingress_class.h @@ -925,6 +1066,9 @@ set(HDRS model/v1_ingress_spec.h model/v1_ingress_status.h model/v1_ingress_tls.h + model/v1_ip_address.h + model/v1_ip_address_list.h + model/v1_ip_address_spec.h model/v1_ip_block.h model/v1_iscsi_persistent_volume_source.h model/v1_iscsi_volume_source.h @@ -937,6 +1081,7 @@ set(HDRS model/v1_json_schema_props.h model/v1_key_to_path.h model/v1_label_selector.h + model/v1_label_selector_attributes.h model/v1_label_selector_requirement.h model/v1_lease.h model/v1_lease_list.h @@ -949,6 +1094,7 @@ set(HDRS model/v1_limit_range_spec.h model/v1_limit_response.h model/v1_limited_priority_level_configuration.h + model/v1_linux_container_user.h model/v1_list_meta.h model/v1_load_balancer_ingress.h model/v1_load_balancer_status.h @@ -968,6 +1114,7 @@ set(HDRS model/v1_namespace_list.h model/v1_namespace_spec.h model/v1_namespace_status.h + model/v1_network_device_data.h model/v1_network_policy.h model/v1_network_policy_egress_rule.h model/v1_network_policy_ingress_rule.h @@ -983,6 +1130,7 @@ set(HDRS model/v1_node_config_source.h model/v1_node_config_status.h model/v1_node_daemon_endpoints.h + model/v1_node_features.h model/v1_node_list.h model/v1_node_runtime_handler.h model/v1_node_runtime_handler_features.h @@ -991,6 +1139,7 @@ set(HDRS model/v1_node_selector_term.h model/v1_node_spec.h model/v1_node_status.h + model/v1_node_swap_status.h model/v1_node_system_info.h model/v1_non_resource_attributes.h model/v1_non_resource_policy_rule.h @@ -998,10 +1147,12 @@ set(HDRS model/v1_object_field_selector.h model/v1_object_meta.h model/v1_object_reference.h + model/v1_opaque_device_configuration.h model/v1_overhead.h model/v1_owner_reference.h model/v1_param_kind.h model/v1_param_ref.h + model/v1_parent_reference.h model/v1_persistent_volume.h model/v1_persistent_volume_claim.h model/v1_persistent_volume_claim_condition.h @@ -1018,6 +1169,7 @@ set(HDRS model/v1_pod_affinity.h model/v1_pod_affinity_term.h model/v1_pod_anti_affinity.h + model/v1_pod_certificate_projection.h model/v1_pod_condition.h model/v1_pod_disruption_budget.h model/v1_pod_disruption_budget_list.h @@ -1025,6 +1177,7 @@ set(HDRS model/v1_pod_disruption_budget_status.h model/v1_pod_dns_config.h model/v1_pod_dns_config_option.h + model/v1_pod_extended_resource_claim_status.h model/v1_pod_failure_policy.h model/v1_pod_failure_policy_on_exit_codes_requirement.h model/v1_pod_failure_policy_on_pod_conditions_pattern.h @@ -1073,15 +1226,27 @@ set(HDRS model/v1_replication_controller_spec.h model/v1_replication_controller_status.h model/v1_resource_attributes.h - model/v1_resource_claim.h + model/v1_resource_claim_consumer_reference.h + model/v1_resource_claim_list.h + model/v1_resource_claim_spec.h + model/v1_resource_claim_status.h + model/v1_resource_claim_template.h + model/v1_resource_claim_template_list.h + model/v1_resource_claim_template_spec.h model/v1_resource_field_selector.h + model/v1_resource_health.h model/v1_resource_policy_rule.h + model/v1_resource_pool.h model/v1_resource_quota.h model/v1_resource_quota_list.h model/v1_resource_quota_spec.h model/v1_resource_quota_status.h model/v1_resource_requirements.h model/v1_resource_rule.h + model/v1_resource_slice.h + model/v1_resource_slice_list.h + model/v1_resource_slice_spec.h + model/v1_resource_status.h model/v1_role.h model/v1_role_binding.h model/v1_role_binding_list.h @@ -1125,6 +1290,10 @@ set(HDRS model/v1_service_account_subject.h model/v1_service_account_token_projection.h model/v1_service_backend_port.h + model/v1_service_cidr.h + model/v1_service_cidr_list.h + model/v1_service_cidr_spec.h + model/v1_service_cidr_status.h model/v1_service_list.h model/v1_service_port.h model/v1_service_spec.h @@ -1189,6 +1358,8 @@ set(HDRS model/v1_volume_attachment_source.h model/v1_volume_attachment_spec.h model/v1_volume_attachment_status.h + model/v1_volume_attributes_class.h + model/v1_volume_attributes_class_list.h model/v1_volume_device.h model/v1_volume_error.h model/v1_volume_mount.h @@ -1202,29 +1373,30 @@ set(HDRS model/v1_webhook_conversion.h model/v1_weighted_pod_affinity_term.h model/v1_windows_security_context_options.h - model/v1alpha1_audit_annotation.h + model/v1alpha1_apply_configuration.h model/v1alpha1_cluster_trust_bundle.h model/v1alpha1_cluster_trust_bundle_list.h model/v1alpha1_cluster_trust_bundle_spec.h - model/v1alpha1_expression_warning.h model/v1alpha1_group_version_resource.h - model/v1alpha1_ip_address.h - model/v1alpha1_ip_address_list.h - model/v1alpha1_ip_address_spec.h + model/v1alpha1_json_patch.h model/v1alpha1_match_condition.h model/v1alpha1_match_resources.h model/v1alpha1_migration_condition.h + model/v1alpha1_mutating_admission_policy.h + model/v1alpha1_mutating_admission_policy_binding.h + model/v1alpha1_mutating_admission_policy_binding_list.h + model/v1alpha1_mutating_admission_policy_binding_spec.h + model/v1alpha1_mutating_admission_policy_list.h + model/v1alpha1_mutating_admission_policy_spec.h + model/v1alpha1_mutation.h model/v1alpha1_named_rule_with_operations.h model/v1alpha1_param_kind.h model/v1alpha1_param_ref.h - model/v1alpha1_parent_reference.h - model/v1alpha1_self_subject_review.h - model/v1alpha1_self_subject_review_status.h + model/v1alpha1_pod_certificate_request.h + model/v1alpha1_pod_certificate_request_list.h + model/v1alpha1_pod_certificate_request_spec.h + model/v1alpha1_pod_certificate_request_status.h model/v1alpha1_server_storage_version.h - model/v1alpha1_service_cidr.h - model/v1alpha1_service_cidr_list.h - model/v1alpha1_service_cidr_spec.h - model/v1alpha1_service_cidr_status.h model/v1alpha1_storage_version.h model/v1alpha1_storage_version_condition.h model/v1alpha1_storage_version_list.h @@ -1233,99 +1405,134 @@ set(HDRS model/v1alpha1_storage_version_migration_spec.h model/v1alpha1_storage_version_migration_status.h model/v1alpha1_storage_version_status.h - model/v1alpha1_type_checking.h - model/v1alpha1_validating_admission_policy.h - model/v1alpha1_validating_admission_policy_binding.h - model/v1alpha1_validating_admission_policy_binding_list.h - model/v1alpha1_validating_admission_policy_binding_spec.h - model/v1alpha1_validating_admission_policy_list.h - model/v1alpha1_validating_admission_policy_spec.h - model/v1alpha1_validating_admission_policy_status.h - model/v1alpha1_validation.h model/v1alpha1_variable.h model/v1alpha1_volume_attributes_class.h model/v1alpha1_volume_attributes_class_list.h - model/v1alpha2_allocation_result.h - model/v1alpha2_driver_allocation_result.h - model/v1alpha2_driver_requests.h - model/v1alpha2_named_resources_allocation_result.h - model/v1alpha2_named_resources_attribute.h - model/v1alpha2_named_resources_filter.h - model/v1alpha2_named_resources_instance.h - model/v1alpha2_named_resources_int_slice.h - model/v1alpha2_named_resources_request.h - model/v1alpha2_named_resources_resources.h - model/v1alpha2_named_resources_string_slice.h - model/v1alpha2_pod_scheduling_context.h - model/v1alpha2_pod_scheduling_context_list.h - model/v1alpha2_pod_scheduling_context_spec.h - model/v1alpha2_pod_scheduling_context_status.h - model/v1alpha2_resource_claim.h - model/v1alpha2_resource_claim_consumer_reference.h - model/v1alpha2_resource_claim_list.h - model/v1alpha2_resource_claim_parameters.h - model/v1alpha2_resource_claim_parameters_list.h - model/v1alpha2_resource_claim_parameters_reference.h - model/v1alpha2_resource_claim_scheduling_status.h - model/v1alpha2_resource_claim_spec.h - model/v1alpha2_resource_claim_status.h - model/v1alpha2_resource_claim_template.h - model/v1alpha2_resource_claim_template_list.h - model/v1alpha2_resource_claim_template_spec.h - model/v1alpha2_resource_class.h - model/v1alpha2_resource_class_list.h - model/v1alpha2_resource_class_parameters.h - model/v1alpha2_resource_class_parameters_list.h - model/v1alpha2_resource_class_parameters_reference.h - model/v1alpha2_resource_filter.h - model/v1alpha2_resource_handle.h - model/v1alpha2_resource_request.h - model/v1alpha2_resource_slice.h - model/v1alpha2_resource_slice_list.h - model/v1alpha2_structured_resource_handle.h - model/v1alpha2_vendor_parameters.h - model/v1beta1_audit_annotation.h - model/v1beta1_expression_warning.h + model/v1alpha2_lease_candidate.h + model/v1alpha2_lease_candidate_list.h + model/v1alpha2_lease_candidate_spec.h + model/v1alpha3_cel_device_selector.h + model/v1alpha3_device_selector.h + model/v1alpha3_device_taint.h + model/v1alpha3_device_taint_rule.h + model/v1alpha3_device_taint_rule_list.h + model/v1alpha3_device_taint_rule_spec.h + model/v1alpha3_device_taint_selector.h + model/v1beta1_allocated_device_status.h + model/v1beta1_allocation_result.h + model/v1beta1_apply_configuration.h + model/v1beta1_basic_device.h + model/v1beta1_capacity_request_policy.h + model/v1beta1_capacity_request_policy_range.h + model/v1beta1_capacity_requirements.h + model/v1beta1_cel_device_selector.h + model/v1beta1_cluster_trust_bundle.h + model/v1beta1_cluster_trust_bundle_list.h + model/v1beta1_cluster_trust_bundle_spec.h + model/v1beta1_counter.h + model/v1beta1_counter_set.h + model/v1beta1_device.h + model/v1beta1_device_allocation_configuration.h + model/v1beta1_device_allocation_result.h + model/v1beta1_device_attribute.h + model/v1beta1_device_capacity.h + model/v1beta1_device_claim.h + model/v1beta1_device_claim_configuration.h + model/v1beta1_device_class.h + model/v1beta1_device_class_configuration.h + model/v1beta1_device_class_list.h + model/v1beta1_device_class_spec.h + model/v1beta1_device_constraint.h + model/v1beta1_device_counter_consumption.h + model/v1beta1_device_request.h + model/v1beta1_device_request_allocation_result.h + model/v1beta1_device_selector.h + model/v1beta1_device_sub_request.h + model/v1beta1_device_taint.h + model/v1beta1_device_toleration.h + model/v1beta1_ip_address.h + model/v1beta1_ip_address_list.h + model/v1beta1_ip_address_spec.h + model/v1beta1_json_patch.h + model/v1beta1_lease_candidate.h + model/v1beta1_lease_candidate_list.h + model/v1beta1_lease_candidate_spec.h model/v1beta1_match_condition.h model/v1beta1_match_resources.h + model/v1beta1_mutating_admission_policy.h + model/v1beta1_mutating_admission_policy_binding.h + model/v1beta1_mutating_admission_policy_binding_list.h + model/v1beta1_mutating_admission_policy_binding_spec.h + model/v1beta1_mutating_admission_policy_list.h + model/v1beta1_mutating_admission_policy_spec.h + model/v1beta1_mutation.h model/v1beta1_named_rule_with_operations.h + model/v1beta1_network_device_data.h + model/v1beta1_opaque_device_configuration.h model/v1beta1_param_kind.h model/v1beta1_param_ref.h - model/v1beta1_self_subject_review.h - model/v1beta1_self_subject_review_status.h - model/v1beta1_type_checking.h - model/v1beta1_validating_admission_policy.h - model/v1beta1_validating_admission_policy_binding.h - model/v1beta1_validating_admission_policy_binding_list.h - model/v1beta1_validating_admission_policy_binding_spec.h - model/v1beta1_validating_admission_policy_list.h - model/v1beta1_validating_admission_policy_spec.h - model/v1beta1_validating_admission_policy_status.h - model/v1beta1_validation.h + model/v1beta1_parent_reference.h + model/v1beta1_resource_claim.h + model/v1beta1_resource_claim_consumer_reference.h + model/v1beta1_resource_claim_list.h + model/v1beta1_resource_claim_spec.h + model/v1beta1_resource_claim_status.h + model/v1beta1_resource_claim_template.h + model/v1beta1_resource_claim_template_list.h + model/v1beta1_resource_claim_template_spec.h + model/v1beta1_resource_pool.h + model/v1beta1_resource_slice.h + model/v1beta1_resource_slice_list.h + model/v1beta1_resource_slice_spec.h + model/v1beta1_service_cidr.h + model/v1beta1_service_cidr_list.h + model/v1beta1_service_cidr_spec.h + model/v1beta1_service_cidr_status.h model/v1beta1_variable.h - model/v1beta3_exempt_priority_level_configuration.h - model/v1beta3_flow_distinguisher_method.h - model/v1beta3_flow_schema.h - model/v1beta3_flow_schema_condition.h - model/v1beta3_flow_schema_list.h - model/v1beta3_flow_schema_spec.h - model/v1beta3_flow_schema_status.h - model/v1beta3_group_subject.h - model/v1beta3_limit_response.h - model/v1beta3_limited_priority_level_configuration.h - model/v1beta3_non_resource_policy_rule.h - model/v1beta3_policy_rules_with_subjects.h - model/v1beta3_priority_level_configuration.h - model/v1beta3_priority_level_configuration_condition.h - model/v1beta3_priority_level_configuration_list.h - model/v1beta3_priority_level_configuration_reference.h - model/v1beta3_priority_level_configuration_spec.h - model/v1beta3_priority_level_configuration_status.h - model/v1beta3_queuing_configuration.h - model/v1beta3_resource_policy_rule.h - model/v1beta3_service_account_subject.h - model/v1beta3_subject.h - model/v1beta3_user_subject.h + model/v1beta1_volume_attributes_class.h + model/v1beta1_volume_attributes_class_list.h + model/v1beta2_allocated_device_status.h + model/v1beta2_allocation_result.h + model/v1beta2_capacity_request_policy.h + model/v1beta2_capacity_request_policy_range.h + model/v1beta2_capacity_requirements.h + model/v1beta2_cel_device_selector.h + model/v1beta2_counter.h + model/v1beta2_counter_set.h + model/v1beta2_device.h + model/v1beta2_device_allocation_configuration.h + model/v1beta2_device_allocation_result.h + model/v1beta2_device_attribute.h + model/v1beta2_device_capacity.h + model/v1beta2_device_claim.h + model/v1beta2_device_claim_configuration.h + model/v1beta2_device_class.h + model/v1beta2_device_class_configuration.h + model/v1beta2_device_class_list.h + model/v1beta2_device_class_spec.h + model/v1beta2_device_constraint.h + model/v1beta2_device_counter_consumption.h + model/v1beta2_device_request.h + model/v1beta2_device_request_allocation_result.h + model/v1beta2_device_selector.h + model/v1beta2_device_sub_request.h + model/v1beta2_device_taint.h + model/v1beta2_device_toleration.h + model/v1beta2_exact_device_request.h + model/v1beta2_network_device_data.h + model/v1beta2_opaque_device_configuration.h + model/v1beta2_resource_claim.h + model/v1beta2_resource_claim_consumer_reference.h + model/v1beta2_resource_claim_list.h + model/v1beta2_resource_claim_spec.h + model/v1beta2_resource_claim_status.h + model/v1beta2_resource_claim_template.h + model/v1beta2_resource_claim_template_list.h + model/v1beta2_resource_claim_template_spec.h + model/v1beta2_resource_pool.h + model/v1beta2_resource_slice.h + model/v1beta2_resource_slice_list.h + model/v1beta2_resource_slice_spec.h model/v2_container_resource_metric_source.h model/v2_container_resource_metric_status.h model/v2_cross_version_object_reference.h @@ -1364,8 +1571,6 @@ set(HDRS api/AppsV1API.h api/AuthenticationAPI.h api/AuthenticationV1API.h - api/AuthenticationV1alpha1API.h - api/AuthenticationV1beta1API.h api/AuthorizationAPI.h api/AuthorizationV1API.h api/AutoscalingAPI.h @@ -1376,8 +1581,11 @@ set(HDRS api/CertificatesAPI.h api/CertificatesV1API.h api/CertificatesV1alpha1API.h + api/CertificatesV1beta1API.h api/CoordinationAPI.h api/CoordinationV1API.h + api/CoordinationV1alpha2API.h + api/CoordinationV1beta1API.h api/CoreAPI.h api/CoreV1API.h api/CustomObjectsAPI.h @@ -1387,13 +1595,12 @@ set(HDRS api/EventsV1API.h api/FlowcontrolApiserverAPI.h api/FlowcontrolApiserverV1API.h - api/FlowcontrolApiserverV1beta3API.h api/InternalApiserverAPI.h api/InternalApiserverV1alpha1API.h api/LogsAPI.h api/NetworkingAPI.h api/NetworkingV1API.h - api/NetworkingV1alpha1API.h + api/NetworkingV1beta1API.h api/NodeAPI.h api/NodeV1API.h api/OpenidAPI.h @@ -1402,12 +1609,16 @@ set(HDRS api/RbacAuthorizationAPI.h api/RbacAuthorizationV1API.h api/ResourceAPI.h - api/ResourceV1alpha2API.h + api/ResourceV1API.h + api/ResourceV1alpha3API.h + api/ResourceV1beta1API.h + api/ResourceV1beta2API.h api/SchedulingAPI.h api/SchedulingV1API.h api/StorageAPI.h api/StorageV1API.h api/StorageV1alpha1API.h + api/StorageV1beta1API.h api/StoragemigrationAPI.h api/StoragemigrationV1alpha1API.h api/VersionAPI.h @@ -1420,7 +1631,11 @@ include(PreTarget.cmake OPTIONAL) set(PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") # Add library with project file with project name as library name -add_library(${pkgName} ${SRCS} ${HDRS}) +if(NOT BUILD_STATIC_LIBS) + add_library(${pkgName} ${SRCS} ${HDRS}) +else() + add_library(${pkgName} STATIC ${SRCS} ${HDRS}) +endif() # Link dependent libraries if(NOT CMAKE_VERSION VERSION_LESS 3.4) target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto) @@ -1506,8 +1721,6 @@ set(HDRS "") # unit-tests/manual-AppsV1API.c # unit-tests/manual-AuthenticationAPI.c # unit-tests/manual-AuthenticationV1API.c -# unit-tests/manual-AuthenticationV1alpha1API.c -# unit-tests/manual-AuthenticationV1beta1API.c # unit-tests/manual-AuthorizationAPI.c # unit-tests/manual-AuthorizationV1API.c # unit-tests/manual-AutoscalingAPI.c @@ -1518,8 +1731,11 @@ set(HDRS "") # unit-tests/manual-CertificatesAPI.c # unit-tests/manual-CertificatesV1API.c # unit-tests/manual-CertificatesV1alpha1API.c +# unit-tests/manual-CertificatesV1beta1API.c # unit-tests/manual-CoordinationAPI.c # unit-tests/manual-CoordinationV1API.c +# unit-tests/manual-CoordinationV1alpha2API.c +# unit-tests/manual-CoordinationV1beta1API.c # unit-tests/manual-CoreAPI.c # unit-tests/manual-CoreV1API.c # unit-tests/manual-CustomObjectsAPI.c @@ -1529,13 +1745,12 @@ set(HDRS "") # unit-tests/manual-EventsV1API.c # unit-tests/manual-FlowcontrolApiserverAPI.c # unit-tests/manual-FlowcontrolApiserverV1API.c -# unit-tests/manual-FlowcontrolApiserverV1beta3API.c # unit-tests/manual-InternalApiserverAPI.c # unit-tests/manual-InternalApiserverV1alpha1API.c # unit-tests/manual-LogsAPI.c # unit-tests/manual-NetworkingAPI.c # unit-tests/manual-NetworkingV1API.c -# unit-tests/manual-NetworkingV1alpha1API.c +# unit-tests/manual-NetworkingV1beta1API.c # unit-tests/manual-NodeAPI.c # unit-tests/manual-NodeV1API.c # unit-tests/manual-OpenidAPI.c @@ -1544,12 +1759,16 @@ set(HDRS "") # unit-tests/manual-RbacAuthorizationAPI.c # unit-tests/manual-RbacAuthorizationV1API.c # unit-tests/manual-ResourceAPI.c -# unit-tests/manual-ResourceV1alpha2API.c +# unit-tests/manual-ResourceV1API.c +# unit-tests/manual-ResourceV1alpha3API.c +# unit-tests/manual-ResourceV1beta1API.c +# unit-tests/manual-ResourceV1beta2API.c # unit-tests/manual-SchedulingAPI.c # unit-tests/manual-SchedulingV1API.c # unit-tests/manual-StorageAPI.c # unit-tests/manual-StorageV1API.c # unit-tests/manual-StorageV1alpha1API.c +# unit-tests/manual-StorageV1beta1API.c # unit-tests/manual-StoragemigrationAPI.c # unit-tests/manual-StoragemigrationV1alpha1API.c # unit-tests/manual-VersionAPI.c diff --git a/kubernetes/Config.cmake.in b/kubernetes/Config.cmake.in index 5eeaaa5d..9015c2ba 100644 --- a/kubernetes/Config.cmake.in +++ b/kubernetes/Config.cmake.in @@ -1,6 +1,5 @@ -find_package(OpenSSL REQUIRED) -find_package(ZLIB REQUIRED) -find_package(yaml CONFIG REQUIRED) -find_package(Libwebsockets CONFIG REQUIRED) +@PACKAGE_INIT@ -include("${CMAKE_CURRENT_LIST_DIR}/@pkgName@Targets.cmake") +include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake) + +check_required_components("@PROJECT_NAME@") diff --git a/kubernetes/ConfigureChecks.cmake b/kubernetes/ConfigureChecks.cmake index c9cda1ad..0e63728f 100644 --- a/kubernetes/ConfigureChecks.cmake +++ b/kubernetes/ConfigureChecks.cmake @@ -1,5 +1,5 @@ -include(CheckCXXSymbolExists) +include(CheckSymbolExists) -check_cxx_symbol_exists(strndup "string.h" HAVE_STRNDUP) -check_cxx_symbol_exists(secure_getenv "stdlib.h" HAVE_SECURE_GETENV) -check_cxx_symbol_exists(getenv "stdlib.h" HAVE_GETENV) +check_symbol_exists(strndup "string.h" HAVE_STRNDUP) +check_symbol_exists(secure_getenv "stdlib.h" HAVE_SECURE_GETENV) +check_symbol_exists(getenv "stdlib.h" HAVE_GETENV) diff --git a/kubernetes/PreTarget.cmake b/kubernetes/PreTarget.cmake index 271a7d66..32c4faa6 100644 --- a/kubernetes/PreTarget.cmake +++ b/kubernetes/PreTarget.cmake @@ -1,5 +1,5 @@ set(PROJECT_VERSION_MAJOR 0) -set(PROJECT_VERSION_MINOR 10) +set(PROJECT_VERSION_MINOR 14) set(PROJECT_VERSION_PATCH 0) set(PROJECT_PACKAGE_DESCRIPTION_SUMMARY "The Kubernetes client library for the C programming language.") diff --git a/kubernetes/README.md b/kubernetes/README.md index 188c05dd..fa78222e 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -3,22 +3,22 @@ ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client. -- API version: release-1.30 +- API version: release-1.34 - Package version: -- Generator version: 7.6.0-SNAPSHOT +- Generator version: 7.18.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen ## Installation -You'll need the `curl 7.58.0` package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later. +You'll need the `curl 7.61.1` package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later. # Prerequisites -## Install the `curl 7.58.0` package with the following command on Linux. +## Install the `curl 7.61.1` package with the following command on Linux. ```bash sudo apt remove curl -wget http://curl.haxx.se/download/curl-7.58.0.tar.gz -tar -xvf curl-7.58.0.tar.gz -cd curl-7.58.0/ +wget http://curl.haxx.se/download/curl-7.61.1.tar.gz +tar -xvf curl-7.61.1.tar.gz +cd curl-7.61.1/ ./configure make sudo make install @@ -98,42 +98,36 @@ Category | Method | HTTP request | Description *AdmissionregistrationV1API* | [**AdmissionregistrationV1API_replaceValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1API.md#AdmissionregistrationV1API_replaceValidatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name} | *AdmissionregistrationV1API* | [**AdmissionregistrationV1API_replaceValidatingAdmissionPolicyStatus**](docs/AdmissionregistrationV1API.md#AdmissionregistrationV1API_replaceValidatingAdmissionPolicyStatus) | **PUT** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status | *AdmissionregistrationV1API* | [**AdmissionregistrationV1API_replaceValidatingWebhookConfiguration**](docs/AdmissionregistrationV1API.md#AdmissionregistrationV1API_replaceValidatingWebhookConfiguration) | **PUT** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | *AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_getAPIResources**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_getAPIResources) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/ | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | -*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1API* | [**AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | *AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_getAPIResources**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_getAPIResources) | **GET** /apis/admissionregistration.k8s.io/v1beta1/ | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | -*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1API* | [**AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding**](docs/AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | *ApiextensionsAPI* | [**ApiextensionsAPI_getAPIGroup**](docs/ApiextensionsAPI.md#ApiextensionsAPI_getAPIGroup) | **GET** /apis/apiextensions.k8s.io/ | *ApiextensionsV1API* | [**ApiextensionsV1API_createCustomResourceDefinition**](docs/ApiextensionsV1API.md#ApiextensionsV1API_createCustomResourceDefinition) | **POST** /apis/apiextensions.k8s.io/v1/customresourcedefinitions | *ApiextensionsV1API* | [**ApiextensionsV1API_deleteCollectionCustomResourceDefinition**](docs/ApiextensionsV1API.md#ApiextensionsV1API_deleteCollectionCustomResourceDefinition) | **DELETE** /apis/apiextensions.k8s.io/v1/customresourcedefinitions | @@ -226,10 +220,6 @@ Category | Method | HTTP request | Description *AuthenticationV1API* | [**AuthenticationV1API_createSelfSubjectReview**](docs/AuthenticationV1API.md#AuthenticationV1API_createSelfSubjectReview) | **POST** /apis/authentication.k8s.io/v1/selfsubjectreviews | *AuthenticationV1API* | [**AuthenticationV1API_createTokenReview**](docs/AuthenticationV1API.md#AuthenticationV1API_createTokenReview) | **POST** /apis/authentication.k8s.io/v1/tokenreviews | *AuthenticationV1API* | [**AuthenticationV1API_getAPIResources**](docs/AuthenticationV1API.md#AuthenticationV1API_getAPIResources) | **GET** /apis/authentication.k8s.io/v1/ | -*AuthenticationV1alpha1API* | [**AuthenticationV1alpha1API_createSelfSubjectReview**](docs/AuthenticationV1alpha1API.md#AuthenticationV1alpha1API_createSelfSubjectReview) | **POST** /apis/authentication.k8s.io/v1alpha1/selfsubjectreviews | -*AuthenticationV1alpha1API* | [**AuthenticationV1alpha1API_getAPIResources**](docs/AuthenticationV1alpha1API.md#AuthenticationV1alpha1API_getAPIResources) | **GET** /apis/authentication.k8s.io/v1alpha1/ | -*AuthenticationV1beta1API* | [**AuthenticationV1beta1API_createSelfSubjectReview**](docs/AuthenticationV1beta1API.md#AuthenticationV1beta1API_createSelfSubjectReview) | **POST** /apis/authentication.k8s.io/v1beta1/selfsubjectreviews | -*AuthenticationV1beta1API* | [**AuthenticationV1beta1API_getAPIResources**](docs/AuthenticationV1beta1API.md#AuthenticationV1beta1API_getAPIResources) | **GET** /apis/authentication.k8s.io/v1beta1/ | *AuthorizationAPI* | [**AuthorizationAPI_getAPIGroup**](docs/AuthorizationAPI.md#AuthorizationAPI_getAPIGroup) | **GET** /apis/authorization.k8s.io/ | *AuthorizationV1API* | [**AuthorizationV1API_createNamespacedLocalSubjectAccessReview**](docs/AuthorizationV1API.md#AuthorizationV1API_createNamespacedLocalSubjectAccessReview) | **POST** /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews | *AuthorizationV1API* | [**AuthorizationV1API_createSelfSubjectAccessReview**](docs/AuthorizationV1API.md#AuthorizationV1API_createSelfSubjectAccessReview) | **POST** /apis/authorization.k8s.io/v1/selfsubjectaccessreviews | @@ -301,13 +291,32 @@ Category | Method | HTTP request | Description *CertificatesV1API* | [**CertificatesV1API_replaceCertificateSigningRequestApproval**](docs/CertificatesV1API.md#CertificatesV1API_replaceCertificateSigningRequestApproval) | **PUT** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval | *CertificatesV1API* | [**CertificatesV1API_replaceCertificateSigningRequestStatus**](docs/CertificatesV1API.md#CertificatesV1API_replaceCertificateSigningRequestStatus) | **PUT** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_createClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_createClusterTrustBundle) | **POST** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_createNamespacedPodCertificateRequest**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_createNamespacedPodCertificateRequest) | **POST** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_deleteClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_deleteCollectionClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteCollectionClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest) | **DELETE** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest) | **DELETE** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_getAPIResources**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_getAPIResources) | **GET** /apis/certificates.k8s.io/v1alpha1/ | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_listClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_listClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_listNamespacedPodCertificateRequest**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_listNamespacedPodCertificateRequest) | **GET** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces) | **GET** /apis/certificates.k8s.io/v1alpha1/podcertificaterequests | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_patchClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_patchClusterTrustBundle) | **PATCH** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_patchNamespacedPodCertificateRequest**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_patchNamespacedPodCertificateRequest) | **PATCH** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus) | **PATCH** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_readClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_readClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_readNamespacedPodCertificateRequest**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_readNamespacedPodCertificateRequest) | **GET** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus) | **GET** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_replaceClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_replaceClusterTrustBundle) | **PUT** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest) | **PUT** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | +*CertificatesV1alpha1API* | [**CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus) | **PUT** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_createClusterTrustBundle**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_createClusterTrustBundle) | **POST** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_deleteClusterTrustBundle**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_deleteClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_deleteCollectionClusterTrustBundle**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_deleteCollectionClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_getAPIResources**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_getAPIResources) | **GET** /apis/certificates.k8s.io/v1beta1/ | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_listClusterTrustBundle**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_listClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_patchClusterTrustBundle**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_patchClusterTrustBundle) | **PATCH** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_readClusterTrustBundle**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_readClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +*CertificatesV1beta1API* | [**CertificatesV1beta1API_replaceClusterTrustBundle**](docs/CertificatesV1beta1API.md#CertificatesV1beta1API_replaceClusterTrustBundle) | **PUT** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | *CoordinationAPI* | [**CoordinationAPI_getAPIGroup**](docs/CoordinationAPI.md#CoordinationAPI_getAPIGroup) | **GET** /apis/coordination.k8s.io/ | *CoordinationV1API* | [**CoordinationV1API_createNamespacedLease**](docs/CoordinationV1API.md#CoordinationV1API_createNamespacedLease) | **POST** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases | *CoordinationV1API* | [**CoordinationV1API_deleteCollectionNamespacedLease**](docs/CoordinationV1API.md#CoordinationV1API_deleteCollectionNamespacedLease) | **DELETE** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases | @@ -318,6 +327,24 @@ Category | Method | HTTP request | Description *CoordinationV1API* | [**CoordinationV1API_patchNamespacedLease**](docs/CoordinationV1API.md#CoordinationV1API_patchNamespacedLease) | **PATCH** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} | *CoordinationV1API* | [**CoordinationV1API_readNamespacedLease**](docs/CoordinationV1API.md#CoordinationV1API_readNamespacedLease) | **GET** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} | *CoordinationV1API* | [**CoordinationV1API_replaceNamespacedLease**](docs/CoordinationV1API.md#CoordinationV1API_replaceNamespacedLease) | **PUT** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_createNamespacedLeaseCandidate**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_createNamespacedLeaseCandidate) | **POST** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_deleteNamespacedLeaseCandidate**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_deleteNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_getAPIResources**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_getAPIResources) | **GET** /apis/coordination.k8s.io/v1alpha2/ | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces) | **GET** /apis/coordination.k8s.io/v1alpha2/leasecandidates | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_listNamespacedLeaseCandidate**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_listNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_patchNamespacedLeaseCandidate**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_patchNamespacedLeaseCandidate) | **PATCH** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_readNamespacedLeaseCandidate**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_readNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1alpha2API* | [**CoordinationV1alpha2API_replaceNamespacedLeaseCandidate**](docs/CoordinationV1alpha2API.md#CoordinationV1alpha2API_replaceNamespacedLeaseCandidate) | **PUT** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_createNamespacedLeaseCandidate**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_createNamespacedLeaseCandidate) | **POST** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_deleteNamespacedLeaseCandidate**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_deleteNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_getAPIResources**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_getAPIResources) | **GET** /apis/coordination.k8s.io/v1beta1/ | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_listLeaseCandidateForAllNamespaces**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_listLeaseCandidateForAllNamespaces) | **GET** /apis/coordination.k8s.io/v1beta1/leasecandidates | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_listNamespacedLeaseCandidate**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_listNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_patchNamespacedLeaseCandidate**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_patchNamespacedLeaseCandidate) | **PATCH** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_readNamespacedLeaseCandidate**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_readNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1API* | [**CoordinationV1beta1API_replaceNamespacedLeaseCandidate**](docs/CoordinationV1beta1API.md#CoordinationV1beta1API_replaceNamespacedLeaseCandidate) | **PUT** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | *CoreAPI* | [**CoreAPI_getAPIVersions**](docs/CoreAPI.md#CoreAPI_getAPIVersions) | **GET** /api/ | *CoreV1API* | [**CoreV1API_connectDeleteNamespacedPodProxy**](docs/CoreV1API.md#CoreV1API_connectDeleteNamespacedPodProxy) | **DELETE** /api/v1/namespaces/{namespace}/pods/{name}/proxy | *CoreV1API* | [**CoreV1API_connectDeleteNamespacedPodProxyWithPath**](docs/CoreV1API.md#CoreV1API_connectDeleteNamespacedPodProxyWithPath) | **DELETE** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | @@ -454,6 +481,7 @@ Category | Method | HTTP request | Description *CoreV1API* | [**CoreV1API_patchNamespacedPersistentVolumeClaimStatus**](docs/CoreV1API.md#CoreV1API_patchNamespacedPersistentVolumeClaimStatus) | **PATCH** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status | *CoreV1API* | [**CoreV1API_patchNamespacedPod**](docs/CoreV1API.md#CoreV1API_patchNamespacedPod) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name} | *CoreV1API* | [**CoreV1API_patchNamespacedPodEphemeralcontainers**](docs/CoreV1API.md#CoreV1API_patchNamespacedPodEphemeralcontainers) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | +*CoreV1API* | [**CoreV1API_patchNamespacedPodResize**](docs/CoreV1API.md#CoreV1API_patchNamespacedPodResize) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/resize | *CoreV1API* | [**CoreV1API_patchNamespacedPodStatus**](docs/CoreV1API.md#CoreV1API_patchNamespacedPodStatus) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/status | *CoreV1API* | [**CoreV1API_patchNamespacedPodTemplate**](docs/CoreV1API.md#CoreV1API_patchNamespacedPodTemplate) | **PATCH** /api/v1/namespaces/{namespace}/podtemplates/{name} | *CoreV1API* | [**CoreV1API_patchNamespacedReplicationController**](docs/CoreV1API.md#CoreV1API_patchNamespacedReplicationController) | **PATCH** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | @@ -481,6 +509,7 @@ Category | Method | HTTP request | Description *CoreV1API* | [**CoreV1API_readNamespacedPod**](docs/CoreV1API.md#CoreV1API_readNamespacedPod) | **GET** /api/v1/namespaces/{namespace}/pods/{name} | *CoreV1API* | [**CoreV1API_readNamespacedPodEphemeralcontainers**](docs/CoreV1API.md#CoreV1API_readNamespacedPodEphemeralcontainers) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | *CoreV1API* | [**CoreV1API_readNamespacedPodLog**](docs/CoreV1API.md#CoreV1API_readNamespacedPodLog) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/log | +*CoreV1API* | [**CoreV1API_readNamespacedPodResize**](docs/CoreV1API.md#CoreV1API_readNamespacedPodResize) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/resize | *CoreV1API* | [**CoreV1API_readNamespacedPodStatus**](docs/CoreV1API.md#CoreV1API_readNamespacedPodStatus) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/status | *CoreV1API* | [**CoreV1API_readNamespacedPodTemplate**](docs/CoreV1API.md#CoreV1API_readNamespacedPodTemplate) | **GET** /api/v1/namespaces/{namespace}/podtemplates/{name} | *CoreV1API* | [**CoreV1API_readNamespacedReplicationController**](docs/CoreV1API.md#CoreV1API_readNamespacedReplicationController) | **GET** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | @@ -507,6 +536,7 @@ Category | Method | HTTP request | Description *CoreV1API* | [**CoreV1API_replaceNamespacedPersistentVolumeClaimStatus**](docs/CoreV1API.md#CoreV1API_replaceNamespacedPersistentVolumeClaimStatus) | **PUT** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status | *CoreV1API* | [**CoreV1API_replaceNamespacedPod**](docs/CoreV1API.md#CoreV1API_replaceNamespacedPod) | **PUT** /api/v1/namespaces/{namespace}/pods/{name} | *CoreV1API* | [**CoreV1API_replaceNamespacedPodEphemeralcontainers**](docs/CoreV1API.md#CoreV1API_replaceNamespacedPodEphemeralcontainers) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | +*CoreV1API* | [**CoreV1API_replaceNamespacedPodResize**](docs/CoreV1API.md#CoreV1API_replaceNamespacedPodResize) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/resize | *CoreV1API* | [**CoreV1API_replaceNamespacedPodStatus**](docs/CoreV1API.md#CoreV1API_replaceNamespacedPodStatus) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/status | *CoreV1API* | [**CoreV1API_replaceNamespacedPodTemplate**](docs/CoreV1API.md#CoreV1API_replaceNamespacedPodTemplate) | **PUT** /api/v1/namespaces/{namespace}/podtemplates/{name} | *CoreV1API* | [**CoreV1API_replaceNamespacedReplicationController**](docs/CoreV1API.md#CoreV1API_replaceNamespacedReplicationController) | **PUT** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | @@ -536,6 +566,7 @@ Category | Method | HTTP request | Description *CustomObjectsAPI* | [**CustomObjectsAPI_getNamespacedCustomObjectScale**](docs/CustomObjectsAPI.md#CustomObjectsAPI_getNamespacedCustomObjectScale) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale | *CustomObjectsAPI* | [**CustomObjectsAPI_getNamespacedCustomObjectStatus**](docs/CustomObjectsAPI.md#CustomObjectsAPI_getNamespacedCustomObjectStatus) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status | *CustomObjectsAPI* | [**CustomObjectsAPI_listClusterCustomObject**](docs/CustomObjectsAPI.md#CustomObjectsAPI_listClusterCustomObject) | **GET** /apis/{group}/{version}/{plural} | +*CustomObjectsAPI* | [**CustomObjectsAPI_listCustomObjectForAllNamespaces**](docs/CustomObjectsAPI.md#CustomObjectsAPI_listCustomObjectForAllNamespaces) | **GET** /apis/{group}/{version}/{resource_plural} | *CustomObjectsAPI* | [**CustomObjectsAPI_listNamespacedCustomObject**](docs/CustomObjectsAPI.md#CustomObjectsAPI_listNamespacedCustomObject) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural} | *CustomObjectsAPI* | [**CustomObjectsAPI_patchClusterCustomObject**](docs/CustomObjectsAPI.md#CustomObjectsAPI_patchClusterCustomObject) | **PATCH** /apis/{group}/{version}/{plural}/{name} | *CustomObjectsAPI* | [**CustomObjectsAPI_patchClusterCustomObjectScale**](docs/CustomObjectsAPI.md#CustomObjectsAPI_patchClusterCustomObjectScale) | **PATCH** /apis/{group}/{version}/{plural}/{name}/scale | @@ -591,27 +622,6 @@ Category | Method | HTTP request | Description *FlowcontrolApiserverV1API* | [**FlowcontrolApiserverV1API_replaceFlowSchemaStatus**](docs/FlowcontrolApiserverV1API.md#FlowcontrolApiserverV1API_replaceFlowSchemaStatus) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status | *FlowcontrolApiserverV1API* | [**FlowcontrolApiserverV1API_replacePriorityLevelConfiguration**](docs/FlowcontrolApiserverV1API.md#FlowcontrolApiserverV1API_replacePriorityLevelConfiguration) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name} | *FlowcontrolApiserverV1API* | [**FlowcontrolApiserverV1API_replacePriorityLevelConfigurationStatus**](docs/FlowcontrolApiserverV1API.md#FlowcontrolApiserverV1API_replacePriorityLevelConfigurationStatus) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_createFlowSchema**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_createFlowSchema) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_deleteFlowSchema**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteFlowSchema) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_getAPIResources**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_getAPIResources) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/ | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_listFlowSchema**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_listFlowSchema) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_patchFlowSchema**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchFlowSchema) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_readFlowSchema**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readFlowSchema) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_readFlowSchemaStatus**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readFlowSchemaStatus) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_replaceFlowSchema**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replaceFlowSchema) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -*FlowcontrolApiserverV1beta3API* | [**FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus**](docs/FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | *InternalApiserverAPI* | [**InternalApiserverAPI_getAPIGroup**](docs/InternalApiserverAPI.md#InternalApiserverAPI_getAPIGroup) | **GET** /apis/internal.apiserver.k8s.io/ | *InternalApiserverV1alpha1API* | [**InternalApiserverV1alpha1API_createStorageVersion**](docs/InternalApiserverV1alpha1API.md#InternalApiserverV1alpha1API_createStorageVersion) | **POST** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions | *InternalApiserverV1alpha1API* | [**InternalApiserverV1alpha1API_deleteCollectionStorageVersion**](docs/InternalApiserverV1alpha1API.md#InternalApiserverV1alpha1API_deleteCollectionStorageVersion) | **DELETE** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions | @@ -627,51 +637,68 @@ Category | Method | HTTP request | Description *LogsAPI* | [**LogsAPI_logFileHandler**](docs/LogsAPI.md#LogsAPI_logFileHandler) | **GET** /logs/{logpath} | *LogsAPI* | [**LogsAPI_logFileListHandler**](docs/LogsAPI.md#LogsAPI_logFileListHandler) | **GET** /logs/ | *NetworkingAPI* | [**NetworkingAPI_getAPIGroup**](docs/NetworkingAPI.md#NetworkingAPI_getAPIGroup) | **GET** /apis/networking.k8s.io/ | +*NetworkingV1API* | [**NetworkingV1API_createIPAddress**](docs/NetworkingV1API.md#NetworkingV1API_createIPAddress) | **POST** /apis/networking.k8s.io/v1/ipaddresses | *NetworkingV1API* | [**NetworkingV1API_createIngressClass**](docs/NetworkingV1API.md#NetworkingV1API_createIngressClass) | **POST** /apis/networking.k8s.io/v1/ingressclasses | *NetworkingV1API* | [**NetworkingV1API_createNamespacedIngress**](docs/NetworkingV1API.md#NetworkingV1API_createNamespacedIngress) | **POST** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | *NetworkingV1API* | [**NetworkingV1API_createNamespacedNetworkPolicy**](docs/NetworkingV1API.md#NetworkingV1API_createNamespacedNetworkPolicy) | **POST** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | +*NetworkingV1API* | [**NetworkingV1API_createServiceCIDR**](docs/NetworkingV1API.md#NetworkingV1API_createServiceCIDR) | **POST** /apis/networking.k8s.io/v1/servicecidrs | +*NetworkingV1API* | [**NetworkingV1API_deleteCollectionIPAddress**](docs/NetworkingV1API.md#NetworkingV1API_deleteCollectionIPAddress) | **DELETE** /apis/networking.k8s.io/v1/ipaddresses | *NetworkingV1API* | [**NetworkingV1API_deleteCollectionIngressClass**](docs/NetworkingV1API.md#NetworkingV1API_deleteCollectionIngressClass) | **DELETE** /apis/networking.k8s.io/v1/ingressclasses | *NetworkingV1API* | [**NetworkingV1API_deleteCollectionNamespacedIngress**](docs/NetworkingV1API.md#NetworkingV1API_deleteCollectionNamespacedIngress) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | *NetworkingV1API* | [**NetworkingV1API_deleteCollectionNamespacedNetworkPolicy**](docs/NetworkingV1API.md#NetworkingV1API_deleteCollectionNamespacedNetworkPolicy) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | +*NetworkingV1API* | [**NetworkingV1API_deleteCollectionServiceCIDR**](docs/NetworkingV1API.md#NetworkingV1API_deleteCollectionServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1/servicecidrs | +*NetworkingV1API* | [**NetworkingV1API_deleteIPAddress**](docs/NetworkingV1API.md#NetworkingV1API_deleteIPAddress) | **DELETE** /apis/networking.k8s.io/v1/ipaddresses/{name} | *NetworkingV1API* | [**NetworkingV1API_deleteIngressClass**](docs/NetworkingV1API.md#NetworkingV1API_deleteIngressClass) | **DELETE** /apis/networking.k8s.io/v1/ingressclasses/{name} | *NetworkingV1API* | [**NetworkingV1API_deleteNamespacedIngress**](docs/NetworkingV1API.md#NetworkingV1API_deleteNamespacedIngress) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | *NetworkingV1API* | [**NetworkingV1API_deleteNamespacedNetworkPolicy**](docs/NetworkingV1API.md#NetworkingV1API_deleteNamespacedNetworkPolicy) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +*NetworkingV1API* | [**NetworkingV1API_deleteServiceCIDR**](docs/NetworkingV1API.md#NetworkingV1API_deleteServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1/servicecidrs/{name} | *NetworkingV1API* | [**NetworkingV1API_getAPIResources**](docs/NetworkingV1API.md#NetworkingV1API_getAPIResources) | **GET** /apis/networking.k8s.io/v1/ | +*NetworkingV1API* | [**NetworkingV1API_listIPAddress**](docs/NetworkingV1API.md#NetworkingV1API_listIPAddress) | **GET** /apis/networking.k8s.io/v1/ipaddresses | *NetworkingV1API* | [**NetworkingV1API_listIngressClass**](docs/NetworkingV1API.md#NetworkingV1API_listIngressClass) | **GET** /apis/networking.k8s.io/v1/ingressclasses | *NetworkingV1API* | [**NetworkingV1API_listIngressForAllNamespaces**](docs/NetworkingV1API.md#NetworkingV1API_listIngressForAllNamespaces) | **GET** /apis/networking.k8s.io/v1/ingresses | *NetworkingV1API* | [**NetworkingV1API_listNamespacedIngress**](docs/NetworkingV1API.md#NetworkingV1API_listNamespacedIngress) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | *NetworkingV1API* | [**NetworkingV1API_listNamespacedNetworkPolicy**](docs/NetworkingV1API.md#NetworkingV1API_listNamespacedNetworkPolicy) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | *NetworkingV1API* | [**NetworkingV1API_listNetworkPolicyForAllNamespaces**](docs/NetworkingV1API.md#NetworkingV1API_listNetworkPolicyForAllNamespaces) | **GET** /apis/networking.k8s.io/v1/networkpolicies | +*NetworkingV1API* | [**NetworkingV1API_listServiceCIDR**](docs/NetworkingV1API.md#NetworkingV1API_listServiceCIDR) | **GET** /apis/networking.k8s.io/v1/servicecidrs | +*NetworkingV1API* | [**NetworkingV1API_patchIPAddress**](docs/NetworkingV1API.md#NetworkingV1API_patchIPAddress) | **PATCH** /apis/networking.k8s.io/v1/ipaddresses/{name} | *NetworkingV1API* | [**NetworkingV1API_patchIngressClass**](docs/NetworkingV1API.md#NetworkingV1API_patchIngressClass) | **PATCH** /apis/networking.k8s.io/v1/ingressclasses/{name} | *NetworkingV1API* | [**NetworkingV1API_patchNamespacedIngress**](docs/NetworkingV1API.md#NetworkingV1API_patchNamespacedIngress) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | *NetworkingV1API* | [**NetworkingV1API_patchNamespacedIngressStatus**](docs/NetworkingV1API.md#NetworkingV1API_patchNamespacedIngressStatus) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | *NetworkingV1API* | [**NetworkingV1API_patchNamespacedNetworkPolicy**](docs/NetworkingV1API.md#NetworkingV1API_patchNamespacedNetworkPolicy) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +*NetworkingV1API* | [**NetworkingV1API_patchServiceCIDR**](docs/NetworkingV1API.md#NetworkingV1API_patchServiceCIDR) | **PATCH** /apis/networking.k8s.io/v1/servicecidrs/{name} | +*NetworkingV1API* | [**NetworkingV1API_patchServiceCIDRStatus**](docs/NetworkingV1API.md#NetworkingV1API_patchServiceCIDRStatus) | **PATCH** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +*NetworkingV1API* | [**NetworkingV1API_readIPAddress**](docs/NetworkingV1API.md#NetworkingV1API_readIPAddress) | **GET** /apis/networking.k8s.io/v1/ipaddresses/{name} | *NetworkingV1API* | [**NetworkingV1API_readIngressClass**](docs/NetworkingV1API.md#NetworkingV1API_readIngressClass) | **GET** /apis/networking.k8s.io/v1/ingressclasses/{name} | *NetworkingV1API* | [**NetworkingV1API_readNamespacedIngress**](docs/NetworkingV1API.md#NetworkingV1API_readNamespacedIngress) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | *NetworkingV1API* | [**NetworkingV1API_readNamespacedIngressStatus**](docs/NetworkingV1API.md#NetworkingV1API_readNamespacedIngressStatus) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | *NetworkingV1API* | [**NetworkingV1API_readNamespacedNetworkPolicy**](docs/NetworkingV1API.md#NetworkingV1API_readNamespacedNetworkPolicy) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +*NetworkingV1API* | [**NetworkingV1API_readServiceCIDR**](docs/NetworkingV1API.md#NetworkingV1API_readServiceCIDR) | **GET** /apis/networking.k8s.io/v1/servicecidrs/{name} | +*NetworkingV1API* | [**NetworkingV1API_readServiceCIDRStatus**](docs/NetworkingV1API.md#NetworkingV1API_readServiceCIDRStatus) | **GET** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +*NetworkingV1API* | [**NetworkingV1API_replaceIPAddress**](docs/NetworkingV1API.md#NetworkingV1API_replaceIPAddress) | **PUT** /apis/networking.k8s.io/v1/ipaddresses/{name} | *NetworkingV1API* | [**NetworkingV1API_replaceIngressClass**](docs/NetworkingV1API.md#NetworkingV1API_replaceIngressClass) | **PUT** /apis/networking.k8s.io/v1/ingressclasses/{name} | *NetworkingV1API* | [**NetworkingV1API_replaceNamespacedIngress**](docs/NetworkingV1API.md#NetworkingV1API_replaceNamespacedIngress) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | *NetworkingV1API* | [**NetworkingV1API_replaceNamespacedIngressStatus**](docs/NetworkingV1API.md#NetworkingV1API_replaceNamespacedIngressStatus) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | *NetworkingV1API* | [**NetworkingV1API_replaceNamespacedNetworkPolicy**](docs/NetworkingV1API.md#NetworkingV1API_replaceNamespacedNetworkPolicy) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_createIPAddress**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_createIPAddress) | **POST** /apis/networking.k8s.io/v1alpha1/ipaddresses | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_createServiceCIDR**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_createServiceCIDR) | **POST** /apis/networking.k8s.io/v1alpha1/servicecidrs | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_deleteCollectionIPAddress**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_deleteCollectionIPAddress) | **DELETE** /apis/networking.k8s.io/v1alpha1/ipaddresses | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_deleteCollectionServiceCIDR**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_deleteCollectionServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1alpha1/servicecidrs | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_deleteIPAddress**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_deleteIPAddress) | **DELETE** /apis/networking.k8s.io/v1alpha1/ipaddresses/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_deleteServiceCIDR**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_deleteServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1alpha1/servicecidrs/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_getAPIResources**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_getAPIResources) | **GET** /apis/networking.k8s.io/v1alpha1/ | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_listIPAddress**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_listIPAddress) | **GET** /apis/networking.k8s.io/v1alpha1/ipaddresses | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_listServiceCIDR**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_listServiceCIDR) | **GET** /apis/networking.k8s.io/v1alpha1/servicecidrs | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_patchIPAddress**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_patchIPAddress) | **PATCH** /apis/networking.k8s.io/v1alpha1/ipaddresses/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_patchServiceCIDR**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_patchServiceCIDR) | **PATCH** /apis/networking.k8s.io/v1alpha1/servicecidrs/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_patchServiceCIDRStatus**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_patchServiceCIDRStatus) | **PATCH** /apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_readIPAddress**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_readIPAddress) | **GET** /apis/networking.k8s.io/v1alpha1/ipaddresses/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_readServiceCIDR**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_readServiceCIDR) | **GET** /apis/networking.k8s.io/v1alpha1/servicecidrs/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_readServiceCIDRStatus**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_readServiceCIDRStatus) | **GET** /apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_replaceIPAddress**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_replaceIPAddress) | **PUT** /apis/networking.k8s.io/v1alpha1/ipaddresses/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_replaceServiceCIDR**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_replaceServiceCIDR) | **PUT** /apis/networking.k8s.io/v1alpha1/servicecidrs/{name} | -*NetworkingV1alpha1API* | [**NetworkingV1alpha1API_replaceServiceCIDRStatus**](docs/NetworkingV1alpha1API.md#NetworkingV1alpha1API_replaceServiceCIDRStatus) | **PUT** /apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status | +*NetworkingV1API* | [**NetworkingV1API_replaceServiceCIDR**](docs/NetworkingV1API.md#NetworkingV1API_replaceServiceCIDR) | **PUT** /apis/networking.k8s.io/v1/servicecidrs/{name} | +*NetworkingV1API* | [**NetworkingV1API_replaceServiceCIDRStatus**](docs/NetworkingV1API.md#NetworkingV1API_replaceServiceCIDRStatus) | **PUT** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_createIPAddress**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_createIPAddress) | **POST** /apis/networking.k8s.io/v1beta1/ipaddresses | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_createServiceCIDR**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_createServiceCIDR) | **POST** /apis/networking.k8s.io/v1beta1/servicecidrs | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_deleteCollectionIPAddress**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_deleteCollectionIPAddress) | **DELETE** /apis/networking.k8s.io/v1beta1/ipaddresses | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_deleteCollectionServiceCIDR**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_deleteCollectionServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1beta1/servicecidrs | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_deleteIPAddress**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_deleteIPAddress) | **DELETE** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_deleteServiceCIDR**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_deleteServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_getAPIResources**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_getAPIResources) | **GET** /apis/networking.k8s.io/v1beta1/ | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_listIPAddress**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_listIPAddress) | **GET** /apis/networking.k8s.io/v1beta1/ipaddresses | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_listServiceCIDR**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_listServiceCIDR) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_patchIPAddress**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_patchIPAddress) | **PATCH** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_patchServiceCIDR**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_patchServiceCIDR) | **PATCH** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_patchServiceCIDRStatus**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_patchServiceCIDRStatus) | **PATCH** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_readIPAddress**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_readIPAddress) | **GET** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_readServiceCIDR**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_readServiceCIDR) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_readServiceCIDRStatus**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_readServiceCIDRStatus) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_replaceIPAddress**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_replaceIPAddress) | **PUT** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_replaceServiceCIDR**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_replaceServiceCIDR) | **PUT** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1API* | [**NetworkingV1beta1API_replaceServiceCIDRStatus**](docs/NetworkingV1beta1API.md#NetworkingV1beta1API_replaceServiceCIDRStatus) | **PUT** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | *NodeAPI* | [**NodeAPI_getAPIGroup**](docs/NodeAPI.md#NodeAPI_getAPIGroup) | **GET** /apis/node.k8s.io/ | *NodeV1API* | [**NodeV1API_createRuntimeClass**](docs/NodeV1API.md#NodeV1API_createRuntimeClass) | **POST** /apis/node.k8s.io/v1/runtimeclasses | *NodeV1API* | [**NodeV1API_deleteCollectionRuntimeClass**](docs/NodeV1API.md#NodeV1API_deleteCollectionRuntimeClass) | **DELETE** /apis/node.k8s.io/v1/runtimeclasses | @@ -728,67 +755,116 @@ Category | Method | HTTP request | Description *RbacAuthorizationV1API* | [**RbacAuthorizationV1API_replaceNamespacedRole**](docs/RbacAuthorizationV1API.md#RbacAuthorizationV1API_replaceNamespacedRole) | **PUT** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name} | *RbacAuthorizationV1API* | [**RbacAuthorizationV1API_replaceNamespacedRoleBinding**](docs/RbacAuthorizationV1API.md#RbacAuthorizationV1API_replaceNamespacedRoleBinding) | **PUT** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name} | *ResourceAPI* | [**ResourceAPI_getAPIGroup**](docs/ResourceAPI.md#ResourceAPI_getAPIGroup) | **GET** /apis/resource.k8s.io/ | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_createNamespacedPodSchedulingContext**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_createNamespacedPodSchedulingContext) | **POST** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_createNamespacedResourceClaim**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_createNamespacedResourceClaimParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_createNamespacedResourceClaimParameters) | **POST** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_createNamespacedResourceClaimTemplate**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_createNamespacedResourceClassParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_createNamespacedResourceClassParameters) | **POST** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_createResourceClass**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_createResourceClass) | **POST** /apis/resource.k8s.io/v1alpha2/resourceclasses | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_createResourceSlice**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1alpha2/resourceslices | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteCollectionNamespacedPodSchedulingContext**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteCollectionNamespacedPodSchedulingContext) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteCollectionNamespacedResourceClaim**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimParameters) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimTemplate**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteCollectionNamespacedResourceClassParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteCollectionNamespacedResourceClassParameters) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteCollectionResourceClass**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteCollectionResourceClass) | **DELETE** /apis/resource.k8s.io/v1alpha2/resourceclasses | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteCollectionResourceSlice**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1alpha2/resourceslices | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteNamespacedPodSchedulingContext**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteNamespacedPodSchedulingContext) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteNamespacedResourceClaim**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteNamespacedResourceClaimParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteNamespacedResourceClaimParameters) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteNamespacedResourceClaimTemplate**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteNamespacedResourceClassParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteNamespacedResourceClassParameters) | **DELETE** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteResourceClass**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteResourceClass) | **DELETE** /apis/resource.k8s.io/v1alpha2/resourceclasses/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_deleteResourceSlice**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1alpha2/resourceslices/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_getAPIResources**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_getAPIResources) | **GET** /apis/resource.k8s.io/v1alpha2/ | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listNamespacedPodSchedulingContext**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listNamespacedPodSchedulingContext) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listNamespacedResourceClaim**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listNamespacedResourceClaimParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listNamespacedResourceClaimParameters) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listNamespacedResourceClaimTemplate**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listNamespacedResourceClassParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listNamespacedResourceClassParameters) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listPodSchedulingContextForAllNamespaces**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listPodSchedulingContextForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha2/podschedulingcontexts | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listResourceClaimForAllNamespaces**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha2/resourceclaims | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listResourceClaimParametersForAllNamespaces**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listResourceClaimParametersForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha2/resourceclaimparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listResourceClaimTemplateForAllNamespaces**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha2/resourceclaimtemplates | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listResourceClass**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listResourceClass) | **GET** /apis/resource.k8s.io/v1alpha2/resourceclasses | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listResourceClassParametersForAllNamespaces**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listResourceClassParametersForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha2/resourceclassparameters | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_listResourceSlice**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1alpha2/resourceslices | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchNamespacedPodSchedulingContext**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchNamespacedPodSchedulingContext) | **PATCH** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchNamespacedPodSchedulingContextStatus**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchNamespacedPodSchedulingContextStatus) | **PATCH** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchNamespacedResourceClaim**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchNamespacedResourceClaimParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchNamespacedResourceClaimParameters) | **PATCH** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchNamespacedResourceClaimStatus**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchNamespacedResourceClaimTemplate**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchNamespacedResourceClassParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchNamespacedResourceClassParameters) | **PATCH** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchResourceClass**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchResourceClass) | **PATCH** /apis/resource.k8s.io/v1alpha2/resourceclasses/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_patchResourceSlice**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1alpha2/resourceslices/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readNamespacedPodSchedulingContext**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readNamespacedPodSchedulingContext) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readNamespacedPodSchedulingContextStatus**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readNamespacedPodSchedulingContextStatus) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readNamespacedResourceClaim**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readNamespacedResourceClaimParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readNamespacedResourceClaimParameters) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readNamespacedResourceClaimStatus**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readNamespacedResourceClaimTemplate**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readNamespacedResourceClassParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readNamespacedResourceClassParameters) | **GET** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readResourceClass**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readResourceClass) | **GET** /apis/resource.k8s.io/v1alpha2/resourceclasses/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_readResourceSlice**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1alpha2/resourceslices/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceNamespacedPodSchedulingContext**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceNamespacedPodSchedulingContext) | **PUT** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceNamespacedPodSchedulingContextStatus**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceNamespacedPodSchedulingContextStatus) | **PUT** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceNamespacedResourceClaim**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceNamespacedResourceClaimParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceNamespacedResourceClaimParameters) | **PUT** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceNamespacedResourceClaimStatus**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceNamespacedResourceClaimTemplate**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceNamespacedResourceClassParameters**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceNamespacedResourceClassParameters) | **PUT** /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceResourceClass**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceResourceClass) | **PUT** /apis/resource.k8s.io/v1alpha2/resourceclasses/{name} | -*ResourceV1alpha2API* | [**ResourceV1alpha2API_replaceResourceSlice**](docs/ResourceV1alpha2API.md#ResourceV1alpha2API_replaceResourceSlice) | **PUT** /apis/resource.k8s.io/v1alpha2/resourceslices/{name} | +*ResourceV1API* | [**ResourceV1API_createDeviceClass**](docs/ResourceV1API.md#ResourceV1API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1/deviceclasses | +*ResourceV1API* | [**ResourceV1API_createNamespacedResourceClaim**](docs/ResourceV1API.md#ResourceV1API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +*ResourceV1API* | [**ResourceV1API_createNamespacedResourceClaimTemplate**](docs/ResourceV1API.md#ResourceV1API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1API* | [**ResourceV1API_createResourceSlice**](docs/ResourceV1API.md#ResourceV1API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1/resourceslices | +*ResourceV1API* | [**ResourceV1API_deleteCollectionDeviceClass**](docs/ResourceV1API.md#ResourceV1API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1/deviceclasses | +*ResourceV1API* | [**ResourceV1API_deleteCollectionNamespacedResourceClaim**](docs/ResourceV1API.md#ResourceV1API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +*ResourceV1API* | [**ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate**](docs/ResourceV1API.md#ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1API* | [**ResourceV1API_deleteCollectionResourceSlice**](docs/ResourceV1API.md#ResourceV1API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1/resourceslices | +*ResourceV1API* | [**ResourceV1API_deleteDeviceClass**](docs/ResourceV1API.md#ResourceV1API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1API* | [**ResourceV1API_deleteNamespacedResourceClaim**](docs/ResourceV1API.md#ResourceV1API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1API* | [**ResourceV1API_deleteNamespacedResourceClaimTemplate**](docs/ResourceV1API.md#ResourceV1API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1API* | [**ResourceV1API_deleteResourceSlice**](docs/ResourceV1API.md#ResourceV1API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1API* | [**ResourceV1API_getAPIResources**](docs/ResourceV1API.md#ResourceV1API_getAPIResources) | **GET** /apis/resource.k8s.io/v1/ | +*ResourceV1API* | [**ResourceV1API_listDeviceClass**](docs/ResourceV1API.md#ResourceV1API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1/deviceclasses | +*ResourceV1API* | [**ResourceV1API_listNamespacedResourceClaim**](docs/ResourceV1API.md#ResourceV1API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +*ResourceV1API* | [**ResourceV1API_listNamespacedResourceClaimTemplate**](docs/ResourceV1API.md#ResourceV1API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1API* | [**ResourceV1API_listResourceClaimForAllNamespaces**](docs/ResourceV1API.md#ResourceV1API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1/resourceclaims | +*ResourceV1API* | [**ResourceV1API_listResourceClaimTemplateForAllNamespaces**](docs/ResourceV1API.md#ResourceV1API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1/resourceclaimtemplates | +*ResourceV1API* | [**ResourceV1API_listResourceSlice**](docs/ResourceV1API.md#ResourceV1API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1/resourceslices | +*ResourceV1API* | [**ResourceV1API_patchDeviceClass**](docs/ResourceV1API.md#ResourceV1API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1API* | [**ResourceV1API_patchNamespacedResourceClaim**](docs/ResourceV1API.md#ResourceV1API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1API* | [**ResourceV1API_patchNamespacedResourceClaimStatus**](docs/ResourceV1API.md#ResourceV1API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1API* | [**ResourceV1API_patchNamespacedResourceClaimTemplate**](docs/ResourceV1API.md#ResourceV1API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1API* | [**ResourceV1API_patchResourceSlice**](docs/ResourceV1API.md#ResourceV1API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1API* | [**ResourceV1API_readDeviceClass**](docs/ResourceV1API.md#ResourceV1API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1API* | [**ResourceV1API_readNamespacedResourceClaim**](docs/ResourceV1API.md#ResourceV1API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1API* | [**ResourceV1API_readNamespacedResourceClaimStatus**](docs/ResourceV1API.md#ResourceV1API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1API* | [**ResourceV1API_readNamespacedResourceClaimTemplate**](docs/ResourceV1API.md#ResourceV1API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1API* | [**ResourceV1API_readResourceSlice**](docs/ResourceV1API.md#ResourceV1API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1API* | [**ResourceV1API_replaceDeviceClass**](docs/ResourceV1API.md#ResourceV1API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1API* | [**ResourceV1API_replaceNamespacedResourceClaim**](docs/ResourceV1API.md#ResourceV1API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1API* | [**ResourceV1API_replaceNamespacedResourceClaimStatus**](docs/ResourceV1API.md#ResourceV1API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1API* | [**ResourceV1API_replaceNamespacedResourceClaimTemplate**](docs/ResourceV1API.md#ResourceV1API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1API* | [**ResourceV1API_replaceResourceSlice**](docs/ResourceV1API.md#ResourceV1API_replaceResourceSlice) | **PUT** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_createDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_createDeviceTaintRule) | **POST** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteCollectionDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_getAPIResources**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_getAPIResources) | **GET** /apis/resource.k8s.io/v1alpha3/ | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_listDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_patchDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_patchDeviceTaintRule) | **PATCH** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_readDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_readDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_replaceDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_replaceDeviceTaintRule) | **PUT** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_createDeviceClass**](docs/ResourceV1beta1API.md#ResourceV1beta1API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1beta1/deviceclasses | +*ResourceV1beta1API* | [**ResourceV1beta1API_createNamespacedResourceClaim**](docs/ResourceV1beta1API.md#ResourceV1beta1API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +*ResourceV1beta1API* | [**ResourceV1beta1API_createNamespacedResourceClaimTemplate**](docs/ResourceV1beta1API.md#ResourceV1beta1API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta1API* | [**ResourceV1beta1API_createResourceSlice**](docs/ResourceV1beta1API.md#ResourceV1beta1API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1beta1/resourceslices | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteCollectionDeviceClass**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta1/deviceclasses | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteCollectionNamespacedResourceClaim**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteCollectionResourceSlice**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta1/resourceslices | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteDeviceClass**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteNamespacedResourceClaim**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteNamespacedResourceClaimTemplate**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_deleteResourceSlice**](docs/ResourceV1beta1API.md#ResourceV1beta1API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_getAPIResources**](docs/ResourceV1beta1API.md#ResourceV1beta1API_getAPIResources) | **GET** /apis/resource.k8s.io/v1beta1/ | +*ResourceV1beta1API* | [**ResourceV1beta1API_listDeviceClass**](docs/ResourceV1beta1API.md#ResourceV1beta1API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1beta1/deviceclasses | +*ResourceV1beta1API* | [**ResourceV1beta1API_listNamespacedResourceClaim**](docs/ResourceV1beta1API.md#ResourceV1beta1API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +*ResourceV1beta1API* | [**ResourceV1beta1API_listNamespacedResourceClaimTemplate**](docs/ResourceV1beta1API.md#ResourceV1beta1API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta1API* | [**ResourceV1beta1API_listResourceClaimForAllNamespaces**](docs/ResourceV1beta1API.md#ResourceV1beta1API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta1/resourceclaims | +*ResourceV1beta1API* | [**ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces**](docs/ResourceV1beta1API.md#ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta1/resourceclaimtemplates | +*ResourceV1beta1API* | [**ResourceV1beta1API_listResourceSlice**](docs/ResourceV1beta1API.md#ResourceV1beta1API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1beta1/resourceslices | +*ResourceV1beta1API* | [**ResourceV1beta1API_patchDeviceClass**](docs/ResourceV1beta1API.md#ResourceV1beta1API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_patchNamespacedResourceClaim**](docs/ResourceV1beta1API.md#ResourceV1beta1API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_patchNamespacedResourceClaimStatus**](docs/ResourceV1beta1API.md#ResourceV1beta1API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta1API* | [**ResourceV1beta1API_patchNamespacedResourceClaimTemplate**](docs/ResourceV1beta1API.md#ResourceV1beta1API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_patchResourceSlice**](docs/ResourceV1beta1API.md#ResourceV1beta1API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_readDeviceClass**](docs/ResourceV1beta1API.md#ResourceV1beta1API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_readNamespacedResourceClaim**](docs/ResourceV1beta1API.md#ResourceV1beta1API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_readNamespacedResourceClaimStatus**](docs/ResourceV1beta1API.md#ResourceV1beta1API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta1API* | [**ResourceV1beta1API_readNamespacedResourceClaimTemplate**](docs/ResourceV1beta1API.md#ResourceV1beta1API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_readResourceSlice**](docs/ResourceV1beta1API.md#ResourceV1beta1API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_replaceDeviceClass**](docs/ResourceV1beta1API.md#ResourceV1beta1API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_replaceNamespacedResourceClaim**](docs/ResourceV1beta1API.md#ResourceV1beta1API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_replaceNamespacedResourceClaimStatus**](docs/ResourceV1beta1API.md#ResourceV1beta1API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta1API* | [**ResourceV1beta1API_replaceNamespacedResourceClaimTemplate**](docs/ResourceV1beta1API.md#ResourceV1beta1API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1API* | [**ResourceV1beta1API_replaceResourceSlice**](docs/ResourceV1beta1API.md#ResourceV1beta1API_replaceResourceSlice) | **PUT** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_createDeviceClass**](docs/ResourceV1beta2API.md#ResourceV1beta2API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1beta2/deviceclasses | +*ResourceV1beta2API* | [**ResourceV1beta2API_createNamespacedResourceClaim**](docs/ResourceV1beta2API.md#ResourceV1beta2API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +*ResourceV1beta2API* | [**ResourceV1beta2API_createNamespacedResourceClaimTemplate**](docs/ResourceV1beta2API.md#ResourceV1beta2API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta2API* | [**ResourceV1beta2API_createResourceSlice**](docs/ResourceV1beta2API.md#ResourceV1beta2API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1beta2/resourceslices | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteCollectionDeviceClass**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta2/deviceclasses | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteCollectionNamespacedResourceClaim**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteCollectionResourceSlice**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta2/resourceslices | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteDeviceClass**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteNamespacedResourceClaim**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteNamespacedResourceClaimTemplate**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_deleteResourceSlice**](docs/ResourceV1beta2API.md#ResourceV1beta2API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_getAPIResources**](docs/ResourceV1beta2API.md#ResourceV1beta2API_getAPIResources) | **GET** /apis/resource.k8s.io/v1beta2/ | +*ResourceV1beta2API* | [**ResourceV1beta2API_listDeviceClass**](docs/ResourceV1beta2API.md#ResourceV1beta2API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1beta2/deviceclasses | +*ResourceV1beta2API* | [**ResourceV1beta2API_listNamespacedResourceClaim**](docs/ResourceV1beta2API.md#ResourceV1beta2API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +*ResourceV1beta2API* | [**ResourceV1beta2API_listNamespacedResourceClaimTemplate**](docs/ResourceV1beta2API.md#ResourceV1beta2API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta2API* | [**ResourceV1beta2API_listResourceClaimForAllNamespaces**](docs/ResourceV1beta2API.md#ResourceV1beta2API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta2/resourceclaims | +*ResourceV1beta2API* | [**ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces**](docs/ResourceV1beta2API.md#ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta2/resourceclaimtemplates | +*ResourceV1beta2API* | [**ResourceV1beta2API_listResourceSlice**](docs/ResourceV1beta2API.md#ResourceV1beta2API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1beta2/resourceslices | +*ResourceV1beta2API* | [**ResourceV1beta2API_patchDeviceClass**](docs/ResourceV1beta2API.md#ResourceV1beta2API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_patchNamespacedResourceClaim**](docs/ResourceV1beta2API.md#ResourceV1beta2API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_patchNamespacedResourceClaimStatus**](docs/ResourceV1beta2API.md#ResourceV1beta2API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta2API* | [**ResourceV1beta2API_patchNamespacedResourceClaimTemplate**](docs/ResourceV1beta2API.md#ResourceV1beta2API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_patchResourceSlice**](docs/ResourceV1beta2API.md#ResourceV1beta2API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_readDeviceClass**](docs/ResourceV1beta2API.md#ResourceV1beta2API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_readNamespacedResourceClaim**](docs/ResourceV1beta2API.md#ResourceV1beta2API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_readNamespacedResourceClaimStatus**](docs/ResourceV1beta2API.md#ResourceV1beta2API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta2API* | [**ResourceV1beta2API_readNamespacedResourceClaimTemplate**](docs/ResourceV1beta2API.md#ResourceV1beta2API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_readResourceSlice**](docs/ResourceV1beta2API.md#ResourceV1beta2API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_replaceDeviceClass**](docs/ResourceV1beta2API.md#ResourceV1beta2API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_replaceNamespacedResourceClaim**](docs/ResourceV1beta2API.md#ResourceV1beta2API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_replaceNamespacedResourceClaimStatus**](docs/ResourceV1beta2API.md#ResourceV1beta2API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta2API* | [**ResourceV1beta2API_replaceNamespacedResourceClaimTemplate**](docs/ResourceV1beta2API.md#ResourceV1beta2API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2API* | [**ResourceV1beta2API_replaceResourceSlice**](docs/ResourceV1beta2API.md#ResourceV1beta2API_replaceResourceSlice) | **PUT** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | *SchedulingAPI* | [**SchedulingAPI_getAPIGroup**](docs/SchedulingAPI.md#SchedulingAPI_getAPIGroup) | **GET** /apis/scheduling.k8s.io/ | *SchedulingV1API* | [**SchedulingV1API_createPriorityClass**](docs/SchedulingV1API.md#SchedulingV1API_createPriorityClass) | **POST** /apis/scheduling.k8s.io/v1/priorityclasses | *SchedulingV1API* | [**SchedulingV1API_deleteCollectionPriorityClass**](docs/SchedulingV1API.md#SchedulingV1API_deleteCollectionPriorityClass) | **DELETE** /apis/scheduling.k8s.io/v1/priorityclasses | @@ -804,6 +880,7 @@ Category | Method | HTTP request | Description *StorageV1API* | [**StorageV1API_createNamespacedCSIStorageCapacity**](docs/StorageV1API.md#StorageV1API_createNamespacedCSIStorageCapacity) | **POST** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | *StorageV1API* | [**StorageV1API_createStorageClass**](docs/StorageV1API.md#StorageV1API_createStorageClass) | **POST** /apis/storage.k8s.io/v1/storageclasses | *StorageV1API* | [**StorageV1API_createVolumeAttachment**](docs/StorageV1API.md#StorageV1API_createVolumeAttachment) | **POST** /apis/storage.k8s.io/v1/volumeattachments | +*StorageV1API* | [**StorageV1API_createVolumeAttributesClass**](docs/StorageV1API.md#StorageV1API_createVolumeAttributesClass) | **POST** /apis/storage.k8s.io/v1/volumeattributesclasses | *StorageV1API* | [**StorageV1API_deleteCSIDriver**](docs/StorageV1API.md#StorageV1API_deleteCSIDriver) | **DELETE** /apis/storage.k8s.io/v1/csidrivers/{name} | *StorageV1API* | [**StorageV1API_deleteCSINode**](docs/StorageV1API.md#StorageV1API_deleteCSINode) | **DELETE** /apis/storage.k8s.io/v1/csinodes/{name} | *StorageV1API* | [**StorageV1API_deleteCollectionCSIDriver**](docs/StorageV1API.md#StorageV1API_deleteCollectionCSIDriver) | **DELETE** /apis/storage.k8s.io/v1/csidrivers | @@ -811,9 +888,11 @@ Category | Method | HTTP request | Description *StorageV1API* | [**StorageV1API_deleteCollectionNamespacedCSIStorageCapacity**](docs/StorageV1API.md#StorageV1API_deleteCollectionNamespacedCSIStorageCapacity) | **DELETE** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | *StorageV1API* | [**StorageV1API_deleteCollectionStorageClass**](docs/StorageV1API.md#StorageV1API_deleteCollectionStorageClass) | **DELETE** /apis/storage.k8s.io/v1/storageclasses | *StorageV1API* | [**StorageV1API_deleteCollectionVolumeAttachment**](docs/StorageV1API.md#StorageV1API_deleteCollectionVolumeAttachment) | **DELETE** /apis/storage.k8s.io/v1/volumeattachments | +*StorageV1API* | [**StorageV1API_deleteCollectionVolumeAttributesClass**](docs/StorageV1API.md#StorageV1API_deleteCollectionVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1/volumeattributesclasses | *StorageV1API* | [**StorageV1API_deleteNamespacedCSIStorageCapacity**](docs/StorageV1API.md#StorageV1API_deleteNamespacedCSIStorageCapacity) | **DELETE** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | *StorageV1API* | [**StorageV1API_deleteStorageClass**](docs/StorageV1API.md#StorageV1API_deleteStorageClass) | **DELETE** /apis/storage.k8s.io/v1/storageclasses/{name} | *StorageV1API* | [**StorageV1API_deleteVolumeAttachment**](docs/StorageV1API.md#StorageV1API_deleteVolumeAttachment) | **DELETE** /apis/storage.k8s.io/v1/volumeattachments/{name} | +*StorageV1API* | [**StorageV1API_deleteVolumeAttributesClass**](docs/StorageV1API.md#StorageV1API_deleteVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | *StorageV1API* | [**StorageV1API_getAPIResources**](docs/StorageV1API.md#StorageV1API_getAPIResources) | **GET** /apis/storage.k8s.io/v1/ | *StorageV1API* | [**StorageV1API_listCSIDriver**](docs/StorageV1API.md#StorageV1API_listCSIDriver) | **GET** /apis/storage.k8s.io/v1/csidrivers | *StorageV1API* | [**StorageV1API_listCSINode**](docs/StorageV1API.md#StorageV1API_listCSINode) | **GET** /apis/storage.k8s.io/v1/csinodes | @@ -821,24 +900,28 @@ Category | Method | HTTP request | Description *StorageV1API* | [**StorageV1API_listNamespacedCSIStorageCapacity**](docs/StorageV1API.md#StorageV1API_listNamespacedCSIStorageCapacity) | **GET** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | *StorageV1API* | [**StorageV1API_listStorageClass**](docs/StorageV1API.md#StorageV1API_listStorageClass) | **GET** /apis/storage.k8s.io/v1/storageclasses | *StorageV1API* | [**StorageV1API_listVolumeAttachment**](docs/StorageV1API.md#StorageV1API_listVolumeAttachment) | **GET** /apis/storage.k8s.io/v1/volumeattachments | +*StorageV1API* | [**StorageV1API_listVolumeAttributesClass**](docs/StorageV1API.md#StorageV1API_listVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1/volumeattributesclasses | *StorageV1API* | [**StorageV1API_patchCSIDriver**](docs/StorageV1API.md#StorageV1API_patchCSIDriver) | **PATCH** /apis/storage.k8s.io/v1/csidrivers/{name} | *StorageV1API* | [**StorageV1API_patchCSINode**](docs/StorageV1API.md#StorageV1API_patchCSINode) | **PATCH** /apis/storage.k8s.io/v1/csinodes/{name} | *StorageV1API* | [**StorageV1API_patchNamespacedCSIStorageCapacity**](docs/StorageV1API.md#StorageV1API_patchNamespacedCSIStorageCapacity) | **PATCH** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | *StorageV1API* | [**StorageV1API_patchStorageClass**](docs/StorageV1API.md#StorageV1API_patchStorageClass) | **PATCH** /apis/storage.k8s.io/v1/storageclasses/{name} | *StorageV1API* | [**StorageV1API_patchVolumeAttachment**](docs/StorageV1API.md#StorageV1API_patchVolumeAttachment) | **PATCH** /apis/storage.k8s.io/v1/volumeattachments/{name} | *StorageV1API* | [**StorageV1API_patchVolumeAttachmentStatus**](docs/StorageV1API.md#StorageV1API_patchVolumeAttachmentStatus) | **PATCH** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +*StorageV1API* | [**StorageV1API_patchVolumeAttributesClass**](docs/StorageV1API.md#StorageV1API_patchVolumeAttributesClass) | **PATCH** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | *StorageV1API* | [**StorageV1API_readCSIDriver**](docs/StorageV1API.md#StorageV1API_readCSIDriver) | **GET** /apis/storage.k8s.io/v1/csidrivers/{name} | *StorageV1API* | [**StorageV1API_readCSINode**](docs/StorageV1API.md#StorageV1API_readCSINode) | **GET** /apis/storage.k8s.io/v1/csinodes/{name} | *StorageV1API* | [**StorageV1API_readNamespacedCSIStorageCapacity**](docs/StorageV1API.md#StorageV1API_readNamespacedCSIStorageCapacity) | **GET** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | *StorageV1API* | [**StorageV1API_readStorageClass**](docs/StorageV1API.md#StorageV1API_readStorageClass) | **GET** /apis/storage.k8s.io/v1/storageclasses/{name} | *StorageV1API* | [**StorageV1API_readVolumeAttachment**](docs/StorageV1API.md#StorageV1API_readVolumeAttachment) | **GET** /apis/storage.k8s.io/v1/volumeattachments/{name} | *StorageV1API* | [**StorageV1API_readVolumeAttachmentStatus**](docs/StorageV1API.md#StorageV1API_readVolumeAttachmentStatus) | **GET** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +*StorageV1API* | [**StorageV1API_readVolumeAttributesClass**](docs/StorageV1API.md#StorageV1API_readVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | *StorageV1API* | [**StorageV1API_replaceCSIDriver**](docs/StorageV1API.md#StorageV1API_replaceCSIDriver) | **PUT** /apis/storage.k8s.io/v1/csidrivers/{name} | *StorageV1API* | [**StorageV1API_replaceCSINode**](docs/StorageV1API.md#StorageV1API_replaceCSINode) | **PUT** /apis/storage.k8s.io/v1/csinodes/{name} | *StorageV1API* | [**StorageV1API_replaceNamespacedCSIStorageCapacity**](docs/StorageV1API.md#StorageV1API_replaceNamespacedCSIStorageCapacity) | **PUT** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | *StorageV1API* | [**StorageV1API_replaceStorageClass**](docs/StorageV1API.md#StorageV1API_replaceStorageClass) | **PUT** /apis/storage.k8s.io/v1/storageclasses/{name} | *StorageV1API* | [**StorageV1API_replaceVolumeAttachment**](docs/StorageV1API.md#StorageV1API_replaceVolumeAttachment) | **PUT** /apis/storage.k8s.io/v1/volumeattachments/{name} | *StorageV1API* | [**StorageV1API_replaceVolumeAttachmentStatus**](docs/StorageV1API.md#StorageV1API_replaceVolumeAttachmentStatus) | **PUT** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +*StorageV1API* | [**StorageV1API_replaceVolumeAttributesClass**](docs/StorageV1API.md#StorageV1API_replaceVolumeAttributesClass) | **PUT** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | *StorageV1alpha1API* | [**StorageV1alpha1API_createVolumeAttributesClass**](docs/StorageV1alpha1API.md#StorageV1alpha1API_createVolumeAttributesClass) | **POST** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | *StorageV1alpha1API* | [**StorageV1alpha1API_deleteCollectionVolumeAttributesClass**](docs/StorageV1alpha1API.md#StorageV1alpha1API_deleteCollectionVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | *StorageV1alpha1API* | [**StorageV1alpha1API_deleteVolumeAttributesClass**](docs/StorageV1alpha1API.md#StorageV1alpha1API_deleteVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | @@ -847,6 +930,14 @@ Category | Method | HTTP request | Description *StorageV1alpha1API* | [**StorageV1alpha1API_patchVolumeAttributesClass**](docs/StorageV1alpha1API.md#StorageV1alpha1API_patchVolumeAttributesClass) | **PATCH** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | *StorageV1alpha1API* | [**StorageV1alpha1API_readVolumeAttributesClass**](docs/StorageV1alpha1API.md#StorageV1alpha1API_readVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | *StorageV1alpha1API* | [**StorageV1alpha1API_replaceVolumeAttributesClass**](docs/StorageV1alpha1API.md#StorageV1alpha1API_replaceVolumeAttributesClass) | **PUT** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | +*StorageV1beta1API* | [**StorageV1beta1API_createVolumeAttributesClass**](docs/StorageV1beta1API.md#StorageV1beta1API_createVolumeAttributesClass) | **POST** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +*StorageV1beta1API* | [**StorageV1beta1API_deleteCollectionVolumeAttributesClass**](docs/StorageV1beta1API.md#StorageV1beta1API_deleteCollectionVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +*StorageV1beta1API* | [**StorageV1beta1API_deleteVolumeAttributesClass**](docs/StorageV1beta1API.md#StorageV1beta1API_deleteVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +*StorageV1beta1API* | [**StorageV1beta1API_getAPIResources**](docs/StorageV1beta1API.md#StorageV1beta1API_getAPIResources) | **GET** /apis/storage.k8s.io/v1beta1/ | +*StorageV1beta1API* | [**StorageV1beta1API_listVolumeAttributesClass**](docs/StorageV1beta1API.md#StorageV1beta1API_listVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +*StorageV1beta1API* | [**StorageV1beta1API_patchVolumeAttributesClass**](docs/StorageV1beta1API.md#StorageV1beta1API_patchVolumeAttributesClass) | **PATCH** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +*StorageV1beta1API* | [**StorageV1beta1API_readVolumeAttributesClass**](docs/StorageV1beta1API.md#StorageV1beta1API_readVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +*StorageV1beta1API* | [**StorageV1beta1API_replaceVolumeAttributesClass**](docs/StorageV1beta1API.md#StorageV1beta1API_replaceVolumeAttributesClass) | **PUT** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | *StoragemigrationAPI* | [**StoragemigrationAPI_getAPIGroup**](docs/StoragemigrationAPI.md#StoragemigrationAPI_getAPIGroup) | **GET** /apis/storagemigration.k8s.io/ | *StoragemigrationV1alpha1API* | [**StoragemigrationV1alpha1API_createStorageVersionMigration**](docs/StoragemigrationV1alpha1API.md#StoragemigrationV1alpha1API_createStorageVersionMigration) | **POST** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | *StoragemigrationV1alpha1API* | [**StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration**](docs/StoragemigrationV1alpha1API.md#StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration) | **DELETE** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | @@ -875,15 +966,19 @@ Category | Method | HTTP request | Description - [core_v1_event_t](docs/core_v1_event.md) - [core_v1_event_list_t](docs/core_v1_event_list.md) - [core_v1_event_series_t](docs/core_v1_event_series.md) + - [core_v1_resource_claim_t](docs/core_v1_resource_claim.md) - [discovery_v1_endpoint_port_t](docs/discovery_v1_endpoint_port.md) - [events_v1_event_t](docs/events_v1_event.md) - [events_v1_event_list_t](docs/events_v1_event_list.md) - [events_v1_event_series_t](docs/events_v1_event_series.md) - [flowcontrol_v1_subject_t](docs/flowcontrol_v1_subject.md) - [rbac_v1_subject_t](docs/rbac_v1_subject.md) + - [resource_v1_resource_claim_t](docs/resource_v1_resource_claim.md) - [storage_v1_token_request_t](docs/storage_v1_token_request.md) - [v1_affinity_t](docs/v1_affinity.md) - [v1_aggregation_rule_t](docs/v1_aggregation_rule.md) + - [v1_allocated_device_status_t](docs/v1_allocated_device_status.md) + - [v1_allocation_result_t](docs/v1_allocation_result.md) - [v1_api_group_t](docs/v1_api_group.md) - [v1_api_group_list_t](docs/v1_api_group_list.md) - [v1_api_resource_t](docs/v1_api_resource.md) @@ -904,6 +999,10 @@ Category | Method | HTTP request | Description - [v1_binding_t](docs/v1_binding.md) - [v1_bound_object_reference_t](docs/v1_bound_object_reference.md) - [v1_capabilities_t](docs/v1_capabilities.md) + - [v1_capacity_request_policy_t](docs/v1_capacity_request_policy.md) + - [v1_capacity_request_policy_range_t](docs/v1_capacity_request_policy_range.md) + - [v1_capacity_requirements_t](docs/v1_capacity_requirements.md) + - [v1_cel_device_selector_t](docs/v1_cel_device_selector.md) - [v1_ceph_fs_persistent_volume_source_t](docs/v1_ceph_fs_persistent_volume_source.md) - [v1_ceph_fs_volume_source_t](docs/v1_ceph_fs_volume_source.md) - [v1_certificate_signing_request_t](docs/v1_certificate_signing_request.md) @@ -913,7 +1012,6 @@ Category | Method | HTTP request | Description - [v1_certificate_signing_request_status_t](docs/v1_certificate_signing_request_status.md) - [v1_cinder_persistent_volume_source_t](docs/v1_cinder_persistent_volume_source.md) - [v1_cinder_volume_source_t](docs/v1_cinder_volume_source.md) - - [v1_claim_source_t](docs/v1_claim_source.md) - [v1_client_ip_config_t](docs/v1_client_ip_config.md) - [v1_cluster_role_t](docs/v1_cluster_role.md) - [v1_cluster_role_binding_t](docs/v1_cluster_role_binding.md) @@ -932,16 +1030,22 @@ Category | Method | HTTP request | Description - [v1_config_map_projection_t](docs/v1_config_map_projection.md) - [v1_config_map_volume_source_t](docs/v1_config_map_volume_source.md) - [v1_container_t](docs/v1_container.md) + - [v1_container_extended_resource_request_t](docs/v1_container_extended_resource_request.md) - [v1_container_image_t](docs/v1_container_image.md) - [v1_container_port_t](docs/v1_container_port.md) - [v1_container_resize_policy_t](docs/v1_container_resize_policy.md) + - [v1_container_restart_rule_t](docs/v1_container_restart_rule.md) + - [v1_container_restart_rule_on_exit_codes_t](docs/v1_container_restart_rule_on_exit_codes.md) - [v1_container_state_t](docs/v1_container_state.md) - [v1_container_state_running_t](docs/v1_container_state_running.md) - [v1_container_state_terminated_t](docs/v1_container_state_terminated.md) - [v1_container_state_waiting_t](docs/v1_container_state_waiting.md) - [v1_container_status_t](docs/v1_container_status.md) + - [v1_container_user_t](docs/v1_container_user.md) - [v1_controller_revision_t](docs/v1_controller_revision.md) - [v1_controller_revision_list_t](docs/v1_controller_revision_list.md) + - [v1_counter_t](docs/v1_counter.md) + - [v1_counter_set_t](docs/v1_counter_set.md) - [v1_cron_job_t](docs/v1_cron_job.md) - [v1_cron_job_list_t](docs/v1_cron_job_list.md) - [v1_cron_job_spec_t](docs/v1_cron_job_spec.md) @@ -984,6 +1088,25 @@ Category | Method | HTTP request | Description - [v1_deployment_spec_t](docs/v1_deployment_spec.md) - [v1_deployment_status_t](docs/v1_deployment_status.md) - [v1_deployment_strategy_t](docs/v1_deployment_strategy.md) + - [v1_device_t](docs/v1_device.md) + - [v1_device_allocation_configuration_t](docs/v1_device_allocation_configuration.md) + - [v1_device_allocation_result_t](docs/v1_device_allocation_result.md) + - [v1_device_attribute_t](docs/v1_device_attribute.md) + - [v1_device_capacity_t](docs/v1_device_capacity.md) + - [v1_device_claim_t](docs/v1_device_claim.md) + - [v1_device_claim_configuration_t](docs/v1_device_claim_configuration.md) + - [v1_device_class_t](docs/v1_device_class.md) + - [v1_device_class_configuration_t](docs/v1_device_class_configuration.md) + - [v1_device_class_list_t](docs/v1_device_class_list.md) + - [v1_device_class_spec_t](docs/v1_device_class_spec.md) + - [v1_device_constraint_t](docs/v1_device_constraint.md) + - [v1_device_counter_consumption_t](docs/v1_device_counter_consumption.md) + - [v1_device_request_t](docs/v1_device_request.md) + - [v1_device_request_allocation_result_t](docs/v1_device_request_allocation_result.md) + - [v1_device_selector_t](docs/v1_device_selector.md) + - [v1_device_sub_request_t](docs/v1_device_sub_request.md) + - [v1_device_taint_t](docs/v1_device_taint.md) + - [v1_device_toleration_t](docs/v1_device_toleration.md) - [v1_downward_api_projection_t](docs/v1_downward_api_projection.md) - [v1_downward_api_volume_file_t](docs/v1_downward_api_volume_file.md) - [v1_downward_api_volume_source_t](docs/v1_downward_api_volume_source.md) @@ -1004,11 +1127,15 @@ Category | Method | HTTP request | Description - [v1_ephemeral_volume_source_t](docs/v1_ephemeral_volume_source.md) - [v1_event_source_t](docs/v1_event_source.md) - [v1_eviction_t](docs/v1_eviction.md) + - [v1_exact_device_request_t](docs/v1_exact_device_request.md) - [v1_exec_action_t](docs/v1_exec_action.md) - [v1_exempt_priority_level_configuration_t](docs/v1_exempt_priority_level_configuration.md) - [v1_expression_warning_t](docs/v1_expression_warning.md) - [v1_external_documentation_t](docs/v1_external_documentation.md) - [v1_fc_volume_source_t](docs/v1_fc_volume_source.md) + - [v1_field_selector_attributes_t](docs/v1_field_selector_attributes.md) + - [v1_field_selector_requirement_t](docs/v1_field_selector_requirement.md) + - [v1_file_key_selector_t](docs/v1_file_key_selector.md) - [v1_flex_persistent_volume_source_t](docs/v1_flex_persistent_volume_source.md) - [v1_flex_volume_source_t](docs/v1_flex_volume_source.md) - [v1_flocker_volume_source_t](docs/v1_flocker_volume_source.md) @@ -1018,6 +1145,7 @@ Category | Method | HTTP request | Description - [v1_flow_schema_list_t](docs/v1_flow_schema_list.md) - [v1_flow_schema_spec_t](docs/v1_flow_schema_spec.md) - [v1_flow_schema_status_t](docs/v1_flow_schema_status.md) + - [v1_for_node_t](docs/v1_for_node.md) - [v1_for_zone_t](docs/v1_for_zone.md) - [v1_gce_persistent_disk_volume_source_t](docs/v1_gce_persistent_disk_volume_source.md) - [v1_git_repo_volume_source_t](docs/v1_git_repo_volume_source.md) @@ -1037,6 +1165,7 @@ Category | Method | HTTP request | Description - [v1_http_header_t](docs/v1_http_header.md) - [v1_http_ingress_path_t](docs/v1_http_ingress_path.md) - [v1_http_ingress_rule_value_t](docs/v1_http_ingress_rule_value.md) + - [v1_image_volume_source_t](docs/v1_image_volume_source.md) - [v1_ingress_t](docs/v1_ingress.md) - [v1_ingress_backend_t](docs/v1_ingress_backend.md) - [v1_ingress_class_t](docs/v1_ingress_class.md) @@ -1052,6 +1181,9 @@ Category | Method | HTTP request | Description - [v1_ingress_spec_t](docs/v1_ingress_spec.md) - [v1_ingress_status_t](docs/v1_ingress_status.md) - [v1_ingress_tls_t](docs/v1_ingress_tls.md) + - [v1_ip_address_t](docs/v1_ip_address.md) + - [v1_ip_address_list_t](docs/v1_ip_address_list.md) + - [v1_ip_address_spec_t](docs/v1_ip_address_spec.md) - [v1_ip_block_t](docs/v1_ip_block.md) - [v1_iscsi_persistent_volume_source_t](docs/v1_iscsi_persistent_volume_source.md) - [v1_iscsi_volume_source_t](docs/v1_iscsi_volume_source.md) @@ -1064,6 +1196,7 @@ Category | Method | HTTP request | Description - [v1_json_schema_props_t](docs/v1_json_schema_props.md) - [v1_key_to_path_t](docs/v1_key_to_path.md) - [v1_label_selector_t](docs/v1_label_selector.md) + - [v1_label_selector_attributes_t](docs/v1_label_selector_attributes.md) - [v1_label_selector_requirement_t](docs/v1_label_selector_requirement.md) - [v1_lease_t](docs/v1_lease.md) - [v1_lease_list_t](docs/v1_lease_list.md) @@ -1076,6 +1209,7 @@ Category | Method | HTTP request | Description - [v1_limit_range_spec_t](docs/v1_limit_range_spec.md) - [v1_limit_response_t](docs/v1_limit_response.md) - [v1_limited_priority_level_configuration_t](docs/v1_limited_priority_level_configuration.md) + - [v1_linux_container_user_t](docs/v1_linux_container_user.md) - [v1_list_meta_t](docs/v1_list_meta.md) - [v1_load_balancer_ingress_t](docs/v1_load_balancer_ingress.md) - [v1_load_balancer_status_t](docs/v1_load_balancer_status.md) @@ -1095,6 +1229,7 @@ Category | Method | HTTP request | Description - [v1_namespace_list_t](docs/v1_namespace_list.md) - [v1_namespace_spec_t](docs/v1_namespace_spec.md) - [v1_namespace_status_t](docs/v1_namespace_status.md) + - [v1_network_device_data_t](docs/v1_network_device_data.md) - [v1_network_policy_t](docs/v1_network_policy.md) - [v1_network_policy_egress_rule_t](docs/v1_network_policy_egress_rule.md) - [v1_network_policy_ingress_rule_t](docs/v1_network_policy_ingress_rule.md) @@ -1110,6 +1245,7 @@ Category | Method | HTTP request | Description - [v1_node_config_source_t](docs/v1_node_config_source.md) - [v1_node_config_status_t](docs/v1_node_config_status.md) - [v1_node_daemon_endpoints_t](docs/v1_node_daemon_endpoints.md) + - [v1_node_features_t](docs/v1_node_features.md) - [v1_node_list_t](docs/v1_node_list.md) - [v1_node_runtime_handler_t](docs/v1_node_runtime_handler.md) - [v1_node_runtime_handler_features_t](docs/v1_node_runtime_handler_features.md) @@ -1118,6 +1254,7 @@ Category | Method | HTTP request | Description - [v1_node_selector_term_t](docs/v1_node_selector_term.md) - [v1_node_spec_t](docs/v1_node_spec.md) - [v1_node_status_t](docs/v1_node_status.md) + - [v1_node_swap_status_t](docs/v1_node_swap_status.md) - [v1_node_system_info_t](docs/v1_node_system_info.md) - [v1_non_resource_attributes_t](docs/v1_non_resource_attributes.md) - [v1_non_resource_policy_rule_t](docs/v1_non_resource_policy_rule.md) @@ -1125,10 +1262,12 @@ Category | Method | HTTP request | Description - [v1_object_field_selector_t](docs/v1_object_field_selector.md) - [v1_object_meta_t](docs/v1_object_meta.md) - [v1_object_reference_t](docs/v1_object_reference.md) + - [v1_opaque_device_configuration_t](docs/v1_opaque_device_configuration.md) - [v1_overhead_t](docs/v1_overhead.md) - [v1_owner_reference_t](docs/v1_owner_reference.md) - [v1_param_kind_t](docs/v1_param_kind.md) - [v1_param_ref_t](docs/v1_param_ref.md) + - [v1_parent_reference_t](docs/v1_parent_reference.md) - [v1_persistent_volume_t](docs/v1_persistent_volume.md) - [v1_persistent_volume_claim_t](docs/v1_persistent_volume_claim.md) - [v1_persistent_volume_claim_condition_t](docs/v1_persistent_volume_claim_condition.md) @@ -1145,6 +1284,7 @@ Category | Method | HTTP request | Description - [v1_pod_affinity_t](docs/v1_pod_affinity.md) - [v1_pod_affinity_term_t](docs/v1_pod_affinity_term.md) - [v1_pod_anti_affinity_t](docs/v1_pod_anti_affinity.md) + - [v1_pod_certificate_projection_t](docs/v1_pod_certificate_projection.md) - [v1_pod_condition_t](docs/v1_pod_condition.md) - [v1_pod_disruption_budget_t](docs/v1_pod_disruption_budget.md) - [v1_pod_disruption_budget_list_t](docs/v1_pod_disruption_budget_list.md) @@ -1152,6 +1292,7 @@ Category | Method | HTTP request | Description - [v1_pod_disruption_budget_status_t](docs/v1_pod_disruption_budget_status.md) - [v1_pod_dns_config_t](docs/v1_pod_dns_config.md) - [v1_pod_dns_config_option_t](docs/v1_pod_dns_config_option.md) + - [v1_pod_extended_resource_claim_status_t](docs/v1_pod_extended_resource_claim_status.md) - [v1_pod_failure_policy_t](docs/v1_pod_failure_policy.md) - [v1_pod_failure_policy_on_exit_codes_requirement_t](docs/v1_pod_failure_policy_on_exit_codes_requirement.md) - [v1_pod_failure_policy_on_pod_conditions_pattern_t](docs/v1_pod_failure_policy_on_pod_conditions_pattern.md) @@ -1200,15 +1341,27 @@ Category | Method | HTTP request | Description - [v1_replication_controller_spec_t](docs/v1_replication_controller_spec.md) - [v1_replication_controller_status_t](docs/v1_replication_controller_status.md) - [v1_resource_attributes_t](docs/v1_resource_attributes.md) - - [v1_resource_claim_t](docs/v1_resource_claim.md) + - [v1_resource_claim_consumer_reference_t](docs/v1_resource_claim_consumer_reference.md) + - [v1_resource_claim_list_t](docs/v1_resource_claim_list.md) + - [v1_resource_claim_spec_t](docs/v1_resource_claim_spec.md) + - [v1_resource_claim_status_t](docs/v1_resource_claim_status.md) + - [v1_resource_claim_template_t](docs/v1_resource_claim_template.md) + - [v1_resource_claim_template_list_t](docs/v1_resource_claim_template_list.md) + - [v1_resource_claim_template_spec_t](docs/v1_resource_claim_template_spec.md) - [v1_resource_field_selector_t](docs/v1_resource_field_selector.md) + - [v1_resource_health_t](docs/v1_resource_health.md) - [v1_resource_policy_rule_t](docs/v1_resource_policy_rule.md) + - [v1_resource_pool_t](docs/v1_resource_pool.md) - [v1_resource_quota_t](docs/v1_resource_quota.md) - [v1_resource_quota_list_t](docs/v1_resource_quota_list.md) - [v1_resource_quota_spec_t](docs/v1_resource_quota_spec.md) - [v1_resource_quota_status_t](docs/v1_resource_quota_status.md) - [v1_resource_requirements_t](docs/v1_resource_requirements.md) - [v1_resource_rule_t](docs/v1_resource_rule.md) + - [v1_resource_slice_t](docs/v1_resource_slice.md) + - [v1_resource_slice_list_t](docs/v1_resource_slice_list.md) + - [v1_resource_slice_spec_t](docs/v1_resource_slice_spec.md) + - [v1_resource_status_t](docs/v1_resource_status.md) - [v1_role_t](docs/v1_role.md) - [v1_role_binding_t](docs/v1_role_binding.md) - [v1_role_binding_list_t](docs/v1_role_binding_list.md) @@ -1252,6 +1405,10 @@ Category | Method | HTTP request | Description - [v1_service_account_subject_t](docs/v1_service_account_subject.md) - [v1_service_account_token_projection_t](docs/v1_service_account_token_projection.md) - [v1_service_backend_port_t](docs/v1_service_backend_port.md) + - [v1_service_cidr_t](docs/v1_service_cidr.md) + - [v1_service_cidr_list_t](docs/v1_service_cidr_list.md) + - [v1_service_cidr_spec_t](docs/v1_service_cidr_spec.md) + - [v1_service_cidr_status_t](docs/v1_service_cidr_status.md) - [v1_service_list_t](docs/v1_service_list.md) - [v1_service_port_t](docs/v1_service_port.md) - [v1_service_spec_t](docs/v1_service_spec.md) @@ -1316,6 +1473,8 @@ Category | Method | HTTP request | Description - [v1_volume_attachment_source_t](docs/v1_volume_attachment_source.md) - [v1_volume_attachment_spec_t](docs/v1_volume_attachment_spec.md) - [v1_volume_attachment_status_t](docs/v1_volume_attachment_status.md) + - [v1_volume_attributes_class_t](docs/v1_volume_attributes_class.md) + - [v1_volume_attributes_class_list_t](docs/v1_volume_attributes_class_list.md) - [v1_volume_device_t](docs/v1_volume_device.md) - [v1_volume_error_t](docs/v1_volume_error.md) - [v1_volume_mount_t](docs/v1_volume_mount.md) @@ -1329,29 +1488,30 @@ Category | Method | HTTP request | Description - [v1_webhook_conversion_t](docs/v1_webhook_conversion.md) - [v1_weighted_pod_affinity_term_t](docs/v1_weighted_pod_affinity_term.md) - [v1_windows_security_context_options_t](docs/v1_windows_security_context_options.md) - - [v1alpha1_audit_annotation_t](docs/v1alpha1_audit_annotation.md) + - [v1alpha1_apply_configuration_t](docs/v1alpha1_apply_configuration.md) - [v1alpha1_cluster_trust_bundle_t](docs/v1alpha1_cluster_trust_bundle.md) - [v1alpha1_cluster_trust_bundle_list_t](docs/v1alpha1_cluster_trust_bundle_list.md) - [v1alpha1_cluster_trust_bundle_spec_t](docs/v1alpha1_cluster_trust_bundle_spec.md) - - [v1alpha1_expression_warning_t](docs/v1alpha1_expression_warning.md) - [v1alpha1_group_version_resource_t](docs/v1alpha1_group_version_resource.md) - - [v1alpha1_ip_address_t](docs/v1alpha1_ip_address.md) - - [v1alpha1_ip_address_list_t](docs/v1alpha1_ip_address_list.md) - - [v1alpha1_ip_address_spec_t](docs/v1alpha1_ip_address_spec.md) + - [v1alpha1_json_patch_t](docs/v1alpha1_json_patch.md) - [v1alpha1_match_condition_t](docs/v1alpha1_match_condition.md) - [v1alpha1_match_resources_t](docs/v1alpha1_match_resources.md) - [v1alpha1_migration_condition_t](docs/v1alpha1_migration_condition.md) + - [v1alpha1_mutating_admission_policy_t](docs/v1alpha1_mutating_admission_policy.md) + - [v1alpha1_mutating_admission_policy_binding_t](docs/v1alpha1_mutating_admission_policy_binding.md) + - [v1alpha1_mutating_admission_policy_binding_list_t](docs/v1alpha1_mutating_admission_policy_binding_list.md) + - [v1alpha1_mutating_admission_policy_binding_spec_t](docs/v1alpha1_mutating_admission_policy_binding_spec.md) + - [v1alpha1_mutating_admission_policy_list_t](docs/v1alpha1_mutating_admission_policy_list.md) + - [v1alpha1_mutating_admission_policy_spec_t](docs/v1alpha1_mutating_admission_policy_spec.md) + - [v1alpha1_mutation_t](docs/v1alpha1_mutation.md) - [v1alpha1_named_rule_with_operations_t](docs/v1alpha1_named_rule_with_operations.md) - [v1alpha1_param_kind_t](docs/v1alpha1_param_kind.md) - [v1alpha1_param_ref_t](docs/v1alpha1_param_ref.md) - - [v1alpha1_parent_reference_t](docs/v1alpha1_parent_reference.md) - - [v1alpha1_self_subject_review_t](docs/v1alpha1_self_subject_review.md) - - [v1alpha1_self_subject_review_status_t](docs/v1alpha1_self_subject_review_status.md) + - [v1alpha1_pod_certificate_request_t](docs/v1alpha1_pod_certificate_request.md) + - [v1alpha1_pod_certificate_request_list_t](docs/v1alpha1_pod_certificate_request_list.md) + - [v1alpha1_pod_certificate_request_spec_t](docs/v1alpha1_pod_certificate_request_spec.md) + - [v1alpha1_pod_certificate_request_status_t](docs/v1alpha1_pod_certificate_request_status.md) - [v1alpha1_server_storage_version_t](docs/v1alpha1_server_storage_version.md) - - [v1alpha1_service_cidr_t](docs/v1alpha1_service_cidr.md) - - [v1alpha1_service_cidr_list_t](docs/v1alpha1_service_cidr_list.md) - - [v1alpha1_service_cidr_spec_t](docs/v1alpha1_service_cidr_spec.md) - - [v1alpha1_service_cidr_status_t](docs/v1alpha1_service_cidr_status.md) - [v1alpha1_storage_version_t](docs/v1alpha1_storage_version.md) - [v1alpha1_storage_version_condition_t](docs/v1alpha1_storage_version_condition.md) - [v1alpha1_storage_version_list_t](docs/v1alpha1_storage_version_list.md) @@ -1360,99 +1520,134 @@ Category | Method | HTTP request | Description - [v1alpha1_storage_version_migration_spec_t](docs/v1alpha1_storage_version_migration_spec.md) - [v1alpha1_storage_version_migration_status_t](docs/v1alpha1_storage_version_migration_status.md) - [v1alpha1_storage_version_status_t](docs/v1alpha1_storage_version_status.md) - - [v1alpha1_type_checking_t](docs/v1alpha1_type_checking.md) - - [v1alpha1_validating_admission_policy_t](docs/v1alpha1_validating_admission_policy.md) - - [v1alpha1_validating_admission_policy_binding_t](docs/v1alpha1_validating_admission_policy_binding.md) - - [v1alpha1_validating_admission_policy_binding_list_t](docs/v1alpha1_validating_admission_policy_binding_list.md) - - [v1alpha1_validating_admission_policy_binding_spec_t](docs/v1alpha1_validating_admission_policy_binding_spec.md) - - [v1alpha1_validating_admission_policy_list_t](docs/v1alpha1_validating_admission_policy_list.md) - - [v1alpha1_validating_admission_policy_spec_t](docs/v1alpha1_validating_admission_policy_spec.md) - - [v1alpha1_validating_admission_policy_status_t](docs/v1alpha1_validating_admission_policy_status.md) - - [v1alpha1_validation_t](docs/v1alpha1_validation.md) - [v1alpha1_variable_t](docs/v1alpha1_variable.md) - [v1alpha1_volume_attributes_class_t](docs/v1alpha1_volume_attributes_class.md) - [v1alpha1_volume_attributes_class_list_t](docs/v1alpha1_volume_attributes_class_list.md) - - [v1alpha2_allocation_result_t](docs/v1alpha2_allocation_result.md) - - [v1alpha2_driver_allocation_result_t](docs/v1alpha2_driver_allocation_result.md) - - [v1alpha2_driver_requests_t](docs/v1alpha2_driver_requests.md) - - [v1alpha2_named_resources_allocation_result_t](docs/v1alpha2_named_resources_allocation_result.md) - - [v1alpha2_named_resources_attribute_t](docs/v1alpha2_named_resources_attribute.md) - - [v1alpha2_named_resources_filter_t](docs/v1alpha2_named_resources_filter.md) - - [v1alpha2_named_resources_instance_t](docs/v1alpha2_named_resources_instance.md) - - [v1alpha2_named_resources_int_slice_t](docs/v1alpha2_named_resources_int_slice.md) - - [v1alpha2_named_resources_request_t](docs/v1alpha2_named_resources_request.md) - - [v1alpha2_named_resources_resources_t](docs/v1alpha2_named_resources_resources.md) - - [v1alpha2_named_resources_string_slice_t](docs/v1alpha2_named_resources_string_slice.md) - - [v1alpha2_pod_scheduling_context_t](docs/v1alpha2_pod_scheduling_context.md) - - [v1alpha2_pod_scheduling_context_list_t](docs/v1alpha2_pod_scheduling_context_list.md) - - [v1alpha2_pod_scheduling_context_spec_t](docs/v1alpha2_pod_scheduling_context_spec.md) - - [v1alpha2_pod_scheduling_context_status_t](docs/v1alpha2_pod_scheduling_context_status.md) - - [v1alpha2_resource_claim_t](docs/v1alpha2_resource_claim.md) - - [v1alpha2_resource_claim_consumer_reference_t](docs/v1alpha2_resource_claim_consumer_reference.md) - - [v1alpha2_resource_claim_list_t](docs/v1alpha2_resource_claim_list.md) - - [v1alpha2_resource_claim_parameters_t](docs/v1alpha2_resource_claim_parameters.md) - - [v1alpha2_resource_claim_parameters_list_t](docs/v1alpha2_resource_claim_parameters_list.md) - - [v1alpha2_resource_claim_parameters_reference_t](docs/v1alpha2_resource_claim_parameters_reference.md) - - [v1alpha2_resource_claim_scheduling_status_t](docs/v1alpha2_resource_claim_scheduling_status.md) - - [v1alpha2_resource_claim_spec_t](docs/v1alpha2_resource_claim_spec.md) - - [v1alpha2_resource_claim_status_t](docs/v1alpha2_resource_claim_status.md) - - [v1alpha2_resource_claim_template_t](docs/v1alpha2_resource_claim_template.md) - - [v1alpha2_resource_claim_template_list_t](docs/v1alpha2_resource_claim_template_list.md) - - [v1alpha2_resource_claim_template_spec_t](docs/v1alpha2_resource_claim_template_spec.md) - - [v1alpha2_resource_class_t](docs/v1alpha2_resource_class.md) - - [v1alpha2_resource_class_list_t](docs/v1alpha2_resource_class_list.md) - - [v1alpha2_resource_class_parameters_t](docs/v1alpha2_resource_class_parameters.md) - - [v1alpha2_resource_class_parameters_list_t](docs/v1alpha2_resource_class_parameters_list.md) - - [v1alpha2_resource_class_parameters_reference_t](docs/v1alpha2_resource_class_parameters_reference.md) - - [v1alpha2_resource_filter_t](docs/v1alpha2_resource_filter.md) - - [v1alpha2_resource_handle_t](docs/v1alpha2_resource_handle.md) - - [v1alpha2_resource_request_t](docs/v1alpha2_resource_request.md) - - [v1alpha2_resource_slice_t](docs/v1alpha2_resource_slice.md) - - [v1alpha2_resource_slice_list_t](docs/v1alpha2_resource_slice_list.md) - - [v1alpha2_structured_resource_handle_t](docs/v1alpha2_structured_resource_handle.md) - - [v1alpha2_vendor_parameters_t](docs/v1alpha2_vendor_parameters.md) - - [v1beta1_audit_annotation_t](docs/v1beta1_audit_annotation.md) - - [v1beta1_expression_warning_t](docs/v1beta1_expression_warning.md) + - [v1alpha2_lease_candidate_t](docs/v1alpha2_lease_candidate.md) + - [v1alpha2_lease_candidate_list_t](docs/v1alpha2_lease_candidate_list.md) + - [v1alpha2_lease_candidate_spec_t](docs/v1alpha2_lease_candidate_spec.md) + - [v1alpha3_cel_device_selector_t](docs/v1alpha3_cel_device_selector.md) + - [v1alpha3_device_selector_t](docs/v1alpha3_device_selector.md) + - [v1alpha3_device_taint_t](docs/v1alpha3_device_taint.md) + - [v1alpha3_device_taint_rule_t](docs/v1alpha3_device_taint_rule.md) + - [v1alpha3_device_taint_rule_list_t](docs/v1alpha3_device_taint_rule_list.md) + - [v1alpha3_device_taint_rule_spec_t](docs/v1alpha3_device_taint_rule_spec.md) + - [v1alpha3_device_taint_selector_t](docs/v1alpha3_device_taint_selector.md) + - [v1beta1_allocated_device_status_t](docs/v1beta1_allocated_device_status.md) + - [v1beta1_allocation_result_t](docs/v1beta1_allocation_result.md) + - [v1beta1_apply_configuration_t](docs/v1beta1_apply_configuration.md) + - [v1beta1_basic_device_t](docs/v1beta1_basic_device.md) + - [v1beta1_capacity_request_policy_t](docs/v1beta1_capacity_request_policy.md) + - [v1beta1_capacity_request_policy_range_t](docs/v1beta1_capacity_request_policy_range.md) + - [v1beta1_capacity_requirements_t](docs/v1beta1_capacity_requirements.md) + - [v1beta1_cel_device_selector_t](docs/v1beta1_cel_device_selector.md) + - [v1beta1_cluster_trust_bundle_t](docs/v1beta1_cluster_trust_bundle.md) + - [v1beta1_cluster_trust_bundle_list_t](docs/v1beta1_cluster_trust_bundle_list.md) + - [v1beta1_cluster_trust_bundle_spec_t](docs/v1beta1_cluster_trust_bundle_spec.md) + - [v1beta1_counter_t](docs/v1beta1_counter.md) + - [v1beta1_counter_set_t](docs/v1beta1_counter_set.md) + - [v1beta1_device_t](docs/v1beta1_device.md) + - [v1beta1_device_allocation_configuration_t](docs/v1beta1_device_allocation_configuration.md) + - [v1beta1_device_allocation_result_t](docs/v1beta1_device_allocation_result.md) + - [v1beta1_device_attribute_t](docs/v1beta1_device_attribute.md) + - [v1beta1_device_capacity_t](docs/v1beta1_device_capacity.md) + - [v1beta1_device_claim_t](docs/v1beta1_device_claim.md) + - [v1beta1_device_claim_configuration_t](docs/v1beta1_device_claim_configuration.md) + - [v1beta1_device_class_t](docs/v1beta1_device_class.md) + - [v1beta1_device_class_configuration_t](docs/v1beta1_device_class_configuration.md) + - [v1beta1_device_class_list_t](docs/v1beta1_device_class_list.md) + - [v1beta1_device_class_spec_t](docs/v1beta1_device_class_spec.md) + - [v1beta1_device_constraint_t](docs/v1beta1_device_constraint.md) + - [v1beta1_device_counter_consumption_t](docs/v1beta1_device_counter_consumption.md) + - [v1beta1_device_request_t](docs/v1beta1_device_request.md) + - [v1beta1_device_request_allocation_result_t](docs/v1beta1_device_request_allocation_result.md) + - [v1beta1_device_selector_t](docs/v1beta1_device_selector.md) + - [v1beta1_device_sub_request_t](docs/v1beta1_device_sub_request.md) + - [v1beta1_device_taint_t](docs/v1beta1_device_taint.md) + - [v1beta1_device_toleration_t](docs/v1beta1_device_toleration.md) + - [v1beta1_ip_address_t](docs/v1beta1_ip_address.md) + - [v1beta1_ip_address_list_t](docs/v1beta1_ip_address_list.md) + - [v1beta1_ip_address_spec_t](docs/v1beta1_ip_address_spec.md) + - [v1beta1_json_patch_t](docs/v1beta1_json_patch.md) + - [v1beta1_lease_candidate_t](docs/v1beta1_lease_candidate.md) + - [v1beta1_lease_candidate_list_t](docs/v1beta1_lease_candidate_list.md) + - [v1beta1_lease_candidate_spec_t](docs/v1beta1_lease_candidate_spec.md) - [v1beta1_match_condition_t](docs/v1beta1_match_condition.md) - [v1beta1_match_resources_t](docs/v1beta1_match_resources.md) + - [v1beta1_mutating_admission_policy_t](docs/v1beta1_mutating_admission_policy.md) + - [v1beta1_mutating_admission_policy_binding_t](docs/v1beta1_mutating_admission_policy_binding.md) + - [v1beta1_mutating_admission_policy_binding_list_t](docs/v1beta1_mutating_admission_policy_binding_list.md) + - [v1beta1_mutating_admission_policy_binding_spec_t](docs/v1beta1_mutating_admission_policy_binding_spec.md) + - [v1beta1_mutating_admission_policy_list_t](docs/v1beta1_mutating_admission_policy_list.md) + - [v1beta1_mutating_admission_policy_spec_t](docs/v1beta1_mutating_admission_policy_spec.md) + - [v1beta1_mutation_t](docs/v1beta1_mutation.md) - [v1beta1_named_rule_with_operations_t](docs/v1beta1_named_rule_with_operations.md) + - [v1beta1_network_device_data_t](docs/v1beta1_network_device_data.md) + - [v1beta1_opaque_device_configuration_t](docs/v1beta1_opaque_device_configuration.md) - [v1beta1_param_kind_t](docs/v1beta1_param_kind.md) - [v1beta1_param_ref_t](docs/v1beta1_param_ref.md) - - [v1beta1_self_subject_review_t](docs/v1beta1_self_subject_review.md) - - [v1beta1_self_subject_review_status_t](docs/v1beta1_self_subject_review_status.md) - - [v1beta1_type_checking_t](docs/v1beta1_type_checking.md) - - [v1beta1_validating_admission_policy_t](docs/v1beta1_validating_admission_policy.md) - - [v1beta1_validating_admission_policy_binding_t](docs/v1beta1_validating_admission_policy_binding.md) - - [v1beta1_validating_admission_policy_binding_list_t](docs/v1beta1_validating_admission_policy_binding_list.md) - - [v1beta1_validating_admission_policy_binding_spec_t](docs/v1beta1_validating_admission_policy_binding_spec.md) - - [v1beta1_validating_admission_policy_list_t](docs/v1beta1_validating_admission_policy_list.md) - - [v1beta1_validating_admission_policy_spec_t](docs/v1beta1_validating_admission_policy_spec.md) - - [v1beta1_validating_admission_policy_status_t](docs/v1beta1_validating_admission_policy_status.md) - - [v1beta1_validation_t](docs/v1beta1_validation.md) + - [v1beta1_parent_reference_t](docs/v1beta1_parent_reference.md) + - [v1beta1_resource_claim_t](docs/v1beta1_resource_claim.md) + - [v1beta1_resource_claim_consumer_reference_t](docs/v1beta1_resource_claim_consumer_reference.md) + - [v1beta1_resource_claim_list_t](docs/v1beta1_resource_claim_list.md) + - [v1beta1_resource_claim_spec_t](docs/v1beta1_resource_claim_spec.md) + - [v1beta1_resource_claim_status_t](docs/v1beta1_resource_claim_status.md) + - [v1beta1_resource_claim_template_t](docs/v1beta1_resource_claim_template.md) + - [v1beta1_resource_claim_template_list_t](docs/v1beta1_resource_claim_template_list.md) + - [v1beta1_resource_claim_template_spec_t](docs/v1beta1_resource_claim_template_spec.md) + - [v1beta1_resource_pool_t](docs/v1beta1_resource_pool.md) + - [v1beta1_resource_slice_t](docs/v1beta1_resource_slice.md) + - [v1beta1_resource_slice_list_t](docs/v1beta1_resource_slice_list.md) + - [v1beta1_resource_slice_spec_t](docs/v1beta1_resource_slice_spec.md) + - [v1beta1_service_cidr_t](docs/v1beta1_service_cidr.md) + - [v1beta1_service_cidr_list_t](docs/v1beta1_service_cidr_list.md) + - [v1beta1_service_cidr_spec_t](docs/v1beta1_service_cidr_spec.md) + - [v1beta1_service_cidr_status_t](docs/v1beta1_service_cidr_status.md) - [v1beta1_variable_t](docs/v1beta1_variable.md) - - [v1beta3_exempt_priority_level_configuration_t](docs/v1beta3_exempt_priority_level_configuration.md) - - [v1beta3_flow_distinguisher_method_t](docs/v1beta3_flow_distinguisher_method.md) - - [v1beta3_flow_schema_t](docs/v1beta3_flow_schema.md) - - [v1beta3_flow_schema_condition_t](docs/v1beta3_flow_schema_condition.md) - - [v1beta3_flow_schema_list_t](docs/v1beta3_flow_schema_list.md) - - [v1beta3_flow_schema_spec_t](docs/v1beta3_flow_schema_spec.md) - - [v1beta3_flow_schema_status_t](docs/v1beta3_flow_schema_status.md) - - [v1beta3_group_subject_t](docs/v1beta3_group_subject.md) - - [v1beta3_limit_response_t](docs/v1beta3_limit_response.md) - - [v1beta3_limited_priority_level_configuration_t](docs/v1beta3_limited_priority_level_configuration.md) - - [v1beta3_non_resource_policy_rule_t](docs/v1beta3_non_resource_policy_rule.md) - - [v1beta3_policy_rules_with_subjects_t](docs/v1beta3_policy_rules_with_subjects.md) - - [v1beta3_priority_level_configuration_t](docs/v1beta3_priority_level_configuration.md) - - [v1beta3_priority_level_configuration_condition_t](docs/v1beta3_priority_level_configuration_condition.md) - - [v1beta3_priority_level_configuration_list_t](docs/v1beta3_priority_level_configuration_list.md) - - [v1beta3_priority_level_configuration_reference_t](docs/v1beta3_priority_level_configuration_reference.md) - - [v1beta3_priority_level_configuration_spec_t](docs/v1beta3_priority_level_configuration_spec.md) - - [v1beta3_priority_level_configuration_status_t](docs/v1beta3_priority_level_configuration_status.md) - - [v1beta3_queuing_configuration_t](docs/v1beta3_queuing_configuration.md) - - [v1beta3_resource_policy_rule_t](docs/v1beta3_resource_policy_rule.md) - - [v1beta3_service_account_subject_t](docs/v1beta3_service_account_subject.md) - - [v1beta3_subject_t](docs/v1beta3_subject.md) - - [v1beta3_user_subject_t](docs/v1beta3_user_subject.md) + - [v1beta1_volume_attributes_class_t](docs/v1beta1_volume_attributes_class.md) + - [v1beta1_volume_attributes_class_list_t](docs/v1beta1_volume_attributes_class_list.md) + - [v1beta2_allocated_device_status_t](docs/v1beta2_allocated_device_status.md) + - [v1beta2_allocation_result_t](docs/v1beta2_allocation_result.md) + - [v1beta2_capacity_request_policy_t](docs/v1beta2_capacity_request_policy.md) + - [v1beta2_capacity_request_policy_range_t](docs/v1beta2_capacity_request_policy_range.md) + - [v1beta2_capacity_requirements_t](docs/v1beta2_capacity_requirements.md) + - [v1beta2_cel_device_selector_t](docs/v1beta2_cel_device_selector.md) + - [v1beta2_counter_t](docs/v1beta2_counter.md) + - [v1beta2_counter_set_t](docs/v1beta2_counter_set.md) + - [v1beta2_device_t](docs/v1beta2_device.md) + - [v1beta2_device_allocation_configuration_t](docs/v1beta2_device_allocation_configuration.md) + - [v1beta2_device_allocation_result_t](docs/v1beta2_device_allocation_result.md) + - [v1beta2_device_attribute_t](docs/v1beta2_device_attribute.md) + - [v1beta2_device_capacity_t](docs/v1beta2_device_capacity.md) + - [v1beta2_device_claim_t](docs/v1beta2_device_claim.md) + - [v1beta2_device_claim_configuration_t](docs/v1beta2_device_claim_configuration.md) + - [v1beta2_device_class_t](docs/v1beta2_device_class.md) + - [v1beta2_device_class_configuration_t](docs/v1beta2_device_class_configuration.md) + - [v1beta2_device_class_list_t](docs/v1beta2_device_class_list.md) + - [v1beta2_device_class_spec_t](docs/v1beta2_device_class_spec.md) + - [v1beta2_device_constraint_t](docs/v1beta2_device_constraint.md) + - [v1beta2_device_counter_consumption_t](docs/v1beta2_device_counter_consumption.md) + - [v1beta2_device_request_t](docs/v1beta2_device_request.md) + - [v1beta2_device_request_allocation_result_t](docs/v1beta2_device_request_allocation_result.md) + - [v1beta2_device_selector_t](docs/v1beta2_device_selector.md) + - [v1beta2_device_sub_request_t](docs/v1beta2_device_sub_request.md) + - [v1beta2_device_taint_t](docs/v1beta2_device_taint.md) + - [v1beta2_device_toleration_t](docs/v1beta2_device_toleration.md) + - [v1beta2_exact_device_request_t](docs/v1beta2_exact_device_request.md) + - [v1beta2_network_device_data_t](docs/v1beta2_network_device_data.md) + - [v1beta2_opaque_device_configuration_t](docs/v1beta2_opaque_device_configuration.md) + - [v1beta2_resource_claim_t](docs/v1beta2_resource_claim.md) + - [v1beta2_resource_claim_consumer_reference_t](docs/v1beta2_resource_claim_consumer_reference.md) + - [v1beta2_resource_claim_list_t](docs/v1beta2_resource_claim_list.md) + - [v1beta2_resource_claim_spec_t](docs/v1beta2_resource_claim_spec.md) + - [v1beta2_resource_claim_status_t](docs/v1beta2_resource_claim_status.md) + - [v1beta2_resource_claim_template_t](docs/v1beta2_resource_claim_template.md) + - [v1beta2_resource_claim_template_list_t](docs/v1beta2_resource_claim_template_list.md) + - [v1beta2_resource_claim_template_spec_t](docs/v1beta2_resource_claim_template_spec.md) + - [v1beta2_resource_pool_t](docs/v1beta2_resource_pool.md) + - [v1beta2_resource_slice_t](docs/v1beta2_resource_slice.md) + - [v1beta2_resource_slice_list_t](docs/v1beta2_resource_slice_list.md) + - [v1beta2_resource_slice_spec_t](docs/v1beta2_resource_slice_spec.md) - [v2_container_resource_metric_source_t](docs/v2_container_resource_metric_source.md) - [v2_container_resource_metric_status_t](docs/v2_container_resource_metric_status.md) - [v2_cross_version_object_reference_t](docs/v2_cross_version_object_reference.md) diff --git a/kubernetes/api/AdmissionregistrationAPI.c b/kubernetes/api/AdmissionregistrationAPI.c index c32b3be0..1177331d 100644 --- a/kubernetes/api/AdmissionregistrationAPI.c +++ b/kubernetes/api/AdmissionregistrationAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "AdmissionregistrationAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ AdmissionregistrationAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/"); + @@ -42,6 +42,7 @@ AdmissionregistrationAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ AdmissionregistrationAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(AdmissionregistrationAPIlocalVarJSON); - cJSON_Delete(AdmissionregistrationAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(AdmissionregistrationAPIlocalVarJSON); + cJSON_Delete(AdmissionregistrationAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AdmissionregistrationV1API.c b/kubernetes/api/AdmissionregistrationV1API.c index 2b6369dd..daf822d5 100644 --- a/kubernetes/api/AdmissionregistrationV1API.c +++ b/kubernetes/api/AdmissionregistrationV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "AdmissionregistrationV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a MutatingWebhookConfiguration @@ -23,11 +20,14 @@ AdmissionregistrationV1API_createMutatingWebhookConfiguration(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations"); + @@ -84,13 +84,15 @@ AdmissionregistrationV1API_createMutatingWebhookConfiguration(apiClient_t *apiCl cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_mutating_webhook_configuration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ AdmissionregistrationV1API_createMutatingWebhookConfiguration(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ AdmissionregistrationV1API_createMutatingWebhookConfiguration(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_mutating_webhook_configuration_t *elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_mutating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -208,11 +214,14 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicy(apiClient_t *apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies"); + @@ -269,13 +278,15 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicy(apiClient_t *apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_validating_admission_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -284,6 +295,7 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicy(apiClient_t *apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -303,11 +315,14 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicy(apiClient_t *apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_t *elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -393,11 +408,14 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicyBinding(apiClient_t *a list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings"); + @@ -454,13 +472,15 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicyBinding(apiClient_t *a cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_validating_admission_policy_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -469,6 +489,7 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicyBinding(apiClient_t *a localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -488,11 +509,14 @@ AdmissionregistrationV1API_createValidatingAdmissionPolicyBinding(apiClient_t *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_binding_t *elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -578,11 +602,14 @@ AdmissionregistrationV1API_createValidatingWebhookConfiguration(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations"); + @@ -639,13 +666,15 @@ AdmissionregistrationV1API_createValidatingWebhookConfiguration(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_validating_webhook_configuration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -654,6 +683,7 @@ AdmissionregistrationV1API_createValidatingWebhookConfiguration(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -673,11 +703,14 @@ AdmissionregistrationV1API_createValidatingWebhookConfiguration(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_webhook_configuration_t *elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -755,7 +788,7 @@ AdmissionregistrationV1API_createValidatingWebhookConfiguration(apiClient_t *api // delete collection of MutatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -763,11 +796,14 @@ AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations"); + @@ -833,6 +869,19 @@ AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClien list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -937,13 +986,15 @@ AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -952,6 +1003,7 @@ AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -963,11 +1015,14 @@ AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1047,6 +1102,18 @@ AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClien keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1153,7 +1220,7 @@ AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClien // delete collection of ValidatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1161,11 +1228,14 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies"); + @@ -1231,6 +1301,19 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1335,13 +1418,15 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1350,6 +1435,7 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1361,11 +1447,14 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1445,6 +1534,18 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1551,7 +1652,7 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t // delete collection of ValidatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1559,11 +1660,14 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings"); + @@ -1629,6 +1733,19 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiC list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1733,13 +1850,15 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiC cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1748,6 +1867,7 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1759,11 +1879,14 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1843,6 +1966,18 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiC keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1949,7 +2084,7 @@ AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiC // delete collection of ValidatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1957,11 +2092,14 @@ AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations"); + @@ -2027,6 +2165,19 @@ AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiCli list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2131,13 +2282,15 @@ AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiCli cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2146,6 +2299,7 @@ AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2157,11 +2311,14 @@ AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2241,6 +2398,18 @@ AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiCli keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2347,7 +2516,7 @@ AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiCli // delete a MutatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2355,15 +2524,20 @@ AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2411,6 +2585,19 @@ AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiCl list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -2440,13 +2627,15 @@ AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiCl cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2455,6 +2644,7 @@ AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2470,11 +2660,14 @@ AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2531,6 +2724,18 @@ AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiCl keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -2565,7 +2770,7 @@ AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiCl // delete a ValidatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2573,15 +2778,20 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2629,6 +2839,19 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClien list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -2658,13 +2881,15 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2673,6 +2898,7 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2688,11 +2914,14 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2749,6 +2978,18 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClien keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -2783,7 +3024,7 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClien // delete a ValidatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2791,15 +3032,20 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *a list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2847,6 +3093,19 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *a list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -2876,13 +3135,15 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *a cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2891,6 +3152,7 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *a localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2906,11 +3168,14 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2967,6 +3232,18 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *a keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3001,7 +3278,7 @@ AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *a // delete a ValidatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3009,15 +3286,20 @@ AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3065,6 +3347,19 @@ AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *api list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3094,13 +3389,15 @@ AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3109,6 +3406,7 @@ AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3124,11 +3422,14 @@ AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3185,6 +3486,18 @@ AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *api keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3227,17 +3540,21 @@ AdmissionregistrationV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3246,6 +3563,7 @@ AdmissionregistrationV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3257,11 +3575,14 @@ AdmissionregistrationV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3294,11 +3615,14 @@ AdmissionregistrationV1API_listMutatingWebhookConfiguration(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations"); + @@ -3442,8 +3766,10 @@ AdmissionregistrationV1API_listMutatingWebhookConfiguration(apiClient_t *apiClie list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3452,6 +3778,7 @@ AdmissionregistrationV1API_listMutatingWebhookConfiguration(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3463,11 +3790,14 @@ AdmissionregistrationV1API_listMutatingWebhookConfiguration(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_mutating_webhook_configuration_list_t *elementToReturn = v1_mutating_webhook_configuration_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_mutating_webhook_configuration_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_mutating_webhook_configuration_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3632,11 +3962,14 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies"); + @@ -3780,8 +4113,10 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3790,6 +4125,7 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3801,11 +4137,14 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_list_t *elementToReturn = v1_validating_admission_policy_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3970,11 +4309,14 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicyBinding(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings"); + @@ -4118,8 +4460,10 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicyBinding(apiClient_t *api list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4128,6 +4472,7 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicyBinding(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4139,11 +4484,14 @@ AdmissionregistrationV1API_listValidatingAdmissionPolicyBinding(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_binding_list_t *elementToReturn = v1_validating_admission_policy_binding_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_binding_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_binding_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4308,11 +4656,14 @@ AdmissionregistrationV1API_listValidatingWebhookConfiguration(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations"); + @@ -4456,8 +4807,10 @@ AdmissionregistrationV1API_listValidatingWebhookConfiguration(apiClient_t *apiCl list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4466,6 +4819,7 @@ AdmissionregistrationV1API_listValidatingWebhookConfiguration(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4477,11 +4831,14 @@ AdmissionregistrationV1API_listValidatingWebhookConfiguration(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_webhook_configuration_list_t *elementToReturn = v1_validating_webhook_configuration_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_webhook_configuration_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_webhook_configuration_list_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4646,15 +5003,20 @@ AdmissionregistrationV1API_patchMutatingWebhookConfiguration(apiClient_t *apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4730,17 +5092,20 @@ AdmissionregistrationV1API_patchMutatingWebhookConfiguration(apiClient_t *apiCli cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4749,6 +5114,7 @@ AdmissionregistrationV1API_patchMutatingWebhookConfiguration(apiClient_t *apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -4764,11 +5130,14 @@ AdmissionregistrationV1API_patchMutatingWebhookConfiguration(apiClient_t *apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_mutating_webhook_configuration_t *elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_mutating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4867,15 +5236,20 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4951,17 +5325,20 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4970,6 +5347,7 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -4985,11 +5363,14 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_t *elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5088,15 +5469,20 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyBinding(apiClient_t *ap list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5172,17 +5558,20 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyBinding(apiClient_t *ap cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5191,6 +5580,7 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyBinding(apiClient_t *ap localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -5206,11 +5596,14 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyBinding(apiClient_t *ap // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_binding_t *elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5309,15 +5702,20 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyStatus(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5393,17 +5791,20 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyStatus(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5412,6 +5813,7 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyStatus(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -5427,11 +5829,14 @@ AdmissionregistrationV1API_patchValidatingAdmissionPolicyStatus(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_t *elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5530,15 +5935,20 @@ AdmissionregistrationV1API_patchValidatingWebhookConfiguration(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5614,17 +6024,20 @@ AdmissionregistrationV1API_patchValidatingWebhookConfiguration(apiClient_t *apiC cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5633,6 +6046,7 @@ AdmissionregistrationV1API_patchValidatingWebhookConfiguration(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -5648,11 +6062,14 @@ AdmissionregistrationV1API_patchValidatingWebhookConfiguration(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_webhook_configuration_t *elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5751,15 +6168,20 @@ AdmissionregistrationV1API_readMutatingWebhookConfiguration(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5784,6 +6206,7 @@ AdmissionregistrationV1API_readMutatingWebhookConfiguration(apiClient_t *apiClie list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5792,6 +6215,7 @@ AdmissionregistrationV1API_readMutatingWebhookConfiguration(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5803,11 +6227,14 @@ AdmissionregistrationV1API_readMutatingWebhookConfiguration(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_mutating_webhook_configuration_t *elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_mutating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5853,15 +6280,20 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5886,6 +6318,7 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5894,6 +6327,7 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5905,11 +6339,14 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_t *elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5955,15 +6392,20 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyBinding(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5988,6 +6430,7 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyBinding(apiClient_t *api list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5996,6 +6439,7 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyBinding(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6007,11 +6451,14 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyBinding(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_binding_t *elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6057,15 +6504,20 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6090,6 +6542,7 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiC list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6098,6 +6551,7 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6109,11 +6563,14 @@ AdmissionregistrationV1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_t *elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6159,15 +6616,20 @@ AdmissionregistrationV1API_readValidatingWebhookConfiguration(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6192,6 +6654,7 @@ AdmissionregistrationV1API_readValidatingWebhookConfiguration(apiClient_t *apiCl list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6200,6 +6663,7 @@ AdmissionregistrationV1API_readValidatingWebhookConfiguration(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6211,11 +6675,14 @@ AdmissionregistrationV1API_readValidatingWebhookConfiguration(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_webhook_configuration_t *elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6261,15 +6728,20 @@ AdmissionregistrationV1API_replaceMutatingWebhookConfiguration(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6332,13 +6804,15 @@ AdmissionregistrationV1API_replaceMutatingWebhookConfiguration(apiClient_t *apiC cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_mutating_webhook_configuration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6347,6 +6821,7 @@ AdmissionregistrationV1API_replaceMutatingWebhookConfiguration(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -6362,11 +6837,14 @@ AdmissionregistrationV1API_replaceMutatingWebhookConfiguration(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_mutating_webhook_configuration_t *elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_mutating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_mutating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6453,15 +6931,20 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6524,13 +7007,15 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClie cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_validating_admission_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6539,6 +7024,7 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -6554,11 +7040,14 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_t *elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6645,15 +7134,20 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyBinding(apiClient_t * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6716,13 +7210,15 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyBinding(apiClient_t * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_validating_admission_policy_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6731,6 +7227,7 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyBinding(apiClient_t * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -6746,11 +7243,14 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyBinding(apiClient_t * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_binding_t *elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6837,15 +7337,20 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *a list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6908,13 +7413,15 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *a cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_validating_admission_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6923,6 +7430,7 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *a localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -6938,11 +7446,14 @@ AdmissionregistrationV1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_admission_policy_t *elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7029,15 +7540,20 @@ AdmissionregistrationV1API_replaceValidatingWebhookConfiguration(apiClient_t *ap list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7100,13 +7616,15 @@ AdmissionregistrationV1API_replaceValidatingWebhookConfiguration(apiClient_t *ap cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_validating_webhook_configuration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7115,6 +7633,7 @@ AdmissionregistrationV1API_replaceValidatingWebhookConfiguration(apiClient_t *ap localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -7130,11 +7649,14 @@ AdmissionregistrationV1API_replaceValidatingWebhookConfiguration(apiClient_t *ap // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_validating_webhook_configuration_t *elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_validating_webhook_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_validating_webhook_configuration_parseFromJSON(AdmissionregistrationV1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AdmissionregistrationV1API.h b/kubernetes/api/AdmissionregistrationV1API.h index a8fd80bf..d3b7ea06 100644 --- a/kubernetes/api/AdmissionregistrationV1API.h +++ b/kubernetes/api/AdmissionregistrationV1API.h @@ -46,49 +46,49 @@ AdmissionregistrationV1API_createValidatingWebhookConfiguration(apiClient_t *api // delete collection of MutatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ValidatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ValidatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ValidatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a MutatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ValidatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ValidatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ValidatingWebhookConfiguration // v1_status_t* -AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/AdmissionregistrationV1alpha1API.c b/kubernetes/api/AdmissionregistrationV1alpha1API.c index 49fd3d67..5532cdd5 100644 --- a/kubernetes/api/AdmissionregistrationV1alpha1API.c +++ b/kubernetes/api/AdmissionregistrationV1alpha1API.c @@ -1,21 +1,18 @@ #include #include #include + #include "AdmissionregistrationV1alpha1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 -// create a ValidatingAdmissionPolicy +// create a MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *apiClient, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy(apiClient_t *apiClient, v1alpha1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -23,11 +20,14 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *ap list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies"); + @@ -84,13 +84,15 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *ap cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1alpha1_validating_admission_policy_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_mutating_admission_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *ap localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *ap // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_t *elementToReturn = v1alpha1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -197,10 +203,10 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *ap } -// create a ValidatingAdmissionPolicyBinding +// create a MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClient_t *apiClient, v1alpha1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding(apiClient_t *apiClient, v1alpha1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings"); + @@ -269,13 +278,15 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1alpha1_validating_admission_policy_binding_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_mutating_admission_policy_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -284,6 +295,7 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -303,11 +315,14 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_binding_t *elementToReturn = v1alpha1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -382,10 +397,10 @@ AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClien } -// delete collection of ValidatingAdmissionPolicy +// delete collection of MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -393,11 +408,14 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies"); + @@ -463,6 +481,19 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiCl list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -567,13 +598,15 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiCl cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -582,6 +615,7 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -593,11 +627,14 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -677,6 +714,18 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiCl keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -780,10 +829,10 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiCl } -// delete collection of ValidatingAdmissionPolicyBinding +// delete collection of MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -791,11 +840,14 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBindin list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings"); + @@ -861,6 +913,19 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBindin list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -965,13 +1030,15 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBindin cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -980,6 +1047,7 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBindin localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -991,11 +1059,14 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBindin // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1075,6 +1146,18 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBindin keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1178,10 +1261,10 @@ AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBindin } -// delete a ValidatingAdmissionPolicy +// delete a MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1189,15 +1272,20 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *ap list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1245,6 +1333,19 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *ap list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1274,13 +1375,15 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *ap cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1289,6 +1392,7 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *ap localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1304,11 +1408,14 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *ap // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1365,6 +1472,18 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *ap keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1396,10 +1515,10 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *ap } -// delete a ValidatingAdmissionPolicyBinding +// delete a MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1407,15 +1526,20 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1463,6 +1587,19 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClien list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1492,13 +1629,15 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1507,6 +1646,7 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1522,11 +1662,14 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1583,6 +1726,18 @@ AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClien keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1625,17 +1780,21 @@ AdmissionregistrationV1alpha1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1644,6 +1803,7 @@ AdmissionregistrationV1alpha1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1655,11 +1815,14 @@ AdmissionregistrationV1alpha1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1681,10 +1844,10 @@ AdmissionregistrationV1alpha1API_getAPIResources(apiClient_t *apiClient) } -// list or watch objects of kind ValidatingAdmissionPolicy +// list or watch objects of kind MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_list_t* -AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1alpha1_mutating_admission_policy_list_t* +AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1692,11 +1855,14 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies"); + @@ -1840,8 +2006,10 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiC list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1850,6 +2018,7 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1861,11 +2030,14 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_list_t *elementToReturn = v1alpha1_validating_admission_policy_list_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_list_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2019,10 +2191,10 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiC } -// list or watch objects of kind ValidatingAdmissionPolicyBinding +// list or watch objects of kind MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_list_t* -AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1alpha1_mutating_admission_policy_binding_list_t* +AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2030,11 +2202,14 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings"); + @@ -2178,8 +2353,10 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_ list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2188,6 +2365,7 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2199,11 +2377,14 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_binding_list_t *elementToReturn = v1alpha1_validating_admission_policy_binding_list_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_binding_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_binding_list_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2357,10 +2538,10 @@ AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_ } -// partially update the specified ValidatingAdmissionPolicy +// partially update the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2368,15 +2549,20 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2452,17 +2638,20 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2471,6 +2660,7 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -2486,11 +2676,14 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_t *elementToReturn = v1alpha1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2578,10 +2771,10 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *api } -// partially update the specified ValidatingAdmissionPolicyBinding +// partially update the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2589,15 +2782,20 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2673,17 +2871,20 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2692,6 +2893,7 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -2707,11 +2909,14 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_binding_t *elementToReturn = v1alpha1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2799,26 +3004,31 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient } -// partially update status of the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2840,71 +3050,10 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_ keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2913,26 +3062,26 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_ localVarHeaderType, localVarContentType, localVarBodyParameters, - "PATCH"); + localVarBodyLength, + "GET"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_t *elementToReturn = v1alpha1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2945,14 +3094,9 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_ list_freeList(localVarHeaderType); - list_freeList(localVarContentType); + free(localVarPath); free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -2965,54 +3109,6 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_ keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } return elementToReturn; end: free(localVarPath); @@ -3020,10 +3116,10 @@ AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_ } -// read the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty) +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3031,15 +3127,20 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3064,6 +3165,7 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiC list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3072,6 +3174,7 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3083,11 +3186,14 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_t *elementToReturn = v1alpha1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3122,10 +3228,10 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiC } -// read the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty) +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1alpha1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3133,15 +3239,20 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding(apiClient_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3163,9 +3274,56 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding(apiClient_ keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_mutating_admission_policy_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3174,22 +3332,30 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding(apiClient_ localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_binding_t *elementToReturn = v1alpha1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3205,264 +3371,11 @@ AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding(apiClient_ free(localVarPath); free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read status of the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_t *elementToReturn = v1alpha1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_validating_admission_policy_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_t *elementToReturn = v1alpha1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -3518,10 +3431,10 @@ AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy(apiClient_t *a } -// replace the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1alpha1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3529,207 +3442,20 @@ AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding(apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name}"); + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}"); - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { + if(!name) goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_validating_admission_policy_binding_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_binding_t *elementToReturn = v1alpha1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace status of the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status"); // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3792,13 +3518,15 @@ AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus(apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1alpha1_validating_admission_policy_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_mutating_admission_policy_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3807,6 +3535,7 @@ AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus(apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -3822,11 +3551,14 @@ AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus(apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_validating_admission_policy_t *elementToReturn = v1alpha1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1alpha1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AdmissionregistrationV1alpha1API.h b/kubernetes/api/AdmissionregistrationV1alpha1API.h index 77f9e0a3..07ffb247 100644 --- a/kubernetes/api/AdmissionregistrationV1alpha1API.h +++ b/kubernetes/api/AdmissionregistrationV1alpha1API.h @@ -9,46 +9,46 @@ #include "../model/v1_api_resource_list.h" #include "../model/v1_delete_options.h" #include "../model/v1_status.h" -#include "../model/v1alpha1_validating_admission_policy.h" -#include "../model/v1alpha1_validating_admission_policy_binding.h" -#include "../model/v1alpha1_validating_admission_policy_binding_list.h" -#include "../model/v1alpha1_validating_admission_policy_list.h" +#include "../model/v1alpha1_mutating_admission_policy.h" +#include "../model/v1alpha1_mutating_admission_policy_binding.h" +#include "../model/v1alpha1_mutating_admission_policy_binding_list.h" +#include "../model/v1alpha1_mutating_admission_policy_list.h" -// create a ValidatingAdmissionPolicy +// create a MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *apiClient, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy(apiClient_t *apiClient, v1alpha1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -// create a ValidatingAdmissionPolicyBinding +// create a MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClient_t *apiClient, v1alpha1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding(apiClient_t *apiClient, v1alpha1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -// delete collection of ValidatingAdmissionPolicy +// delete collection of MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); -// delete collection of ValidatingAdmissionPolicyBinding +// delete collection of MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); -// delete a ValidatingAdmissionPolicy +// delete a MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); -// delete a ValidatingAdmissionPolicyBinding +// delete a MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources @@ -57,69 +57,51 @@ v1_api_resource_list_t* AdmissionregistrationV1alpha1API_getAPIResources(apiClient_t *apiClient); -// list or watch objects of kind ValidatingAdmissionPolicy +// list or watch objects of kind MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_list_t* -AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1alpha1_mutating_admission_policy_list_t* +AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); -// list or watch objects of kind ValidatingAdmissionPolicyBinding +// list or watch objects of kind MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_list_t* -AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1alpha1_mutating_admission_policy_binding_list_t* +AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); -// partially update the specified ValidatingAdmissionPolicy +// partially update the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); -// partially update the specified ValidatingAdmissionPolicyBinding +// partially update the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); -// partially update status of the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); -// read the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); -// read the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); +v1alpha1_mutating_admission_policy_t* +AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1alpha1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -// read status of the specified ValidatingAdmissionPolicy +// replace the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, char *pretty); - - -// replace the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ValidatingAdmissionPolicyBinding -// -v1alpha1_validating_admission_policy_binding_t* -AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace status of the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* -AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1alpha1_mutating_admission_policy_binding_t* +AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1alpha1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); diff --git a/kubernetes/api/AdmissionregistrationV1beta1API.c b/kubernetes/api/AdmissionregistrationV1beta1API.c index 4ab5634a..848291fe 100644 --- a/kubernetes/api/AdmissionregistrationV1beta1API.c +++ b/kubernetes/api/AdmissionregistrationV1beta1API.c @@ -1,21 +1,18 @@ #include #include #include + #include "AdmissionregistrationV1beta1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 -// create a ValidatingAdmissionPolicy +// create a MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *apiClient, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy(apiClient_t *apiClient, v1beta1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -23,11 +20,14 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies"); + @@ -84,13 +84,15 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1beta1_validating_admission_policy_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1beta1_mutating_admission_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_t *elementToReturn = v1beta1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -197,10 +203,10 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *api } -// create a ValidatingAdmissionPolicyBinding +// create a MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient_t *apiClient, v1beta1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding(apiClient_t *apiClient, v1beta1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings"); + @@ -269,13 +278,15 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1beta1_validating_admission_policy_binding_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1beta1_mutating_admission_policy_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -284,6 +295,7 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -303,11 +315,14 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_binding_t *elementToReturn = v1beta1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -382,10 +397,10 @@ AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient } -// delete collection of ValidatingAdmissionPolicy +// delete collection of MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -393,11 +408,14 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies"); + @@ -463,6 +481,19 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiCli list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -567,13 +598,15 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiCli cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -582,6 +615,7 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -593,11 +627,14 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -677,6 +714,18 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiCli keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -780,10 +829,10 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiCli } -// delete collection of ValidatingAdmissionPolicyBinding +// delete collection of MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -791,11 +840,14 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings"); + @@ -861,6 +913,19 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -965,13 +1030,15 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -980,6 +1047,7 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -991,11 +1059,14 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1075,6 +1146,18 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1178,10 +1261,10 @@ AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding } -// delete a ValidatingAdmissionPolicy +// delete a MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1189,15 +1272,20 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1245,6 +1333,19 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *api list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1274,13 +1375,15 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1289,6 +1392,7 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1304,11 +1408,14 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1365,6 +1472,18 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *api keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1396,10 +1515,10 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *api } -// delete a ValidatingAdmissionPolicyBinding +// delete a MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1407,15 +1526,20 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1463,6 +1587,19 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1492,13 +1629,15 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1507,6 +1646,7 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1522,11 +1662,14 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1583,6 +1726,18 @@ AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1625,17 +1780,21 @@ AdmissionregistrationV1beta1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1644,6 +1803,7 @@ AdmissionregistrationV1beta1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1655,11 +1815,14 @@ AdmissionregistrationV1beta1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1681,10 +1844,10 @@ AdmissionregistrationV1beta1API_getAPIResources(apiClient_t *apiClient) } -// list or watch objects of kind ValidatingAdmissionPolicy +// list or watch objects of kind MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_list_t* -AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1beta1_mutating_admission_policy_list_t* +AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1692,11 +1855,14 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies"); + @@ -1840,8 +2006,10 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiCl list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1850,6 +2018,7 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1861,11 +2030,14 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_list_t *elementToReturn = v1beta1_validating_admission_policy_list_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_list_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2019,10 +2191,10 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiCl } -// list or watch objects of kind ValidatingAdmissionPolicyBinding +// list or watch objects of kind MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_list_t* -AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1beta1_mutating_admission_policy_binding_list_t* +AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2030,11 +2202,14 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings"); + @@ -2178,8 +2353,10 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2188,6 +2365,7 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2199,11 +2377,14 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_binding_list_t *elementToReturn = v1beta1_validating_admission_policy_binding_list_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_binding_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_binding_list_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2357,10 +2538,10 @@ AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t } -// partially update the specified ValidatingAdmissionPolicy +// partially update the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2368,15 +2549,20 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2452,17 +2638,20 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiC cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2471,6 +2660,7 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -2486,11 +2676,14 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_t *elementToReturn = v1beta1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2578,10 +2771,10 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiC } -// partially update the specified ValidatingAdmissionPolicyBinding +// partially update the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2589,15 +2782,20 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2673,17 +2871,20 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2692,6 +2893,7 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -2707,11 +2909,14 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_binding_t *elementToReturn = v1beta1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2799,26 +3004,31 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_ } -// partially update status of the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2840,71 +3050,10 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2913,26 +3062,26 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t localVarHeaderType, localVarContentType, localVarBodyParameters, - "PATCH"); + localVarBodyLength, + "GET"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_t *elementToReturn = v1beta1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2945,14 +3094,9 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t list_freeList(localVarHeaderType); - list_freeList(localVarContentType); + free(localVarPath); free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -2965,54 +3109,6 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } return elementToReturn; end: free(localVarPath); @@ -3020,10 +3116,10 @@ AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t } -// read the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty) +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3031,15 +3127,20 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3064,6 +3165,7 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiCl list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3072,6 +3174,7 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3083,11 +3186,14 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_t *elementToReturn = v1beta1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3122,10 +3228,10 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiCl } -// read the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty) +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1beta1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3133,15 +3239,20 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding(apiClient_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}"); + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3163,9 +3274,56 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding(apiClient_t keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_mutating_admission_policy_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3174,22 +3332,30 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding(apiClient_t localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_binding_t *elementToReturn = v1beta1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3205,264 +3371,11 @@ AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding(apiClient_t free(localVarPath); free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read status of the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_t *elementToReturn = v1beta1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta1_validating_admission_policy_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_t *elementToReturn = v1beta1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -3518,10 +3431,10 @@ AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy(apiClient_t *ap } -// replace the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1beta1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3529,207 +3442,20 @@ AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding(apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name}"); + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}"); - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { + if(!name) goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta1_validating_admission_policy_binding_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_binding_t *elementToReturn = v1beta1_validating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace status of the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status"); // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3792,13 +3518,15 @@ AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus(apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1beta1_validating_admission_policy_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1beta1_mutating_admission_policy_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3807,6 +3535,7 @@ AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus(apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -3822,11 +3551,14 @@ AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus(apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_validating_admission_policy_t *elementToReturn = v1beta1_validating_admission_policy_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); - cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1beta1_mutating_admission_policy_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AdmissionregistrationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_mutating_admission_policy_binding_parseFromJSON(AdmissionregistrationV1beta1APIlocalVarJSON); + cJSON_Delete(AdmissionregistrationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AdmissionregistrationV1beta1API.h b/kubernetes/api/AdmissionregistrationV1beta1API.h index c3034f10..ac0b5ba3 100644 --- a/kubernetes/api/AdmissionregistrationV1beta1API.h +++ b/kubernetes/api/AdmissionregistrationV1beta1API.h @@ -9,46 +9,46 @@ #include "../model/v1_api_resource_list.h" #include "../model/v1_delete_options.h" #include "../model/v1_status.h" -#include "../model/v1beta1_validating_admission_policy.h" -#include "../model/v1beta1_validating_admission_policy_binding.h" -#include "../model/v1beta1_validating_admission_policy_binding_list.h" -#include "../model/v1beta1_validating_admission_policy_list.h" +#include "../model/v1beta1_mutating_admission_policy.h" +#include "../model/v1beta1_mutating_admission_policy_binding.h" +#include "../model/v1beta1_mutating_admission_policy_binding_list.h" +#include "../model/v1beta1_mutating_admission_policy_list.h" -// create a ValidatingAdmissionPolicy +// create a MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *apiClient, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy(apiClient_t *apiClient, v1beta1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -// create a ValidatingAdmissionPolicyBinding +// create a MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient_t *apiClient, v1beta1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding(apiClient_t *apiClient, v1beta1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -// delete collection of ValidatingAdmissionPolicy +// delete collection of MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); -// delete collection of ValidatingAdmissionPolicyBinding +// delete collection of MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); -// delete a ValidatingAdmissionPolicy +// delete a MutatingAdmissionPolicy // v1_status_t* -AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); -// delete a ValidatingAdmissionPolicyBinding +// delete a MutatingAdmissionPolicyBinding // v1_status_t* -AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources @@ -57,69 +57,51 @@ v1_api_resource_list_t* AdmissionregistrationV1beta1API_getAPIResources(apiClient_t *apiClient); -// list or watch objects of kind ValidatingAdmissionPolicy +// list or watch objects of kind MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_list_t* -AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1beta1_mutating_admission_policy_list_t* +AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); -// list or watch objects of kind ValidatingAdmissionPolicyBinding +// list or watch objects of kind MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_list_t* -AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1beta1_mutating_admission_policy_binding_list_t* +AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); -// partially update the specified ValidatingAdmissionPolicy +// partially update the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); -// partially update the specified ValidatingAdmissionPolicyBinding +// partially update the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); -// partially update status of the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); -// read the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); -// read the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); +v1beta1_mutating_admission_policy_t* +AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1beta1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -// read status of the specified ValidatingAdmissionPolicy +// replace the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, char *pretty); - - -// replace the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ValidatingAdmissionPolicyBinding -// -v1beta1_validating_admission_policy_binding_t* -AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace status of the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* -AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta1_mutating_admission_policy_binding_t* +AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1beta1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); diff --git a/kubernetes/api/ApiextensionsAPI.c b/kubernetes/api/ApiextensionsAPI.c index c5491f39..45d10e74 100644 --- a/kubernetes/api/ApiextensionsAPI.c +++ b/kubernetes/api/ApiextensionsAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "ApiextensionsAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ ApiextensionsAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/"); + @@ -42,6 +42,7 @@ ApiextensionsAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ ApiextensionsAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(ApiextensionsAPIlocalVarJSON); - cJSON_Delete(ApiextensionsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(ApiextensionsAPIlocalVarJSON); + cJSON_Delete(ApiextensionsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/ApiextensionsV1API.c b/kubernetes/api/ApiextensionsV1API.c index 7395e3e8..58271903 100644 --- a/kubernetes/api/ApiextensionsV1API.c +++ b/kubernetes/api/ApiextensionsV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "ApiextensionsV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a CustomResourceDefinition @@ -23,11 +20,14 @@ ApiextensionsV1API_createCustomResourceDefinition(apiClient_t *apiClient, v1_cus list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions"); + @@ -84,13 +84,15 @@ ApiextensionsV1API_createCustomResourceDefinition(apiClient_t *apiClient, v1_cus cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_custom_resource_definition_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ ApiextensionsV1API_createCustomResourceDefinition(apiClient_t *apiClient, v1_cus localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ ApiextensionsV1API_createCustomResourceDefinition(apiClient_t *apiClient, v1_cus // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_t *elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ ApiextensionsV1API_createCustomResourceDefinition(apiClient_t *apiClient, v1_cus // delete collection of CustomResourceDefinition // v1_status_t* -ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions"); + @@ -278,6 +287,19 @@ ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClie list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -382,13 +404,15 @@ ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClie cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -397,6 +421,7 @@ ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -408,11 +433,14 @@ ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -492,6 +520,18 @@ ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClie keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -598,7 +638,7 @@ ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClie // delete a CustomResourceDefinition // v1_status_t* -ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -606,15 +646,20 @@ ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -662,6 +707,19 @@ ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -691,13 +749,15 @@ ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -706,6 +766,7 @@ ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -721,11 +782,14 @@ ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -782,6 +846,18 @@ ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -824,17 +900,21 @@ ApiextensionsV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ ApiextensionsV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ ApiextensionsV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ ApiextensionsV1API_listCustomResourceDefinition(apiClient_t *apiClient, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions"); + @@ -1039,8 +1126,10 @@ ApiextensionsV1API_listCustomResourceDefinition(apiClient_t *apiClient, char *pr list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ ApiextensionsV1API_listCustomResourceDefinition(apiClient_t *apiClient, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ ApiextensionsV1API_listCustomResourceDefinition(apiClient_t *apiClient, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_list_t *elementToReturn = v1_custom_resource_definition_list_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_list_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ ApiextensionsV1API_patchCustomResourceDefinition(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ ApiextensionsV1API_patchCustomResourceDefinition(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ ApiextensionsV1API_patchCustomResourceDefinition(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ ApiextensionsV1API_patchCustomResourceDefinition(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_t *elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ ApiextensionsV1API_patchCustomResourceDefinitionStatus(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1534,17 +1644,20 @@ ApiextensionsV1API_patchCustomResourceDefinitionStatus(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1553,6 +1666,7 @@ ApiextensionsV1API_patchCustomResourceDefinitionStatus(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1568,11 +1682,14 @@ ApiextensionsV1API_patchCustomResourceDefinitionStatus(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_t *elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1671,15 +1788,20 @@ ApiextensionsV1API_readCustomResourceDefinition(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1704,6 +1826,7 @@ ApiextensionsV1API_readCustomResourceDefinition(apiClient_t *apiClient, char *na list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1712,6 +1835,7 @@ ApiextensionsV1API_readCustomResourceDefinition(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1723,11 +1847,14 @@ ApiextensionsV1API_readCustomResourceDefinition(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_t *elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1773,15 +1900,20 @@ ApiextensionsV1API_readCustomResourceDefinitionStatus(apiClient_t *apiClient, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1806,6 +1938,7 @@ ApiextensionsV1API_readCustomResourceDefinitionStatus(apiClient_t *apiClient, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1814,6 +1947,7 @@ ApiextensionsV1API_readCustomResourceDefinitionStatus(apiClient_t *apiClient, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1825,11 +1959,14 @@ ApiextensionsV1API_readCustomResourceDefinitionStatus(apiClient_t *apiClient, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_t *elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1875,15 +2012,20 @@ ApiextensionsV1API_replaceCustomResourceDefinition(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1946,13 +2088,15 @@ ApiextensionsV1API_replaceCustomResourceDefinition(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_custom_resource_definition_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1961,6 +2105,7 @@ ApiextensionsV1API_replaceCustomResourceDefinition(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1976,11 +2121,14 @@ ApiextensionsV1API_replaceCustomResourceDefinition(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_t *elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2067,15 +2215,20 @@ ApiextensionsV1API_replaceCustomResourceDefinitionStatus(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status"); + char *localVarPath = strdup("/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2138,13 +2291,15 @@ ApiextensionsV1API_replaceCustomResourceDefinitionStatus(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_custom_resource_definition_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2153,6 +2308,7 @@ ApiextensionsV1API_replaceCustomResourceDefinitionStatus(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2168,11 +2324,14 @@ ApiextensionsV1API_replaceCustomResourceDefinitionStatus(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_custom_resource_definition_t *elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); - cJSON_Delete(ApiextensionsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_custom_resource_definition_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiextensionsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_custom_resource_definition_parseFromJSON(ApiextensionsV1APIlocalVarJSON); + cJSON_Delete(ApiextensionsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/ApiextensionsV1API.h b/kubernetes/api/ApiextensionsV1API.h index 662b40e3..40274476 100644 --- a/kubernetes/api/ApiextensionsV1API.h +++ b/kubernetes/api/ApiextensionsV1API.h @@ -22,13 +22,13 @@ ApiextensionsV1API_createCustomResourceDefinition(apiClient_t *apiClient, v1_cus // delete collection of CustomResourceDefinition // v1_status_t* -ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a CustomResourceDefinition // v1_status_t* -ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/ApiregistrationAPI.c b/kubernetes/api/ApiregistrationAPI.c index 601c80c5..9e41f048 100644 --- a/kubernetes/api/ApiregistrationAPI.c +++ b/kubernetes/api/ApiregistrationAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "ApiregistrationAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ ApiregistrationAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/"); + @@ -42,6 +42,7 @@ ApiregistrationAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ ApiregistrationAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(ApiregistrationAPIlocalVarJSON); - cJSON_Delete(ApiregistrationAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(ApiregistrationAPIlocalVarJSON); + cJSON_Delete(ApiregistrationAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/ApiregistrationV1API.c b/kubernetes/api/ApiregistrationV1API.c index 1113752b..76e305b5 100644 --- a/kubernetes/api/ApiregistrationV1API.c +++ b/kubernetes/api/ApiregistrationV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "ApiregistrationV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create an APIService @@ -23,11 +20,14 @@ ApiregistrationV1API_createAPIService(apiClient_t *apiClient, v1_api_service_t * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices"); + @@ -84,13 +84,15 @@ ApiregistrationV1API_createAPIService(apiClient_t *apiClient, v1_api_service_t * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_api_service_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ ApiregistrationV1API_createAPIService(apiClient_t *apiClient, v1_api_service_t * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ ApiregistrationV1API_createAPIService(apiClient_t *apiClient, v1_api_service_t * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_t *elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ ApiregistrationV1API_createAPIService(apiClient_t *apiClient, v1_api_service_t * // delete an APIService // v1_status_t* -ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,15 +214,20 @@ ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -264,6 +275,19 @@ ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -293,13 +317,15 @@ ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -308,6 +334,7 @@ ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -323,11 +350,14 @@ ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -384,6 +414,18 @@ ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -418,7 +460,7 @@ ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char * // delete collection of APIService // v1_status_t* -ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -426,11 +468,14 @@ ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices"); + @@ -496,6 +541,19 @@ ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pr list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -600,13 +658,15 @@ ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pr cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -615,6 +675,7 @@ ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -626,11 +687,14 @@ ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -710,6 +774,18 @@ ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pr keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -824,17 +900,21 @@ ApiregistrationV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ ApiregistrationV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ ApiregistrationV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ ApiregistrationV1API_listAPIService(apiClient_t *apiClient, char *pretty, int *a list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices"); + @@ -1039,8 +1126,10 @@ ApiregistrationV1API_listAPIService(apiClient_t *apiClient, char *pretty, int *a list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ ApiregistrationV1API_listAPIService(apiClient_t *apiClient, char *pretty, int *a localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ ApiregistrationV1API_listAPIService(apiClient_t *apiClient, char *pretty, int *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_list_t *elementToReturn = v1_api_service_list_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_list_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ ApiregistrationV1API_patchAPIService(apiClient_t *apiClient, char *name, object_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ ApiregistrationV1API_patchAPIService(apiClient_t *apiClient, char *name, object_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ ApiregistrationV1API_patchAPIService(apiClient_t *apiClient, char *name, object_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ ApiregistrationV1API_patchAPIService(apiClient_t *apiClient, char *name, object_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_t *elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ ApiregistrationV1API_patchAPIServiceStatus(apiClient_t *apiClient, char *name, o list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices/{name}/status"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1534,17 +1644,20 @@ ApiregistrationV1API_patchAPIServiceStatus(apiClient_t *apiClient, char *name, o cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1553,6 +1666,7 @@ ApiregistrationV1API_patchAPIServiceStatus(apiClient_t *apiClient, char *name, o localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1568,11 +1682,14 @@ ApiregistrationV1API_patchAPIServiceStatus(apiClient_t *apiClient, char *name, o // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_t *elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1671,15 +1788,20 @@ ApiregistrationV1API_readAPIService(apiClient_t *apiClient, char *name, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1704,6 +1826,7 @@ ApiregistrationV1API_readAPIService(apiClient_t *apiClient, char *name, char *pr list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1712,6 +1835,7 @@ ApiregistrationV1API_readAPIService(apiClient_t *apiClient, char *name, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1723,11 +1847,14 @@ ApiregistrationV1API_readAPIService(apiClient_t *apiClient, char *name, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_t *elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1773,15 +1900,20 @@ ApiregistrationV1API_readAPIServiceStatus(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices/{name}/status"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1806,6 +1938,7 @@ ApiregistrationV1API_readAPIServiceStatus(apiClient_t *apiClient, char *name, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1814,6 +1947,7 @@ ApiregistrationV1API_readAPIServiceStatus(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1825,11 +1959,14 @@ ApiregistrationV1API_readAPIServiceStatus(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_t *elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1875,15 +2012,20 @@ ApiregistrationV1API_replaceAPIService(apiClient_t *apiClient, char *name, v1_ap list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1946,13 +2088,15 @@ ApiregistrationV1API_replaceAPIService(apiClient_t *apiClient, char *name, v1_ap cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_api_service_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1961,6 +2105,7 @@ ApiregistrationV1API_replaceAPIService(apiClient_t *apiClient, char *name, v1_ap localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1976,11 +2121,14 @@ ApiregistrationV1API_replaceAPIService(apiClient_t *apiClient, char *name, v1_ap // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_t *elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2067,15 +2215,20 @@ ApiregistrationV1API_replaceAPIServiceStatus(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apiregistration.k8s.io/v1/apiservices/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apiregistration.k8s.io/v1/apiservices/{name}/status"); + char *localVarPath = strdup("/apis/apiregistration.k8s.io/v1/apiservices/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2138,13 +2291,15 @@ ApiregistrationV1API_replaceAPIServiceStatus(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_api_service_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2153,6 +2308,7 @@ ApiregistrationV1API_replaceAPIServiceStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2168,11 +2324,14 @@ ApiregistrationV1API_replaceAPIServiceStatus(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_service_t *elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); - cJSON_Delete(ApiregistrationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApiregistrationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_service_parseFromJSON(ApiregistrationV1APIlocalVarJSON); + cJSON_Delete(ApiregistrationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/ApiregistrationV1API.h b/kubernetes/api/ApiregistrationV1API.h index 71c7806c..78b3abe3 100644 --- a/kubernetes/api/ApiregistrationV1API.h +++ b/kubernetes/api/ApiregistrationV1API.h @@ -22,13 +22,13 @@ ApiregistrationV1API_createAPIService(apiClient_t *apiClient, v1_api_service_t * // delete an APIService // v1_status_t* -ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete collection of APIService // v1_status_t* -ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/ApisAPI.c b/kubernetes/api/ApisAPI.c index 7248e181..afa07f62 100644 --- a/kubernetes/api/ApisAPI.c +++ b/kubernetes/api/ApisAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "ApisAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get available API versions @@ -23,11 +20,14 @@ ApisAPI_getAPIVersions(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/"); + char *localVarPath = strdup("/apis/"); + @@ -42,6 +42,7 @@ ApisAPI_getAPIVersions(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ ApisAPI_getAPIVersions(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ApisAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_list_t *elementToReturn = v1_api_group_list_parseFromJSON(ApisAPIlocalVarJSON); - cJSON_Delete(ApisAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ApisAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_list_parseFromJSON(ApisAPIlocalVarJSON); + cJSON_Delete(ApisAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AppsAPI.c b/kubernetes/api/AppsAPI.c index 9dc086d8..a06ebda4 100644 --- a/kubernetes/api/AppsAPI.c +++ b/kubernetes/api/AppsAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "AppsAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ AppsAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/"); + char *localVarPath = strdup("/apis/apps/"); + @@ -42,6 +42,7 @@ AppsAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ AppsAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(AppsAPIlocalVarJSON); - cJSON_Delete(AppsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(AppsAPIlocalVarJSON); + cJSON_Delete(AppsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AppsV1API.c b/kubernetes/api/AppsV1API.c index 2f14d7c3..2904cb23 100644 --- a/kubernetes/api/AppsV1API.c +++ b/kubernetes/api/AppsV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "AppsV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a ControllerRevision @@ -23,15 +20,20 @@ AppsV1API_createNamespacedControllerRevision(apiClient_t *apiClient, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/controllerrevisions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/controllerrevisions"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ AppsV1API_createNamespacedControllerRevision(apiClient_t *apiClient, char *_name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_controller_revision_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ AppsV1API_createNamespacedControllerRevision(apiClient_t *apiClient, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ AppsV1API_createNamespacedControllerRevision(apiClient_t *apiClient, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_controller_revision_t *elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_controller_revision_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -219,15 +227,20 @@ AppsV1API_createNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, v1 list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -290,13 +303,15 @@ AppsV1API_createNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, v1 cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_daemon_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -305,6 +320,7 @@ AppsV1API_createNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, v1 localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -324,11 +340,14 @@ AppsV1API_createNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, v1 // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_t *elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -415,15 +434,20 @@ AppsV1API_createNamespacedDeployment(apiClient_t *apiClient, char *_namespace, v list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -486,13 +510,15 @@ AppsV1API_createNamespacedDeployment(apiClient_t *apiClient, char *_namespace, v cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_deployment_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -501,6 +527,7 @@ AppsV1API_createNamespacedDeployment(apiClient_t *apiClient, char *_namespace, v localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -520,11 +547,14 @@ AppsV1API_createNamespacedDeployment(apiClient_t *apiClient, char *_namespace, v // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_t *elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -611,15 +641,20 @@ AppsV1API_createNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, v list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -682,13 +717,15 @@ AppsV1API_createNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, v cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_replica_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -697,6 +734,7 @@ AppsV1API_createNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, v localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -716,11 +754,14 @@ AppsV1API_createNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, v // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_t *elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -807,15 +848,20 @@ AppsV1API_createNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -878,13 +924,15 @@ AppsV1API_createNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_stateful_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -893,6 +941,7 @@ AppsV1API_createNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -912,11 +961,14 @@ AppsV1API_createNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_t *elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -995,7 +1047,7 @@ AppsV1API_createNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, // delete collection of ControllerRevision // v1_status_t* -AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1003,15 +1055,20 @@ AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/controllerrevisions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/controllerrevisions"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1083,6 +1140,19 @@ AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, c list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1187,13 +1257,15 @@ AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1202,6 +1274,7 @@ AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1213,11 +1286,14 @@ AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1298,6 +1374,18 @@ AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, c keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1404,7 +1492,7 @@ AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, c // delete collection of DaemonSet // v1_status_t* -AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1412,15 +1500,20 @@ AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1492,6 +1585,19 @@ AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_nam list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1596,13 +1702,15 @@ AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1611,6 +1719,7 @@ AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1622,11 +1731,14 @@ AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1707,6 +1819,18 @@ AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_nam keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1813,7 +1937,7 @@ AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_nam // delete collection of Deployment // v1_status_t* -AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1821,15 +1945,20 @@ AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1901,6 +2030,19 @@ AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2005,13 +2147,15 @@ AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2020,6 +2164,7 @@ AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2031,11 +2176,14 @@ AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2116,6 +2264,18 @@ AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2222,7 +2382,7 @@ AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_na // delete collection of ReplicaSet // v1_status_t* -AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2230,15 +2390,20 @@ AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2310,6 +2475,19 @@ AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2414,13 +2592,15 @@ AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2429,6 +2609,7 @@ AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2440,11 +2621,14 @@ AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2525,6 +2709,18 @@ AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2631,7 +2827,7 @@ AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_na // delete collection of StatefulSet // v1_status_t* -AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2639,15 +2835,20 @@ AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2719,6 +2920,19 @@ AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_n list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2823,13 +3037,15 @@ AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2838,6 +3054,7 @@ AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2849,11 +3066,14 @@ AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2934,6 +3154,18 @@ AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_n keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -3040,7 +3272,7 @@ AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_n // delete a ControllerRevision // v1_status_t* -AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3048,15 +3280,22 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3066,7 +3305,7 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3114,6 +3353,19 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3143,13 +3395,15 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3158,6 +3412,7 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3173,11 +3428,14 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3235,6 +3493,18 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3269,7 +3539,7 @@ AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, // delete a DaemonSet // v1_status_t* -AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3277,15 +3547,22 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3295,7 +3572,7 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3343,6 +3620,19 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3372,13 +3662,15 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3387,6 +3679,7 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3402,11 +3695,14 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3464,6 +3760,18 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3498,7 +3806,7 @@ AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_n // delete a Deployment // v1_status_t* -AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3506,15 +3814,22 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3524,7 +3839,7 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3572,6 +3887,19 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3601,13 +3929,15 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3616,6 +3946,7 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3631,11 +3962,14 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3693,6 +4027,18 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3727,7 +4073,7 @@ AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_ // delete a ReplicaSet // v1_status_t* -AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3735,15 +4081,22 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3753,7 +4106,7 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3801,6 +4154,19 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3830,13 +4196,15 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3845,6 +4213,7 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3860,11 +4229,14 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3922,6 +4294,18 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3956,7 +4340,7 @@ AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_ // delete a StatefulSet // v1_status_t* -AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3964,15 +4348,22 @@ AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3982,7 +4373,7 @@ AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4030,6 +4421,19 @@ AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -4059,13 +4463,15 @@ AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4074,6 +4480,7 @@ AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -4089,11 +4496,14 @@ AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4151,6 +4561,18 @@ AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -4193,17 +4615,21 @@ AppsV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/"); + char *localVarPath = strdup("/apis/apps/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4212,6 +4638,7 @@ AppsV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4223,11 +4650,14 @@ AppsV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4260,11 +4690,14 @@ AppsV1API_listControllerRevisionForAllNamespaces(apiClient_t *apiClient, int *al list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/controllerrevisions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/controllerrevisions"); + char *localVarPath = strdup("/apis/apps/v1/controllerrevisions"); + @@ -4408,8 +4841,10 @@ AppsV1API_listControllerRevisionForAllNamespaces(apiClient_t *apiClient, int *al list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4418,6 +4853,7 @@ AppsV1API_listControllerRevisionForAllNamespaces(apiClient_t *apiClient, int *al localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4429,11 +4865,14 @@ AppsV1API_listControllerRevisionForAllNamespaces(apiClient_t *apiClient, int *al // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_controller_revision_list_t *elementToReturn = v1_controller_revision_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_controller_revision_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_controller_revision_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4598,11 +5037,14 @@ AppsV1API_listDaemonSetForAllNamespaces(apiClient_t *apiClient, int *allowWatchB list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/daemonsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/daemonsets"); + char *localVarPath = strdup("/apis/apps/v1/daemonsets"); + @@ -4746,8 +5188,10 @@ AppsV1API_listDaemonSetForAllNamespaces(apiClient_t *apiClient, int *allowWatchB list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4756,6 +5200,7 @@ AppsV1API_listDaemonSetForAllNamespaces(apiClient_t *apiClient, int *allowWatchB localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4767,11 +5212,14 @@ AppsV1API_listDaemonSetForAllNamespaces(apiClient_t *apiClient, int *allowWatchB // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_list_t *elementToReturn = v1_daemon_set_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4936,11 +5384,14 @@ AppsV1API_listDeploymentForAllNamespaces(apiClient_t *apiClient, int *allowWatch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/deployments")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/deployments"); + char *localVarPath = strdup("/apis/apps/v1/deployments"); + @@ -5084,8 +5535,10 @@ AppsV1API_listDeploymentForAllNamespaces(apiClient_t *apiClient, int *allowWatch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5094,6 +5547,7 @@ AppsV1API_listDeploymentForAllNamespaces(apiClient_t *apiClient, int *allowWatch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5105,11 +5559,14 @@ AppsV1API_listDeploymentForAllNamespaces(apiClient_t *apiClient, int *allowWatch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_list_t *elementToReturn = v1_deployment_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5274,15 +5731,20 @@ AppsV1API_listNamespacedControllerRevision(apiClient_t *apiClient, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/controllerrevisions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/controllerrevisions"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5432,8 +5894,10 @@ AppsV1API_listNamespacedControllerRevision(apiClient_t *apiClient, char *_namesp list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5442,6 +5906,7 @@ AppsV1API_listNamespacedControllerRevision(apiClient_t *apiClient, char *_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5453,11 +5918,14 @@ AppsV1API_listNamespacedControllerRevision(apiClient_t *apiClient, char *_namesp // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_controller_revision_list_t *elementToReturn = v1_controller_revision_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_controller_revision_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_controller_revision_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5623,15 +6091,20 @@ AppsV1API_listNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5781,8 +6254,10 @@ AppsV1API_listNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5791,6 +6266,7 @@ AppsV1API_listNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5802,11 +6278,14 @@ AppsV1API_listNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_list_t *elementToReturn = v1_daemon_set_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5972,15 +6451,20 @@ AppsV1API_listNamespacedDeployment(apiClient_t *apiClient, char *_namespace, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6130,8 +6614,10 @@ AppsV1API_listNamespacedDeployment(apiClient_t *apiClient, char *_namespace, cha list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6140,6 +6626,7 @@ AppsV1API_listNamespacedDeployment(apiClient_t *apiClient, char *_namespace, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6151,11 +6638,14 @@ AppsV1API_listNamespacedDeployment(apiClient_t *apiClient, char *_namespace, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_list_t *elementToReturn = v1_deployment_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6321,15 +6811,20 @@ AppsV1API_listNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6479,8 +6974,10 @@ AppsV1API_listNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, cha list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6489,6 +6986,7 @@ AppsV1API_listNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6500,11 +6998,14 @@ AppsV1API_listNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_list_t *elementToReturn = v1_replica_set_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6670,15 +7171,20 @@ AppsV1API_listNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6828,8 +7334,10 @@ AppsV1API_listNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6838,6 +7346,7 @@ AppsV1API_listNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6849,11 +7358,14 @@ AppsV1API_listNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_list_t *elementToReturn = v1_stateful_set_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7019,11 +7531,14 @@ AppsV1API_listReplicaSetForAllNamespaces(apiClient_t *apiClient, int *allowWatch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/replicasets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/replicasets"); + char *localVarPath = strdup("/apis/apps/v1/replicasets"); + @@ -7167,8 +7682,10 @@ AppsV1API_listReplicaSetForAllNamespaces(apiClient_t *apiClient, int *allowWatch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7177,6 +7694,7 @@ AppsV1API_listReplicaSetForAllNamespaces(apiClient_t *apiClient, int *allowWatch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -7188,11 +7706,14 @@ AppsV1API_listReplicaSetForAllNamespaces(apiClient_t *apiClient, int *allowWatch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_list_t *elementToReturn = v1_replica_set_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7357,11 +7878,14 @@ AppsV1API_listStatefulSetForAllNamespaces(apiClient_t *apiClient, int *allowWatc list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/statefulsets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/statefulsets"); + char *localVarPath = strdup("/apis/apps/v1/statefulsets"); + @@ -7505,8 +8029,10 @@ AppsV1API_listStatefulSetForAllNamespaces(apiClient_t *apiClient, int *allowWatc list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7515,6 +8041,7 @@ AppsV1API_listStatefulSetForAllNamespaces(apiClient_t *apiClient, int *allowWatc localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -7526,11 +8053,14 @@ AppsV1API_listStatefulSetForAllNamespaces(apiClient_t *apiClient, int *allowWatc // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_list_t *elementToReturn = v1_stateful_set_list_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_list_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7695,15 +8225,22 @@ AppsV1API_patchNamespacedControllerRevision(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7713,7 +8250,7 @@ AppsV1API_patchNamespacedControllerRevision(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7789,17 +8326,20 @@ AppsV1API_patchNamespacedControllerRevision(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7808,6 +8348,7 @@ AppsV1API_patchNamespacedControllerRevision(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -7823,11 +8364,14 @@ AppsV1API_patchNamespacedControllerRevision(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_controller_revision_t *elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_controller_revision_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7927,15 +8471,22 @@ AppsV1API_patchNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7945,7 +8496,7 @@ AppsV1API_patchNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8021,17 +8572,20 @@ AppsV1API_patchNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8040,6 +8594,7 @@ AppsV1API_patchNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -8055,11 +8610,14 @@ AppsV1API_patchNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_t *elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8159,15 +8717,22 @@ AppsV1API_patchNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8177,7 +8742,7 @@ AppsV1API_patchNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8253,17 +8818,20 @@ AppsV1API_patchNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8272,6 +8840,7 @@ AppsV1API_patchNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -8287,11 +8856,14 @@ AppsV1API_patchNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_t *elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8391,15 +8963,22 @@ AppsV1API_patchNamespacedDeployment(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8409,7 +8988,7 @@ AppsV1API_patchNamespacedDeployment(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8485,17 +9064,20 @@ AppsV1API_patchNamespacedDeployment(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8504,6 +9086,7 @@ AppsV1API_patchNamespacedDeployment(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -8519,11 +9102,14 @@ AppsV1API_patchNamespacedDeployment(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_t *elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8623,15 +9209,22 @@ AppsV1API_patchNamespacedDeploymentScale(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8641,7 +9234,7 @@ AppsV1API_patchNamespacedDeploymentScale(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8717,17 +9310,20 @@ AppsV1API_patchNamespacedDeploymentScale(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8736,6 +9332,7 @@ AppsV1API_patchNamespacedDeploymentScale(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -8751,11 +9348,14 @@ AppsV1API_patchNamespacedDeploymentScale(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8855,15 +9455,22 @@ AppsV1API_patchNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8873,7 +9480,7 @@ AppsV1API_patchNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8949,17 +9556,20 @@ AppsV1API_patchNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8968,6 +9578,7 @@ AppsV1API_patchNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -8983,11 +9594,14 @@ AppsV1API_patchNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_t *elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9087,15 +9701,22 @@ AppsV1API_patchNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -9105,7 +9726,7 @@ AppsV1API_patchNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -9181,17 +9802,20 @@ AppsV1API_patchNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9200,6 +9824,7 @@ AppsV1API_patchNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -9215,11 +9840,14 @@ AppsV1API_patchNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_t *elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9319,15 +9947,22 @@ AppsV1API_patchNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -9337,7 +9972,7 @@ AppsV1API_patchNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -9413,17 +10048,20 @@ AppsV1API_patchNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9432,6 +10070,7 @@ AppsV1API_patchNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -9447,11 +10086,14 @@ AppsV1API_patchNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9551,15 +10193,22 @@ AppsV1API_patchNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -9569,7 +10218,7 @@ AppsV1API_patchNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -9645,17 +10294,20 @@ AppsV1API_patchNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9664,6 +10316,7 @@ AppsV1API_patchNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -9679,11 +10332,14 @@ AppsV1API_patchNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_t *elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9783,15 +10439,22 @@ AppsV1API_patchNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -9801,7 +10464,7 @@ AppsV1API_patchNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -9877,17 +10540,20 @@ AppsV1API_patchNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9896,6 +10562,7 @@ AppsV1API_patchNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -9911,11 +10578,14 @@ AppsV1API_patchNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_t *elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10015,15 +10685,22 @@ AppsV1API_patchNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -10033,7 +10710,7 @@ AppsV1API_patchNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10109,17 +10786,20 @@ AppsV1API_patchNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10128,6 +10808,7 @@ AppsV1API_patchNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -10143,11 +10824,14 @@ AppsV1API_patchNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10247,15 +10931,22 @@ AppsV1API_patchNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -10265,7 +10956,7 @@ AppsV1API_patchNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10341,17 +11032,20 @@ AppsV1API_patchNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10360,6 +11054,7 @@ AppsV1API_patchNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -10375,11 +11070,14 @@ AppsV1API_patchNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_t *elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10479,15 +11177,22 @@ AppsV1API_readNamespacedControllerRevision(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -10497,7 +11202,7 @@ AppsV1API_readNamespacedControllerRevision(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10522,6 +11227,7 @@ AppsV1API_readNamespacedControllerRevision(apiClient_t *apiClient, char *name, c list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10530,6 +11236,7 @@ AppsV1API_readNamespacedControllerRevision(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -10541,11 +11248,14 @@ AppsV1API_readNamespacedControllerRevision(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_controller_revision_t *elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_controller_revision_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10592,15 +11302,22 @@ AppsV1API_readNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -10610,7 +11327,7 @@ AppsV1API_readNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10635,6 +11352,7 @@ AppsV1API_readNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10643,6 +11361,7 @@ AppsV1API_readNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -10654,11 +11373,14 @@ AppsV1API_readNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_t *elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10705,15 +11427,22 @@ AppsV1API_readNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -10723,7 +11452,7 @@ AppsV1API_readNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10748,6 +11477,7 @@ AppsV1API_readNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10756,6 +11486,7 @@ AppsV1API_readNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -10767,11 +11498,14 @@ AppsV1API_readNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_t *elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10818,15 +11552,22 @@ AppsV1API_readNamespacedDeployment(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -10836,7 +11577,7 @@ AppsV1API_readNamespacedDeployment(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10861,6 +11602,7 @@ AppsV1API_readNamespacedDeployment(apiClient_t *apiClient, char *name, char *_na list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10869,6 +11611,7 @@ AppsV1API_readNamespacedDeployment(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -10880,11 +11623,14 @@ AppsV1API_readNamespacedDeployment(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_t *elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10931,15 +11677,22 @@ AppsV1API_readNamespacedDeploymentScale(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -10949,7 +11702,7 @@ AppsV1API_readNamespacedDeploymentScale(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10974,6 +11727,7 @@ AppsV1API_readNamespacedDeploymentScale(apiClient_t *apiClient, char *name, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10982,6 +11736,7 @@ AppsV1API_readNamespacedDeploymentScale(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -10993,11 +11748,14 @@ AppsV1API_readNamespacedDeploymentScale(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11044,15 +11802,22 @@ AppsV1API_readNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11062,7 +11827,7 @@ AppsV1API_readNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11087,6 +11852,7 @@ AppsV1API_readNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, cha list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11095,6 +11861,7 @@ AppsV1API_readNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -11106,11 +11873,14 @@ AppsV1API_readNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_t *elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11157,15 +11927,22 @@ AppsV1API_readNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11175,7 +11952,7 @@ AppsV1API_readNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11200,6 +11977,7 @@ AppsV1API_readNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_na list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11208,6 +11986,7 @@ AppsV1API_readNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -11219,11 +11998,14 @@ AppsV1API_readNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_t *elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11270,15 +12052,22 @@ AppsV1API_readNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11288,7 +12077,7 @@ AppsV1API_readNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11313,6 +12102,7 @@ AppsV1API_readNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11321,6 +12111,7 @@ AppsV1API_readNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -11332,11 +12123,14 @@ AppsV1API_readNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11383,15 +12177,22 @@ AppsV1API_readNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11401,7 +12202,7 @@ AppsV1API_readNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11426,6 +12227,7 @@ AppsV1API_readNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, cha list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11434,6 +12236,7 @@ AppsV1API_readNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -11445,11 +12248,14 @@ AppsV1API_readNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_t *elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11496,15 +12302,22 @@ AppsV1API_readNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11514,7 +12327,7 @@ AppsV1API_readNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11539,6 +12352,7 @@ AppsV1API_readNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_n list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11547,6 +12361,7 @@ AppsV1API_readNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -11558,11 +12373,14 @@ AppsV1API_readNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_t *elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11609,15 +12427,22 @@ AppsV1API_readNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11627,7 +12452,7 @@ AppsV1API_readNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11652,6 +12477,7 @@ AppsV1API_readNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, cha list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11660,6 +12486,7 @@ AppsV1API_readNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -11671,11 +12498,14 @@ AppsV1API_readNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11722,15 +12552,22 @@ AppsV1API_readNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11740,7 +12577,7 @@ AppsV1API_readNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11765,6 +12602,7 @@ AppsV1API_readNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11773,6 +12611,7 @@ AppsV1API_readNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -11784,11 +12623,14 @@ AppsV1API_readNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_t *elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11835,15 +12677,22 @@ AppsV1API_replaceNamespacedControllerRevision(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -11853,7 +12702,7 @@ AppsV1API_replaceNamespacedControllerRevision(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11916,13 +12765,15 @@ AppsV1API_replaceNamespacedControllerRevision(apiClient_t *apiClient, char *name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_controller_revision_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11931,6 +12782,7 @@ AppsV1API_replaceNamespacedControllerRevision(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -11946,11 +12798,14 @@ AppsV1API_replaceNamespacedControllerRevision(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_controller_revision_t *elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_controller_revision_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_controller_revision_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12038,15 +12893,22 @@ AppsV1API_replaceNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -12056,7 +12918,7 @@ AppsV1API_replaceNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -12119,13 +12981,15 @@ AppsV1API_replaceNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_daemon_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -12134,6 +12998,7 @@ AppsV1API_replaceNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -12149,11 +13014,14 @@ AppsV1API_replaceNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_t *elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12241,15 +13109,22 @@ AppsV1API_replaceNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -12259,7 +13134,7 @@ AppsV1API_replaceNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -12322,13 +13197,15 @@ AppsV1API_replaceNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_daemon_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -12337,6 +13214,7 @@ AppsV1API_replaceNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -12352,11 +13230,14 @@ AppsV1API_replaceNamespacedDaemonSetStatus(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_daemon_set_t *elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_daemon_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_daemon_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12444,15 +13325,22 @@ AppsV1API_replaceNamespacedDeployment(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -12462,7 +13350,7 @@ AppsV1API_replaceNamespacedDeployment(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -12525,13 +13413,15 @@ AppsV1API_replaceNamespacedDeployment(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_deployment_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -12540,6 +13430,7 @@ AppsV1API_replaceNamespacedDeployment(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -12555,11 +13446,14 @@ AppsV1API_replaceNamespacedDeployment(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_t *elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12647,15 +13541,22 @@ AppsV1API_replaceNamespacedDeploymentScale(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -12665,7 +13566,7 @@ AppsV1API_replaceNamespacedDeploymentScale(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -12728,13 +13629,15 @@ AppsV1API_replaceNamespacedDeploymentScale(apiClient_t *apiClient, char *name, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_scale_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -12743,6 +13646,7 @@ AppsV1API_replaceNamespacedDeploymentScale(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -12758,11 +13662,14 @@ AppsV1API_replaceNamespacedDeploymentScale(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12850,15 +13757,22 @@ AppsV1API_replaceNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -12868,7 +13782,7 @@ AppsV1API_replaceNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -12931,13 +13845,15 @@ AppsV1API_replaceNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_deployment_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -12946,6 +13862,7 @@ AppsV1API_replaceNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -12961,11 +13878,14 @@ AppsV1API_replaceNamespacedDeploymentStatus(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_deployment_t *elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_deployment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_deployment_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -13053,15 +13973,22 @@ AppsV1API_replaceNamespacedReplicaSet(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -13071,7 +13998,7 @@ AppsV1API_replaceNamespacedReplicaSet(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13134,13 +14061,15 @@ AppsV1API_replaceNamespacedReplicaSet(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_replica_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -13149,6 +14078,7 @@ AppsV1API_replaceNamespacedReplicaSet(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -13164,11 +14094,14 @@ AppsV1API_replaceNamespacedReplicaSet(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_t *elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -13256,15 +14189,22 @@ AppsV1API_replaceNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -13274,7 +14214,7 @@ AppsV1API_replaceNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13337,13 +14277,15 @@ AppsV1API_replaceNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_scale_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -13352,6 +14294,7 @@ AppsV1API_replaceNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -13367,11 +14310,14 @@ AppsV1API_replaceNamespacedReplicaSetScale(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -13459,15 +14405,22 @@ AppsV1API_replaceNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -13477,7 +14430,7 @@ AppsV1API_replaceNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13540,13 +14493,15 @@ AppsV1API_replaceNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_replica_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -13555,6 +14510,7 @@ AppsV1API_replaceNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -13570,11 +14526,14 @@ AppsV1API_replaceNamespacedReplicaSetStatus(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replica_set_t *elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replica_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replica_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -13662,15 +14621,22 @@ AppsV1API_replaceNamespacedStatefulSet(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -13680,7 +14646,7 @@ AppsV1API_replaceNamespacedStatefulSet(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13743,13 +14709,15 @@ AppsV1API_replaceNamespacedStatefulSet(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_stateful_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -13758,6 +14726,7 @@ AppsV1API_replaceNamespacedStatefulSet(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -13773,11 +14742,14 @@ AppsV1API_replaceNamespacedStatefulSet(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_t *elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -13865,15 +14837,22 @@ AppsV1API_replaceNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -13883,7 +14862,7 @@ AppsV1API_replaceNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13946,13 +14925,15 @@ AppsV1API_replaceNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_scale_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -13961,6 +14942,7 @@ AppsV1API_replaceNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -13976,11 +14958,14 @@ AppsV1API_replaceNamespacedStatefulSetScale(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -14068,15 +15053,22 @@ AppsV1API_replaceNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status"); + char *localVarPath = strdup("/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -14086,7 +15078,7 @@ AppsV1API_replaceNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -14149,13 +15141,15 @@ AppsV1API_replaceNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_stateful_set_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -14164,6 +15158,7 @@ AppsV1API_replaceNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -14179,11 +15174,14 @@ AppsV1API_replaceNamespacedStatefulSetStatus(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_stateful_set_t *elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); - cJSON_Delete(AppsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_stateful_set_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AppsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_stateful_set_parseFromJSON(AppsV1APIlocalVarJSON); + cJSON_Delete(AppsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AppsV1API.h b/kubernetes/api/AppsV1API.h index 0e4de6d1..4524b0d0 100644 --- a/kubernetes/api/AppsV1API.h +++ b/kubernetes/api/AppsV1API.h @@ -55,61 +55,61 @@ AppsV1API_createNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, // delete collection of ControllerRevision // v1_status_t* -AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of DaemonSet // v1_status_t* -AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Deployment // v1_status_t* -AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ReplicaSet // v1_status_t* -AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of StatefulSet // v1_status_t* -AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a ControllerRevision // v1_status_t* -AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a DaemonSet // v1_status_t* -AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a Deployment // v1_status_t* -AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ReplicaSet // v1_status_t* -AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a StatefulSet // v1_status_t* -AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/AuthenticationAPI.c b/kubernetes/api/AuthenticationAPI.c index f1556a39..e0482eef 100644 --- a/kubernetes/api/AuthenticationAPI.c +++ b/kubernetes/api/AuthenticationAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "AuthenticationAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ AuthenticationAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/"); + char *localVarPath = strdup("/apis/authentication.k8s.io/"); + @@ -42,6 +42,7 @@ AuthenticationAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ AuthenticationAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthenticationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(AuthenticationAPIlocalVarJSON); - cJSON_Delete(AuthenticationAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthenticationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(AuthenticationAPIlocalVarJSON); + cJSON_Delete(AuthenticationAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AuthenticationV1API.c b/kubernetes/api/AuthenticationV1API.c index fdb04370..fe4f2950 100644 --- a/kubernetes/api/AuthenticationV1API.c +++ b/kubernetes/api/AuthenticationV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "AuthenticationV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a SelfSubjectReview @@ -23,11 +20,14 @@ AuthenticationV1API_createSelfSubjectReview(apiClient_t *apiClient, v1_self_subj list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/v1/selfsubjectreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/v1/selfsubjectreviews"); + char *localVarPath = strdup("/apis/authentication.k8s.io/v1/selfsubjectreviews"); + @@ -84,13 +84,15 @@ AuthenticationV1API_createSelfSubjectReview(apiClient_t *apiClient, v1_self_subj cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_self_subject_review_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ AuthenticationV1API_createSelfSubjectReview(apiClient_t *apiClient, v1_self_subj localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ AuthenticationV1API_createSelfSubjectReview(apiClient_t *apiClient, v1_self_subj // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthenticationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_self_subject_review_t *elementToReturn = v1_self_subject_review_parseFromJSON(AuthenticationV1APIlocalVarJSON); - cJSON_Delete(AuthenticationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_self_subject_review_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthenticationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_self_subject_review_parseFromJSON(AuthenticationV1APIlocalVarJSON); + cJSON_Delete(AuthenticationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -208,11 +214,14 @@ AuthenticationV1API_createTokenReview(apiClient_t *apiClient, v1_token_review_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/v1/tokenreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/v1/tokenreviews"); + char *localVarPath = strdup("/apis/authentication.k8s.io/v1/tokenreviews"); + @@ -269,13 +278,15 @@ AuthenticationV1API_createTokenReview(apiClient_t *apiClient, v1_token_review_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_token_review_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -284,6 +295,7 @@ AuthenticationV1API_createTokenReview(apiClient_t *apiClient, v1_token_review_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -303,11 +315,14 @@ AuthenticationV1API_createTokenReview(apiClient_t *apiClient, v1_token_review_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthenticationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_token_review_t *elementToReturn = v1_token_review_parseFromJSON(AuthenticationV1APIlocalVarJSON); - cJSON_Delete(AuthenticationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_token_review_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthenticationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_token_review_parseFromJSON(AuthenticationV1APIlocalVarJSON); + cJSON_Delete(AuthenticationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -393,17 +408,21 @@ AuthenticationV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/v1/"); + char *localVarPath = strdup("/apis/authentication.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -412,6 +431,7 @@ AuthenticationV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -423,11 +443,14 @@ AuthenticationV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthenticationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AuthenticationV1APIlocalVarJSON); - cJSON_Delete(AuthenticationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthenticationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AuthenticationV1APIlocalVarJSON); + cJSON_Delete(AuthenticationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AuthenticationV1alpha1API.c b/kubernetes/api/AuthenticationV1alpha1API.c deleted file mode 100644 index ac31213b..00000000 --- a/kubernetes/api/AuthenticationV1alpha1API.c +++ /dev/null @@ -1,266 +0,0 @@ -#include -#include -#include -#include "AuthenticationV1alpha1API.h" - -#define MAX_NUMBER_LENGTH 16 -#define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) - - -// create a SelfSubjectReview -// -v1alpha1_self_subject_review_t* -AuthenticationV1alpha1API_createSelfSubjectReview(apiClient_t *apiClient, v1alpha1_self_subject_review_t *body, char *dryRun, char *fieldManager, char *fieldValidation, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/v1alpha1/selfsubjectreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/v1alpha1/selfsubjectreviews"); - - - - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_self_subject_review_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AuthenticationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_self_subject_review_t *elementToReturn = v1alpha1_self_subject_review_parseFromJSON(AuthenticationV1alpha1APIlocalVarJSON); - cJSON_Delete(AuthenticationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// get available resources -// -v1_api_resource_list_t* -AuthenticationV1alpha1API_getAPIResources(apiClient_t *apiClient) -{ - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/v1alpha1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/v1alpha1/"); - - - - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AuthenticationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AuthenticationV1alpha1APIlocalVarJSON); - cJSON_Delete(AuthenticationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - diff --git a/kubernetes/api/AuthenticationV1alpha1API.h b/kubernetes/api/AuthenticationV1alpha1API.h deleted file mode 100644 index 106475cf..00000000 --- a/kubernetes/api/AuthenticationV1alpha1API.h +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include "../include/apiClient.h" -#include "../include/list.h" -#include "../external/cJSON.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "../model/v1_api_resource_list.h" -#include "../model/v1alpha1_self_subject_review.h" - - -// create a SelfSubjectReview -// -v1alpha1_self_subject_review_t* -AuthenticationV1alpha1API_createSelfSubjectReview(apiClient_t *apiClient, v1alpha1_self_subject_review_t *body, char *dryRun, char *fieldManager, char *fieldValidation, char *pretty); - - -// get available resources -// -v1_api_resource_list_t* -AuthenticationV1alpha1API_getAPIResources(apiClient_t *apiClient); - - diff --git a/kubernetes/api/AuthenticationV1beta1API.c b/kubernetes/api/AuthenticationV1beta1API.c deleted file mode 100644 index d6f0c260..00000000 --- a/kubernetes/api/AuthenticationV1beta1API.c +++ /dev/null @@ -1,266 +0,0 @@ -#include -#include -#include -#include "AuthenticationV1beta1API.h" - -#define MAX_NUMBER_LENGTH 16 -#define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) - - -// create a SelfSubjectReview -// -v1beta1_self_subject_review_t* -AuthenticationV1beta1API_createSelfSubjectReview(apiClient_t *apiClient, v1beta1_self_subject_review_t *body, char *dryRun, char *fieldManager, char *fieldValidation, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/v1beta1/selfsubjectreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/v1beta1/selfsubjectreviews"); - - - - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta1_self_subject_review_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AuthenticationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta1_self_subject_review_t *elementToReturn = v1beta1_self_subject_review_parseFromJSON(AuthenticationV1beta1APIlocalVarJSON); - cJSON_Delete(AuthenticationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// get available resources -// -v1_api_resource_list_t* -AuthenticationV1beta1API_getAPIResources(apiClient_t *apiClient) -{ - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/authentication.k8s.io/v1beta1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authentication.k8s.io/v1beta1/"); - - - - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *AuthenticationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AuthenticationV1beta1APIlocalVarJSON); - cJSON_Delete(AuthenticationV1beta1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - diff --git a/kubernetes/api/AuthenticationV1beta1API.h b/kubernetes/api/AuthenticationV1beta1API.h deleted file mode 100644 index 35a2468a..00000000 --- a/kubernetes/api/AuthenticationV1beta1API.h +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include "../include/apiClient.h" -#include "../include/list.h" -#include "../external/cJSON.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "../model/v1_api_resource_list.h" -#include "../model/v1beta1_self_subject_review.h" - - -// create a SelfSubjectReview -// -v1beta1_self_subject_review_t* -AuthenticationV1beta1API_createSelfSubjectReview(apiClient_t *apiClient, v1beta1_self_subject_review_t *body, char *dryRun, char *fieldManager, char *fieldValidation, char *pretty); - - -// get available resources -// -v1_api_resource_list_t* -AuthenticationV1beta1API_getAPIResources(apiClient_t *apiClient); - - diff --git a/kubernetes/api/AuthorizationAPI.c b/kubernetes/api/AuthorizationAPI.c index 10ad410c..ecd0c1c4 100644 --- a/kubernetes/api/AuthorizationAPI.c +++ b/kubernetes/api/AuthorizationAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "AuthorizationAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ AuthorizationAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authorization.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authorization.k8s.io/"); + char *localVarPath = strdup("/apis/authorization.k8s.io/"); + @@ -42,6 +42,7 @@ AuthorizationAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ AuthorizationAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthorizationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(AuthorizationAPIlocalVarJSON); - cJSON_Delete(AuthorizationAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthorizationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(AuthorizationAPIlocalVarJSON); + cJSON_Delete(AuthorizationAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AuthorizationV1API.c b/kubernetes/api/AuthorizationV1API.c index 345f8b4e..f2b72b3e 100644 --- a/kubernetes/api/AuthorizationV1API.c +++ b/kubernetes/api/AuthorizationV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "AuthorizationV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a LocalSubjectAccessReview @@ -23,15 +20,20 @@ AuthorizationV1API_createNamespacedLocalSubjectAccessReview(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews"); + char *localVarPath = strdup("/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ AuthorizationV1API_createNamespacedLocalSubjectAccessReview(apiClient_t *apiClie cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_local_subject_access_review_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ AuthorizationV1API_createNamespacedLocalSubjectAccessReview(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ AuthorizationV1API_createNamespacedLocalSubjectAccessReview(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_local_subject_access_review_t *elementToReturn = v1_local_subject_access_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); - cJSON_Delete(AuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_local_subject_access_review_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_local_subject_access_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); + cJSON_Delete(AuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -219,11 +227,14 @@ AuthorizationV1API_createSelfSubjectAccessReview(apiClient_t *apiClient, v1_self list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authorization.k8s.io/v1/selfsubjectaccessreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews"); + char *localVarPath = strdup("/apis/authorization.k8s.io/v1/selfsubjectaccessreviews"); + @@ -280,13 +291,15 @@ AuthorizationV1API_createSelfSubjectAccessReview(apiClient_t *apiClient, v1_self cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_self_subject_access_review_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -295,6 +308,7 @@ AuthorizationV1API_createSelfSubjectAccessReview(apiClient_t *apiClient, v1_self localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -314,11 +328,14 @@ AuthorizationV1API_createSelfSubjectAccessReview(apiClient_t *apiClient, v1_self // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_self_subject_access_review_t *elementToReturn = v1_self_subject_access_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); - cJSON_Delete(AuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_self_subject_access_review_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_self_subject_access_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); + cJSON_Delete(AuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -404,11 +421,14 @@ AuthorizationV1API_createSelfSubjectRulesReview(apiClient_t *apiClient, v1_self_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authorization.k8s.io/v1/selfsubjectrulesreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews"); + char *localVarPath = strdup("/apis/authorization.k8s.io/v1/selfsubjectrulesreviews"); + @@ -465,13 +485,15 @@ AuthorizationV1API_createSelfSubjectRulesReview(apiClient_t *apiClient, v1_self_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_self_subject_rules_review_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -480,6 +502,7 @@ AuthorizationV1API_createSelfSubjectRulesReview(apiClient_t *apiClient, v1_self_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -499,11 +522,14 @@ AuthorizationV1API_createSelfSubjectRulesReview(apiClient_t *apiClient, v1_self_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_self_subject_rules_review_t *elementToReturn = v1_self_subject_rules_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); - cJSON_Delete(AuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_self_subject_rules_review_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_self_subject_rules_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); + cJSON_Delete(AuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -589,11 +615,14 @@ AuthorizationV1API_createSubjectAccessReview(apiClient_t *apiClient, v1_subject_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authorization.k8s.io/v1/subjectaccessreviews")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authorization.k8s.io/v1/subjectaccessreviews"); + char *localVarPath = strdup("/apis/authorization.k8s.io/v1/subjectaccessreviews"); + @@ -650,13 +679,15 @@ AuthorizationV1API_createSubjectAccessReview(apiClient_t *apiClient, v1_subject_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_subject_access_review_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -665,6 +696,7 @@ AuthorizationV1API_createSubjectAccessReview(apiClient_t *apiClient, v1_subject_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -684,11 +716,14 @@ AuthorizationV1API_createSubjectAccessReview(apiClient_t *apiClient, v1_subject_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_subject_access_review_t *elementToReturn = v1_subject_access_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); - cJSON_Delete(AuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_subject_access_review_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_subject_access_review_parseFromJSON(AuthorizationV1APIlocalVarJSON); + cJSON_Delete(AuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -774,17 +809,21 @@ AuthorizationV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/authorization.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/authorization.k8s.io/v1/"); + char *localVarPath = strdup("/apis/authorization.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -793,6 +832,7 @@ AuthorizationV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -804,11 +844,14 @@ AuthorizationV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AuthorizationV1APIlocalVarJSON); - cJSON_Delete(AuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AuthorizationV1APIlocalVarJSON); + cJSON_Delete(AuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AutoscalingAPI.c b/kubernetes/api/AutoscalingAPI.c index 2c66377e..77f56ad4 100644 --- a/kubernetes/api/AutoscalingAPI.c +++ b/kubernetes/api/AutoscalingAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "AutoscalingAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ AutoscalingAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/"); + char *localVarPath = strdup("/apis/autoscaling/"); + @@ -42,6 +42,7 @@ AutoscalingAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ AutoscalingAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(AutoscalingAPIlocalVarJSON); - cJSON_Delete(AutoscalingAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(AutoscalingAPIlocalVarJSON); + cJSON_Delete(AutoscalingAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AutoscalingV1API.c b/kubernetes/api/AutoscalingV1API.c index da039d46..05c5c1dc 100644 --- a/kubernetes/api/AutoscalingV1API.c +++ b/kubernetes/api/AutoscalingV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "AutoscalingV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a HorizontalPodAutoscaler @@ -23,15 +20,20 @@ AutoscalingV1API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ AutoscalingV1API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_horizontal_pod_autoscaler_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ AutoscalingV1API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ AutoscalingV1API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_t *elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -211,7 +219,7 @@ AutoscalingV1API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // delete collection of HorizontalPodAutoscaler // v1_status_t* -AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -219,15 +227,20 @@ AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -299,6 +312,19 @@ AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -403,13 +429,15 @@ AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -418,6 +446,7 @@ AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -429,11 +458,14 @@ AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -514,6 +546,18 @@ AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -620,7 +664,7 @@ AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * // delete a HorizontalPodAutoscaler // v1_status_t* -AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -628,15 +672,22 @@ AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -646,7 +697,7 @@ AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -694,6 +745,19 @@ AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -723,13 +787,15 @@ AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -738,6 +804,7 @@ AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -753,11 +820,14 @@ AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -815,6 +885,18 @@ AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -857,17 +939,21 @@ AutoscalingV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/"); + char *localVarPath = strdup("/apis/autoscaling/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -876,6 +962,7 @@ AutoscalingV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -887,11 +974,14 @@ AutoscalingV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -924,11 +1014,14 @@ AutoscalingV1API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v1/horizontalpodautoscalers"); + @@ -1072,8 +1165,10 @@ AutoscalingV1API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1082,6 +1177,7 @@ AutoscalingV1API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1093,11 +1189,14 @@ AutoscalingV1API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_list_t *elementToReturn = v1_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1262,15 +1361,20 @@ AutoscalingV1API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1420,8 +1524,10 @@ AutoscalingV1API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1430,6 +1536,7 @@ AutoscalingV1API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1441,11 +1548,14 @@ AutoscalingV1API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_list_t *elementToReturn = v1_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1611,15 +1721,22 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1629,7 +1746,7 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1705,17 +1822,20 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1724,6 +1844,7 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1739,11 +1860,14 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_t *elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1843,15 +1967,22 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1861,7 +1992,7 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1937,17 +2068,20 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1956,6 +2090,7 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1971,11 +2106,14 @@ AutoscalingV1API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_t *elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2075,15 +2213,22 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2093,7 +2238,7 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2118,6 +2263,7 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2126,6 +2272,7 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2137,11 +2284,14 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_t *elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2188,15 +2338,22 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2206,7 +2363,7 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2231,6 +2388,7 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2239,6 +2397,7 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2250,11 +2409,14 @@ AutoscalingV1API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_t *elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2301,15 +2463,22 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2319,7 +2488,7 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2382,13 +2551,15 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_horizontal_pod_autoscaler_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2397,6 +2568,7 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2412,11 +2584,14 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_t *elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2504,15 +2679,22 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + char *localVarPath = strdup("/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2522,7 +2704,7 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2585,13 +2767,15 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_horizontal_pod_autoscaler_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2600,6 +2784,7 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2615,11 +2800,14 @@ AutoscalingV1API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_horizontal_pod_autoscaler_t *elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); - cJSON_Delete(AutoscalingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV1APIlocalVarJSON); + cJSON_Delete(AutoscalingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AutoscalingV1API.h b/kubernetes/api/AutoscalingV1API.h index bb3f972a..5ab1cd5f 100644 --- a/kubernetes/api/AutoscalingV1API.h +++ b/kubernetes/api/AutoscalingV1API.h @@ -22,13 +22,13 @@ AutoscalingV1API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // delete collection of HorizontalPodAutoscaler // v1_status_t* -AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a HorizontalPodAutoscaler // v1_status_t* -AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/AutoscalingV2API.c b/kubernetes/api/AutoscalingV2API.c index 20b415ec..cc80fbd4 100644 --- a/kubernetes/api/AutoscalingV2API.c +++ b/kubernetes/api/AutoscalingV2API.c @@ -1,15 +1,12 @@ #include #include #include + #include "AutoscalingV2API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a HorizontalPodAutoscaler @@ -23,15 +20,20 @@ AutoscalingV2API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ AutoscalingV2API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v2_horizontal_pod_autoscaler_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ AutoscalingV2API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ AutoscalingV2API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_t *elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -211,7 +219,7 @@ AutoscalingV2API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // delete collection of HorizontalPodAutoscaler // v1_status_t* -AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -219,15 +227,20 @@ AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -299,6 +312,19 @@ AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -403,13 +429,15 @@ AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -418,6 +446,7 @@ AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -429,11 +458,14 @@ AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -514,6 +546,18 @@ AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -620,7 +664,7 @@ AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t * // delete a HorizontalPodAutoscaler // v1_status_t* -AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -628,15 +672,22 @@ AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -646,7 +697,7 @@ AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -694,6 +745,19 @@ AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -723,13 +787,15 @@ AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -738,6 +804,7 @@ AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -753,11 +820,14 @@ AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -815,6 +885,18 @@ AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -857,17 +939,21 @@ AutoscalingV2API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/"); + char *localVarPath = strdup("/apis/autoscaling/v2/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -876,6 +962,7 @@ AutoscalingV2API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -887,11 +974,14 @@ AutoscalingV2API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -924,11 +1014,14 @@ AutoscalingV2API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v2/horizontalpodautoscalers"); + @@ -1072,8 +1165,10 @@ AutoscalingV2API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1082,6 +1177,7 @@ AutoscalingV2API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1093,11 +1189,14 @@ AutoscalingV2API_listHorizontalPodAutoscalerForAllNamespaces(apiClient_t *apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_list_t *elementToReturn = v2_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1262,15 +1361,20 @@ AutoscalingV2API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1420,8 +1524,10 @@ AutoscalingV2API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1430,6 +1536,7 @@ AutoscalingV2API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1441,11 +1548,14 @@ AutoscalingV2API_listNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_list_t *elementToReturn = v2_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_list_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1611,15 +1721,22 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1629,7 +1746,7 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1705,17 +1822,20 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1724,6 +1844,7 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1739,11 +1860,14 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_t *elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1843,15 +1967,22 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1861,7 +1992,7 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1937,17 +2068,20 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1956,6 +2090,7 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1971,11 +2106,14 @@ AutoscalingV2API_patchNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_t *elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2075,15 +2213,22 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2093,7 +2238,7 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2118,6 +2263,7 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2126,6 +2272,7 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2137,11 +2284,14 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_t *elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2188,15 +2338,22 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2206,7 +2363,7 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2231,6 +2388,7 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2239,6 +2397,7 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2250,11 +2409,14 @@ AutoscalingV2API_readNamespacedHorizontalPodAutoscalerStatus(apiClient_t *apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_t *elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2301,15 +2463,22 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2319,7 +2488,7 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2382,13 +2551,15 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v2_horizontal_pod_autoscaler_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2397,6 +2568,7 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2412,11 +2584,14 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_t *elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2504,15 +2679,22 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + char *localVarPath = strdup("/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2522,7 +2704,7 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2585,13 +2767,15 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v2_horizontal_pod_autoscaler_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2600,6 +2784,7 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2615,11 +2800,14 @@ AutoscalingV2API_replaceNamespacedHorizontalPodAutoscalerStatus(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v2_horizontal_pod_autoscaler_t *elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); - cJSON_Delete(AutoscalingV2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v2_horizontal_pod_autoscaler_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *AutoscalingV2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v2_horizontal_pod_autoscaler_parseFromJSON(AutoscalingV2APIlocalVarJSON); + cJSON_Delete(AutoscalingV2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/AutoscalingV2API.h b/kubernetes/api/AutoscalingV2API.h index 4c83d72a..bf21449b 100644 --- a/kubernetes/api/AutoscalingV2API.h +++ b/kubernetes/api/AutoscalingV2API.h @@ -22,13 +22,13 @@ AutoscalingV2API_createNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, // delete collection of HorizontalPodAutoscaler // v1_status_t* -AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a HorizontalPodAutoscaler // v1_status_t* -AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/BatchAPI.c b/kubernetes/api/BatchAPI.c index 8440f885..8a32a4f9 100644 --- a/kubernetes/api/BatchAPI.c +++ b/kubernetes/api/BatchAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "BatchAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ BatchAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/"); + char *localVarPath = strdup("/apis/batch/"); + @@ -42,6 +42,7 @@ BatchAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ BatchAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(BatchAPIlocalVarJSON); - cJSON_Delete(BatchAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(BatchAPIlocalVarJSON); + cJSON_Delete(BatchAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/BatchV1API.c b/kubernetes/api/BatchV1API.c index 928d6296..d1e102c5 100644 --- a/kubernetes/api/BatchV1API.c +++ b/kubernetes/api/BatchV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "BatchV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a CronJob @@ -23,15 +20,20 @@ BatchV1API_createNamespacedCronJob(apiClient_t *apiClient, char *_namespace, v1_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ BatchV1API_createNamespacedCronJob(apiClient_t *apiClient, char *_namespace, v1_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_cron_job_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ BatchV1API_createNamespacedCronJob(apiClient_t *apiClient, char *_namespace, v1_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ BatchV1API_createNamespacedCronJob(apiClient_t *apiClient, char *_namespace, v1_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_t *elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -219,15 +227,20 @@ BatchV1API_createNamespacedJob(apiClient_t *apiClient, char *_namespace, v1_job_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -290,13 +303,15 @@ BatchV1API_createNamespacedJob(apiClient_t *apiClient, char *_namespace, v1_job_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_job_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -305,6 +320,7 @@ BatchV1API_createNamespacedJob(apiClient_t *apiClient, char *_namespace, v1_job_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -324,11 +340,14 @@ BatchV1API_createNamespacedJob(apiClient_t *apiClient, char *_namespace, v1_job_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_t *elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -407,7 +426,7 @@ BatchV1API_createNamespacedJob(apiClient_t *apiClient, char *_namespace, v1_job_ // delete collection of CronJob // v1_status_t* -BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -415,15 +434,20 @@ BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -495,6 +519,19 @@ BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_name list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -599,13 +636,15 @@ BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -614,6 +653,7 @@ BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -625,11 +665,14 @@ BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -710,6 +753,18 @@ BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_name keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -816,7 +871,7 @@ BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_name // delete collection of Job // v1_status_t* -BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -824,15 +879,20 @@ BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespac list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -904,6 +964,19 @@ BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespac list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1008,13 +1081,15 @@ BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespac cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1023,6 +1098,7 @@ BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespac localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1034,11 +1110,14 @@ BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespac // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1119,6 +1198,18 @@ BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespac keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1225,7 +1316,7 @@ BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespac // delete a CronJob // v1_status_t* -BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1233,15 +1324,22 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1251,7 +1349,7 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1299,6 +1397,19 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1328,13 +1439,15 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1343,6 +1456,7 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1358,11 +1472,14 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1420,6 +1537,18 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1454,7 +1583,7 @@ BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_na // delete a Job // v1_status_t* -BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1462,15 +1591,22 @@ BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1480,7 +1616,7 @@ BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namesp localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1528,6 +1664,19 @@ BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namesp list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1557,13 +1706,15 @@ BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namesp cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1572,6 +1723,7 @@ BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1587,11 +1739,14 @@ BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namesp // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1649,6 +1804,18 @@ BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namesp keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1691,17 +1858,21 @@ BatchV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/"); + char *localVarPath = strdup("/apis/batch/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1710,6 +1881,7 @@ BatchV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1721,11 +1893,14 @@ BatchV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1758,11 +1933,14 @@ BatchV1API_listCronJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBo list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/cronjobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/cronjobs"); + char *localVarPath = strdup("/apis/batch/v1/cronjobs"); + @@ -1906,8 +2084,10 @@ BatchV1API_listCronJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBo list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1916,6 +2096,7 @@ BatchV1API_listCronJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBo localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1927,11 +2108,14 @@ BatchV1API_listCronJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBo // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_list_t *elementToReturn = v1_cron_job_list_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_list_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2096,11 +2280,14 @@ BatchV1API_listJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookma list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/jobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/jobs"); + char *localVarPath = strdup("/apis/batch/v1/jobs"); + @@ -2244,8 +2431,10 @@ BatchV1API_listJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookma list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2254,6 +2443,7 @@ BatchV1API_listJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookma localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2265,11 +2455,14 @@ BatchV1API_listJobForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookma // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_list_t *elementToReturn = v1_job_list_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_list_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2434,15 +2627,20 @@ BatchV1API_listNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2592,8 +2790,10 @@ BatchV1API_listNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2602,6 +2802,7 @@ BatchV1API_listNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2613,11 +2814,14 @@ BatchV1API_listNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_list_t *elementToReturn = v1_cron_job_list_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_list_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2783,15 +2987,20 @@ BatchV1API_listNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pre list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2941,8 +3150,10 @@ BatchV1API_listNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pre list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2951,6 +3162,7 @@ BatchV1API_listNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pre localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2962,11 +3174,14 @@ BatchV1API_listNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pre // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_list_t *elementToReturn = v1_job_list_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_list_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3132,15 +3347,22 @@ BatchV1API_patchNamespacedCronJob(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3150,7 +3372,7 @@ BatchV1API_patchNamespacedCronJob(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3226,17 +3448,20 @@ BatchV1API_patchNamespacedCronJob(apiClient_t *apiClient, char *name, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3245,6 +3470,7 @@ BatchV1API_patchNamespacedCronJob(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3260,11 +3486,14 @@ BatchV1API_patchNamespacedCronJob(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_t *elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3364,15 +3593,22 @@ BatchV1API_patchNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3382,7 +3618,7 @@ BatchV1API_patchNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3458,17 +3694,20 @@ BatchV1API_patchNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3477,6 +3716,7 @@ BatchV1API_patchNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3492,11 +3732,14 @@ BatchV1API_patchNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_t *elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3596,15 +3839,22 @@ BatchV1API_patchNamespacedJob(apiClient_t *apiClient, char *name, char *_namespa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3614,7 +3864,7 @@ BatchV1API_patchNamespacedJob(apiClient_t *apiClient, char *name, char *_namespa localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3690,17 +3940,20 @@ BatchV1API_patchNamespacedJob(apiClient_t *apiClient, char *name, char *_namespa cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3709,6 +3962,7 @@ BatchV1API_patchNamespacedJob(apiClient_t *apiClient, char *name, char *_namespa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3724,11 +3978,14 @@ BatchV1API_patchNamespacedJob(apiClient_t *apiClient, char *name, char *_namespa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_t *elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3828,15 +4085,22 @@ BatchV1API_patchNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3846,7 +4110,7 @@ BatchV1API_patchNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3922,17 +4186,20 @@ BatchV1API_patchNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3941,6 +4208,7 @@ BatchV1API_patchNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3956,11 +4224,14 @@ BatchV1API_patchNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_t *elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4060,15 +4331,22 @@ BatchV1API_readNamespacedCronJob(apiClient_t *apiClient, char *name, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4078,7 +4356,7 @@ BatchV1API_readNamespacedCronJob(apiClient_t *apiClient, char *name, char *_name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4103,6 +4381,7 @@ BatchV1API_readNamespacedCronJob(apiClient_t *apiClient, char *name, char *_name list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4111,6 +4390,7 @@ BatchV1API_readNamespacedCronJob(apiClient_t *apiClient, char *name, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4122,11 +4402,14 @@ BatchV1API_readNamespacedCronJob(apiClient_t *apiClient, char *name, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_t *elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4173,15 +4456,22 @@ BatchV1API_readNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4191,7 +4481,7 @@ BatchV1API_readNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4216,6 +4506,7 @@ BatchV1API_readNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4224,6 +4515,7 @@ BatchV1API_readNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4235,11 +4527,14 @@ BatchV1API_readNamespacedCronJobStatus(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_t *elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4286,15 +4581,22 @@ BatchV1API_readNamespacedJob(apiClient_t *apiClient, char *name, char *_namespac list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4304,7 +4606,7 @@ BatchV1API_readNamespacedJob(apiClient_t *apiClient, char *name, char *_namespac localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4329,6 +4631,7 @@ BatchV1API_readNamespacedJob(apiClient_t *apiClient, char *name, char *_namespac list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4337,6 +4640,7 @@ BatchV1API_readNamespacedJob(apiClient_t *apiClient, char *name, char *_namespac localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4348,11 +4652,14 @@ BatchV1API_readNamespacedJob(apiClient_t *apiClient, char *name, char *_namespac // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_t *elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4399,15 +4706,22 @@ BatchV1API_readNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4417,7 +4731,7 @@ BatchV1API_readNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4442,6 +4756,7 @@ BatchV1API_readNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_na list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4450,6 +4765,7 @@ BatchV1API_readNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4461,11 +4777,14 @@ BatchV1API_readNamespacedJobStatus(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_t *elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4512,15 +4831,22 @@ BatchV1API_replaceNamespacedCronJob(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4530,7 +4856,7 @@ BatchV1API_replaceNamespacedCronJob(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4593,13 +4919,15 @@ BatchV1API_replaceNamespacedCronJob(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_cron_job_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4608,6 +4936,7 @@ BatchV1API_replaceNamespacedCronJob(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -4623,11 +4952,14 @@ BatchV1API_replaceNamespacedCronJob(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_t *elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4715,15 +5047,22 @@ BatchV1API_replaceNamespacedCronJobStatus(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4733,7 +5072,7 @@ BatchV1API_replaceNamespacedCronJobStatus(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4796,13 +5135,15 @@ BatchV1API_replaceNamespacedCronJobStatus(apiClient_t *apiClient, char *name, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_cron_job_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4811,6 +5152,7 @@ BatchV1API_replaceNamespacedCronJobStatus(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -4826,11 +5168,14 @@ BatchV1API_replaceNamespacedCronJobStatus(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cron_job_t *elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cron_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cron_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4918,15 +5263,22 @@ BatchV1API_replaceNamespacedJob(apiClient_t *apiClient, char *name, char *_names list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4936,7 +5288,7 @@ BatchV1API_replaceNamespacedJob(apiClient_t *apiClient, char *name, char *_names localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4999,13 +5351,15 @@ BatchV1API_replaceNamespacedJob(apiClient_t *apiClient, char *name, char *_names cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_job_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5014,6 +5368,7 @@ BatchV1API_replaceNamespacedJob(apiClient_t *apiClient, char *name, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5029,11 +5384,14 @@ BatchV1API_replaceNamespacedJob(apiClient_t *apiClient, char *name, char *_names // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_t *elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5121,15 +5479,22 @@ BatchV1API_replaceNamespacedJobStatus(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status"); + char *localVarPath = strdup("/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5139,7 +5504,7 @@ BatchV1API_replaceNamespacedJobStatus(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5202,13 +5567,15 @@ BatchV1API_replaceNamespacedJobStatus(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_job_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5217,6 +5584,7 @@ BatchV1API_replaceNamespacedJobStatus(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5232,11 +5600,14 @@ BatchV1API_replaceNamespacedJobStatus(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_job_t *elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); - cJSON_Delete(BatchV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_job_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *BatchV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_job_parseFromJSON(BatchV1APIlocalVarJSON); + cJSON_Delete(BatchV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/BatchV1API.h b/kubernetes/api/BatchV1API.h index ae699313..f992e59c 100644 --- a/kubernetes/api/BatchV1API.h +++ b/kubernetes/api/BatchV1API.h @@ -30,25 +30,25 @@ BatchV1API_createNamespacedJob(apiClient_t *apiClient, char *_namespace, v1_job_ // delete collection of CronJob // v1_status_t* -BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Job // v1_status_t* -BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a CronJob // v1_status_t* -BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a Job // v1_status_t* -BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/CertificatesAPI.c b/kubernetes/api/CertificatesAPI.c index 87ff9621..e8adc4a2 100644 --- a/kubernetes/api/CertificatesAPI.c +++ b/kubernetes/api/CertificatesAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "CertificatesAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ CertificatesAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/"); + char *localVarPath = strdup("/apis/certificates.k8s.io/"); + @@ -42,6 +42,7 @@ CertificatesAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ CertificatesAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(CertificatesAPIlocalVarJSON); - cJSON_Delete(CertificatesAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(CertificatesAPIlocalVarJSON); + cJSON_Delete(CertificatesAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/CertificatesV1API.c b/kubernetes/api/CertificatesV1API.c index 9c70f96b..0ead9ee4 100644 --- a/kubernetes/api/CertificatesV1API.c +++ b/kubernetes/api/CertificatesV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "CertificatesV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a CertificateSigningRequest @@ -23,11 +20,14 @@ CertificatesV1API_createCertificateSigningRequest(apiClient_t *apiClient, v1_cer list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests"); + @@ -84,13 +84,15 @@ CertificatesV1API_createCertificateSigningRequest(apiClient_t *apiClient, v1_cer cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_certificate_signing_request_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ CertificatesV1API_createCertificateSigningRequest(apiClient_t *apiClient, v1_cer localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ CertificatesV1API_createCertificateSigningRequest(apiClient_t *apiClient, v1_cer // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ CertificatesV1API_createCertificateSigningRequest(apiClient_t *apiClient, v1_cer // delete a CertificateSigningRequest // v1_status_t* -CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,15 +214,20 @@ CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -264,6 +275,19 @@ CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -293,13 +317,15 @@ CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -308,6 +334,7 @@ CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -323,11 +350,14 @@ CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -384,6 +414,18 @@ CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -418,7 +460,7 @@ CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * // delete collection of CertificateSigningRequest // v1_status_t* -CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -426,11 +468,14 @@ CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests"); + @@ -496,6 +541,19 @@ CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClie list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -600,13 +658,15 @@ CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClie cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -615,6 +675,7 @@ CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -626,11 +687,14 @@ CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -710,6 +774,18 @@ CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClie keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -824,17 +900,21 @@ CertificatesV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ CertificatesV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ CertificatesV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ CertificatesV1API_listCertificateSigningRequest(apiClient_t *apiClient, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests"); + @@ -1039,8 +1126,10 @@ CertificatesV1API_listCertificateSigningRequest(apiClient_t *apiClient, char *pr list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ CertificatesV1API_listCertificateSigningRequest(apiClient_t *apiClient, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ CertificatesV1API_listCertificateSigningRequest(apiClient_t *apiClient, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_list_t *elementToReturn = v1_certificate_signing_request_list_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_list_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ CertificatesV1API_patchCertificateSigningRequest(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ CertificatesV1API_patchCertificateSigningRequest(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ CertificatesV1API_patchCertificateSigningRequest(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ CertificatesV1API_patchCertificateSigningRequest(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ CertificatesV1API_patchCertificateSigningRequestApproval(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1534,17 +1644,20 @@ CertificatesV1API_patchCertificateSigningRequestApproval(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1553,6 +1666,7 @@ CertificatesV1API_patchCertificateSigningRequestApproval(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1568,11 +1682,14 @@ CertificatesV1API_patchCertificateSigningRequestApproval(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1671,15 +1788,20 @@ CertificatesV1API_patchCertificateSigningRequestStatus(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1755,17 +1877,20 @@ CertificatesV1API_patchCertificateSigningRequestStatus(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1774,6 +1899,7 @@ CertificatesV1API_patchCertificateSigningRequestStatus(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1789,11 +1915,14 @@ CertificatesV1API_patchCertificateSigningRequestStatus(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1892,15 +2021,20 @@ CertificatesV1API_readCertificateSigningRequest(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1925,6 +2059,7 @@ CertificatesV1API_readCertificateSigningRequest(apiClient_t *apiClient, char *na list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1933,6 +2068,7 @@ CertificatesV1API_readCertificateSigningRequest(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1944,11 +2080,14 @@ CertificatesV1API_readCertificateSigningRequest(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1994,15 +2133,20 @@ CertificatesV1API_readCertificateSigningRequestApproval(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2027,6 +2171,7 @@ CertificatesV1API_readCertificateSigningRequestApproval(apiClient_t *apiClient, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2035,6 +2180,7 @@ CertificatesV1API_readCertificateSigningRequestApproval(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2046,11 +2192,14 @@ CertificatesV1API_readCertificateSigningRequestApproval(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2096,15 +2245,20 @@ CertificatesV1API_readCertificateSigningRequestStatus(apiClient_t *apiClient, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2129,6 +2283,7 @@ CertificatesV1API_readCertificateSigningRequestStatus(apiClient_t *apiClient, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2137,6 +2292,7 @@ CertificatesV1API_readCertificateSigningRequestStatus(apiClient_t *apiClient, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2148,11 +2304,14 @@ CertificatesV1API_readCertificateSigningRequestStatus(apiClient_t *apiClient, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2198,15 +2357,20 @@ CertificatesV1API_replaceCertificateSigningRequest(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2269,13 +2433,15 @@ CertificatesV1API_replaceCertificateSigningRequest(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_certificate_signing_request_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2284,6 +2450,7 @@ CertificatesV1API_replaceCertificateSigningRequest(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2299,11 +2466,14 @@ CertificatesV1API_replaceCertificateSigningRequest(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2390,15 +2560,20 @@ CertificatesV1API_replaceCertificateSigningRequestApproval(apiClient_t *apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2461,13 +2636,15 @@ CertificatesV1API_replaceCertificateSigningRequestApproval(apiClient_t *apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_certificate_signing_request_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2476,6 +2653,7 @@ CertificatesV1API_replaceCertificateSigningRequestApproval(apiClient_t *apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2491,11 +2669,14 @@ CertificatesV1API_replaceCertificateSigningRequestApproval(apiClient_t *apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2582,15 +2763,20 @@ CertificatesV1API_replaceCertificateSigningRequestStatus(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2653,13 +2839,15 @@ CertificatesV1API_replaceCertificateSigningRequestStatus(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_certificate_signing_request_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2668,6 +2856,7 @@ CertificatesV1API_replaceCertificateSigningRequestStatus(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2683,11 +2872,14 @@ CertificatesV1API_replaceCertificateSigningRequestStatus(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_certificate_signing_request_t *elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); - cJSON_Delete(CertificatesV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_certificate_signing_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_certificate_signing_request_parseFromJSON(CertificatesV1APIlocalVarJSON); + cJSON_Delete(CertificatesV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/CertificatesV1API.h b/kubernetes/api/CertificatesV1API.h index 35d4f46a..04f9a7dc 100644 --- a/kubernetes/api/CertificatesV1API.h +++ b/kubernetes/api/CertificatesV1API.h @@ -22,13 +22,13 @@ CertificatesV1API_createCertificateSigningRequest(apiClient_t *apiClient, v1_cer // delete a CertificateSigningRequest // v1_status_t* -CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete collection of CertificateSigningRequest // v1_status_t* -CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/CertificatesV1alpha1API.c b/kubernetes/api/CertificatesV1alpha1API.c index 8ee57cf8..11a9ee2e 100644 --- a/kubernetes/api/CertificatesV1alpha1API.c +++ b/kubernetes/api/CertificatesV1alpha1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "CertificatesV1alpha1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a ClusterTrustBundle @@ -23,11 +20,14 @@ CertificatesV1alpha1API_createClusterTrustBundle(apiClient_t *apiClient, v1alpha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/clustertrustbundles"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles"); + @@ -84,13 +84,221 @@ CertificatesV1alpha1API_createClusterTrustBundle(apiClient_t *apiClient, v1alpha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_cluster_trust_bundle_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_createNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_pod_certificate_request_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +307,7 @@ CertificatesV1alpha1API_createClusterTrustBundle(apiClient_t *apiClient, v1alpha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +327,14 @@ CertificatesV1alpha1API_createClusterTrustBundle(apiClient_t *apiClient, v1alpha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_cluster_trust_bundle_t *elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_pod_certificate_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -137,6 +349,7 @@ CertificatesV1alpha1API_createClusterTrustBundle(apiClient_t *apiClient, v1alpha list_freeList(localVarHeaderType); free(localVarPath); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -200,7 +413,7 @@ CertificatesV1alpha1API_createClusterTrustBundle(apiClient_t *apiClient, v1alpha // delete a ClusterTrustBundle // v1_status_t* -CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,15 +421,20 @@ CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -264,6 +482,19 @@ CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *n list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -293,13 +524,15 @@ CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -308,6 +541,7 @@ CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -323,11 +557,14 @@ CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -384,6 +621,18 @@ CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *n keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -418,7 +667,7 @@ CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *n // delete collection of ClusterTrustBundle // v1_status_t* -CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -426,11 +675,14 @@ CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/clustertrustbundles"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles"); + @@ -496,6 +748,19 @@ CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClien list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -600,13 +865,15 @@ CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -615,6 +882,7 @@ CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -626,11 +894,14 @@ CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -710,6 +981,18 @@ CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClien keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -813,90 +1096,38 @@ CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClien } -// get available resources +// delete collection of PodCertificateRequest // -v1_api_resource_list_t* -CertificatesV1alpha1API_getAPIResources(apiClient_t *apiClient) +v1_status_t* +CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { - list_t *localVarQueryParameters = NULL; + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/"); + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests"); + if(!_namespace) + goto end; - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ClusterTrustBundle -// -v1alpha1_cluster_trust_bundle_list_t* -CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/clustertrustbundles"); - + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -912,19 +1143,6 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - // query parameters char *keyQuery__continue = NULL; char * valueQuery__continue = NULL; @@ -937,6 +1155,18 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre list_addElement(localVarQueryParameters,keyPairQuery__continue); } + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + // query parameters char *keyQuery_fieldSelector = NULL; char * valueQuery_fieldSelector = NULL; @@ -949,6 +1179,32 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); } + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -974,6 +1230,31 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre list_addElement(localVarQueryParameters,keyPairQuery_limit); } + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + // query parameters char *keyQuery_resourceVersion = NULL; char * valueQuery_resourceVersion = NULL; @@ -1024,23 +1305,19 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); } - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,7 +1326,8 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "DELETE"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { @@ -1060,11 +1338,14 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_cluster_trust_bundle_list_t *elementToReturn = v1alpha1_cluster_trust_bundle_list_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1079,6 +1360,12 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre list_freeList(localVarHeaderType); free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -1091,18 +1378,6 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } if(keyQuery__continue){ free(keyQuery__continue); keyQuery__continue = NULL; @@ -1115,6 +1390,18 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre keyValuePair_free(keyPairQuery__continue); keyPairQuery__continue = NULL; } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } if(keyQuery_fieldSelector){ free(keyQuery_fieldSelector); keyQuery_fieldSelector = NULL; @@ -1127,6 +1414,30 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre keyValuePair_free(keyPairQuery_fieldSelector); keyPairQuery_fieldSelector = NULL; } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1151,6 +1462,30 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre keyValuePair_free(keyPairQuery_limit); keyPairQuery_limit = NULL; } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } if(keyQuery_resourceVersion){ free(keyQuery_resourceVersion); keyQuery_resourceVersion = NULL; @@ -1183,33 +1518,2504 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre free(valueQuery_sendInitialEvents); valueQuery_sendInitialEvents = NULL; } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a PodCertificateRequest +// +v1_status_t* +CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +CertificatesV1alpha1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ClusterTrustBundle +// +v1alpha1_cluster_trust_bundle_list_t* +CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_cluster_trust_bundle_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_cluster_trust_bundle_list_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind PodCertificateRequest +// +v1alpha1_pod_certificate_request_list_t* +CertificatesV1alpha1API_listNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_pod_certificate_request_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_list_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind PodCertificateRequest +// +v1alpha1_pod_certificate_request_list_t* +CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/podcertificaterequests"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_pod_certificate_request_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_list_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ClusterTrustBundle +// +v1alpha1_cluster_trust_bundle_t* +CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_patchNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_pod_certificate_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_pod_certificate_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ClusterTrustBundle +// +v1alpha1_cluster_trust_bundle_t* +CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_readNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_pod_certificate_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha1_pod_certificate_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } return elementToReturn; end: @@ -1218,26 +4024,31 @@ CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pre } -// partially update the specified ClusterTrustBundle +// replace the specified ClusterTrustBundle // v1alpha1_cluster_trust_bundle_t* -CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char *name, v1alpha1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1296,34 +4107,19 @@ CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *na list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); } - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - // Body Param cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_cluster_trust_bundle_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,7 +4128,8 @@ CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, - "PATCH"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { @@ -1347,11 +4144,14 @@ CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_cluster_trust_bundle_t *elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1364,7 +4164,7 @@ CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *na list_freeList(localVarHeaderType); - list_freeList(localVarContentType); + free(localVarPath); free(localVarToReplace_name); if (localVarSingleItemJSON_body) { @@ -1420,18 +4220,6 @@ CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *na keyValuePair_free(keyPairQuery_fieldValidation); keyPairQuery_fieldValidation = NULL; } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } return elementToReturn; end: free(localVarPath); @@ -1439,10 +4227,10 @@ CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *na } -// read the specified ClusterTrustBundle +// replace the specified PodCertificateRequest // -v1alpha1_cluster_trust_bundle_t* -CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty) +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1450,15 +4238,22 @@ CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1467,6 +4262,16 @@ CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters @@ -1480,9 +4285,56 @@ CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *nam keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_pod_certificate_request_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1491,22 +4343,30 @@ CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_cluster_trust_bundle_t *elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_pod_certificate_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1522,6 +4382,12 @@ CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *nam free(localVarPath); free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -1534,6 +4400,42 @@ CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *nam keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } return elementToReturn; end: free(localVarPath); @@ -1541,10 +4443,10 @@ CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *nam } -// replace the specified ClusterTrustBundle +// replace status of the specified PodCertificateRequest // -v1alpha1_cluster_trust_bundle_t* -CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char *name, v1alpha1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1552,15 +4454,22 @@ CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}"); + char *localVarPath = strdup("/apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1569,6 +4478,16 @@ CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters @@ -1623,13 +4542,15 @@ CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1alpha1_cluster_trust_bundle_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1alpha1_pod_certificate_request_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1638,6 +4559,7 @@ CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1653,11 +4575,14 @@ CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_cluster_trust_bundle_t *elementToReturn = v1alpha1_cluster_trust_bundle_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); - cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_pod_certificate_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_pod_certificate_request_parseFromJSON(CertificatesV1alpha1APIlocalVarJSON); + cJSON_Delete(CertificatesV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1673,6 +4598,7 @@ CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char * free(localVarPath); free(localVarToReplace_name); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; diff --git a/kubernetes/api/CertificatesV1alpha1API.h b/kubernetes/api/CertificatesV1alpha1API.h index b946b3f8..cdb0ee75 100644 --- a/kubernetes/api/CertificatesV1alpha1API.h +++ b/kubernetes/api/CertificatesV1alpha1API.h @@ -11,6 +11,8 @@ #include "../model/v1_status.h" #include "../model/v1alpha1_cluster_trust_bundle.h" #include "../model/v1alpha1_cluster_trust_bundle_list.h" +#include "../model/v1alpha1_pod_certificate_request.h" +#include "../model/v1alpha1_pod_certificate_request_list.h" // create a ClusterTrustBundle @@ -19,16 +21,34 @@ v1alpha1_cluster_trust_bundle_t* CertificatesV1alpha1API_createClusterTrustBundle(apiClient_t *apiClient, v1alpha1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// create a PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_createNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + // delete a ClusterTrustBundle // v1_status_t* -CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete collection of ClusterTrustBundle // v1_status_t* -CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of PodCertificateRequest +// +v1_status_t* +CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a PodCertificateRequest +// +v1_status_t* +CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources @@ -43,21 +63,69 @@ v1alpha1_cluster_trust_bundle_list_t* CertificatesV1alpha1API_listClusterTrustBundle(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +// list or watch objects of kind PodCertificateRequest +// +v1alpha1_pod_certificate_request_list_t* +CertificatesV1alpha1API_listNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind PodCertificateRequest +// +v1alpha1_pod_certificate_request_list_t* +CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + // partially update the specified ClusterTrustBundle // v1alpha1_cluster_trust_bundle_t* CertificatesV1alpha1API_patchClusterTrustBundle(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +// partially update the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_patchNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + // read the specified ClusterTrustBundle // v1alpha1_cluster_trust_bundle_t* CertificatesV1alpha1API_readClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty); +// read the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_readNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + // replace the specified ClusterTrustBundle // v1alpha1_cluster_trust_bundle_t* CertificatesV1alpha1API_replaceClusterTrustBundle(apiClient_t *apiClient, char *name, v1alpha1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// replace the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* +CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/CertificatesV1beta1API.c b/kubernetes/api/CertificatesV1beta1API.c new file mode 100644 index 00000000..be713e9c --- /dev/null +++ b/kubernetes/api/CertificatesV1beta1API.c @@ -0,0 +1,1861 @@ +#include +#include +#include + +#include "CertificatesV1beta1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_createClusterTrustBundle(apiClient_t *apiClient, v1beta1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/clustertrustbundles"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_cluster_trust_bundle_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_cluster_trust_bundle_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ClusterTrustBundle +// +v1_status_t* +CertificatesV1beta1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ClusterTrustBundle +// +v1_status_t* +CertificatesV1beta1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/clustertrustbundles"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +CertificatesV1beta1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_list_t* +CertificatesV1beta1API_listClusterTrustBundle(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/clustertrustbundles"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_cluster_trust_bundle_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_cluster_trust_bundle_list_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_patchClusterTrustBundle(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_cluster_trust_bundle_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_readClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_cluster_trust_bundle_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_replaceClusterTrustBundle(apiClient_t *apiClient, char *name, v1beta1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_cluster_trust_bundle_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_cluster_trust_bundle_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CertificatesV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_cluster_trust_bundle_parseFromJSON(CertificatesV1beta1APIlocalVarJSON); + cJSON_Delete(CertificatesV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/CertificatesV1beta1API.h b/kubernetes/api/CertificatesV1beta1API.h new file mode 100644 index 00000000..65f1dada --- /dev/null +++ b/kubernetes/api/CertificatesV1beta1API.h @@ -0,0 +1,63 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1beta1_cluster_trust_bundle.h" +#include "../model/v1beta1_cluster_trust_bundle_list.h" + + +// create a ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_createClusterTrustBundle(apiClient_t *apiClient, v1beta1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete a ClusterTrustBundle +// +v1_status_t* +CertificatesV1beta1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete collection of ClusterTrustBundle +// +v1_status_t* +CertificatesV1beta1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +CertificatesV1beta1API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_list_t* +CertificatesV1beta1API_listClusterTrustBundle(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_patchClusterTrustBundle(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_readClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified ClusterTrustBundle +// +v1beta1_cluster_trust_bundle_t* +CertificatesV1beta1API_replaceClusterTrustBundle(apiClient_t *apiClient, char *name, v1beta1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/CoordinationAPI.c b/kubernetes/api/CoordinationAPI.c index 609bca81..745235eb 100644 --- a/kubernetes/api/CoordinationAPI.c +++ b/kubernetes/api/CoordinationAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "CoordinationAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ CoordinationAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/"); + char *localVarPath = strdup("/apis/coordination.k8s.io/"); + @@ -42,6 +42,7 @@ CoordinationAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ CoordinationAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(CoordinationAPIlocalVarJSON); - cJSON_Delete(CoordinationAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(CoordinationAPIlocalVarJSON); + cJSON_Delete(CoordinationAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/CoordinationV1API.c b/kubernetes/api/CoordinationV1API.c index bdcbfde7..3f5ede67 100644 --- a/kubernetes/api/CoordinationV1API.c +++ b/kubernetes/api/CoordinationV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "CoordinationV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a Lease @@ -23,15 +20,20 @@ CoordinationV1API_createNamespacedLease(apiClient_t *apiClient, char *_namespace list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ CoordinationV1API_createNamespacedLease(apiClient_t *apiClient, char *_namespace cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_lease_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ CoordinationV1API_createNamespacedLease(apiClient_t *apiClient, char *_namespace localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ CoordinationV1API_createNamespacedLease(apiClient_t *apiClient, char *_namespace // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_lease_t *elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_lease_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -211,7 +219,7 @@ CoordinationV1API_createNamespacedLease(apiClient_t *apiClient, char *_namespace // delete collection of Lease // v1_status_t* -CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -219,15 +227,20 @@ CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -299,6 +312,19 @@ CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -403,13 +429,15 @@ CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -418,6 +446,7 @@ CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -429,11 +458,14 @@ CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -514,6 +546,18 @@ CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -620,7 +664,7 @@ CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * // delete a Lease // v1_status_t* -CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -628,15 +672,22 @@ CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -646,7 +697,7 @@ CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -694,6 +745,19 @@ CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -723,13 +787,15 @@ CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -738,6 +804,7 @@ CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -753,11 +820,14 @@ CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -815,6 +885,18 @@ CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -857,17 +939,21 @@ CoordinationV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -876,6 +962,7 @@ CoordinationV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -887,11 +974,14 @@ CoordinationV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -924,11 +1014,14 @@ CoordinationV1API_listLeaseForAllNamespaces(apiClient_t *apiClient, int *allowWa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/leases")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/leases"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/leases"); + @@ -1072,8 +1165,10 @@ CoordinationV1API_listLeaseForAllNamespaces(apiClient_t *apiClient, int *allowWa list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1082,6 +1177,7 @@ CoordinationV1API_listLeaseForAllNamespaces(apiClient_t *apiClient, int *allowWa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1093,11 +1189,14 @@ CoordinationV1API_listLeaseForAllNamespaces(apiClient_t *apiClient, int *allowWa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_lease_list_t *elementToReturn = v1_lease_list_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_lease_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_lease_list_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1262,15 +1361,20 @@ CoordinationV1API_listNamespacedLease(apiClient_t *apiClient, char *_namespace, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1420,8 +1524,10 @@ CoordinationV1API_listNamespacedLease(apiClient_t *apiClient, char *_namespace, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1430,6 +1536,7 @@ CoordinationV1API_listNamespacedLease(apiClient_t *apiClient, char *_namespace, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1441,11 +1548,14 @@ CoordinationV1API_listNamespacedLease(apiClient_t *apiClient, char *_namespace, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_lease_list_t *elementToReturn = v1_lease_list_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_lease_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_lease_list_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1611,15 +1721,22 @@ CoordinationV1API_patchNamespacedLease(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1629,7 +1746,7 @@ CoordinationV1API_patchNamespacedLease(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1705,17 +1822,20 @@ CoordinationV1API_patchNamespacedLease(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1724,6 +1844,7 @@ CoordinationV1API_patchNamespacedLease(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1739,11 +1860,14 @@ CoordinationV1API_patchNamespacedLease(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_lease_t *elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_lease_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1843,15 +1967,22 @@ CoordinationV1API_readNamespacedLease(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1861,7 +1992,7 @@ CoordinationV1API_readNamespacedLease(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1886,6 +2017,7 @@ CoordinationV1API_readNamespacedLease(apiClient_t *apiClient, char *name, char * list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1894,6 +2026,7 @@ CoordinationV1API_readNamespacedLease(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1905,11 +2038,14 @@ CoordinationV1API_readNamespacedLease(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_lease_t *elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_lease_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1956,15 +2092,22 @@ CoordinationV1API_replaceNamespacedLease(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + char *localVarPath = strdup("/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1974,7 +2117,7 @@ CoordinationV1API_replaceNamespacedLease(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2037,13 +2180,15 @@ CoordinationV1API_replaceNamespacedLease(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_lease_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2052,6 +2197,7 @@ CoordinationV1API_replaceNamespacedLease(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2067,11 +2213,14 @@ CoordinationV1API_replaceNamespacedLease(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_lease_t *elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); - cJSON_Delete(CoordinationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_lease_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_lease_parseFromJSON(CoordinationV1APIlocalVarJSON); + cJSON_Delete(CoordinationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/CoordinationV1API.h b/kubernetes/api/CoordinationV1API.h index 3b5ea0a6..d2b07600 100644 --- a/kubernetes/api/CoordinationV1API.h +++ b/kubernetes/api/CoordinationV1API.h @@ -22,13 +22,13 @@ CoordinationV1API_createNamespacedLease(apiClient_t *apiClient, char *_namespace // delete collection of Lease // v1_status_t* -CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a Lease // v1_status_t* -CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/CoordinationV1alpha2API.c b/kubernetes/api/CoordinationV1alpha2API.c new file mode 100644 index 00000000..99b86954 --- /dev/null +++ b/kubernetes/api/CoordinationV1alpha2API.c @@ -0,0 +1,2299 @@ +#include +#include +#include + +#include "CoordinationV1alpha2API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_createNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, v1alpha2_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1alpha2_lease_candidate_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha2_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha2_lease_candidate_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of LeaseCandidate +// +v1_status_t* +CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a LeaseCandidate +// +v1_status_t* +CoordinationV1alpha2API_deleteNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +CoordinationV1alpha2API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind LeaseCandidate +// +v1alpha2_lease_candidate_list_t* +CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/leasecandidates"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha2_lease_candidate_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha2_lease_candidate_list_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind LeaseCandidate +// +v1alpha2_lease_candidate_list_t* +CoordinationV1alpha2API_listNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha2_lease_candidate_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha2_lease_candidate_list_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_patchNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha2_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha2_lease_candidate_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_readNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha2_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha2_lease_candidate_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_replaceNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1alpha2_lease_candidate_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha2_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha2_lease_candidate_parseFromJSON(CoordinationV1alpha2APIlocalVarJSON); + cJSON_Delete(CoordinationV1alpha2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/CoordinationV1alpha2API.h b/kubernetes/api/CoordinationV1alpha2API.h new file mode 100644 index 00000000..0280e30a --- /dev/null +++ b/kubernetes/api/CoordinationV1alpha2API.h @@ -0,0 +1,69 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1alpha2_lease_candidate.h" +#include "../model/v1alpha2_lease_candidate_list.h" + + +// create a LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_createNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, v1alpha2_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of LeaseCandidate +// +v1_status_t* +CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a LeaseCandidate +// +v1_status_t* +CoordinationV1alpha2API_deleteNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +CoordinationV1alpha2API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind LeaseCandidate +// +v1alpha2_lease_candidate_list_t* +CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind LeaseCandidate +// +v1alpha2_lease_candidate_list_t* +CoordinationV1alpha2API_listNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_patchNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_readNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// replace the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* +CoordinationV1alpha2API_replaceNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/CoordinationV1beta1API.c b/kubernetes/api/CoordinationV1beta1API.c new file mode 100644 index 00000000..2577b6ae --- /dev/null +++ b/kubernetes/api/CoordinationV1beta1API.c @@ -0,0 +1,2299 @@ +#include +#include +#include + +#include "CoordinationV1beta1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_createNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, v1beta1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_lease_candidate_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_lease_candidate_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of LeaseCandidate +// +v1_status_t* +CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a LeaseCandidate +// +v1_status_t* +CoordinationV1beta1API_deleteNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +CoordinationV1beta1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind LeaseCandidate +// +v1beta1_lease_candidate_list_t* +CoordinationV1beta1API_listLeaseCandidateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/leasecandidates"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_lease_candidate_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_lease_candidate_list_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind LeaseCandidate +// +v1beta1_lease_candidate_list_t* +CoordinationV1beta1API_listNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_lease_candidate_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_lease_candidate_list_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_patchNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_lease_candidate_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_readNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_lease_candidate_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_replaceNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_lease_candidate_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_lease_candidate_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoordinationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_lease_candidate_parseFromJSON(CoordinationV1beta1APIlocalVarJSON); + cJSON_Delete(CoordinationV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/CoordinationV1beta1API.h b/kubernetes/api/CoordinationV1beta1API.h new file mode 100644 index 00000000..5d176664 --- /dev/null +++ b/kubernetes/api/CoordinationV1beta1API.h @@ -0,0 +1,69 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1beta1_lease_candidate.h" +#include "../model/v1beta1_lease_candidate_list.h" + + +// create a LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_createNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, v1beta1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of LeaseCandidate +// +v1_status_t* +CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a LeaseCandidate +// +v1_status_t* +CoordinationV1beta1API_deleteNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +CoordinationV1beta1API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind LeaseCandidate +// +v1beta1_lease_candidate_list_t* +CoordinationV1beta1API_listLeaseCandidateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind LeaseCandidate +// +v1beta1_lease_candidate_list_t* +CoordinationV1beta1API_listNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_patchNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_readNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// replace the specified LeaseCandidate +// +v1beta1_lease_candidate_t* +CoordinationV1beta1API_replaceNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/CoreAPI.c b/kubernetes/api/CoreAPI.c index fd498af8..e7882268 100644 --- a/kubernetes/api/CoreAPI.c +++ b/kubernetes/api/CoreAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "CoreAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get available API versions @@ -23,11 +20,14 @@ CoreAPI_getAPIVersions(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/"); + char *localVarPath = strdup("/api/"); + @@ -42,6 +42,7 @@ CoreAPI_getAPIVersions(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ CoreAPI_getAPIVersions(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_versions_t *elementToReturn = v1_api_versions_parseFromJSON(CoreAPIlocalVarJSON); - cJSON_Delete(CoreAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_versions_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_versions_parseFromJSON(CoreAPIlocalVarJSON); + cJSON_Delete(CoreAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/CoreV1API.c b/kubernetes/api/CoreV1API.c index deadb92b..d4f1c268 100644 --- a/kubernetes/api/CoreV1API.c +++ b/kubernetes/api/CoreV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "CoreV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // connect DELETE requests to proxy of Pod @@ -23,15 +20,22 @@ CoreV1API_connectDeleteNamespacedPodProxy(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -41,7 +45,7 @@ CoreV1API_connectDeleteNamespacedPodProxy(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -72,6 +76,7 @@ CoreV1API_connectDeleteNamespacedPodProxy(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -82,8 +87,10 @@ CoreV1API_connectDeleteNamespacedPodProxy(apiClient_t *apiClient, char *name, ch //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -128,15 +135,24 @@ CoreV1API_connectDeleteNamespacedPodProxyWithPath(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -146,7 +162,7 @@ CoreV1API_connectDeleteNamespacedPodProxyWithPath(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -156,7 +172,7 @@ CoreV1API_connectDeleteNamespacedPodProxyWithPath(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -187,6 +203,7 @@ CoreV1API_connectDeleteNamespacedPodProxyWithPath(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -197,8 +214,10 @@ CoreV1API_connectDeleteNamespacedPodProxyWithPath(apiClient_t *apiClient, char * //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -244,15 +263,22 @@ CoreV1API_connectDeleteNamespacedServiceProxy(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -262,7 +288,7 @@ CoreV1API_connectDeleteNamespacedServiceProxy(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -293,6 +319,7 @@ CoreV1API_connectDeleteNamespacedServiceProxy(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -303,8 +330,10 @@ CoreV1API_connectDeleteNamespacedServiceProxy(apiClient_t *apiClient, char *name //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -349,15 +378,24 @@ CoreV1API_connectDeleteNamespacedServiceProxyWithPath(apiClient_t *apiClient, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -367,7 +405,7 @@ CoreV1API_connectDeleteNamespacedServiceProxyWithPath(apiClient_t *apiClient, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -377,7 +415,7 @@ CoreV1API_connectDeleteNamespacedServiceProxyWithPath(apiClient_t *apiClient, ch localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -408,6 +446,7 @@ CoreV1API_connectDeleteNamespacedServiceProxyWithPath(apiClient_t *apiClient, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -418,8 +457,10 @@ CoreV1API_connectDeleteNamespacedServiceProxyWithPath(apiClient_t *apiClient, ch //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -465,15 +506,20 @@ CoreV1API_connectDeleteNodeProxy(apiClient_t *apiClient, char *name, char *path) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -504,6 +550,7 @@ CoreV1API_connectDeleteNodeProxy(apiClient_t *apiClient, char *name, char *path) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -514,8 +561,10 @@ CoreV1API_connectDeleteNodeProxy(apiClient_t *apiClient, char *name, char *path) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -559,15 +608,22 @@ CoreV1API_connectDeleteNodeProxyWithPath(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -577,7 +633,7 @@ CoreV1API_connectDeleteNodeProxyWithPath(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -608,6 +664,7 @@ CoreV1API_connectDeleteNodeProxyWithPath(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -618,8 +675,10 @@ CoreV1API_connectDeleteNodeProxyWithPath(apiClient_t *apiClient, char *name, cha //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -664,15 +723,22 @@ CoreV1API_connectGetNamespacedPodAttach(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/attach")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/attach"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/attach"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -682,7 +748,7 @@ CoreV1API_connectGetNamespacedPodAttach(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -765,6 +831,7 @@ CoreV1API_connectGetNamespacedPodAttach(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -775,8 +842,10 @@ CoreV1API_connectGetNamespacedPodAttach(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -869,15 +938,22 @@ CoreV1API_connectGetNamespacedPodExec(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/exec")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/exec"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/exec"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -887,7 +963,7 @@ CoreV1API_connectGetNamespacedPodExec(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -982,6 +1058,7 @@ CoreV1API_connectGetNamespacedPodExec(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -992,8 +1069,10 @@ CoreV1API_connectGetNamespacedPodExec(apiClient_t *apiClient, char *name, char * //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1098,15 +1177,22 @@ CoreV1API_connectGetNamespacedPodPortforward(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/portforward")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/portforward"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/portforward"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1116,7 +1202,7 @@ CoreV1API_connectGetNamespacedPodPortforward(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1148,6 +1234,7 @@ CoreV1API_connectGetNamespacedPodPortforward(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1158,8 +1245,10 @@ CoreV1API_connectGetNamespacedPodPortforward(apiClient_t *apiClient, char *name, //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1204,15 +1293,22 @@ CoreV1API_connectGetNamespacedPodProxy(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1222,7 +1318,7 @@ CoreV1API_connectGetNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1253,6 +1349,7 @@ CoreV1API_connectGetNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1263,8 +1360,10 @@ CoreV1API_connectGetNamespacedPodProxy(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1309,15 +1408,24 @@ CoreV1API_connectGetNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1327,7 +1435,7 @@ CoreV1API_connectGetNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1337,7 +1445,7 @@ CoreV1API_connectGetNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -1368,6 +1476,7 @@ CoreV1API_connectGetNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1378,8 +1487,10 @@ CoreV1API_connectGetNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1425,15 +1536,22 @@ CoreV1API_connectGetNamespacedServiceProxy(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1443,7 +1561,7 @@ CoreV1API_connectGetNamespacedServiceProxy(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1474,6 +1592,7 @@ CoreV1API_connectGetNamespacedServiceProxy(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1484,8 +1603,10 @@ CoreV1API_connectGetNamespacedServiceProxy(apiClient_t *apiClient, char *name, c //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1530,15 +1651,24 @@ CoreV1API_connectGetNamespacedServiceProxyWithPath(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1548,7 +1678,7 @@ CoreV1API_connectGetNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1558,7 +1688,7 @@ CoreV1API_connectGetNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -1589,6 +1719,7 @@ CoreV1API_connectGetNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1599,8 +1730,10 @@ CoreV1API_connectGetNamespacedServiceProxyWithPath(apiClient_t *apiClient, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1646,15 +1779,20 @@ CoreV1API_connectGetNodeProxy(apiClient_t *apiClient, char *name, char *path) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1685,6 +1823,7 @@ CoreV1API_connectGetNodeProxy(apiClient_t *apiClient, char *name, char *path) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1695,8 +1834,10 @@ CoreV1API_connectGetNodeProxy(apiClient_t *apiClient, char *name, char *path) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1740,15 +1881,22 @@ CoreV1API_connectGetNodeProxyWithPath(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1758,7 +1906,7 @@ CoreV1API_connectGetNodeProxyWithPath(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -1789,6 +1937,7 @@ CoreV1API_connectGetNodeProxyWithPath(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1799,8 +1948,10 @@ CoreV1API_connectGetNodeProxyWithPath(apiClient_t *apiClient, char *name, char * //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1845,15 +1996,22 @@ CoreV1API_connectHeadNamespacedPodProxy(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1863,7 +2021,7 @@ CoreV1API_connectHeadNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1894,6 +2052,7 @@ CoreV1API_connectHeadNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "HEAD"); // uncomment below to debug the error response @@ -1904,8 +2063,10 @@ CoreV1API_connectHeadNamespacedPodProxy(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -1950,15 +2111,24 @@ CoreV1API_connectHeadNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1968,7 +2138,7 @@ CoreV1API_connectHeadNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1978,7 +2148,7 @@ CoreV1API_connectHeadNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -2009,6 +2179,7 @@ CoreV1API_connectHeadNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "HEAD"); // uncomment below to debug the error response @@ -2019,8 +2190,10 @@ CoreV1API_connectHeadNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2066,15 +2239,22 @@ CoreV1API_connectHeadNamespacedServiceProxy(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2084,7 +2264,7 @@ CoreV1API_connectHeadNamespacedServiceProxy(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2115,6 +2295,7 @@ CoreV1API_connectHeadNamespacedServiceProxy(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "HEAD"); // uncomment below to debug the error response @@ -2125,8 +2306,10 @@ CoreV1API_connectHeadNamespacedServiceProxy(apiClient_t *apiClient, char *name, //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2171,15 +2354,24 @@ CoreV1API_connectHeadNamespacedServiceProxyWithPath(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2189,7 +2381,7 @@ CoreV1API_connectHeadNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2199,7 +2391,7 @@ CoreV1API_connectHeadNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -2230,6 +2422,7 @@ CoreV1API_connectHeadNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "HEAD"); // uncomment below to debug the error response @@ -2240,8 +2433,10 @@ CoreV1API_connectHeadNamespacedServiceProxyWithPath(apiClient_t *apiClient, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2287,15 +2482,20 @@ CoreV1API_connectHeadNodeProxy(apiClient_t *apiClient, char *name, char *path) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2326,6 +2526,7 @@ CoreV1API_connectHeadNodeProxy(apiClient_t *apiClient, char *name, char *path) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "HEAD"); // uncomment below to debug the error response @@ -2336,8 +2537,10 @@ CoreV1API_connectHeadNodeProxy(apiClient_t *apiClient, char *name, char *path) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2381,15 +2584,22 @@ CoreV1API_connectHeadNodeProxyWithPath(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2399,7 +2609,7 @@ CoreV1API_connectHeadNodeProxyWithPath(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -2430,6 +2640,7 @@ CoreV1API_connectHeadNodeProxyWithPath(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "HEAD"); // uncomment below to debug the error response @@ -2440,8 +2651,10 @@ CoreV1API_connectHeadNodeProxyWithPath(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2486,15 +2699,22 @@ CoreV1API_connectOptionsNamespacedPodProxy(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2504,7 +2724,7 @@ CoreV1API_connectOptionsNamespacedPodProxy(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2535,6 +2755,7 @@ CoreV1API_connectOptionsNamespacedPodProxy(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "OPTIONS"); // uncomment below to debug the error response @@ -2545,8 +2766,10 @@ CoreV1API_connectOptionsNamespacedPodProxy(apiClient_t *apiClient, char *name, c //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2591,15 +2814,24 @@ CoreV1API_connectOptionsNamespacedPodProxyWithPath(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2609,7 +2841,7 @@ CoreV1API_connectOptionsNamespacedPodProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2619,7 +2851,7 @@ CoreV1API_connectOptionsNamespacedPodProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -2650,6 +2882,7 @@ CoreV1API_connectOptionsNamespacedPodProxyWithPath(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "OPTIONS"); // uncomment below to debug the error response @@ -2660,8 +2893,10 @@ CoreV1API_connectOptionsNamespacedPodProxyWithPath(apiClient_t *apiClient, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2707,15 +2942,22 @@ CoreV1API_connectOptionsNamespacedServiceProxy(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2725,7 +2967,7 @@ CoreV1API_connectOptionsNamespacedServiceProxy(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2756,6 +2998,7 @@ CoreV1API_connectOptionsNamespacedServiceProxy(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "OPTIONS"); // uncomment below to debug the error response @@ -2766,8 +3009,10 @@ CoreV1API_connectOptionsNamespacedServiceProxy(apiClient_t *apiClient, char *nam //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2812,15 +3057,24 @@ CoreV1API_connectOptionsNamespacedServiceProxyWithPath(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2830,7 +3084,7 @@ CoreV1API_connectOptionsNamespacedServiceProxyWithPath(apiClient_t *apiClient, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2840,7 +3094,7 @@ CoreV1API_connectOptionsNamespacedServiceProxyWithPath(apiClient_t *apiClient, c localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -2871,6 +3125,7 @@ CoreV1API_connectOptionsNamespacedServiceProxyWithPath(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "OPTIONS"); // uncomment below to debug the error response @@ -2881,8 +3136,10 @@ CoreV1API_connectOptionsNamespacedServiceProxyWithPath(apiClient_t *apiClient, c //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -2928,15 +3185,20 @@ CoreV1API_connectOptionsNodeProxy(apiClient_t *apiClient, char *name, char *path list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2967,6 +3229,7 @@ CoreV1API_connectOptionsNodeProxy(apiClient_t *apiClient, char *name, char *path localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "OPTIONS"); // uncomment below to debug the error response @@ -2977,8 +3240,10 @@ CoreV1API_connectOptionsNodeProxy(apiClient_t *apiClient, char *name, char *path //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3022,15 +3287,22 @@ CoreV1API_connectOptionsNodeProxyWithPath(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3040,7 +3312,7 @@ CoreV1API_connectOptionsNodeProxyWithPath(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -3071,6 +3343,7 @@ CoreV1API_connectOptionsNodeProxyWithPath(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "OPTIONS"); // uncomment below to debug the error response @@ -3081,8 +3354,10 @@ CoreV1API_connectOptionsNodeProxyWithPath(apiClient_t *apiClient, char *name, ch //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3127,15 +3402,22 @@ CoreV1API_connectPatchNamespacedPodProxy(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3145,7 +3427,7 @@ CoreV1API_connectPatchNamespacedPodProxy(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3176,6 +3458,7 @@ CoreV1API_connectPatchNamespacedPodProxy(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3186,8 +3469,10 @@ CoreV1API_connectPatchNamespacedPodProxy(apiClient_t *apiClient, char *name, cha //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3232,15 +3517,24 @@ CoreV1API_connectPatchNamespacedPodProxyWithPath(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3250,7 +3544,7 @@ CoreV1API_connectPatchNamespacedPodProxyWithPath(apiClient_t *apiClient, char *n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3260,7 +3554,7 @@ CoreV1API_connectPatchNamespacedPodProxyWithPath(apiClient_t *apiClient, char *n localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -3291,6 +3585,7 @@ CoreV1API_connectPatchNamespacedPodProxyWithPath(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3301,8 +3596,10 @@ CoreV1API_connectPatchNamespacedPodProxyWithPath(apiClient_t *apiClient, char *n //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3348,15 +3645,22 @@ CoreV1API_connectPatchNamespacedServiceProxy(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3366,7 +3670,7 @@ CoreV1API_connectPatchNamespacedServiceProxy(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3397,6 +3701,7 @@ CoreV1API_connectPatchNamespacedServiceProxy(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3407,8 +3712,10 @@ CoreV1API_connectPatchNamespacedServiceProxy(apiClient_t *apiClient, char *name, //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3453,15 +3760,24 @@ CoreV1API_connectPatchNamespacedServiceProxyWithPath(apiClient_t *apiClient, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3471,7 +3787,7 @@ CoreV1API_connectPatchNamespacedServiceProxyWithPath(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3481,7 +3797,7 @@ CoreV1API_connectPatchNamespacedServiceProxyWithPath(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -3512,6 +3828,7 @@ CoreV1API_connectPatchNamespacedServiceProxyWithPath(apiClient_t *apiClient, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3522,8 +3839,10 @@ CoreV1API_connectPatchNamespacedServiceProxyWithPath(apiClient_t *apiClient, cha //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3569,15 +3888,20 @@ CoreV1API_connectPatchNodeProxy(apiClient_t *apiClient, char *name, char *path) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3608,6 +3932,7 @@ CoreV1API_connectPatchNodeProxy(apiClient_t *apiClient, char *name, char *path) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3618,8 +3943,10 @@ CoreV1API_connectPatchNodeProxy(apiClient_t *apiClient, char *name, char *path) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3663,15 +3990,22 @@ CoreV1API_connectPatchNodeProxyWithPath(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3681,7 +4015,7 @@ CoreV1API_connectPatchNodeProxyWithPath(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -3712,6 +4046,7 @@ CoreV1API_connectPatchNodeProxyWithPath(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3722,8 +4057,10 @@ CoreV1API_connectPatchNodeProxyWithPath(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3768,15 +4105,22 @@ CoreV1API_connectPostNamespacedPodAttach(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/attach")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/attach"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/attach"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3786,7 +4130,7 @@ CoreV1API_connectPostNamespacedPodAttach(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3869,6 +4213,7 @@ CoreV1API_connectPostNamespacedPodAttach(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -3879,8 +4224,10 @@ CoreV1API_connectPostNamespacedPodAttach(apiClient_t *apiClient, char *name, cha //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -3973,15 +4320,22 @@ CoreV1API_connectPostNamespacedPodExec(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/exec")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/exec"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/exec"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3991,7 +4345,7 @@ CoreV1API_connectPostNamespacedPodExec(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4086,6 +4440,7 @@ CoreV1API_connectPostNamespacedPodExec(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4096,8 +4451,10 @@ CoreV1API_connectPostNamespacedPodExec(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4202,15 +4559,22 @@ CoreV1API_connectPostNamespacedPodPortforward(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/portforward")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/portforward"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/portforward"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4220,7 +4584,7 @@ CoreV1API_connectPostNamespacedPodPortforward(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4252,6 +4616,7 @@ CoreV1API_connectPostNamespacedPodPortforward(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4262,8 +4627,10 @@ CoreV1API_connectPostNamespacedPodPortforward(apiClient_t *apiClient, char *name //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4308,15 +4675,22 @@ CoreV1API_connectPostNamespacedPodProxy(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4326,7 +4700,7 @@ CoreV1API_connectPostNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4357,6 +4731,7 @@ CoreV1API_connectPostNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4367,8 +4742,10 @@ CoreV1API_connectPostNamespacedPodProxy(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4413,15 +4790,24 @@ CoreV1API_connectPostNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4431,7 +4817,7 @@ CoreV1API_connectPostNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4441,7 +4827,7 @@ CoreV1API_connectPostNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -4472,6 +4858,7 @@ CoreV1API_connectPostNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4482,8 +4869,10 @@ CoreV1API_connectPostNamespacedPodProxyWithPath(apiClient_t *apiClient, char *na //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4529,15 +4918,22 @@ CoreV1API_connectPostNamespacedServiceProxy(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4547,7 +4943,7 @@ CoreV1API_connectPostNamespacedServiceProxy(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4578,6 +4974,7 @@ CoreV1API_connectPostNamespacedServiceProxy(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4588,8 +4985,10 @@ CoreV1API_connectPostNamespacedServiceProxy(apiClient_t *apiClient, char *name, //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4634,15 +5033,24 @@ CoreV1API_connectPostNamespacedServiceProxyWithPath(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4652,7 +5060,7 @@ CoreV1API_connectPostNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4662,7 +5070,7 @@ CoreV1API_connectPostNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -4693,6 +5101,7 @@ CoreV1API_connectPostNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4703,8 +5112,10 @@ CoreV1API_connectPostNamespacedServiceProxyWithPath(apiClient_t *apiClient, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4750,15 +5161,20 @@ CoreV1API_connectPostNodeProxy(apiClient_t *apiClient, char *name, char *path) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4789,6 +5205,7 @@ CoreV1API_connectPostNodeProxy(apiClient_t *apiClient, char *name, char *path) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4799,8 +5216,10 @@ CoreV1API_connectPostNodeProxy(apiClient_t *apiClient, char *name, char *path) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4844,15 +5263,22 @@ CoreV1API_connectPostNodeProxyWithPath(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4862,7 +5288,7 @@ CoreV1API_connectPostNodeProxyWithPath(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -4893,6 +5319,7 @@ CoreV1API_connectPostNodeProxyWithPath(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -4903,8 +5330,10 @@ CoreV1API_connectPostNodeProxyWithPath(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -4949,15 +5378,22 @@ CoreV1API_connectPutNamespacedPodProxy(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4967,7 +5403,7 @@ CoreV1API_connectPutNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4998,6 +5434,7 @@ CoreV1API_connectPutNamespacedPodProxy(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5008,8 +5445,10 @@ CoreV1API_connectPutNamespacedPodProxy(apiClient_t *apiClient, char *name, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -5054,15 +5493,24 @@ CoreV1API_connectPutNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5072,7 +5520,7 @@ CoreV1API_connectPutNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5082,7 +5530,7 @@ CoreV1API_connectPutNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -5113,6 +5561,7 @@ CoreV1API_connectPutNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5123,8 +5572,10 @@ CoreV1API_connectPutNamespacedPodProxyWithPath(apiClient_t *apiClient, char *nam //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -5170,15 +5621,22 @@ CoreV1API_connectPutNamespacedServiceProxy(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5188,7 +5646,7 @@ CoreV1API_connectPutNamespacedServiceProxy(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5219,6 +5677,7 @@ CoreV1API_connectPutNamespacedServiceProxy(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5229,8 +5688,10 @@ CoreV1API_connectPutNamespacedServiceProxy(apiClient_t *apiClient, char *name, c //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -5275,15 +5736,24 @@ CoreV1API_connectPutNamespacedServiceProxyWithPath(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5293,7 +5763,7 @@ CoreV1API_connectPutNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5303,7 +5773,7 @@ CoreV1API_connectPutNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(_namespace)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -5334,6 +5804,7 @@ CoreV1API_connectPutNamespacedServiceProxyWithPath(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5344,8 +5815,10 @@ CoreV1API_connectPutNamespacedServiceProxyWithPath(apiClient_t *apiClient, char //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -5391,15 +5864,20 @@ CoreV1API_connectPutNodeProxy(apiClient_t *apiClient, char *name, char *path) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5430,6 +5908,7 @@ CoreV1API_connectPutNodeProxy(apiClient_t *apiClient, char *name, char *path) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5440,8 +5919,10 @@ CoreV1API_connectPutNodeProxy(apiClient_t *apiClient, char *name, char *path) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -5485,15 +5966,22 @@ CoreV1API_connectPutNodeProxyWithPath(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/proxy/{path}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/proxy/{path}"); + char *localVarPath = strdup("/api/v1/nodes/{name}/proxy/{path}"); + + if(!name) + goto end; + if(!path) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(path)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5503,7 +5991,7 @@ CoreV1API_connectPutNodeProxyWithPath(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + strlen("{ path }"); + long sizeOfPathParams_path = strlen(name)+3 + strlen(path)+3 + sizeof("{ path }") - 1; if(path == NULL) { goto end; } @@ -5534,6 +6022,7 @@ CoreV1API_connectPutNodeProxyWithPath(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5544,8 +6033,10 @@ CoreV1API_connectPutNodeProxyWithPath(apiClient_t *apiClient, char *name, char * //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); @@ -5590,11 +6081,14 @@ CoreV1API_createNamespace(apiClient_t *apiClient, v1_namespace_t *body, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces"); + char *localVarPath = strdup("/api/v1/namespaces"); + @@ -5651,13 +6145,15 @@ CoreV1API_createNamespace(apiClient_t *apiClient, v1_namespace_t *body, char *pr cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_namespace_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5666,6 +6162,7 @@ CoreV1API_createNamespace(apiClient_t *apiClient, v1_namespace_t *body, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -5685,11 +6182,14 @@ CoreV1API_createNamespace(apiClient_t *apiClient, v1_namespace_t *body, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5775,15 +6275,20 @@ CoreV1API_createNamespacedBinding(apiClient_t *apiClient, char *_namespace, v1_b list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/bindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/bindings"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/bindings"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5846,13 +6351,15 @@ CoreV1API_createNamespacedBinding(apiClient_t *apiClient, char *_namespace, v1_b cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5861,6 +6368,7 @@ CoreV1API_createNamespacedBinding(apiClient_t *apiClient, char *_namespace, v1_b localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -5880,11 +6388,14 @@ CoreV1API_createNamespacedBinding(apiClient_t *apiClient, char *_namespace, v1_b // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_binding_t *elementToReturn = v1_binding_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_binding_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5971,15 +6482,20 @@ CoreV1API_createNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, v1 list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/configmaps")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/configmaps"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/configmaps"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6042,13 +6558,15 @@ CoreV1API_createNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, v1 cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_config_map_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6057,6 +6575,7 @@ CoreV1API_createNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, v1 localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -6076,11 +6595,14 @@ CoreV1API_createNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, v1 // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_config_map_t *elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_config_map_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6167,15 +6689,20 @@ CoreV1API_createNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, v1 list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/endpoints")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/endpoints"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/endpoints"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6238,13 +6765,15 @@ CoreV1API_createNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, v1 cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_endpoints_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6253,6 +6782,7 @@ CoreV1API_createNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, v1 localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -6272,11 +6802,14 @@ CoreV1API_createNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, v1 // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoints_t *elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoints_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6363,15 +6896,20 @@ CoreV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, core_v list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/events"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/events"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6434,13 +6972,15 @@ CoreV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, core_v cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = core_v1_event_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6449,6 +6989,7 @@ CoreV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, core_v localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -6468,11 +7009,14 @@ CoreV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, core_v // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - core_v1_event_t *elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + core_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6559,15 +7103,20 @@ CoreV1API_createNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, v list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/limitranges")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/limitranges"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/limitranges"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6630,13 +7179,15 @@ CoreV1API_createNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, v cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_limit_range_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6645,6 +7196,7 @@ CoreV1API_createNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, v localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -6664,11 +7216,14 @@ CoreV1API_createNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, v // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_limit_range_t *elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_limit_range_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6755,15 +7310,20 @@ CoreV1API_createNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6826,13 +7386,15 @@ CoreV1API_createNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_persistent_volume_claim_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6841,6 +7403,7 @@ CoreV1API_createNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -6860,11 +7423,14 @@ CoreV1API_createNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6951,15 +7517,20 @@ CoreV1API_createNamespacedPod(apiClient_t *apiClient, char *_namespace, v1_pod_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7022,13 +7593,15 @@ CoreV1API_createNamespacedPod(apiClient_t *apiClient, char *_namespace, v1_pod_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7037,6 +7610,7 @@ CoreV1API_createNamespacedPod(apiClient_t *apiClient, char *_namespace, v1_pod_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -7056,11 +7630,14 @@ CoreV1API_createNamespacedPod(apiClient_t *apiClient, char *_namespace, v1_pod_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7147,15 +7724,22 @@ CoreV1API_createNamespacedPodBinding(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/binding")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/binding"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/binding"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7165,7 +7749,7 @@ CoreV1API_createNamespacedPodBinding(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7228,13 +7812,15 @@ CoreV1API_createNamespacedPodBinding(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7243,6 +7829,7 @@ CoreV1API_createNamespacedPodBinding(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -7262,11 +7849,14 @@ CoreV1API_createNamespacedPodBinding(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_binding_t *elementToReturn = v1_binding_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_binding_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7354,15 +7944,22 @@ CoreV1API_createNamespacedPodEviction(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/eviction")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/eviction"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/eviction"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7372,7 +7969,7 @@ CoreV1API_createNamespacedPodEviction(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7435,13 +8032,15 @@ CoreV1API_createNamespacedPodEviction(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_eviction_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7450,6 +8049,7 @@ CoreV1API_createNamespacedPodEviction(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -7469,11 +8069,14 @@ CoreV1API_createNamespacedPodEviction(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_eviction_t *elementToReturn = v1_eviction_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_eviction_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_eviction_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7561,15 +8164,20 @@ CoreV1API_createNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/podtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/podtemplates"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/podtemplates"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7632,13 +8240,15 @@ CoreV1API_createNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_template_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7647,6 +8257,7 @@ CoreV1API_createNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -7666,11 +8277,14 @@ CoreV1API_createNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_template_t *elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7757,15 +8371,20 @@ CoreV1API_createNamespacedReplicationController(apiClient_t *apiClient, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7828,13 +8447,15 @@ CoreV1API_createNamespacedReplicationController(apiClient_t *apiClient, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_replication_controller_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7843,6 +8464,7 @@ CoreV1API_createNamespacedReplicationController(apiClient_t *apiClient, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -7862,11 +8484,14 @@ CoreV1API_createNamespacedReplicationController(apiClient_t *apiClient, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_t *elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7953,15 +8578,20 @@ CoreV1API_createNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8024,13 +8654,15 @@ CoreV1API_createNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_resource_quota_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8039,6 +8671,7 @@ CoreV1API_createNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -8058,11 +8691,14 @@ CoreV1API_createNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8149,15 +8785,20 @@ CoreV1API_createNamespacedSecret(apiClient_t *apiClient, char *_namespace, v1_se list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/secrets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/secrets"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/secrets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8220,13 +8861,15 @@ CoreV1API_createNamespacedSecret(apiClient_t *apiClient, char *_namespace, v1_se cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_secret_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8235,6 +8878,7 @@ CoreV1API_createNamespacedSecret(apiClient_t *apiClient, char *_namespace, v1_se localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -8254,11 +8898,14 @@ CoreV1API_createNamespacedSecret(apiClient_t *apiClient, char *_namespace, v1_se // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_secret_t *elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_secret_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8345,15 +8992,20 @@ CoreV1API_createNamespacedService(apiClient_t *apiClient, char *_namespace, v1_s list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8416,13 +9068,15 @@ CoreV1API_createNamespacedService(apiClient_t *apiClient, char *_namespace, v1_s cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_service_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8431,6 +9085,7 @@ CoreV1API_createNamespacedService(apiClient_t *apiClient, char *_namespace, v1_s localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -8450,11 +9105,14 @@ CoreV1API_createNamespacedService(apiClient_t *apiClient, char *_namespace, v1_s // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8541,15 +9199,20 @@ CoreV1API_createNamespacedServiceAccount(apiClient_t *apiClient, char *_namespac list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8612,13 +9275,15 @@ CoreV1API_createNamespacedServiceAccount(apiClient_t *apiClient, char *_namespac cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_service_account_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8627,6 +9292,7 @@ CoreV1API_createNamespacedServiceAccount(apiClient_t *apiClient, char *_namespac localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -8646,11 +9312,14 @@ CoreV1API_createNamespacedServiceAccount(apiClient_t *apiClient, char *_namespac // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_account_t *elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_account_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8737,15 +9406,22 @@ CoreV1API_createNamespacedServiceAccountToken(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8755,7 +9431,7 @@ CoreV1API_createNamespacedServiceAccountToken(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -8818,13 +9494,15 @@ CoreV1API_createNamespacedServiceAccountToken(apiClient_t *apiClient, char *name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = authentication_v1_token_request_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8833,6 +9511,7 @@ CoreV1API_createNamespacedServiceAccountToken(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -8852,11 +9531,14 @@ CoreV1API_createNamespacedServiceAccountToken(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - authentication_v1_token_request_t *elementToReturn = authentication_v1_token_request_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + authentication_v1_token_request_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = authentication_v1_token_request_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8944,11 +9626,14 @@ CoreV1API_createNode(apiClient_t *apiClient, v1_node_t *body, char *pretty, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes"); + char *localVarPath = strdup("/api/v1/nodes"); + @@ -9005,13 +9690,15 @@ CoreV1API_createNode(apiClient_t *apiClient, v1_node_t *body, char *pretty, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_node_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9020,6 +9707,7 @@ CoreV1API_createNode(apiClient_t *apiClient, v1_node_t *body, char *pretty, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -9039,11 +9727,14 @@ CoreV1API_createNode(apiClient_t *apiClient, v1_node_t *body, char *pretty, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_t *elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9129,11 +9820,14 @@ CoreV1API_createPersistentVolume(apiClient_t *apiClient, v1_persistent_volume_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes"); + char *localVarPath = strdup("/api/v1/persistentvolumes"); + @@ -9190,13 +9884,15 @@ CoreV1API_createPersistentVolume(apiClient_t *apiClient, v1_persistent_volume_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_persistent_volume_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9205,6 +9901,7 @@ CoreV1API_createPersistentVolume(apiClient_t *apiClient, v1_persistent_volume_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -9224,11 +9921,14 @@ CoreV1API_createPersistentVolume(apiClient_t *apiClient, v1_persistent_volume_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9306,7 +10006,7 @@ CoreV1API_createPersistentVolume(apiClient_t *apiClient, v1_persistent_volume_t // delete collection of ConfigMap // v1_status_t* -CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -9314,15 +10014,20 @@ CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/configmaps")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/configmaps"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/configmaps"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -9394,6 +10099,19 @@ CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_nam list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -9498,13 +10216,15 @@ CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9513,6 +10233,7 @@ CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -9524,11 +10245,14 @@ CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9609,6 +10333,18 @@ CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_nam keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -9715,7 +10451,7 @@ CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_nam // delete collection of Endpoints // v1_status_t* -CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -9723,15 +10459,20 @@ CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/endpoints")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/endpoints"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/endpoints"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -9803,6 +10544,19 @@ CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_nam list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -9907,13 +10661,15 @@ CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9922,6 +10678,7 @@ CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -9933,11 +10690,14 @@ CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10018,6 +10778,18 @@ CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_nam keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -10124,7 +10896,7 @@ CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_nam // delete collection of Event // v1_status_t* -CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -10132,15 +10904,20 @@ CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/events"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/events"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10212,6 +10989,19 @@ CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespa list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -10316,13 +11106,15 @@ CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespa cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10331,6 +11123,7 @@ CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -10342,11 +11135,14 @@ CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10427,6 +11223,18 @@ CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespa keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -10533,7 +11341,7 @@ CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespa // delete collection of LimitRange // v1_status_t* -CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -10541,15 +11349,20 @@ CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/limitranges")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/limitranges"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/limitranges"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -10621,6 +11434,19 @@ CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -10725,13 +11551,15 @@ CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -10740,6 +11568,7 @@ CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -10751,11 +11580,14 @@ CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -10836,6 +11668,18 @@ CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -10942,7 +11786,7 @@ CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_na // delete collection of PersistentVolumeClaim // v1_status_t* -CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -10950,15 +11794,20 @@ CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11030,6 +11879,19 @@ CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -11134,13 +11996,15 @@ CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11149,6 +12013,7 @@ CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -11160,11 +12025,14 @@ CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11245,6 +12113,18 @@ CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -11351,7 +12231,7 @@ CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient // delete collection of Pod // v1_status_t* -CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -11359,15 +12239,20 @@ CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11439,6 +12324,19 @@ CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -11543,13 +12441,15 @@ CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11558,6 +12458,7 @@ CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -11569,11 +12470,14 @@ CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -11654,6 +12558,18 @@ CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -11760,7 +12676,7 @@ CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace // delete collection of PodTemplate // v1_status_t* -CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -11768,15 +12684,20 @@ CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/podtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/podtemplates"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/podtemplates"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -11848,6 +12769,19 @@ CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_n list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -11952,13 +12886,15 @@ CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -11967,6 +12903,7 @@ CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -11978,11 +12915,14 @@ CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12063,6 +13003,18 @@ CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_n keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -12169,7 +13121,7 @@ CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_n // delete collection of ReplicationController // v1_status_t* -CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -12177,15 +13129,20 @@ CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -12257,6 +13214,19 @@ CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -12361,13 +13331,15 @@ CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -12376,6 +13348,7 @@ CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -12387,11 +13360,14 @@ CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12472,6 +13448,18 @@ CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -12578,7 +13566,7 @@ CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient // delete collection of ResourceQuota // v1_status_t* -CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -12586,15 +13574,20 @@ CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -12666,6 +13659,19 @@ CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -12770,13 +13776,15 @@ CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -12785,6 +13793,7 @@ CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -12796,11 +13805,14 @@ CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -12881,6 +13893,18 @@ CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -12987,7 +14011,7 @@ CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char * // delete collection of Secret // v1_status_t* -CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -12995,15 +14019,20 @@ CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/secrets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/secrets"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/secrets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13075,6 +14104,19 @@ CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namesp list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -13179,13 +14221,15 @@ CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namesp cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -13194,6 +14238,7 @@ CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -13205,11 +14250,14 @@ CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namesp // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -13290,6 +14338,18 @@ CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namesp keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -13396,7 +14456,7 @@ CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namesp // delete collection of Service // v1_status_t* -CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -13404,15 +14464,20 @@ CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_names list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13484,6 +14549,19 @@ CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_names list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -13588,13 +14666,15 @@ CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_names cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -13603,6 +14683,7 @@ CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -13614,11 +14695,14 @@ CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_names // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -13699,6 +14783,18 @@ CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_names keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -13805,7 +14901,7 @@ CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_names // delete collection of ServiceAccount // v1_status_t* -CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -13813,15 +14909,20 @@ CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -13893,6 +14994,19 @@ CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -13997,13 +15111,15 @@ CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -14012,6 +15128,7 @@ CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -14023,11 +15140,14 @@ CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -14108,6 +15228,18 @@ CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -14214,7 +15346,7 @@ CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char // delete collection of Node // v1_status_t* -CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -14222,11 +15354,14 @@ CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_cont list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes"); + char *localVarPath = strdup("/api/v1/nodes"); + @@ -14292,6 +15427,19 @@ CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_cont list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -14396,13 +15544,15 @@ CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_cont cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -14411,6 +15561,7 @@ CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_cont localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -14422,11 +15573,14 @@ CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_cont // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -14506,6 +15660,18 @@ CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_cont keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -14612,7 +15778,7 @@ CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_cont // delete collection of PersistentVolume // v1_status_t* -CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -14620,11 +15786,14 @@ CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes"); + char *localVarPath = strdup("/api/v1/persistentvolumes"); + @@ -14690,6 +15859,19 @@ CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -14794,13 +15976,15 @@ CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -14809,6 +15993,7 @@ CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -14820,11 +16005,14 @@ CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -14904,6 +16092,18 @@ CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -15010,7 +16210,7 @@ CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, // delete a Namespace // v1_status_t* -CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -15018,15 +16218,20 @@ CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -15074,6 +16279,19 @@ CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -15103,13 +16321,15 @@ CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -15118,6 +16338,7 @@ CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -15133,11 +16354,14 @@ CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -15194,6 +16418,18 @@ CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -15228,7 +16464,7 @@ CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char // delete a ConfigMap // v1_status_t* -CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -15236,15 +16472,22 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/configmaps/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/configmaps/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/configmaps/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -15254,7 +16497,7 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -15302,6 +16545,19 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -15331,13 +16587,15 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -15346,6 +16604,7 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -15361,11 +16620,14 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -15423,6 +16685,18 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -15457,7 +16731,7 @@ CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_n // delete Endpoints // v1_status_t* -CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -15465,15 +16739,22 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/endpoints/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/endpoints/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/endpoints/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -15483,7 +16764,7 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -15531,6 +16812,19 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -15560,13 +16854,15 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -15575,6 +16871,7 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -15590,11 +16887,14 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -15652,6 +16952,18 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -15686,7 +16998,7 @@ CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_n // delete an Event // v1_status_t* -CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -15694,15 +17006,22 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -15712,7 +17031,7 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -15760,6 +17079,19 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -15789,13 +17121,15 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -15804,6 +17138,7 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -15819,11 +17154,14 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -15881,6 +17219,18 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -15915,7 +17265,7 @@ CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_names // delete a LimitRange // v1_status_t* -CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -15923,15 +17273,22 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/limitranges/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/limitranges/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/limitranges/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -15941,7 +17298,7 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -15989,6 +17346,19 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -16018,13 +17388,15 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -16033,6 +17405,7 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -16048,11 +17421,14 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -16110,6 +17486,18 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -16144,7 +17532,7 @@ CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_ // delete a PersistentVolumeClaim // v1_persistent_volume_claim_t* -CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -16152,15 +17540,22 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -16170,7 +17565,7 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -16218,6 +17613,19 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -16247,13 +17655,15 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -16262,6 +17672,7 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -16277,11 +17688,14 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -16339,6 +17753,18 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -16373,7 +17799,7 @@ CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *na // delete a Pod // v1_pod_t* -CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -16381,15 +17807,22 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -16399,7 +17832,7 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -16447,6 +17880,19 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -16476,13 +17922,15 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -16491,6 +17939,7 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -16506,11 +17955,14 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -16568,6 +18020,18 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -16602,7 +18066,7 @@ CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespa // delete a PodTemplate // v1_pod_template_t* -CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -16610,15 +18074,22 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/podtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/podtemplates/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/podtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -16628,7 +18099,7 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -16676,6 +18147,19 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -16705,13 +18189,15 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -16720,6 +18206,7 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -16735,11 +18222,14 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_template_t *elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -16797,6 +18287,18 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -16831,7 +18333,7 @@ CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char * // delete a ReplicationController // v1_status_t* -CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -16839,15 +18341,22 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -16857,7 +18366,7 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -16905,6 +18414,19 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -16934,13 +18456,15 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -16949,6 +18473,7 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -16964,11 +18489,14 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -17026,6 +18554,18 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -17060,7 +18600,7 @@ CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *na // delete a ResourceQuota // v1_resource_quota_t* -CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -17068,15 +18608,22 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -17086,7 +18633,7 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -17134,6 +18681,19 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -17163,13 +18723,15 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -17178,6 +18740,7 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -17193,11 +18756,14 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -17255,6 +18821,18 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -17289,7 +18867,7 @@ CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char // delete a Secret // v1_status_t* -CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -17297,15 +18875,22 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/secrets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/secrets/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/secrets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -17315,7 +18900,7 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -17363,6 +18948,19 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -17392,13 +18990,15 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -17407,6 +19007,7 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -17422,11 +19023,14 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -17484,6 +19088,18 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -17518,7 +19134,7 @@ CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_name // delete a Service // v1_service_t* -CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -17526,15 +19142,22 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -17544,7 +19167,7 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -17592,6 +19215,19 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -17621,13 +19257,15 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -17636,6 +19274,7 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -17651,11 +19290,14 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -17713,6 +19355,18 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -17747,7 +19401,7 @@ CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_nam // delete a ServiceAccount // v1_service_account_t* -CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -17755,15 +19409,22 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -17773,7 +19434,7 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -17821,6 +19482,19 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -17850,13 +19524,15 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -17865,6 +19541,7 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -17880,11 +19557,14 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_account_t *elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_account_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -17942,6 +19622,18 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -17976,7 +19668,7 @@ CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, cha // delete a Node // v1_status_t* -CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -17984,15 +19676,20 @@ CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dry list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}"); + char *localVarPath = strdup("/api/v1/nodes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -18040,6 +19737,19 @@ CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dry list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -18069,13 +19779,15 @@ CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dry cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -18084,6 +19796,7 @@ CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dry localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -18099,11 +19812,14 @@ CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dry // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -18160,6 +19876,18 @@ CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dry keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -18194,7 +19922,7 @@ CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dry // delete a PersistentVolume // v1_persistent_volume_t* -CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -18202,15 +19930,20 @@ CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *prett list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes/{name}"); + char *localVarPath = strdup("/api/v1/persistentvolumes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -18258,6 +19991,19 @@ CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *prett list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -18287,13 +20033,15 @@ CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *prett cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -18302,6 +20050,7 @@ CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *prett localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -18317,11 +20066,14 @@ CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *prett // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -18378,6 +20130,18 @@ CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *prett keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -18420,17 +20184,21 @@ CoreV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/"); + char *localVarPath = strdup("/api/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -18439,6 +20207,7 @@ CoreV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -18450,11 +20219,14 @@ CoreV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -18487,11 +20259,14 @@ CoreV1API_listComponentStatus(apiClient_t *apiClient, int *allowWatchBookmarks, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/componentstatuses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/componentstatuses"); + char *localVarPath = strdup("/api/v1/componentstatuses"); + @@ -18635,8 +20410,10 @@ CoreV1API_listComponentStatus(apiClient_t *apiClient, int *allowWatchBookmarks, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -18645,6 +20422,7 @@ CoreV1API_listComponentStatus(apiClient_t *apiClient, int *allowWatchBookmarks, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -18656,11 +20434,14 @@ CoreV1API_listComponentStatus(apiClient_t *apiClient, int *allowWatchBookmarks, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_component_status_list_t *elementToReturn = v1_component_status_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_component_status_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_component_status_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -18825,11 +20606,14 @@ CoreV1API_listConfigMapForAllNamespaces(apiClient_t *apiClient, int *allowWatchB list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/configmaps")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/configmaps"); + char *localVarPath = strdup("/api/v1/configmaps"); + @@ -18973,8 +20757,10 @@ CoreV1API_listConfigMapForAllNamespaces(apiClient_t *apiClient, int *allowWatchB list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -18983,6 +20769,7 @@ CoreV1API_listConfigMapForAllNamespaces(apiClient_t *apiClient, int *allowWatchB localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -18994,11 +20781,14 @@ CoreV1API_listConfigMapForAllNamespaces(apiClient_t *apiClient, int *allowWatchB // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_config_map_list_t *elementToReturn = v1_config_map_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_config_map_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_config_map_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -19163,11 +20953,14 @@ CoreV1API_listEndpointsForAllNamespaces(apiClient_t *apiClient, int *allowWatchB list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/endpoints")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/endpoints"); + char *localVarPath = strdup("/api/v1/endpoints"); + @@ -19311,8 +21104,10 @@ CoreV1API_listEndpointsForAllNamespaces(apiClient_t *apiClient, int *allowWatchB list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -19321,6 +21116,7 @@ CoreV1API_listEndpointsForAllNamespaces(apiClient_t *apiClient, int *allowWatchB localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -19332,11 +21128,14 @@ CoreV1API_listEndpointsForAllNamespaces(apiClient_t *apiClient, int *allowWatchB // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoints_list_t *elementToReturn = v1_endpoints_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoints_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoints_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -19501,11 +21300,14 @@ CoreV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookm list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/events"); + char *localVarPath = strdup("/api/v1/events"); + @@ -19649,8 +21451,10 @@ CoreV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookm list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -19659,6 +21463,7 @@ CoreV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookm localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -19670,11 +21475,14 @@ CoreV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookm // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - core_v1_event_list_t *elementToReturn = core_v1_event_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + core_v1_event_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = core_v1_event_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -19839,11 +21647,14 @@ CoreV1API_listLimitRangeForAllNamespaces(apiClient_t *apiClient, int *allowWatch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/limitranges")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/limitranges"); + char *localVarPath = strdup("/api/v1/limitranges"); + @@ -19987,8 +21798,10 @@ CoreV1API_listLimitRangeForAllNamespaces(apiClient_t *apiClient, int *allowWatch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -19997,6 +21810,7 @@ CoreV1API_listLimitRangeForAllNamespaces(apiClient_t *apiClient, int *allowWatch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -20008,11 +21822,14 @@ CoreV1API_listLimitRangeForAllNamespaces(apiClient_t *apiClient, int *allowWatch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_limit_range_list_t *elementToReturn = v1_limit_range_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_limit_range_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_limit_range_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -20177,11 +21994,14 @@ CoreV1API_listNamespace(apiClient_t *apiClient, char *pretty, int *allowWatchBoo list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces"); + char *localVarPath = strdup("/api/v1/namespaces"); + @@ -20325,8 +22145,10 @@ CoreV1API_listNamespace(apiClient_t *apiClient, char *pretty, int *allowWatchBoo list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -20335,6 +22157,7 @@ CoreV1API_listNamespace(apiClient_t *apiClient, char *pretty, int *allowWatchBoo localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -20346,11 +22169,14 @@ CoreV1API_listNamespace(apiClient_t *apiClient, char *pretty, int *allowWatchBoo // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_list_t *elementToReturn = v1_namespace_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -20515,15 +22341,20 @@ CoreV1API_listNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/configmaps")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/configmaps"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/configmaps"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -20673,8 +22504,10 @@ CoreV1API_listNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -20683,6 +22516,7 @@ CoreV1API_listNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -20694,11 +22528,14 @@ CoreV1API_listNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_config_map_list_t *elementToReturn = v1_config_map_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_config_map_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_config_map_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -20864,15 +22701,20 @@ CoreV1API_listNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/endpoints")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/endpoints"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/endpoints"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -21022,8 +22864,10 @@ CoreV1API_listNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -21032,6 +22876,7 @@ CoreV1API_listNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -21043,11 +22888,14 @@ CoreV1API_listNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoints_list_t *elementToReturn = v1_endpoints_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoints_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoints_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -21213,15 +23061,20 @@ CoreV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/events"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/events"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -21371,8 +23224,10 @@ CoreV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pr list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -21381,6 +23236,7 @@ CoreV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -21392,11 +23248,14 @@ CoreV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - core_v1_event_list_t *elementToReturn = core_v1_event_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + core_v1_event_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = core_v1_event_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -21562,15 +23421,20 @@ CoreV1API_listNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/limitranges")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/limitranges"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/limitranges"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -21720,8 +23584,10 @@ CoreV1API_listNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, cha list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -21730,6 +23596,7 @@ CoreV1API_listNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -21741,11 +23608,14 @@ CoreV1API_listNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_limit_range_list_t *elementToReturn = v1_limit_range_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_limit_range_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_limit_range_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -21911,15 +23781,20 @@ CoreV1API_listNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -22069,8 +23944,10 @@ CoreV1API_listNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -22079,6 +23956,7 @@ CoreV1API_listNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -22090,11 +23968,14 @@ CoreV1API_listNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_list_t *elementToReturn = v1_persistent_volume_claim_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -22260,15 +24141,20 @@ CoreV1API_listNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pret list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -22418,8 +24304,10 @@ CoreV1API_listNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pret list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -22428,6 +24316,7 @@ CoreV1API_listNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pret localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -22439,11 +24328,14 @@ CoreV1API_listNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pret // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_list_t *elementToReturn = v1_pod_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -22609,15 +24501,20 @@ CoreV1API_listNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/podtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/podtemplates"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/podtemplates"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -22767,8 +24664,10 @@ CoreV1API_listNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -22777,6 +24676,7 @@ CoreV1API_listNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -22788,11 +24688,14 @@ CoreV1API_listNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_template_list_t *elementToReturn = v1_pod_template_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_template_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -22958,15 +24861,20 @@ CoreV1API_listNamespacedReplicationController(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -23116,8 +25024,10 @@ CoreV1API_listNamespacedReplicationController(apiClient_t *apiClient, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -23126,6 +25036,7 @@ CoreV1API_listNamespacedReplicationController(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -23137,11 +25048,14 @@ CoreV1API_listNamespacedReplicationController(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_list_t *elementToReturn = v1_replication_controller_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -23307,15 +25221,20 @@ CoreV1API_listNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -23465,8 +25384,10 @@ CoreV1API_listNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -23475,6 +25396,7 @@ CoreV1API_listNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -23486,11 +25408,14 @@ CoreV1API_listNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_list_t *elementToReturn = v1_resource_quota_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -23656,15 +25581,20 @@ CoreV1API_listNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *p list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/secrets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/secrets"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/secrets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -23814,8 +25744,10 @@ CoreV1API_listNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *p list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -23824,6 +25756,7 @@ CoreV1API_listNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *p localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -23835,11 +25768,14 @@ CoreV1API_listNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *p // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_secret_list_t *elementToReturn = v1_secret_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_secret_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_secret_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -24005,15 +25941,20 @@ CoreV1API_listNamespacedService(apiClient_t *apiClient, char *_namespace, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -24163,8 +26104,10 @@ CoreV1API_listNamespacedService(apiClient_t *apiClient, char *_namespace, char * list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -24173,6 +26116,7 @@ CoreV1API_listNamespacedService(apiClient_t *apiClient, char *_namespace, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -24184,11 +26128,14 @@ CoreV1API_listNamespacedService(apiClient_t *apiClient, char *_namespace, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_list_t *elementToReturn = v1_service_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -24354,15 +26301,20 @@ CoreV1API_listNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -24512,8 +26464,10 @@ CoreV1API_listNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -24522,6 +26476,7 @@ CoreV1API_listNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -24533,11 +26488,14 @@ CoreV1API_listNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_account_list_t *elementToReturn = v1_service_account_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_account_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_account_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -24703,11 +26661,14 @@ CoreV1API_listNode(apiClient_t *apiClient, char *pretty, int *allowWatchBookmark list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes"); + char *localVarPath = strdup("/api/v1/nodes"); + @@ -24851,8 +26812,10 @@ CoreV1API_listNode(apiClient_t *apiClient, char *pretty, int *allowWatchBookmark list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -24861,6 +26824,7 @@ CoreV1API_listNode(apiClient_t *apiClient, char *pretty, int *allowWatchBookmark localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -24872,11 +26836,14 @@ CoreV1API_listNode(apiClient_t *apiClient, char *pretty, int *allowWatchBookmark // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_list_t *elementToReturn = v1_node_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_node_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -25041,11 +27008,14 @@ CoreV1API_listPersistentVolume(apiClient_t *apiClient, char *pretty, int *allowW list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes"); + char *localVarPath = strdup("/api/v1/persistentvolumes"); + @@ -25189,8 +27159,10 @@ CoreV1API_listPersistentVolume(apiClient_t *apiClient, char *pretty, int *allowW list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -25199,6 +27171,7 @@ CoreV1API_listPersistentVolume(apiClient_t *apiClient, char *pretty, int *allowW localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -25210,11 +27183,14 @@ CoreV1API_listPersistentVolume(apiClient_t *apiClient, char *pretty, int *allowW // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_list_t *elementToReturn = v1_persistent_volume_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -25379,11 +27355,14 @@ CoreV1API_listPersistentVolumeClaimForAllNamespaces(apiClient_t *apiClient, int list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumeclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumeclaims"); + char *localVarPath = strdup("/api/v1/persistentvolumeclaims"); + @@ -25527,8 +27506,10 @@ CoreV1API_listPersistentVolumeClaimForAllNamespaces(apiClient_t *apiClient, int list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -25537,6 +27518,7 @@ CoreV1API_listPersistentVolumeClaimForAllNamespaces(apiClient_t *apiClient, int localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -25548,11 +27530,14 @@ CoreV1API_listPersistentVolumeClaimForAllNamespaces(apiClient_t *apiClient, int // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_list_t *elementToReturn = v1_persistent_volume_claim_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -25717,11 +27702,14 @@ CoreV1API_listPodForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmar list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/pods")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/pods"); + char *localVarPath = strdup("/api/v1/pods"); + @@ -25865,8 +27853,10 @@ CoreV1API_listPodForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmar list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -25875,6 +27865,7 @@ CoreV1API_listPodForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmar localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -25886,11 +27877,14 @@ CoreV1API_listPodForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmar // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_list_t *elementToReturn = v1_pod_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -26055,11 +28049,14 @@ CoreV1API_listPodTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatc list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/podtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/podtemplates"); + char *localVarPath = strdup("/api/v1/podtemplates"); + @@ -26203,8 +28200,10 @@ CoreV1API_listPodTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatc list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -26213,6 +28212,7 @@ CoreV1API_listPodTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatc localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -26224,11 +28224,14 @@ CoreV1API_listPodTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatc // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_template_list_t *elementToReturn = v1_pod_template_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_template_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -26393,11 +28396,14 @@ CoreV1API_listReplicationControllerForAllNamespaces(apiClient_t *apiClient, int list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/replicationcontrollers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/replicationcontrollers"); + char *localVarPath = strdup("/api/v1/replicationcontrollers"); + @@ -26541,8 +28547,10 @@ CoreV1API_listReplicationControllerForAllNamespaces(apiClient_t *apiClient, int list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -26551,6 +28559,7 @@ CoreV1API_listReplicationControllerForAllNamespaces(apiClient_t *apiClient, int localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -26562,11 +28571,14 @@ CoreV1API_listReplicationControllerForAllNamespaces(apiClient_t *apiClient, int // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_list_t *elementToReturn = v1_replication_controller_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -26731,11 +28743,14 @@ CoreV1API_listResourceQuotaForAllNamespaces(apiClient_t *apiClient, int *allowWa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/resourcequotas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/resourcequotas"); + char *localVarPath = strdup("/api/v1/resourcequotas"); + @@ -26879,8 +28894,10 @@ CoreV1API_listResourceQuotaForAllNamespaces(apiClient_t *apiClient, int *allowWa list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -26889,6 +28906,7 @@ CoreV1API_listResourceQuotaForAllNamespaces(apiClient_t *apiClient, int *allowWa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -26900,11 +28918,14 @@ CoreV1API_listResourceQuotaForAllNamespaces(apiClient_t *apiClient, int *allowWa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_list_t *elementToReturn = v1_resource_quota_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -27069,11 +29090,14 @@ CoreV1API_listSecretForAllNamespaces(apiClient_t *apiClient, int *allowWatchBook list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/secrets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/secrets"); + char *localVarPath = strdup("/api/v1/secrets"); + @@ -27217,8 +29241,10 @@ CoreV1API_listSecretForAllNamespaces(apiClient_t *apiClient, int *allowWatchBook list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -27227,6 +29253,7 @@ CoreV1API_listSecretForAllNamespaces(apiClient_t *apiClient, int *allowWatchBook localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -27238,11 +29265,14 @@ CoreV1API_listSecretForAllNamespaces(apiClient_t *apiClient, int *allowWatchBook // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_secret_list_t *elementToReturn = v1_secret_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_secret_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_secret_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -27407,11 +29437,14 @@ CoreV1API_listServiceAccountForAllNamespaces(apiClient_t *apiClient, int *allowW list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/serviceaccounts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/serviceaccounts"); + char *localVarPath = strdup("/api/v1/serviceaccounts"); + @@ -27555,8 +29588,10 @@ CoreV1API_listServiceAccountForAllNamespaces(apiClient_t *apiClient, int *allowW list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -27565,6 +29600,7 @@ CoreV1API_listServiceAccountForAllNamespaces(apiClient_t *apiClient, int *allowW localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -27576,11 +29612,14 @@ CoreV1API_listServiceAccountForAllNamespaces(apiClient_t *apiClient, int *allowW // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_account_list_t *elementToReturn = v1_service_account_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_account_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_account_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -27745,11 +29784,14 @@ CoreV1API_listServiceForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/services")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/services"); + char *localVarPath = strdup("/api/v1/services"); + @@ -27893,8 +29935,10 @@ CoreV1API_listServiceForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -27903,6 +29947,7 @@ CoreV1API_listServiceForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -27914,11 +29959,14 @@ CoreV1API_listServiceForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_list_t *elementToReturn = v1_service_list_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_list_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -28083,15 +30131,20 @@ CoreV1API_patchNamespace(apiClient_t *apiClient, char *name, object_t *body, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -28167,17 +30220,20 @@ CoreV1API_patchNamespace(apiClient_t *apiClient, char *name, object_t *body, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -28186,6 +30242,7 @@ CoreV1API_patchNamespace(apiClient_t *apiClient, char *name, object_t *body, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -28201,11 +30258,14 @@ CoreV1API_patchNamespace(apiClient_t *apiClient, char *name, object_t *body, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -28304,15 +30364,20 @@ CoreV1API_patchNamespaceStatus(apiClient_t *apiClient, char *name, object_t *bod list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -28388,17 +30453,20 @@ CoreV1API_patchNamespaceStatus(apiClient_t *apiClient, char *name, object_t *bod cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -28407,6 +30475,7 @@ CoreV1API_patchNamespaceStatus(apiClient_t *apiClient, char *name, object_t *bod localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -28422,11 +30491,14 @@ CoreV1API_patchNamespaceStatus(apiClient_t *apiClient, char *name, object_t *bod // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -28525,15 +30597,22 @@ CoreV1API_patchNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/configmaps/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/configmaps/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/configmaps/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -28543,7 +30622,7 @@ CoreV1API_patchNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -28619,17 +30698,20 @@ CoreV1API_patchNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -28638,6 +30720,7 @@ CoreV1API_patchNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -28653,11 +30736,14 @@ CoreV1API_patchNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_config_map_t *elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_config_map_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -28757,15 +30843,22 @@ CoreV1API_patchNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/endpoints/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/endpoints/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/endpoints/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -28775,7 +30868,7 @@ CoreV1API_patchNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -28851,17 +30944,20 @@ CoreV1API_patchNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -28870,6 +30966,7 @@ CoreV1API_patchNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -28885,11 +30982,14 @@ CoreV1API_patchNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoints_t *elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoints_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -28989,15 +31089,22 @@ CoreV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -29007,7 +31114,7 @@ CoreV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_namesp localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -29083,17 +31190,20 @@ CoreV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_namesp cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -29102,6 +31212,7 @@ CoreV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -29117,11 +31228,14 @@ CoreV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_namesp // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - core_v1_event_t *elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + core_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -29221,15 +31335,22 @@ CoreV1API_patchNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/limitranges/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/limitranges/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/limitranges/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -29239,7 +31360,7 @@ CoreV1API_patchNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -29315,17 +31436,20 @@ CoreV1API_patchNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -29334,6 +31458,7 @@ CoreV1API_patchNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -29349,11 +31474,14 @@ CoreV1API_patchNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_limit_range_t *elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_limit_range_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -29453,15 +31581,22 @@ CoreV1API_patchNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -29471,7 +31606,7 @@ CoreV1API_patchNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -29547,17 +31682,20 @@ CoreV1API_patchNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -29566,6 +31704,7 @@ CoreV1API_patchNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -29581,11 +31720,14 @@ CoreV1API_patchNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -29685,15 +31827,22 @@ CoreV1API_patchNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -29703,7 +31852,7 @@ CoreV1API_patchNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -29779,17 +31928,20 @@ CoreV1API_patchNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -29798,6 +31950,7 @@ CoreV1API_patchNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -29813,11 +31966,14 @@ CoreV1API_patchNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -29917,15 +32073,22 @@ CoreV1API_patchNamespacedPod(apiClient_t *apiClient, char *name, char *_namespac list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -29935,7 +32098,7 @@ CoreV1API_patchNamespacedPod(apiClient_t *apiClient, char *name, char *_namespac localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -30011,17 +32174,20 @@ CoreV1API_patchNamespacedPod(apiClient_t *apiClient, char *name, char *_namespac cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -30030,6 +32196,7 @@ CoreV1API_patchNamespacedPod(apiClient_t *apiClient, char *name, char *_namespac localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -30045,11 +32212,14 @@ CoreV1API_patchNamespacedPod(apiClient_t *apiClient, char *name, char *_namespac // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -30149,15 +32319,22 @@ CoreV1API_patchNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -30167,7 +32344,7 @@ CoreV1API_patchNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -30243,17 +32420,20 @@ CoreV1API_patchNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -30262,6 +32442,7 @@ CoreV1API_patchNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -30277,11 +32458,14 @@ CoreV1API_patchNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -30370,10 +32554,10 @@ CoreV1API_patchNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *na } -// partially update status of the specified Pod +// partially update resize of the specified Pod // v1_pod_t* -CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +CoreV1API_patchNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -30381,15 +32565,22 @@ CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/resize"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -30399,7 +32590,7 @@ CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -30475,17 +32666,20 @@ CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -30494,6 +32688,7 @@ CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -30509,11 +32704,14 @@ CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -30602,10 +32800,10 @@ CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_na } -// partially update the specified PodTemplate +// partially update status of the specified Pod // -v1_pod_template_t* -CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_pod_t* +CoreV1API_patchNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -30613,15 +32811,22 @@ CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/podtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/podtemplates/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -30631,7 +32836,7 @@ CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -30707,17 +32912,20 @@ CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -30726,6 +32934,7 @@ CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -30741,11 +32950,14 @@ CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_template_t *elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -30834,10 +33046,10 @@ CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_ } -// partially update the specified ReplicationController +// partially update the specified PodTemplate // -v1_replication_controller_t* -CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_pod_template_t* +CoreV1API_patchNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -30845,15 +33057,22 @@ CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/podtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -30863,7 +33082,7 @@ CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -30939,17 +33158,20 @@ CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -30958,6 +33180,7 @@ CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -30973,11 +33196,14 @@ CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_t *elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -31066,10 +33292,10 @@ CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *nam } -// partially update scale of the specified ReplicationController +// partially update the specified ReplicationController // -v1_scale_t* -CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_replication_controller_t* +CoreV1API_patchNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -31077,15 +33303,22 @@ CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -31095,7 +33328,7 @@ CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -31171,17 +33404,20 @@ CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -31190,6 +33426,7 @@ CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -31205,11 +33442,14 @@ CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -31298,10 +33538,10 @@ CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char } -// partially update status of the specified ReplicationController +// partially update scale of the specified ReplicationController // -v1_replication_controller_t* -CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_scale_t* +CoreV1API_patchNamespacedReplicationControllerScale(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -31309,15 +33549,22 @@ CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -31327,7 +33574,7 @@ CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -31403,17 +33650,20 @@ CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -31422,6 +33672,7 @@ CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -31437,11 +33688,14 @@ CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_t *elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -31530,10 +33784,10 @@ CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, cha } -// partially update the specified ResourceQuota +// partially update status of the specified ReplicationController // -v1_resource_quota_t* -CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_replication_controller_t* +CoreV1API_patchNamespacedReplicationControllerStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -31541,15 +33795,22 @@ CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -31559,7 +33820,7 @@ CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -31635,17 +33896,20 @@ CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -31654,6 +33918,7 @@ CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -31669,11 +33934,14 @@ CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -31762,10 +34030,10 @@ CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char } -// partially update status of the specified ResourceQuota +// partially update the specified ResourceQuota // v1_resource_quota_t* -CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +CoreV1API_patchNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -31773,15 +34041,22 @@ CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -31791,7 +34066,7 @@ CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -31867,17 +34142,20 @@ CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -31886,6 +34164,7 @@ CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -31901,11 +34180,14 @@ CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -31994,10 +34276,10 @@ CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, } -// partially update the specified Secret +// partially update status of the specified ResourceQuota // -v1_secret_t* -CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_resource_quota_t* +CoreV1API_patchNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -32005,15 +34287,22 @@ CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_names list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/secrets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/secrets/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -32023,7 +34312,7 @@ CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_names localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -32099,17 +34388,20 @@ CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_names cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -32118,6 +34410,7 @@ CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -32133,11 +34426,14 @@ CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_names // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_secret_t *elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -32226,10 +34522,10 @@ CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_names } -// partially update the specified Service +// partially update the specified Secret // -v1_service_t* -CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_secret_t* +CoreV1API_patchNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -32237,15 +34533,22 @@ CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/secrets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -32255,7 +34558,7 @@ CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -32331,17 +34634,20 @@ CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -32350,6 +34656,7 @@ CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -32365,11 +34672,14 @@ CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_secret_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -32458,10 +34768,10 @@ CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_name } -// partially update the specified ServiceAccount +// partially update the specified Service // -v1_service_account_t* -CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_service_t* +CoreV1API_patchNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -32469,15 +34779,22 @@ CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -32487,7 +34804,7 @@ CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -32563,17 +34880,20 @@ CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -32582,6 +34902,7 @@ CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -32597,11 +34918,14 @@ CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_account_t *elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -32690,10 +35014,10 @@ CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char } -// partially update status of the specified Service +// partially update the specified ServiceAccount // -v1_service_t* -CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_service_account_t* +CoreV1API_patchNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -32701,15 +35025,22 @@ CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -32719,7 +35050,7 @@ CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -32795,17 +35126,20 @@ CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -32814,6 +35148,7 @@ CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -32829,11 +35164,14 @@ CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_account_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -32922,10 +35260,10 @@ CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char } -// partially update the specified Node +// partially update status of the specified Service // -v1_node_t* -CoreV1API_patchNode(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_service_t* +CoreV1API_patchNamespacedServiceStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -32933,15 +35271,22 @@ CoreV1API_patchNode(apiClient_t *apiClient, char *name, object_t *body, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -32950,6 +35295,16 @@ CoreV1API_patchNode(apiClient_t *apiClient, char *name, object_t *body, char *pr localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters @@ -33017,17 +35372,20 @@ CoreV1API_patchNode(apiClient_t *apiClient, char *name, object_t *body, char *pr cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -33036,6 +35394,7 @@ CoreV1API_patchNode(apiClient_t *apiClient, char *name, object_t *body, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -33051,11 +35410,248 @@ CoreV1API_patchNode(apiClient_t *apiClient, char *name, object_t *body, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_t *elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified Node +// +v1_node_t* +CoreV1API_patchNode(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/api/v1/nodes/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -33154,15 +35750,20 @@ CoreV1API_patchNodeStatus(apiClient_t *apiClient, char *name, object_t *body, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/status"); + char *localVarPath = strdup("/api/v1/nodes/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -33238,17 +35839,20 @@ CoreV1API_patchNodeStatus(apiClient_t *apiClient, char *name, object_t *body, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -33257,6 +35861,7 @@ CoreV1API_patchNodeStatus(apiClient_t *apiClient, char *name, object_t *body, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -33272,11 +35877,14 @@ CoreV1API_patchNodeStatus(apiClient_t *apiClient, char *name, object_t *body, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_t *elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -33375,15 +35983,20 @@ CoreV1API_patchPersistentVolume(apiClient_t *apiClient, char *name, object_t *bo list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes/{name}"); + char *localVarPath = strdup("/api/v1/persistentvolumes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -33459,17 +36072,20 @@ CoreV1API_patchPersistentVolume(apiClient_t *apiClient, char *name, object_t *bo cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -33478,6 +36094,7 @@ CoreV1API_patchPersistentVolume(apiClient_t *apiClient, char *name, object_t *bo localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -33493,11 +36110,14 @@ CoreV1API_patchPersistentVolume(apiClient_t *apiClient, char *name, object_t *bo // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -33596,15 +36216,20 @@ CoreV1API_patchPersistentVolumeStatus(apiClient_t *apiClient, char *name, object list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes/{name}/status"); + char *localVarPath = strdup("/api/v1/persistentvolumes/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -33680,17 +36305,20 @@ CoreV1API_patchPersistentVolumeStatus(apiClient_t *apiClient, char *name, object cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -33699,6 +36327,7 @@ CoreV1API_patchPersistentVolumeStatus(apiClient_t *apiClient, char *name, object localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -33714,11 +36343,14 @@ CoreV1API_patchPersistentVolumeStatus(apiClient_t *apiClient, char *name, object // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -33817,15 +36449,20 @@ CoreV1API_readComponentStatus(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/componentstatuses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/componentstatuses/{name}"); + char *localVarPath = strdup("/api/v1/componentstatuses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -33850,6 +36487,7 @@ CoreV1API_readComponentStatus(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -33858,6 +36496,7 @@ CoreV1API_readComponentStatus(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -33869,11 +36508,14 @@ CoreV1API_readComponentStatus(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_component_status_t *elementToReturn = v1_component_status_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_component_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_component_status_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -33919,15 +36561,20 @@ CoreV1API_readNamespace(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -33952,6 +36599,7 @@ CoreV1API_readNamespace(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -33960,6 +36608,7 @@ CoreV1API_readNamespace(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -33971,11 +36620,14 @@ CoreV1API_readNamespace(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34021,15 +36673,20 @@ CoreV1API_readNamespaceStatus(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34054,6 +36711,7 @@ CoreV1API_readNamespaceStatus(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34062,6 +36720,7 @@ CoreV1API_readNamespaceStatus(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34073,11 +36732,14 @@ CoreV1API_readNamespaceStatus(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34123,15 +36785,22 @@ CoreV1API_readNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/configmaps/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/configmaps/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/configmaps/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34141,7 +36810,7 @@ CoreV1API_readNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34166,6 +36835,7 @@ CoreV1API_readNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34174,6 +36844,7 @@ CoreV1API_readNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34185,11 +36856,14 @@ CoreV1API_readNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_config_map_t *elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_config_map_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34236,15 +36910,22 @@ CoreV1API_readNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/endpoints/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/endpoints/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/endpoints/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34254,7 +36935,7 @@ CoreV1API_readNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34279,6 +36960,7 @@ CoreV1API_readNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34287,6 +36969,7 @@ CoreV1API_readNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34298,11 +36981,14 @@ CoreV1API_readNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoints_t *elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoints_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34349,15 +37035,22 @@ CoreV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34367,7 +37060,7 @@ CoreV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespa localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34392,6 +37085,7 @@ CoreV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespa list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34400,6 +37094,7 @@ CoreV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34411,11 +37106,14 @@ CoreV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - core_v1_event_t *elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + core_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34462,15 +37160,22 @@ CoreV1API_readNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/limitranges/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/limitranges/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/limitranges/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34480,7 +37185,7 @@ CoreV1API_readNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34505,6 +37210,7 @@ CoreV1API_readNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_na list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34513,6 +37219,7 @@ CoreV1API_readNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34524,11 +37231,14 @@ CoreV1API_readNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_limit_range_t *elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_limit_range_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34575,15 +37285,22 @@ CoreV1API_readNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34593,7 +37310,7 @@ CoreV1API_readNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34618,6 +37335,7 @@ CoreV1API_readNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34626,6 +37344,7 @@ CoreV1API_readNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34637,11 +37356,14 @@ CoreV1API_readNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34688,15 +37410,22 @@ CoreV1API_readNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34706,7 +37435,7 @@ CoreV1API_readNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34731,6 +37460,7 @@ CoreV1API_readNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34739,6 +37469,7 @@ CoreV1API_readNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34750,11 +37481,14 @@ CoreV1API_readNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34801,15 +37535,22 @@ CoreV1API_readNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34819,7 +37560,7 @@ CoreV1API_readNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34844,6 +37585,7 @@ CoreV1API_readNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34852,6 +37594,7 @@ CoreV1API_readNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34863,11 +37606,14 @@ CoreV1API_readNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -34914,15 +37660,22 @@ CoreV1API_readNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -34932,7 +37685,7 @@ CoreV1API_readNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -34957,6 +37710,7 @@ CoreV1API_readNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -34965,6 +37719,7 @@ CoreV1API_readNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -34976,11 +37731,14 @@ CoreV1API_readNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -35019,7 +37777,7 @@ CoreV1API_readNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *nam // read log of the specified Pod // char* -CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namespace, char *container, int *follow, int *insecureSkipTLSVerifyBackend, int *limitBytes, char *pretty, int *previous, int *sinceSeconds, int *tailLines, int *timestamps) +CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namespace, char *container, int *follow, int *insecureSkipTLSVerifyBackend, int *limitBytes, char *pretty, int *previous, int *sinceSeconds, char *stream, int *tailLines, int *timestamps) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -35027,15 +37785,22 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/log")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/log"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/log"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -35045,7 +37810,7 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -35145,6 +37910,18 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp list_addElement(localVarQueryParameters,keyPairQuery_sinceSeconds); } + // query parameters + char *keyQuery_stream = NULL; + char * valueQuery_stream = NULL; + keyValuePair_t *keyPairQuery_stream = 0; + if (stream) + { + keyQuery_stream = strdup("stream"); + valueQuery_stream = strdup((stream)); + keyPairQuery_stream = keyValuePair_create(keyQuery_stream, valueQuery_stream); + list_addElement(localVarQueryParameters,keyPairQuery_stream); + } + // query parameters char *keyQuery_tailLines = NULL; char * valueQuery_tailLines = NULL; @@ -35174,6 +37951,358 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_container){ + free(keyQuery_container); + keyQuery_container = NULL; + } + if(valueQuery_container){ + free(valueQuery_container); + valueQuery_container = NULL; + } + if(keyPairQuery_container){ + keyValuePair_free(keyPairQuery_container); + keyPairQuery_container = NULL; + } + if(keyQuery_follow){ + free(keyQuery_follow); + keyQuery_follow = NULL; + } + if(valueQuery_follow){ + free(valueQuery_follow); + valueQuery_follow = NULL; + } + if(keyPairQuery_follow){ + keyValuePair_free(keyPairQuery_follow); + keyPairQuery_follow = NULL; + } + if(keyQuery_insecureSkipTLSVerifyBackend){ + free(keyQuery_insecureSkipTLSVerifyBackend); + keyQuery_insecureSkipTLSVerifyBackend = NULL; + } + if(valueQuery_insecureSkipTLSVerifyBackend){ + free(valueQuery_insecureSkipTLSVerifyBackend); + valueQuery_insecureSkipTLSVerifyBackend = NULL; + } + if(keyPairQuery_insecureSkipTLSVerifyBackend){ + keyValuePair_free(keyPairQuery_insecureSkipTLSVerifyBackend); + keyPairQuery_insecureSkipTLSVerifyBackend = NULL; + } + if(keyQuery_limitBytes){ + free(keyQuery_limitBytes); + keyQuery_limitBytes = NULL; + } + if(valueQuery_limitBytes){ + free(valueQuery_limitBytes); + valueQuery_limitBytes = NULL; + } + if(keyPairQuery_limitBytes){ + keyValuePair_free(keyPairQuery_limitBytes); + keyPairQuery_limitBytes = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_previous){ + free(keyQuery_previous); + keyQuery_previous = NULL; + } + if(valueQuery_previous){ + free(valueQuery_previous); + valueQuery_previous = NULL; + } + if(keyPairQuery_previous){ + keyValuePair_free(keyPairQuery_previous); + keyPairQuery_previous = NULL; + } + if(keyQuery_sinceSeconds){ + free(keyQuery_sinceSeconds); + keyQuery_sinceSeconds = NULL; + } + if(valueQuery_sinceSeconds){ + free(valueQuery_sinceSeconds); + valueQuery_sinceSeconds = NULL; + } + if(keyPairQuery_sinceSeconds){ + keyValuePair_free(keyPairQuery_sinceSeconds); + keyPairQuery_sinceSeconds = NULL; + } + if(keyQuery_stream){ + free(keyQuery_stream); + keyQuery_stream = NULL; + } + if(valueQuery_stream){ + free(valueQuery_stream); + valueQuery_stream = NULL; + } + if(keyPairQuery_stream){ + keyValuePair_free(keyPairQuery_stream); + keyPairQuery_stream = NULL; + } + if(keyQuery_tailLines){ + free(keyQuery_tailLines); + keyQuery_tailLines = NULL; + } + if(valueQuery_tailLines){ + free(valueQuery_tailLines); + valueQuery_tailLines = NULL; + } + if(keyPairQuery_tailLines){ + keyValuePair_free(keyPairQuery_tailLines); + keyPairQuery_tailLines = NULL; + } + if(keyQuery_timestamps){ + free(keyQuery_timestamps); + keyQuery_timestamps = NULL; + } + if(valueQuery_timestamps){ + free(valueQuery_timestamps); + valueQuery_timestamps = NULL; + } + if(keyPairQuery_timestamps){ + keyValuePair_free(keyPairQuery_timestamps); + keyPairQuery_timestamps = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read resize of the specified Pod +// +v1_pod_t* +CoreV1API_readNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/resize"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read status of the specified Pod +// +v1_pod_t* +CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -35182,6 +38311,7 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -35192,9 +38322,18 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //nonprimitive not container + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + //return type if (apiClient->dataReceived) { free(apiClient->dataReceived); apiClient->dataReceived = NULL; @@ -35208,54 +38347,6 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp free(localVarPath); free(localVarToReplace_name); free(localVarToReplace__namespace); - if(keyQuery_container){ - free(keyQuery_container); - keyQuery_container = NULL; - } - if(valueQuery_container){ - free(valueQuery_container); - valueQuery_container = NULL; - } - if(keyPairQuery_container){ - keyValuePair_free(keyPairQuery_container); - keyPairQuery_container = NULL; - } - if(keyQuery_follow){ - free(keyQuery_follow); - keyQuery_follow = NULL; - } - if(valueQuery_follow){ - free(valueQuery_follow); - valueQuery_follow = NULL; - } - if(keyPairQuery_follow){ - keyValuePair_free(keyPairQuery_follow); - keyPairQuery_follow = NULL; - } - if(keyQuery_insecureSkipTLSVerifyBackend){ - free(keyQuery_insecureSkipTLSVerifyBackend); - keyQuery_insecureSkipTLSVerifyBackend = NULL; - } - if(valueQuery_insecureSkipTLSVerifyBackend){ - free(valueQuery_insecureSkipTLSVerifyBackend); - valueQuery_insecureSkipTLSVerifyBackend = NULL; - } - if(keyPairQuery_insecureSkipTLSVerifyBackend){ - keyValuePair_free(keyPairQuery_insecureSkipTLSVerifyBackend); - keyPairQuery_insecureSkipTLSVerifyBackend = NULL; - } - if(keyQuery_limitBytes){ - free(keyQuery_limitBytes); - keyQuery_limitBytes = NULL; - } - if(valueQuery_limitBytes){ - free(valueQuery_limitBytes); - valueQuery_limitBytes = NULL; - } - if(keyPairQuery_limitBytes){ - keyValuePair_free(keyPairQuery_limitBytes); - keyPairQuery_limitBytes = NULL; - } if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -35268,53 +38359,130 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_previous){ - free(keyQuery_previous); - keyQuery_previous = NULL; - } - if(valueQuery_previous){ - free(valueQuery_previous); - valueQuery_previous = NULL; - } - if(keyPairQuery_previous){ - keyValuePair_free(keyPairQuery_previous); - keyPairQuery_previous = NULL; - } - if(keyQuery_sinceSeconds){ - free(keyQuery_sinceSeconds); - keyQuery_sinceSeconds = NULL; - } - if(valueQuery_sinceSeconds){ - free(valueQuery_sinceSeconds); - valueQuery_sinceSeconds = NULL; + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified PodTemplate +// +v1_pod_template_t* +CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/podtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; } - if(keyPairQuery_sinceSeconds){ - keyValuePair_free(keyPairQuery_sinceSeconds); - keyPairQuery_sinceSeconds = NULL; + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; } - if(keyQuery_tailLines){ - free(keyQuery_tailLines); - keyQuery_tailLines = NULL; + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - if(valueQuery_tailLines){ - free(valueQuery_tailLines); - valueQuery_tailLines = NULL; + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_pod_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } - if(keyPairQuery_tailLines){ - keyValuePair_free(keyPairQuery_tailLines); - keyPairQuery_tailLines = NULL; + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; } - if(keyQuery_timestamps){ - free(keyQuery_timestamps); - keyQuery_timestamps = NULL; + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; } - if(valueQuery_timestamps){ - free(valueQuery_timestamps); - valueQuery_timestamps = NULL; + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; } - if(keyPairQuery_timestamps){ - keyValuePair_free(keyPairQuery_timestamps); - keyPairQuery_timestamps = NULL; + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } return elementToReturn; end: @@ -35323,10 +38491,10 @@ CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namesp } -// read status of the specified Pod +// read the specified ReplicationController // -v1_pod_t* -CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_replication_controller_t* +CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -35334,15 +38502,22 @@ CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -35352,7 +38527,7 @@ CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -35377,6 +38552,7 @@ CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -35385,6 +38561,7 @@ CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -35396,11 +38573,14 @@ CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -35436,10 +38616,10 @@ CoreV1API_readNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_nam } -// read the specified PodTemplate +// read scale of the specified ReplicationController // -v1_pod_template_t* -CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_scale_t* +CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -35447,15 +38627,22 @@ CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/podtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/podtemplates/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -35465,7 +38652,7 @@ CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -35490,6 +38677,7 @@ CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_n list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -35498,6 +38686,7 @@ CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -35509,11 +38698,14 @@ CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_template_t *elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -35549,10 +38741,10 @@ CoreV1API_readNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_n } -// read the specified ReplicationController +// read status of the specified ReplicationController // v1_replication_controller_t* -CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -35560,15 +38752,22 @@ CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -35578,7 +38777,7 @@ CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -35603,6 +38802,7 @@ CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -35611,6 +38811,7 @@ CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -35622,11 +38823,14 @@ CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_t *elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -35662,10 +38866,10 @@ CoreV1API_readNamespacedReplicationController(apiClient_t *apiClient, char *name } -// read scale of the specified ReplicationController +// read the specified ResourceQuota // -v1_scale_t* -CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_resource_quota_t* +CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -35673,15 +38877,22 @@ CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -35691,7 +38902,7 @@ CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -35716,6 +38927,7 @@ CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -35724,6 +38936,7 @@ CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -35735,11 +38948,14 @@ CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -35775,10 +38991,10 @@ CoreV1API_readNamespacedReplicationControllerScale(apiClient_t *apiClient, char } -// read status of the specified ReplicationController +// read status of the specified ResourceQuota // -v1_replication_controller_t* -CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_resource_quota_t* +CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -35786,15 +39002,22 @@ CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -35804,7 +39027,7 @@ CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -35829,6 +39052,7 @@ CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -35837,6 +39061,7 @@ CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -35848,11 +39073,14 @@ CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_t *elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -35888,10 +39116,10 @@ CoreV1API_readNamespacedReplicationControllerStatus(apiClient_t *apiClient, char } -// read the specified ResourceQuota +// read the specified Secret // -v1_resource_quota_t* -CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_secret_t* +CoreV1API_readNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -35899,15 +39127,22 @@ CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/secrets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -35917,7 +39152,7 @@ CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -35942,6 +39177,7 @@ CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char * list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -35950,6 +39186,7 @@ CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -35961,11 +39198,14 @@ CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_secret_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36001,10 +39241,10 @@ CoreV1API_readNamespacedResourceQuota(apiClient_t *apiClient, char *name, char * } -// read status of the specified ResourceQuota +// read the specified Service // -v1_resource_quota_t* -CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_service_t* +CoreV1API_readNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -36012,15 +39252,22 @@ CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -36030,7 +39277,7 @@ CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -36055,6 +39302,7 @@ CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -36063,6 +39311,7 @@ CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -36074,11 +39323,14 @@ CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36114,10 +39366,10 @@ CoreV1API_readNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *name, } -// read the specified Secret +// read the specified ServiceAccount // -v1_secret_t* -CoreV1API_readNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_service_account_t* +CoreV1API_readNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -36125,241 +39377,22 @@ CoreV1API_readNamespacedSecret(apiClient_t *apiClient, char *name, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/secrets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/secrets/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_secret_t *elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified Service -// -v1_service_t* -CoreV1API_readNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}"); - + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { + if(!name) goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { + if(!_namespace) goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ServiceAccount -// -v1_service_account_t* -CoreV1API_readNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -36369,7 +39402,7 @@ CoreV1API_readNamespacedServiceAccount(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -36394,6 +39427,7 @@ CoreV1API_readNamespacedServiceAccount(apiClient_t *apiClient, char *name, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -36402,6 +39436,7 @@ CoreV1API_readNamespacedServiceAccount(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -36413,11 +39448,14 @@ CoreV1API_readNamespacedServiceAccount(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_account_t *elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_account_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36464,15 +39502,22 @@ CoreV1API_readNamespacedServiceStatus(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -36482,7 +39527,7 @@ CoreV1API_readNamespacedServiceStatus(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -36507,6 +39552,7 @@ CoreV1API_readNamespacedServiceStatus(apiClient_t *apiClient, char *name, char * list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -36515,6 +39561,7 @@ CoreV1API_readNamespacedServiceStatus(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -36526,11 +39573,14 @@ CoreV1API_readNamespacedServiceStatus(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36577,15 +39627,20 @@ CoreV1API_readNode(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}"); + char *localVarPath = strdup("/api/v1/nodes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -36610,6 +39665,7 @@ CoreV1API_readNode(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -36618,6 +39674,7 @@ CoreV1API_readNode(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -36629,11 +39686,14 @@ CoreV1API_readNode(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_t *elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36679,15 +39739,20 @@ CoreV1API_readNodeStatus(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/status"); + char *localVarPath = strdup("/api/v1/nodes/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -36712,6 +39777,7 @@ CoreV1API_readNodeStatus(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -36720,6 +39786,7 @@ CoreV1API_readNodeStatus(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -36731,11 +39798,14 @@ CoreV1API_readNodeStatus(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_t *elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36781,15 +39851,20 @@ CoreV1API_readPersistentVolume(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes/{name}"); + char *localVarPath = strdup("/api/v1/persistentvolumes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -36814,6 +39889,7 @@ CoreV1API_readPersistentVolume(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -36822,6 +39898,7 @@ CoreV1API_readPersistentVolume(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -36833,11 +39910,14 @@ CoreV1API_readPersistentVolume(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36883,15 +39963,20 @@ CoreV1API_readPersistentVolumeStatus(apiClient_t *apiClient, char *name, char *p list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes/{name}/status"); + char *localVarPath = strdup("/api/v1/persistentvolumes/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -36916,6 +40001,7 @@ CoreV1API_readPersistentVolumeStatus(apiClient_t *apiClient, char *name, char *p list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -36924,6 +40010,7 @@ CoreV1API_readPersistentVolumeStatus(apiClient_t *apiClient, char *name, char *p localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -36935,11 +40022,14 @@ CoreV1API_readPersistentVolumeStatus(apiClient_t *apiClient, char *name, char *p // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -36985,15 +40075,20 @@ CoreV1API_replaceNamespace(apiClient_t *apiClient, char *name, v1_namespace_t *b list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -37056,13 +40151,15 @@ CoreV1API_replaceNamespace(apiClient_t *apiClient, char *name, v1_namespace_t *b cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_namespace_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -37071,6 +40168,7 @@ CoreV1API_replaceNamespace(apiClient_t *apiClient, char *name, v1_namespace_t *b localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -37086,11 +40184,14 @@ CoreV1API_replaceNamespace(apiClient_t *apiClient, char *name, v1_namespace_t *b // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -37177,15 +40278,20 @@ CoreV1API_replaceNamespaceFinalize(apiClient_t *apiClient, char *name, v1_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}/finalize")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}/finalize"); + char *localVarPath = strdup("/api/v1/namespaces/{name}/finalize"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -37248,13 +40354,15 @@ CoreV1API_replaceNamespaceFinalize(apiClient_t *apiClient, char *name, v1_namesp cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_namespace_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -37263,6 +40371,7 @@ CoreV1API_replaceNamespaceFinalize(apiClient_t *apiClient, char *name, v1_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -37278,11 +40387,14 @@ CoreV1API_replaceNamespaceFinalize(apiClient_t *apiClient, char *name, v1_namesp // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -37369,15 +40481,20 @@ CoreV1API_replaceNamespaceStatus(apiClient_t *apiClient, char *name, v1_namespac list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -37440,13 +40557,15 @@ CoreV1API_replaceNamespaceStatus(apiClient_t *apiClient, char *name, v1_namespac cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_namespace_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -37455,6 +40574,7 @@ CoreV1API_replaceNamespaceStatus(apiClient_t *apiClient, char *name, v1_namespac localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -37470,11 +40590,14 @@ CoreV1API_replaceNamespaceStatus(apiClient_t *apiClient, char *name, v1_namespac // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_namespace_t *elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_namespace_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_namespace_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -37561,15 +40684,22 @@ CoreV1API_replaceNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/configmaps/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/configmaps/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/configmaps/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -37579,7 +40709,7 @@ CoreV1API_replaceNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -37642,13 +40772,15 @@ CoreV1API_replaceNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_config_map_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -37657,6 +40789,7 @@ CoreV1API_replaceNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -37672,11 +40805,14 @@ CoreV1API_replaceNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_config_map_t *elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_config_map_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_config_map_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -37764,15 +40900,22 @@ CoreV1API_replaceNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/endpoints/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/endpoints/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/endpoints/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -37782,7 +40925,7 @@ CoreV1API_replaceNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -37845,13 +40988,15 @@ CoreV1API_replaceNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_endpoints_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -37860,6 +41005,7 @@ CoreV1API_replaceNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -37875,11 +41021,14 @@ CoreV1API_replaceNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoints_t *elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoints_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoints_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -37967,15 +41116,22 @@ CoreV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -37985,7 +41141,7 @@ CoreV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -38048,13 +41204,15 @@ CoreV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = core_v1_event_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -38063,6 +41221,7 @@ CoreV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -38078,11 +41237,14 @@ CoreV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - core_v1_event_t *elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + core_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = core_v1_event_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -38170,15 +41332,22 @@ CoreV1API_replaceNamespacedLimitRange(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/limitranges/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/limitranges/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/limitranges/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -38188,7 +41357,7 @@ CoreV1API_replaceNamespacedLimitRange(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -38251,13 +41420,15 @@ CoreV1API_replaceNamespacedLimitRange(apiClient_t *apiClient, char *name, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_limit_range_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -38266,6 +41437,7 @@ CoreV1API_replaceNamespacedLimitRange(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -38281,11 +41453,14 @@ CoreV1API_replaceNamespacedLimitRange(apiClient_t *apiClient, char *name, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_limit_range_t *elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_limit_range_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_limit_range_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -38373,15 +41548,22 @@ CoreV1API_replaceNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -38391,7 +41573,7 @@ CoreV1API_replaceNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -38454,13 +41636,15 @@ CoreV1API_replaceNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_persistent_volume_claim_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -38469,6 +41653,7 @@ CoreV1API_replaceNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -38484,11 +41669,14 @@ CoreV1API_replaceNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -38576,15 +41764,22 @@ CoreV1API_replaceNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -38594,7 +41789,7 @@ CoreV1API_replaceNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -38657,13 +41852,15 @@ CoreV1API_replaceNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_persistent_volume_claim_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -38672,6 +41869,7 @@ CoreV1API_replaceNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -38687,11 +41885,14 @@ CoreV1API_replaceNamespacedPersistentVolumeClaimStatus(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_claim_t *elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_claim_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -38779,15 +41980,22 @@ CoreV1API_replaceNamespacedPod(apiClient_t *apiClient, char *name, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -38797,7 +42005,7 @@ CoreV1API_replaceNamespacedPod(apiClient_t *apiClient, char *name, char *_namesp localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -38860,13 +42068,15 @@ CoreV1API_replaceNamespacedPod(apiClient_t *apiClient, char *name, char *_namesp cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -38875,6 +42085,7 @@ CoreV1API_replaceNamespacedPod(apiClient_t *apiClient, char *name, char *_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -38890,11 +42101,14 @@ CoreV1API_replaceNamespacedPod(apiClient_t *apiClient, char *name, char *_namesp // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -38982,15 +42196,238 @@ CoreV1API_replaceNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_pod_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace resize of the specified Pod +// +v1_pod_t* +CoreV1API_replaceNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, v1_pod_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/resize"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -39000,7 +42437,7 @@ CoreV1API_replaceNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -39063,13 +42500,15 @@ CoreV1API_replaceNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -39078,6 +42517,7 @@ CoreV1API_replaceNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -39093,11 +42533,14 @@ CoreV1API_replaceNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -39185,15 +42628,22 @@ CoreV1API_replaceNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/pods/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/pods/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/pods/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -39203,7 +42653,7 @@ CoreV1API_replaceNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_ localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -39266,13 +42716,15 @@ CoreV1API_replaceNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -39281,6 +42733,7 @@ CoreV1API_replaceNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -39296,11 +42749,14 @@ CoreV1API_replaceNamespacedPodStatus(apiClient_t *apiClient, char *name, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_t *elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -39388,15 +42844,22 @@ CoreV1API_replaceNamespacedPodTemplate(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/podtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/podtemplates/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/podtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -39406,7 +42869,7 @@ CoreV1API_replaceNamespacedPodTemplate(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -39469,13 +42932,15 @@ CoreV1API_replaceNamespacedPodTemplate(apiClient_t *apiClient, char *name, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_template_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -39484,6 +42949,7 @@ CoreV1API_replaceNamespacedPodTemplate(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -39499,11 +42965,14 @@ CoreV1API_replaceNamespacedPodTemplate(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_template_t *elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_template_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -39591,15 +43060,22 @@ CoreV1API_replaceNamespacedReplicationController(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -39609,7 +43085,7 @@ CoreV1API_replaceNamespacedReplicationController(apiClient_t *apiClient, char *n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -39672,13 +43148,15 @@ CoreV1API_replaceNamespacedReplicationController(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_replication_controller_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -39687,6 +43165,7 @@ CoreV1API_replaceNamespacedReplicationController(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -39702,11 +43181,14 @@ CoreV1API_replaceNamespacedReplicationController(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_t *elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -39794,15 +43276,22 @@ CoreV1API_replaceNamespacedReplicationControllerScale(apiClient_t *apiClient, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -39812,7 +43301,7 @@ CoreV1API_replaceNamespacedReplicationControllerScale(apiClient_t *apiClient, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -39875,13 +43364,15 @@ CoreV1API_replaceNamespacedReplicationControllerScale(apiClient_t *apiClient, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_scale_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -39890,6 +43381,7 @@ CoreV1API_replaceNamespacedReplicationControllerScale(apiClient_t *apiClient, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -39905,11 +43397,14 @@ CoreV1API_replaceNamespacedReplicationControllerScale(apiClient_t *apiClient, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_scale_t *elementToReturn = v1_scale_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_scale_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_scale_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -39997,15 +43492,22 @@ CoreV1API_replaceNamespacedReplicationControllerStatus(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -40015,7 +43517,7 @@ CoreV1API_replaceNamespacedReplicationControllerStatus(apiClient_t *apiClient, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -40078,13 +43580,15 @@ CoreV1API_replaceNamespacedReplicationControllerStatus(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_replication_controller_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -40093,6 +43597,7 @@ CoreV1API_replaceNamespacedReplicationControllerStatus(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -40108,11 +43613,14 @@ CoreV1API_replaceNamespacedReplicationControllerStatus(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_replication_controller_t *elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_replication_controller_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_replication_controller_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -40200,15 +43708,22 @@ CoreV1API_replaceNamespacedResourceQuota(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -40218,7 +43733,7 @@ CoreV1API_replaceNamespacedResourceQuota(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -40281,13 +43796,15 @@ CoreV1API_replaceNamespacedResourceQuota(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_resource_quota_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -40296,6 +43813,7 @@ CoreV1API_replaceNamespacedResourceQuota(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -40311,11 +43829,14 @@ CoreV1API_replaceNamespacedResourceQuota(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -40403,15 +43924,22 @@ CoreV1API_replaceNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/resourcequotas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/resourcequotas/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -40421,7 +43949,7 @@ CoreV1API_replaceNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -40484,13 +44012,15 @@ CoreV1API_replaceNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_resource_quota_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -40499,6 +44029,7 @@ CoreV1API_replaceNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -40514,11 +44045,14 @@ CoreV1API_replaceNamespacedResourceQuotaStatus(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_resource_quota_t *elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_resource_quota_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_quota_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -40606,15 +44140,22 @@ CoreV1API_replaceNamespacedSecret(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/secrets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/secrets/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/secrets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -40624,7 +44165,7 @@ CoreV1API_replaceNamespacedSecret(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -40687,13 +44228,15 @@ CoreV1API_replaceNamespacedSecret(apiClient_t *apiClient, char *name, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_secret_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -40702,6 +44245,7 @@ CoreV1API_replaceNamespacedSecret(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -40717,11 +44261,14 @@ CoreV1API_replaceNamespacedSecret(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_secret_t *elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_secret_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_secret_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -40809,15 +44356,22 @@ CoreV1API_replaceNamespacedService(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -40827,7 +44381,7 @@ CoreV1API_replaceNamespacedService(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -40890,13 +44444,15 @@ CoreV1API_replaceNamespacedService(apiClient_t *apiClient, char *name, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_service_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -40905,6 +44461,7 @@ CoreV1API_replaceNamespacedService(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -40920,11 +44477,14 @@ CoreV1API_replaceNamespacedService(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -41012,15 +44572,22 @@ CoreV1API_replaceNamespacedServiceAccount(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/serviceaccounts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/serviceaccounts/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -41030,7 +44597,7 @@ CoreV1API_replaceNamespacedServiceAccount(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -41093,13 +44660,15 @@ CoreV1API_replaceNamespacedServiceAccount(apiClient_t *apiClient, char *name, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_service_account_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -41108,6 +44677,7 @@ CoreV1API_replaceNamespacedServiceAccount(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -41123,11 +44693,14 @@ CoreV1API_replaceNamespacedServiceAccount(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_account_t *elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_account_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_account_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -41215,15 +44788,22 @@ CoreV1API_replaceNamespacedServiceStatus(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/namespaces/{namespace}/services/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/namespaces/{namespace}/services/{name}/status"); + char *localVarPath = strdup("/api/v1/namespaces/{namespace}/services/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -41233,7 +44813,7 @@ CoreV1API_replaceNamespacedServiceStatus(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -41296,13 +44876,15 @@ CoreV1API_replaceNamespacedServiceStatus(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_service_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -41311,6 +44893,7 @@ CoreV1API_replaceNamespacedServiceStatus(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -41326,11 +44909,14 @@ CoreV1API_replaceNamespacedServiceStatus(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_service_t *elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -41418,15 +45004,20 @@ CoreV1API_replaceNode(apiClient_t *apiClient, char *name, v1_node_t *body, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}"); + char *localVarPath = strdup("/api/v1/nodes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -41489,13 +45080,15 @@ CoreV1API_replaceNode(apiClient_t *apiClient, char *name, v1_node_t *body, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_node_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -41504,6 +45097,7 @@ CoreV1API_replaceNode(apiClient_t *apiClient, char *name, v1_node_t *body, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -41519,11 +45113,14 @@ CoreV1API_replaceNode(apiClient_t *apiClient, char *name, v1_node_t *body, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_t *elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -41610,15 +45207,20 @@ CoreV1API_replaceNodeStatus(apiClient_t *apiClient, char *name, v1_node_t *body, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/nodes/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/nodes/{name}/status"); + char *localVarPath = strdup("/api/v1/nodes/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -41681,13 +45283,15 @@ CoreV1API_replaceNodeStatus(apiClient_t *apiClient, char *name, v1_node_t *body, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_node_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -41696,6 +45300,7 @@ CoreV1API_replaceNodeStatus(apiClient_t *apiClient, char *name, v1_node_t *body, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -41711,11 +45316,14 @@ CoreV1API_replaceNodeStatus(apiClient_t *apiClient, char *name, v1_node_t *body, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_node_t *elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_node_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -41802,15 +45410,20 @@ CoreV1API_replacePersistentVolume(apiClient_t *apiClient, char *name, v1_persist list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes/{name}"); + char *localVarPath = strdup("/api/v1/persistentvolumes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -41873,13 +45486,15 @@ CoreV1API_replacePersistentVolume(apiClient_t *apiClient, char *name, v1_persist cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_persistent_volume_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -41888,6 +45503,7 @@ CoreV1API_replacePersistentVolume(apiClient_t *apiClient, char *name, v1_persist localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -41903,11 +45519,14 @@ CoreV1API_replacePersistentVolume(apiClient_t *apiClient, char *name, v1_persist // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -41994,15 +45613,20 @@ CoreV1API_replacePersistentVolumeStatus(apiClient_t *apiClient, char *name, v1_p list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/api/v1/persistentvolumes/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/api/v1/persistentvolumes/{name}/status"); + char *localVarPath = strdup("/api/v1/persistentvolumes/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -42065,13 +45689,15 @@ CoreV1API_replacePersistentVolumeStatus(apiClient_t *apiClient, char *name, v1_p cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_persistent_volume_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -42080,6 +45706,7 @@ CoreV1API_replacePersistentVolumeStatus(apiClient_t *apiClient, char *name, v1_p localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -42095,11 +45722,14 @@ CoreV1API_replacePersistentVolumeStatus(apiClient_t *apiClient, char *name, v1_p // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_persistent_volume_t *elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); - cJSON_Delete(CoreV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_persistent_volume_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CoreV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_persistent_volume_parseFromJSON(CoreV1APIlocalVarJSON); + cJSON_Delete(CoreV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/CoreV1API.h b/kubernetes/api/CoreV1API.h index e88b7812..a1f10d11 100644 --- a/kubernetes/api/CoreV1API.h +++ b/kubernetes/api/CoreV1API.h @@ -452,175 +452,175 @@ CoreV1API_createPersistentVolume(apiClient_t *apiClient, v1_persistent_volume_t // delete collection of ConfigMap // v1_status_t* -CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Endpoints // v1_status_t* -CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Event // v1_status_t* -CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of LimitRange // v1_status_t* -CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of PersistentVolumeClaim // v1_status_t* -CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Pod // v1_status_t* -CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of PodTemplate // v1_status_t* -CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ReplicationController // v1_status_t* -CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ResourceQuota // v1_status_t* -CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Secret // v1_status_t* -CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Service // v1_status_t* -CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ServiceAccount // v1_status_t* -CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Node // v1_status_t* -CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of PersistentVolume // v1_status_t* -CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a Namespace // v1_status_t* -CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ConfigMap // v1_status_t* -CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete Endpoints // v1_status_t* -CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete an Event // v1_status_t* -CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a LimitRange // v1_status_t* -CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a PersistentVolumeClaim // v1_persistent_volume_claim_t* -CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a Pod // v1_pod_t* -CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a PodTemplate // v1_pod_template_t* -CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ReplicationController // v1_status_t* -CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ResourceQuota // v1_resource_quota_t* -CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a Secret // v1_status_t* -CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a Service // v1_service_t* -CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ServiceAccount // v1_service_account_t* -CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a Node // v1_status_t* -CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a PersistentVolume // v1_persistent_volume_t* -CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources @@ -857,6 +857,12 @@ v1_pod_t* CoreV1API_patchNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +// partially update resize of the specified Pod +// +v1_pod_t* +CoreV1API_patchNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + // partially update status of the specified Pod // v1_pod_t* @@ -1016,7 +1022,13 @@ CoreV1API_readNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *nam // read log of the specified Pod // char* -CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namespace, char *container, int *follow, int *insecureSkipTLSVerifyBackend, int *limitBytes, char *pretty, int *previous, int *sinceSeconds, int *tailLines, int *timestamps); +CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namespace, char *container, int *follow, int *insecureSkipTLSVerifyBackend, int *limitBytes, char *pretty, int *previous, int *sinceSeconds, char *stream, int *tailLines, int *timestamps); + + +// read resize of the specified Pod +// +v1_pod_t* +CoreV1API_readNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); // read status of the specified Pod @@ -1175,6 +1187,12 @@ v1_pod_t* CoreV1API_replaceNamespacedPodEphemeralcontainers(apiClient_t *apiClient, char *name, char *_namespace, v1_pod_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// replace resize of the specified Pod +// +v1_pod_t* +CoreV1API_replaceNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, v1_pod_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + // replace status of the specified Pod // v1_pod_t* diff --git a/kubernetes/api/CustomObjectsAPI.c b/kubernetes/api/CustomObjectsAPI.c index 9a3e58f3..2654193d 100644 --- a/kubernetes/api/CustomObjectsAPI.c +++ b/kubernetes/api/CustomObjectsAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "CustomObjectsAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // Creates a cluster scoped Custom object @@ -23,15 +20,24 @@ CustomObjectsAPI_createClusterCustomObject(apiClient_t *apiClient, char *group, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -41,7 +47,7 @@ CustomObjectsAPI_createClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -51,7 +57,7 @@ CustomObjectsAPI_createClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -114,9 +120,10 @@ CustomObjectsAPI_createClusterCustomObject(apiClient_t *apiClient, char *group, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -127,6 +134,7 @@ CustomObjectsAPI_createClusterCustomObject(apiClient_t *apiClient, char *group, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -138,11 +146,14 @@ CustomObjectsAPI_createClusterCustomObject(apiClient_t *apiClient, char *group, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -231,15 +242,26 @@ CustomObjectsAPI_createNamespacedCustomObject(apiClient_t *apiClient, char *grou list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -249,7 +271,7 @@ CustomObjectsAPI_createNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -259,7 +281,7 @@ CustomObjectsAPI_createNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -269,7 +291,7 @@ CustomObjectsAPI_createNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -332,9 +354,10 @@ CustomObjectsAPI_createNamespacedCustomObject(apiClient_t *apiClient, char *grou cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -345,6 +368,7 @@ CustomObjectsAPI_createNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -356,11 +380,14 @@ CustomObjectsAPI_createNamespacedCustomObject(apiClient_t *apiClient, char *grou // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -450,15 +477,26 @@ CustomObjectsAPI_deleteClusterCustomObject(apiClient_t *apiClient, char *group, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -468,7 +506,7 @@ CustomObjectsAPI_deleteClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -478,7 +516,7 @@ CustomObjectsAPI_deleteClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -488,7 +526,7 @@ CustomObjectsAPI_deleteClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -553,9 +591,10 @@ CustomObjectsAPI_deleteClusterCustomObject(apiClient_t *apiClient, char *group, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -566,6 +605,7 @@ CustomObjectsAPI_deleteClusterCustomObject(apiClient_t *apiClient, char *group, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -577,11 +617,14 @@ CustomObjectsAPI_deleteClusterCustomObject(apiClient_t *apiClient, char *group, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -671,15 +714,24 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -689,7 +741,7 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -699,7 +751,7 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -788,9 +840,10 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -801,6 +854,7 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -812,11 +866,14 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -921,7 +978,7 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha // Delete collection of namespace scoped custom objects // object_t* -CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, char *group, char *version, char *_namespace, char *plural, char *pretty, char *labelSelector, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, char *dryRun, v1_delete_options_t *body) +CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, char *group, char *version, char *_namespace, char *plural, char *pretty, char *labelSelector, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, char *dryRun, char *fieldSelector, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -929,15 +986,26 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -947,7 +1015,7 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -957,7 +1025,7 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -967,7 +1035,7 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -1052,13 +1120,26 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + // Body Param cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -1069,6 +1150,7 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1080,11 +1162,14 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1180,6 +1265,18 @@ CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, keyValuePair_free(keyPairQuery_dryRun); keyPairQuery_dryRun = NULL; } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } return elementToReturn; end: free(localVarPath); @@ -1198,15 +1295,28 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -1216,7 +1326,7 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -1226,7 +1336,7 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1236,7 +1346,7 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -1246,7 +1356,7 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1311,9 +1421,10 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -1324,6 +1435,7 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1335,11 +1447,14 @@ CustomObjectsAPI_deleteNamespacedCustomObject(apiClient_t *apiClient, char *grou // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1430,15 +1545,22 @@ CustomObjectsAPI_getAPIResources(apiClient_t *apiClient, char *group, char *vers list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}"); + char *localVarPath = strdup("/apis/{group}/{version}"); + + if(!group) + goto end; + if(!version) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -1448,7 +1570,7 @@ CustomObjectsAPI_getAPIResources(apiClient_t *apiClient, char *group, char *vers localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -1467,6 +1589,7 @@ CustomObjectsAPI_getAPIResources(apiClient_t *apiClient, char *group, char *vers localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1478,11 +1601,14 @@ CustomObjectsAPI_getAPIResources(apiClient_t *apiClient, char *group, char *vers // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1517,15 +1643,26 @@ CustomObjectsAPI_getClusterCustomObject(apiClient_t *apiClient, char *group, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -1535,7 +1672,7 @@ CustomObjectsAPI_getClusterCustomObject(apiClient_t *apiClient, char *group, cha localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -1545,7 +1682,7 @@ CustomObjectsAPI_getClusterCustomObject(apiClient_t *apiClient, char *group, cha localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -1555,7 +1692,7 @@ CustomObjectsAPI_getClusterCustomObject(apiClient_t *apiClient, char *group, cha localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1574,6 +1711,7 @@ CustomObjectsAPI_getClusterCustomObject(apiClient_t *apiClient, char *group, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1585,11 +1723,14 @@ CustomObjectsAPI_getClusterCustomObject(apiClient_t *apiClient, char *group, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1626,15 +1767,26 @@ CustomObjectsAPI_getClusterCustomObjectScale(apiClient_t *apiClient, char *group list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}/scale"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}/scale"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -1644,7 +1796,7 @@ CustomObjectsAPI_getClusterCustomObjectScale(apiClient_t *apiClient, char *group localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -1654,7 +1806,7 @@ CustomObjectsAPI_getClusterCustomObjectScale(apiClient_t *apiClient, char *group localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -1664,7 +1816,7 @@ CustomObjectsAPI_getClusterCustomObjectScale(apiClient_t *apiClient, char *group localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1685,6 +1837,7 @@ CustomObjectsAPI_getClusterCustomObjectScale(apiClient_t *apiClient, char *group localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1696,11 +1849,14 @@ CustomObjectsAPI_getClusterCustomObjectScale(apiClient_t *apiClient, char *group // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1737,15 +1893,26 @@ CustomObjectsAPI_getClusterCustomObjectStatus(apiClient_t *apiClient, char *grou list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}/status"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}/status"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -1755,7 +1922,7 @@ CustomObjectsAPI_getClusterCustomObjectStatus(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -1765,7 +1932,7 @@ CustomObjectsAPI_getClusterCustomObjectStatus(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -1775,7 +1942,7 @@ CustomObjectsAPI_getClusterCustomObjectStatus(apiClient_t *apiClient, char *grou localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1796,6 +1963,7 @@ CustomObjectsAPI_getClusterCustomObjectStatus(apiClient_t *apiClient, char *grou localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1807,11 +1975,14 @@ CustomObjectsAPI_getClusterCustomObjectStatus(apiClient_t *apiClient, char *grou // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1848,15 +2019,28 @@ CustomObjectsAPI_getNamespacedCustomObject(apiClient_t *apiClient, char *group, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -1866,7 +2050,7 @@ CustomObjectsAPI_getNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -1876,7 +2060,7 @@ CustomObjectsAPI_getNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1886,7 +2070,7 @@ CustomObjectsAPI_getNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -1896,7 +2080,7 @@ CustomObjectsAPI_getNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1915,6 +2099,7 @@ CustomObjectsAPI_getNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1926,11 +2111,14 @@ CustomObjectsAPI_getNamespacedCustomObject(apiClient_t *apiClient, char *group, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1968,15 +2156,28 @@ CustomObjectsAPI_getNamespacedCustomObjectScale(apiClient_t *apiClient, char *gr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -1986,7 +2187,7 @@ CustomObjectsAPI_getNamespacedCustomObjectScale(apiClient_t *apiClient, char *gr localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -1996,7 +2197,7 @@ CustomObjectsAPI_getNamespacedCustomObjectScale(apiClient_t *apiClient, char *gr localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2006,7 +2207,7 @@ CustomObjectsAPI_getNamespacedCustomObjectScale(apiClient_t *apiClient, char *gr localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -2016,7 +2217,7 @@ CustomObjectsAPI_getNamespacedCustomObjectScale(apiClient_t *apiClient, char *gr localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2037,6 +2238,7 @@ CustomObjectsAPI_getNamespacedCustomObjectScale(apiClient_t *apiClient, char *gr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2048,11 +2250,14 @@ CustomObjectsAPI_getNamespacedCustomObjectScale(apiClient_t *apiClient, char *gr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2090,15 +2295,28 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -2108,7 +2326,7 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -2118,7 +2336,7 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2128,7 +2346,7 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -2138,19 +2356,257 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_group); + free(localVarToReplace_version); + free(localVarToReplace__namespace); + free(localVarToReplace_plural); + free(localVarToReplace_name); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch cluster scoped custom objects +// +object_t* +CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, char *version, char *plural, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/{group}/{version}/{plural}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + + + // Path Params + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ group }") - 1; + if(group == NULL) { + goto end; + } + char* localVarToReplace_group = malloc(sizeOfPathParams_group); + sprintf(localVarToReplace_group, "{%s}", "group"); + + localVarPath = strReplace(localVarPath, localVarToReplace_group, group); + + // Path Params + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ version }") - 1; + if(version == NULL) { + goto end; + } + char* localVarToReplace_version = malloc(sizeOfPathParams_version); + sprintf(localVarToReplace_version, "{%s}", "version"); + + localVarPath = strReplace(localVarPath, localVarToReplace_version, version); + + // Path Params + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ plural }") - 1; + if(plural == NULL) { + goto end; + } + char* localVarToReplace_plural = malloc(sizeOfPathParams_plural); + sprintf(localVarToReplace_plural, "{%s}", "plural"); + + localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2159,6 +2615,7 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2170,11 +2627,14 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2183,7 +2643,7 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - + list_freeList(localVarQueryParameters); list_freeList(localVarHeaderType); @@ -2191,9 +2651,127 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g free(localVarPath); free(localVarToReplace_group); free(localVarToReplace_version); - free(localVarToReplace__namespace); free(localVarToReplace_plural); - free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } return elementToReturn; end: free(localVarPath); @@ -2201,10 +2779,10 @@ CustomObjectsAPI_getNamespacedCustomObjectStatus(apiClient_t *apiClient, char *g } -// list or watch cluster scoped custom objects +// list or watch namespace scoped custom objects // object_t* -CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, char *version, char *plural, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *timeoutSeconds, int *watch) +CustomObjectsAPI_listCustomObjectForAllNamespaces(apiClient_t *apiClient, char *group, char *version, char *resource_plural, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2212,15 +2790,24 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}"); + char *localVarPath = strdup("/apis/{group}/{version}/{resource_plural}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!resource_plural) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(resource_plural)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -2230,7 +2817,7 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(resource_plural)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -2240,14 +2827,14 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen("{ plural }"); - if(plural == NULL) { + long sizeOfPathParams_resource_plural = strlen(group)+3 + strlen(version)+3 + strlen(resource_plural)+3 + sizeof("{ resource_plural }") - 1; + if(resource_plural == NULL) { goto end; } - char* localVarToReplace_plural = malloc(sizeOfPathParams_plural); - sprintf(localVarToReplace_plural, "{%s}", "plural"); + char* localVarToReplace_resource_plural = malloc(sizeOfPathParams_resource_plural); + sprintf(localVarToReplace_resource_plural, "{%s}", "resource_plural"); - localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); + localVarPath = strReplace(localVarPath, localVarToReplace_resource_plural, resource_plural); @@ -2384,6 +2971,7 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2395,11 +2983,14 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2416,7 +3007,7 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch free(localVarPath); free(localVarToReplace_group); free(localVarToReplace_version); - free(localVarToReplace_plural); + free(localVarToReplace_resource_plural); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -2555,15 +3146,26 @@ CustomObjectsAPI_listNamespacedCustomObject(apiClient_t *apiClient, char *group, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -2573,7 +3175,7 @@ CustomObjectsAPI_listNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -2583,7 +3185,7 @@ CustomObjectsAPI_listNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2593,7 +3195,7 @@ CustomObjectsAPI_listNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -2737,6 +3339,7 @@ CustomObjectsAPI_listNamespacedCustomObject(apiClient_t *apiClient, char *group, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2748,11 +3351,14 @@ CustomObjectsAPI_listNamespacedCustomObject(apiClient_t *apiClient, char *group, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2909,15 +3515,26 @@ CustomObjectsAPI_patchClusterCustomObject(apiClient_t *apiClient, char *group, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -2927,7 +3544,7 @@ CustomObjectsAPI_patchClusterCustomObject(apiClient_t *apiClient, char *group, c localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -2937,7 +3554,7 @@ CustomObjectsAPI_patchClusterCustomObject(apiClient_t *apiClient, char *group, c localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -2947,7 +3564,7 @@ CustomObjectsAPI_patchClusterCustomObject(apiClient_t *apiClient, char *group, c localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3011,9 +3628,10 @@ CustomObjectsAPI_patchClusterCustomObject(apiClient_t *apiClient, char *group, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes @@ -3026,6 +3644,7 @@ CustomObjectsAPI_patchClusterCustomObject(apiClient_t *apiClient, char *group, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3037,11 +3656,14 @@ CustomObjectsAPI_patchClusterCustomObject(apiClient_t *apiClient, char *group, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3131,15 +3753,26 @@ CustomObjectsAPI_patchClusterCustomObjectScale(apiClient_t *apiClient, char *gro list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}/scale"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}/scale"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -3149,7 +3782,7 @@ CustomObjectsAPI_patchClusterCustomObjectScale(apiClient_t *apiClient, char *gro localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -3159,7 +3792,7 @@ CustomObjectsAPI_patchClusterCustomObjectScale(apiClient_t *apiClient, char *gro localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -3169,7 +3802,7 @@ CustomObjectsAPI_patchClusterCustomObjectScale(apiClient_t *apiClient, char *gro localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3233,9 +3866,10 @@ CustomObjectsAPI_patchClusterCustomObjectScale(apiClient_t *apiClient, char *gro cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -3250,6 +3884,7 @@ CustomObjectsAPI_patchClusterCustomObjectScale(apiClient_t *apiClient, char *gro localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3261,11 +3896,14 @@ CustomObjectsAPI_patchClusterCustomObjectScale(apiClient_t *apiClient, char *gro // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3355,15 +3993,26 @@ CustomObjectsAPI_patchClusterCustomObjectStatus(apiClient_t *apiClient, char *gr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}/status"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}/status"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -3373,7 +4022,7 @@ CustomObjectsAPI_patchClusterCustomObjectStatus(apiClient_t *apiClient, char *gr localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -3383,7 +4032,7 @@ CustomObjectsAPI_patchClusterCustomObjectStatus(apiClient_t *apiClient, char *gr localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -3393,7 +4042,7 @@ CustomObjectsAPI_patchClusterCustomObjectStatus(apiClient_t *apiClient, char *gr localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3457,9 +4106,10 @@ CustomObjectsAPI_patchClusterCustomObjectStatus(apiClient_t *apiClient, char *gr cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -3474,6 +4124,7 @@ CustomObjectsAPI_patchClusterCustomObjectStatus(apiClient_t *apiClient, char *gr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3485,11 +4136,14 @@ CustomObjectsAPI_patchClusterCustomObjectStatus(apiClient_t *apiClient, char *gr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3579,15 +4233,28 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -3597,7 +4264,7 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -3607,7 +4274,7 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3617,7 +4284,7 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -3627,7 +4294,7 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3691,9 +4358,10 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes @@ -3706,6 +4374,7 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3717,11 +4386,14 @@ CustomObjectsAPI_patchNamespacedCustomObject(apiClient_t *apiClient, char *group // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3812,15 +4484,28 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -3830,7 +4515,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -3840,7 +4525,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3850,7 +4535,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -3860,7 +4545,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3924,9 +4609,10 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -3942,6 +4628,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3953,11 +4640,14 @@ CustomObjectsAPI_patchNamespacedCustomObjectScale(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4048,15 +4738,28 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -4066,7 +4769,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -4076,7 +4779,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4086,7 +4789,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -4096,7 +4799,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4160,9 +4863,10 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -4178,6 +4882,7 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -4189,11 +4894,14 @@ CustomObjectsAPI_patchNamespacedCustomObjectStatus(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4284,15 +4992,26 @@ CustomObjectsAPI_replaceClusterCustomObject(apiClient_t *apiClient, char *group, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -4302,7 +5021,7 @@ CustomObjectsAPI_replaceClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -4312,7 +5031,7 @@ CustomObjectsAPI_replaceClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -4322,7 +5041,7 @@ CustomObjectsAPI_replaceClusterCustomObject(apiClient_t *apiClient, char *group, localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4373,9 +5092,10 @@ CustomObjectsAPI_replaceClusterCustomObject(apiClient_t *apiClient, char *group, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -4386,6 +5106,7 @@ CustomObjectsAPI_replaceClusterCustomObject(apiClient_t *apiClient, char *group, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -4397,11 +5118,14 @@ CustomObjectsAPI_replaceClusterCustomObject(apiClient_t *apiClient, char *group, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4479,15 +5203,26 @@ CustomObjectsAPI_replaceClusterCustomObjectScale(apiClient_t *apiClient, char *g list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}/scale"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}/scale"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -4497,7 +5232,7 @@ CustomObjectsAPI_replaceClusterCustomObjectScale(apiClient_t *apiClient, char *g localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -4507,7 +5242,7 @@ CustomObjectsAPI_replaceClusterCustomObjectScale(apiClient_t *apiClient, char *g localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -4517,7 +5252,7 @@ CustomObjectsAPI_replaceClusterCustomObjectScale(apiClient_t *apiClient, char *g localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4568,9 +5303,10 @@ CustomObjectsAPI_replaceClusterCustomObjectScale(apiClient_t *apiClient, char *g cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -4583,6 +5319,7 @@ CustomObjectsAPI_replaceClusterCustomObjectScale(apiClient_t *apiClient, char *g localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -4598,11 +5335,14 @@ CustomObjectsAPI_replaceClusterCustomObjectScale(apiClient_t *apiClient, char *g // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4680,15 +5420,26 @@ CustomObjectsAPI_replaceClusterCustomObjectStatus(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/{plural}/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/{plural}/{name}/status"); + char *localVarPath = strdup("/apis/{group}/{version}/{plural}/{name}/status"); + + if(!group) + goto end; + if(!version) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -4698,7 +5449,7 @@ CustomObjectsAPI_replaceClusterCustomObjectStatus(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -4708,7 +5459,7 @@ CustomObjectsAPI_replaceClusterCustomObjectStatus(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -4718,7 +5469,7 @@ CustomObjectsAPI_replaceClusterCustomObjectStatus(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4769,9 +5520,10 @@ CustomObjectsAPI_replaceClusterCustomObjectStatus(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -4784,6 +5536,7 @@ CustomObjectsAPI_replaceClusterCustomObjectStatus(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -4799,11 +5552,14 @@ CustomObjectsAPI_replaceClusterCustomObjectStatus(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4881,15 +5637,28 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -4899,7 +5668,7 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -4909,7 +5678,7 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4919,7 +5688,7 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -4929,7 +5698,7 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4980,9 +5749,10 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces apiClient_invoke(apiClient, @@ -4993,6 +5763,7 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5004,11 +5775,14 @@ CustomObjectsAPI_replaceNamespacedCustomObject(apiClient_t *apiClient, char *gro // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5087,15 +5861,28 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -5105,7 +5892,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -5115,7 +5902,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5125,7 +5912,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -5135,7 +5922,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5186,9 +5973,10 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -5201,6 +5989,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5216,11 +6005,14 @@ CustomObjectsAPI_replaceNamespacedCustomObjectScale(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5299,15 +6091,28 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status"); + char *localVarPath = strdup("/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status"); + + if(!group) + goto end; + if(!version) + goto end; + if(!_namespace) + goto end; + if(!plural) + goto end; + if(!name) + goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ group }"); + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -5317,7 +6122,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ version }"); + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -5327,7 +6132,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_version, version); // Path Params - long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5337,7 +6142,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); // Path Params - long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ plural }"); + long sizeOfPathParams_plural = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ plural }") - 1; if(plural == NULL) { goto end; } @@ -5347,7 +6152,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_plural, plural); // Path Params - long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(group)+3 + strlen(version)+3 + strlen(_namespace)+3 + strlen(plural)+3 + strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5398,9 +6203,10 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -5413,6 +6219,7 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5428,11 +6235,14 @@ CustomObjectsAPI_replaceNamespacedCustomObjectStatus(apiClient_t *apiClient, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - object_t *elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); - cJSON_Delete(CustomObjectsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + object_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *CustomObjectsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = object_parseFromJSON(CustomObjectsAPIlocalVarJSON); + cJSON_Delete(CustomObjectsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/CustomObjectsAPI.h b/kubernetes/api/CustomObjectsAPI.h index 6c66d694..93baa92a 100644 --- a/kubernetes/api/CustomObjectsAPI.h +++ b/kubernetes/api/CustomObjectsAPI.h @@ -37,7 +37,7 @@ CustomObjectsAPI_deleteCollectionClusterCustomObject(apiClient_t *apiClient, cha // Delete collection of namespace scoped custom objects // object_t* -CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, char *group, char *version, char *_namespace, char *plural, char *pretty, char *labelSelector, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, char *dryRun, v1_delete_options_t *body); +CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, char *group, char *version, char *_namespace, char *plural, char *pretty, char *labelSelector, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, char *dryRun, char *fieldSelector, v1_delete_options_t *body); // Deletes the specified namespace scoped custom object @@ -94,6 +94,12 @@ object_t* CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, char *version, char *plural, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *timeoutSeconds, int *watch); +// list or watch namespace scoped custom objects +// +object_t* +CustomObjectsAPI_listCustomObjectForAllNamespaces(apiClient_t *apiClient, char *group, char *version, char *resource_plural, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *timeoutSeconds, int *watch); + + // list or watch namespace scoped custom objects // object_t* diff --git a/kubernetes/api/DiscoveryAPI.c b/kubernetes/api/DiscoveryAPI.c index 7687f6b7..ee13b1fe 100644 --- a/kubernetes/api/DiscoveryAPI.c +++ b/kubernetes/api/DiscoveryAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "DiscoveryAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ DiscoveryAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/"); + char *localVarPath = strdup("/apis/discovery.k8s.io/"); + @@ -42,6 +42,7 @@ DiscoveryAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ DiscoveryAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(DiscoveryAPIlocalVarJSON); - cJSON_Delete(DiscoveryAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(DiscoveryAPIlocalVarJSON); + cJSON_Delete(DiscoveryAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/DiscoveryV1API.c b/kubernetes/api/DiscoveryV1API.c index ad94d4a1..fee397de 100644 --- a/kubernetes/api/DiscoveryV1API.c +++ b/kubernetes/api/DiscoveryV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "DiscoveryV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create an EndpointSlice @@ -23,15 +20,20 @@ DiscoveryV1API_createNamespacedEndpointSlice(apiClient_t *apiClient, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ DiscoveryV1API_createNamespacedEndpointSlice(apiClient_t *apiClient, char *_name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_endpoint_slice_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ DiscoveryV1API_createNamespacedEndpointSlice(apiClient_t *apiClient, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ DiscoveryV1API_createNamespacedEndpointSlice(apiClient_t *apiClient, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoint_slice_t *elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoint_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -211,7 +219,7 @@ DiscoveryV1API_createNamespacedEndpointSlice(apiClient_t *apiClient, char *_name // delete collection of EndpointSlice // v1_status_t* -DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -219,15 +227,20 @@ DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -299,6 +312,19 @@ DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, c list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -403,13 +429,15 @@ DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -418,6 +446,7 @@ DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -429,11 +458,14 @@ DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -514,6 +546,18 @@ DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, c keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -620,7 +664,7 @@ DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, c // delete an EndpointSlice // v1_status_t* -DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -628,15 +672,22 @@ DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -646,7 +697,7 @@ DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -694,6 +745,19 @@ DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -723,13 +787,15 @@ DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -738,6 +804,7 @@ DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -753,11 +820,14 @@ DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -815,6 +885,18 @@ DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -857,17 +939,21 @@ DiscoveryV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -876,6 +962,7 @@ DiscoveryV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -887,11 +974,14 @@ DiscoveryV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -924,11 +1014,14 @@ DiscoveryV1API_listEndpointSliceForAllNamespaces(apiClient_t *apiClient, int *al list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/endpointslices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/endpointslices"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/endpointslices"); + @@ -1072,8 +1165,10 @@ DiscoveryV1API_listEndpointSliceForAllNamespaces(apiClient_t *apiClient, int *al list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1082,6 +1177,7 @@ DiscoveryV1API_listEndpointSliceForAllNamespaces(apiClient_t *apiClient, int *al localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1093,11 +1189,14 @@ DiscoveryV1API_listEndpointSliceForAllNamespaces(apiClient_t *apiClient, int *al // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoint_slice_list_t *elementToReturn = v1_endpoint_slice_list_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoint_slice_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoint_slice_list_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1262,15 +1361,20 @@ DiscoveryV1API_listNamespacedEndpointSlice(apiClient_t *apiClient, char *_namesp list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1420,8 +1524,10 @@ DiscoveryV1API_listNamespacedEndpointSlice(apiClient_t *apiClient, char *_namesp list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1430,6 +1536,7 @@ DiscoveryV1API_listNamespacedEndpointSlice(apiClient_t *apiClient, char *_namesp localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1441,11 +1548,14 @@ DiscoveryV1API_listNamespacedEndpointSlice(apiClient_t *apiClient, char *_namesp // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoint_slice_list_t *elementToReturn = v1_endpoint_slice_list_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoint_slice_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoint_slice_list_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1611,15 +1721,22 @@ DiscoveryV1API_patchNamespacedEndpointSlice(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1629,7 +1746,7 @@ DiscoveryV1API_patchNamespacedEndpointSlice(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1705,17 +1822,20 @@ DiscoveryV1API_patchNamespacedEndpointSlice(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1724,6 +1844,7 @@ DiscoveryV1API_patchNamespacedEndpointSlice(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1739,11 +1860,14 @@ DiscoveryV1API_patchNamespacedEndpointSlice(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoint_slice_t *elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoint_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1843,15 +1967,22 @@ DiscoveryV1API_readNamespacedEndpointSlice(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1861,7 +1992,7 @@ DiscoveryV1API_readNamespacedEndpointSlice(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1886,6 +2017,7 @@ DiscoveryV1API_readNamespacedEndpointSlice(apiClient_t *apiClient, char *name, c list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1894,6 +2026,7 @@ DiscoveryV1API_readNamespacedEndpointSlice(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1905,11 +2038,14 @@ DiscoveryV1API_readNamespacedEndpointSlice(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoint_slice_t *elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoint_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1956,15 +2092,22 @@ DiscoveryV1API_replaceNamespacedEndpointSlice(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + char *localVarPath = strdup("/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1974,7 +2117,7 @@ DiscoveryV1API_replaceNamespacedEndpointSlice(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2037,13 +2180,15 @@ DiscoveryV1API_replaceNamespacedEndpointSlice(apiClient_t *apiClient, char *name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_endpoint_slice_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2052,6 +2197,7 @@ DiscoveryV1API_replaceNamespacedEndpointSlice(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2067,11 +2213,14 @@ DiscoveryV1API_replaceNamespacedEndpointSlice(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_endpoint_slice_t *elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); - cJSON_Delete(DiscoveryV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_endpoint_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *DiscoveryV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_endpoint_slice_parseFromJSON(DiscoveryV1APIlocalVarJSON); + cJSON_Delete(DiscoveryV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/DiscoveryV1API.h b/kubernetes/api/DiscoveryV1API.h index f3f49beb..b1ed1793 100644 --- a/kubernetes/api/DiscoveryV1API.h +++ b/kubernetes/api/DiscoveryV1API.h @@ -22,13 +22,13 @@ DiscoveryV1API_createNamespacedEndpointSlice(apiClient_t *apiClient, char *_name // delete collection of EndpointSlice // v1_status_t* -DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete an EndpointSlice // v1_status_t* -DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/EventsAPI.c b/kubernetes/api/EventsAPI.c index e81911c8..b283ec89 100644 --- a/kubernetes/api/EventsAPI.c +++ b/kubernetes/api/EventsAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "EventsAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ EventsAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/"); + char *localVarPath = strdup("/apis/events.k8s.io/"); + @@ -42,6 +42,7 @@ EventsAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ EventsAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(EventsAPIlocalVarJSON); - cJSON_Delete(EventsAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(EventsAPIlocalVarJSON); + cJSON_Delete(EventsAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/EventsV1API.c b/kubernetes/api/EventsV1API.c index ab73e39e..973e9995 100644 --- a/kubernetes/api/EventsV1API.c +++ b/kubernetes/api/EventsV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "EventsV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create an Event @@ -23,15 +20,20 @@ EventsV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, even list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/namespaces/{namespace}/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/namespaces/{namespace}/events"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/namespaces/{namespace}/events"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ EventsV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, even cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = events_v1_event_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ EventsV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, even localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ EventsV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, even // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - events_v1_event_t *elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + events_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -211,7 +219,7 @@ EventsV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, even // delete collection of Event // v1_status_t* -EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -219,15 +227,20 @@ EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_names list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/namespaces/{namespace}/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/namespaces/{namespace}/events"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/namespaces/{namespace}/events"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -299,6 +312,19 @@ EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_names list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -403,13 +429,15 @@ EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_names cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -418,6 +446,7 @@ EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -429,11 +458,14 @@ EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_names // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -514,6 +546,18 @@ EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_names keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -620,7 +664,7 @@ EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_names // delete an Event // v1_status_t* -EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -628,15 +672,22 @@ EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -646,7 +697,7 @@ EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -694,6 +745,19 @@ EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_nam list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -723,13 +787,15 @@ EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -738,6 +804,7 @@ EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -753,11 +820,14 @@ EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -815,6 +885,18 @@ EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_nam keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -857,17 +939,21 @@ EventsV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -876,6 +962,7 @@ EventsV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -887,11 +974,14 @@ EventsV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -924,11 +1014,14 @@ EventsV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/events"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/events"); + @@ -1072,8 +1165,10 @@ EventsV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1082,6 +1177,7 @@ EventsV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1093,11 +1189,14 @@ EventsV1API_listEventForAllNamespaces(apiClient_t *apiClient, int *allowWatchBoo // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - events_v1_event_list_t *elementToReturn = events_v1_event_list_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + events_v1_event_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = events_v1_event_list_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1262,15 +1361,20 @@ EventsV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/namespaces/{namespace}/events")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/namespaces/{namespace}/events"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/namespaces/{namespace}/events"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1420,8 +1524,10 @@ EventsV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char * list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1430,6 +1536,7 @@ EventsV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1441,11 +1548,14 @@ EventsV1API_listNamespacedEvent(apiClient_t *apiClient, char *_namespace, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - events_v1_event_list_t *elementToReturn = events_v1_event_list_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + events_v1_event_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = events_v1_event_list_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1611,15 +1721,22 @@ EventsV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1629,7 +1746,7 @@ EventsV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1705,17 +1822,20 @@ EventsV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1724,6 +1844,7 @@ EventsV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1739,11 +1860,14 @@ EventsV1API_patchNamespacedEvent(apiClient_t *apiClient, char *name, char *_name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - events_v1_event_t *elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + events_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1843,15 +1967,22 @@ EventsV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_names list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1861,7 +1992,7 @@ EventsV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_names localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1886,6 +2017,7 @@ EventsV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_names list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1894,6 +2026,7 @@ EventsV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1905,11 +2038,14 @@ EventsV1API_readNamespacedEvent(apiClient_t *apiClient, char *name, char *_names // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - events_v1_event_t *elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + events_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1956,15 +2092,22 @@ EventsV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + char *localVarPath = strdup("/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1974,7 +2117,7 @@ EventsV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2037,13 +2180,15 @@ EventsV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = events_v1_event_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2052,6 +2197,7 @@ EventsV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2067,11 +2213,14 @@ EventsV1API_replaceNamespacedEvent(apiClient_t *apiClient, char *name, char *_na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - events_v1_event_t *elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); - cJSON_Delete(EventsV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + events_v1_event_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *EventsV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = events_v1_event_parseFromJSON(EventsV1APIlocalVarJSON); + cJSON_Delete(EventsV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/EventsV1API.h b/kubernetes/api/EventsV1API.h index 17b69d53..987baa5e 100644 --- a/kubernetes/api/EventsV1API.h +++ b/kubernetes/api/EventsV1API.h @@ -22,13 +22,13 @@ EventsV1API_createNamespacedEvent(apiClient_t *apiClient, char *_namespace, even // delete collection of Event // v1_status_t* -EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete an Event // v1_status_t* -EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/FlowcontrolApiserverAPI.c b/kubernetes/api/FlowcontrolApiserverAPI.c index 28fcad3c..fbd0d3e2 100644 --- a/kubernetes/api/FlowcontrolApiserverAPI.c +++ b/kubernetes/api/FlowcontrolApiserverAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "FlowcontrolApiserverAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ FlowcontrolApiserverAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/"); + @@ -42,6 +42,7 @@ FlowcontrolApiserverAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ FlowcontrolApiserverAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(FlowcontrolApiserverAPIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(FlowcontrolApiserverAPIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/FlowcontrolApiserverV1API.c b/kubernetes/api/FlowcontrolApiserverV1API.c index 325b098f..378f90e4 100644 --- a/kubernetes/api/FlowcontrolApiserverV1API.c +++ b/kubernetes/api/FlowcontrolApiserverV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "FlowcontrolApiserverV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a FlowSchema @@ -23,11 +20,14 @@ FlowcontrolApiserverV1API_createFlowSchema(apiClient_t *apiClient, v1_flow_schem list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas"); + @@ -84,13 +84,15 @@ FlowcontrolApiserverV1API_createFlowSchema(apiClient_t *apiClient, v1_flow_schem cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_flow_schema_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ FlowcontrolApiserverV1API_createFlowSchema(apiClient_t *apiClient, v1_flow_schem localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ FlowcontrolApiserverV1API_createFlowSchema(apiClient_t *apiClient, v1_flow_schem // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_t *elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -208,11 +214,14 @@ FlowcontrolApiserverV1API_createPriorityLevelConfiguration(apiClient_t *apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations"); + @@ -269,13 +278,15 @@ FlowcontrolApiserverV1API_createPriorityLevelConfiguration(apiClient_t *apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_priority_level_configuration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -284,6 +295,7 @@ FlowcontrolApiserverV1API_createPriorityLevelConfiguration(apiClient_t *apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -303,11 +315,14 @@ FlowcontrolApiserverV1API_createPriorityLevelConfiguration(apiClient_t *apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_t *elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -385,7 +400,7 @@ FlowcontrolApiserverV1API_createPriorityLevelConfiguration(apiClient_t *apiClien // delete collection of FlowSchema // v1_status_t* -FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -393,11 +408,14 @@ FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas"); + @@ -463,6 +481,19 @@ FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, cha list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -567,13 +598,15 @@ FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -582,6 +615,7 @@ FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -593,11 +627,14 @@ FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -677,6 +714,18 @@ FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, cha keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -783,7 +832,7 @@ FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, cha // delete collection of PriorityLevelConfiguration // v1_status_t* -FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -791,11 +840,14 @@ FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations"); + @@ -861,6 +913,19 @@ FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -965,13 +1030,15 @@ FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -980,6 +1047,7 @@ FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -991,11 +1059,14 @@ FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1075,6 +1146,18 @@ FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1181,7 +1264,7 @@ FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t // delete a FlowSchema // v1_status_t* -FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1189,15 +1272,20 @@ FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1245,6 +1333,19 @@ FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, c list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1274,13 +1375,15 @@ FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1289,6 +1392,7 @@ FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1304,11 +1408,14 @@ FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1365,6 +1472,18 @@ FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, c keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1399,7 +1518,7 @@ FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, c // delete a PriorityLevelConfiguration // v1_status_t* -FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1407,15 +1526,20 @@ FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1463,6 +1587,19 @@ FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClien list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1492,13 +1629,15 @@ FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1507,6 +1646,7 @@ FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1522,11 +1662,14 @@ FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1583,6 +1726,18 @@ FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClien keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1625,17 +1780,21 @@ FlowcontrolApiserverV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1644,6 +1803,7 @@ FlowcontrolApiserverV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1655,11 +1815,14 @@ FlowcontrolApiserverV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1692,11 +1855,14 @@ FlowcontrolApiserverV1API_listFlowSchema(apiClient_t *apiClient, char *pretty, i list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas"); + @@ -1840,8 +2006,10 @@ FlowcontrolApiserverV1API_listFlowSchema(apiClient_t *apiClient, char *pretty, i list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1850,6 +2018,7 @@ FlowcontrolApiserverV1API_listFlowSchema(apiClient_t *apiClient, char *pretty, i localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1861,11 +2030,14 @@ FlowcontrolApiserverV1API_listFlowSchema(apiClient_t *apiClient, char *pretty, i // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_list_t *elementToReturn = v1_flow_schema_list_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_list_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2030,11 +2202,14 @@ FlowcontrolApiserverV1API_listPriorityLevelConfiguration(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations"); + @@ -2178,8 +2353,10 @@ FlowcontrolApiserverV1API_listPriorityLevelConfiguration(apiClient_t *apiClient, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2188,6 +2365,7 @@ FlowcontrolApiserverV1API_listPriorityLevelConfiguration(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2199,11 +2377,14 @@ FlowcontrolApiserverV1API_listPriorityLevelConfiguration(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_list_t *elementToReturn = v1_priority_level_configuration_list_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_list_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2368,15 +2549,20 @@ FlowcontrolApiserverV1API_patchFlowSchema(apiClient_t *apiClient, char *name, ob list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2452,17 +2638,20 @@ FlowcontrolApiserverV1API_patchFlowSchema(apiClient_t *apiClient, char *name, ob cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2471,6 +2660,7 @@ FlowcontrolApiserverV1API_patchFlowSchema(apiClient_t *apiClient, char *name, ob localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -2486,11 +2676,14 @@ FlowcontrolApiserverV1API_patchFlowSchema(apiClient_t *apiClient, char *name, ob // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_t *elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2589,15 +2782,20 @@ FlowcontrolApiserverV1API_patchFlowSchemaStatus(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2673,17 +2871,20 @@ FlowcontrolApiserverV1API_patchFlowSchemaStatus(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2692,6 +2893,7 @@ FlowcontrolApiserverV1API_patchFlowSchemaStatus(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -2707,11 +2909,14 @@ FlowcontrolApiserverV1API_patchFlowSchemaStatus(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_t *elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2810,15 +3015,20 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfiguration(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2894,17 +3104,20 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfiguration(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2913,6 +3126,7 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfiguration(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -2928,11 +3142,14 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfiguration(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_t *elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3031,15 +3248,20 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfigurationStatus(apiClient_t *api list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3115,17 +3337,20 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfigurationStatus(apiClient_t *api cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3134,6 +3359,7 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfigurationStatus(apiClient_t *api localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -3149,11 +3375,14 @@ FlowcontrolApiserverV1API_patchPriorityLevelConfigurationStatus(apiClient_t *api // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_t *elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3252,15 +3481,20 @@ FlowcontrolApiserverV1API_readFlowSchema(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3285,6 +3519,7 @@ FlowcontrolApiserverV1API_readFlowSchema(apiClient_t *apiClient, char *name, cha list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3293,6 +3528,7 @@ FlowcontrolApiserverV1API_readFlowSchema(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3304,11 +3540,14 @@ FlowcontrolApiserverV1API_readFlowSchema(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_t *elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3354,15 +3593,20 @@ FlowcontrolApiserverV1API_readFlowSchemaStatus(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3387,6 +3631,7 @@ FlowcontrolApiserverV1API_readFlowSchemaStatus(apiClient_t *apiClient, char *nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3395,6 +3640,7 @@ FlowcontrolApiserverV1API_readFlowSchemaStatus(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3406,11 +3652,14 @@ FlowcontrolApiserverV1API_readFlowSchemaStatus(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_t *elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3456,15 +3705,20 @@ FlowcontrolApiserverV1API_readPriorityLevelConfiguration(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3489,6 +3743,7 @@ FlowcontrolApiserverV1API_readPriorityLevelConfiguration(apiClient_t *apiClient, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3497,6 +3752,7 @@ FlowcontrolApiserverV1API_readPriorityLevelConfiguration(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3508,11 +3764,14 @@ FlowcontrolApiserverV1API_readPriorityLevelConfiguration(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_t *elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3558,15 +3817,20 @@ FlowcontrolApiserverV1API_readPriorityLevelConfigurationStatus(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3591,6 +3855,7 @@ FlowcontrolApiserverV1API_readPriorityLevelConfigurationStatus(apiClient_t *apiC list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3599,6 +3864,7 @@ FlowcontrolApiserverV1API_readPriorityLevelConfigurationStatus(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3610,11 +3876,14 @@ FlowcontrolApiserverV1API_readPriorityLevelConfigurationStatus(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_t *elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3660,15 +3929,20 @@ FlowcontrolApiserverV1API_replaceFlowSchema(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3731,13 +4005,15 @@ FlowcontrolApiserverV1API_replaceFlowSchema(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_flow_schema_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3746,6 +4022,7 @@ FlowcontrolApiserverV1API_replaceFlowSchema(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -3761,11 +4038,14 @@ FlowcontrolApiserverV1API_replaceFlowSchema(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_t *elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3852,15 +4132,20 @@ FlowcontrolApiserverV1API_replaceFlowSchemaStatus(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3923,13 +4208,15 @@ FlowcontrolApiserverV1API_replaceFlowSchemaStatus(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_flow_schema_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3938,6 +4225,7 @@ FlowcontrolApiserverV1API_replaceFlowSchemaStatus(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -3953,11 +4241,14 @@ FlowcontrolApiserverV1API_replaceFlowSchemaStatus(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_flow_schema_t *elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_flow_schema_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_flow_schema_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4044,15 +4335,20 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfiguration(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4115,13 +4411,15 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfiguration(apiClient_t *apiClie cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_priority_level_configuration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4130,6 +4428,7 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfiguration(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -4145,11 +4444,14 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfiguration(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_t *elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4236,15 +4538,20 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfigurationStatus(apiClient_t *a list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status"); + char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4307,13 +4614,15 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfigurationStatus(apiClient_t *a cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_priority_level_configuration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4322,6 +4631,7 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfigurationStatus(apiClient_t *a localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -4337,11 +4647,14 @@ FlowcontrolApiserverV1API_replacePriorityLevelConfigurationStatus(apiClient_t *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_level_configuration_t *elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_level_configuration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *FlowcontrolApiserverV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1APIlocalVarJSON); + cJSON_Delete(FlowcontrolApiserverV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/FlowcontrolApiserverV1API.h b/kubernetes/api/FlowcontrolApiserverV1API.h index 548a2182..be87efeb 100644 --- a/kubernetes/api/FlowcontrolApiserverV1API.h +++ b/kubernetes/api/FlowcontrolApiserverV1API.h @@ -30,25 +30,25 @@ FlowcontrolApiserverV1API_createPriorityLevelConfiguration(apiClient_t *apiClien // delete collection of FlowSchema // v1_status_t* -FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of PriorityLevelConfiguration // v1_status_t* -FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a FlowSchema // v1_status_t* -FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a PriorityLevelConfiguration // v1_status_t* -FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/FlowcontrolApiserverV1beta3API.c b/kubernetes/api/FlowcontrolApiserverV1beta3API.c deleted file mode 100644 index 4278fe37..00000000 --- a/kubernetes/api/FlowcontrolApiserverV1beta3API.c +++ /dev/null @@ -1,4419 +0,0 @@ -#include -#include -#include -#include "FlowcontrolApiserverV1beta3API.h" - -#define MAX_NUMBER_LENGTH 16 -#define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) - - -// create a FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_createFlowSchema(apiClient_t *apiClient, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta3_flow_schema_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_t *elementToReturn = v1beta3_flow_schema_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create a PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration(apiClient_t *apiClient, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta3_priority_level_configuration_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_t *elementToReturn = v1beta3_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of FlowSchema -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of PriorityLevelConfiguration -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a FlowSchema -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a PriorityLevelConfiguration -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// get available resources -// -v1_api_resource_list_t* -FlowcontrolApiserverV1beta3API_getAPIResources(apiClient_t *apiClient) -{ - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/"); - - - - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind FlowSchema -// -v1beta3_flow_schema_list_t* -FlowcontrolApiserverV1beta3API_listFlowSchema(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_list_t *elementToReturn = v1beta3_flow_schema_list_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_list_t* -FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_list_t *elementToReturn = v1beta3_priority_level_configuration_list_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_patchFlowSchema(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_t *elementToReturn = v1beta3_flow_schema_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update status of the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_t *elementToReturn = v1beta3_flow_schema_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_t *elementToReturn = v1beta3_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update status of the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_t *elementToReturn = v1beta3_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_readFlowSchema(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_t *elementToReturn = v1beta3_flow_schema_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read status of the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_readFlowSchemaStatus(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_t *elementToReturn = v1beta3_flow_schema_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_t *elementToReturn = v1beta3_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read status of the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_t *elementToReturn = v1beta3_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_replaceFlowSchema(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta3_flow_schema_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_t *elementToReturn = v1beta3_flow_schema_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace status of the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta3_flow_schema_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_flow_schema_t *elementToReturn = v1beta3_flow_schema_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta3_priority_level_configuration_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_t *elementToReturn = v1beta3_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace status of the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1beta3_priority_level_configuration_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *FlowcontrolApiserverV1beta3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1beta3_priority_level_configuration_t *elementToReturn = v1beta3_priority_level_configuration_parseFromJSON(FlowcontrolApiserverV1beta3APIlocalVarJSON); - cJSON_Delete(FlowcontrolApiserverV1beta3APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - diff --git a/kubernetes/api/FlowcontrolApiserverV1beta3API.h b/kubernetes/api/FlowcontrolApiserverV1beta3API.h deleted file mode 100644 index ef27e6ec..00000000 --- a/kubernetes/api/FlowcontrolApiserverV1beta3API.h +++ /dev/null @@ -1,143 +0,0 @@ -#include -#include -#include "../include/apiClient.h" -#include "../include/list.h" -#include "../external/cJSON.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "../model/object.h" -#include "../model/v1_api_resource_list.h" -#include "../model/v1_delete_options.h" -#include "../model/v1_status.h" -#include "../model/v1beta3_flow_schema.h" -#include "../model/v1beta3_flow_schema_list.h" -#include "../model/v1beta3_priority_level_configuration.h" -#include "../model/v1beta3_priority_level_configuration_list.h" - - -// create a FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_createFlowSchema(apiClient_t *apiClient, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create a PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration(apiClient_t *apiClient, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// delete collection of FlowSchema -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of PriorityLevelConfiguration -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete a FlowSchema -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete a PriorityLevelConfiguration -// -v1_status_t* -FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// get available resources -// -v1_api_resource_list_t* -FlowcontrolApiserverV1beta3API_getAPIResources(apiClient_t *apiClient); - - -// list or watch objects of kind FlowSchema -// -v1beta3_flow_schema_list_t* -FlowcontrolApiserverV1beta3API_listFlowSchema(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_list_t* -FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// partially update the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_patchFlowSchema(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update status of the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update status of the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// read the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_readFlowSchema(apiClient_t *apiClient, char *name, char *pretty); - - -// read status of the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_readFlowSchemaStatus(apiClient_t *apiClient, char *name, char *pretty); - - -// read the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty); - - -// read status of the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, char *pretty); - - -// replace the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_replaceFlowSchema(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace status of the specified FlowSchema -// -v1beta3_flow_schema_t* -FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace status of the specified PriorityLevelConfiguration -// -v1beta3_priority_level_configuration_t* -FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - diff --git a/kubernetes/api/InternalApiserverAPI.c b/kubernetes/api/InternalApiserverAPI.c index 5e22970e..d64528af 100644 --- a/kubernetes/api/InternalApiserverAPI.c +++ b/kubernetes/api/InternalApiserverAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "InternalApiserverAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ InternalApiserverAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/"); + @@ -42,6 +42,7 @@ InternalApiserverAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ InternalApiserverAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(InternalApiserverAPIlocalVarJSON); - cJSON_Delete(InternalApiserverAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(InternalApiserverAPIlocalVarJSON); + cJSON_Delete(InternalApiserverAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/InternalApiserverV1alpha1API.c b/kubernetes/api/InternalApiserverV1alpha1API.c index ad93611e..c02d798b 100644 --- a/kubernetes/api/InternalApiserverV1alpha1API.c +++ b/kubernetes/api/InternalApiserverV1alpha1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "InternalApiserverV1alpha1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a StorageVersion @@ -23,11 +20,14 @@ InternalApiserverV1alpha1API_createStorageVersion(apiClient_t *apiClient, v1alph list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions"); + @@ -84,13 +84,15 @@ InternalApiserverV1alpha1API_createStorageVersion(apiClient_t *apiClient, v1alph cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_storage_version_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ InternalApiserverV1alpha1API_createStorageVersion(apiClient_t *apiClient, v1alph localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ InternalApiserverV1alpha1API_createStorageVersion(apiClient_t *apiClient, v1alph // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_t *elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ InternalApiserverV1alpha1API_createStorageVersion(apiClient_t *apiClient, v1alph // delete collection of StorageVersion // v1_status_t* -InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClie list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions"); + @@ -278,6 +287,19 @@ InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClie list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -382,13 +404,15 @@ InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClie cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -397,6 +421,7 @@ InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClie localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -408,11 +433,14 @@ InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClie // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -492,6 +520,18 @@ InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClie keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -598,7 +638,7 @@ InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClie // delete a StorageVersion // v1_status_t* -InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -606,15 +646,20 @@ InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -662,6 +707,19 @@ InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -691,13 +749,15 @@ InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -706,6 +766,7 @@ InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -721,11 +782,14 @@ InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -782,6 +846,18 @@ InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -824,17 +900,21 @@ InternalApiserverV1alpha1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ InternalApiserverV1alpha1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ InternalApiserverV1alpha1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ InternalApiserverV1alpha1API_listStorageVersion(apiClient_t *apiClient, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions"); + @@ -1039,8 +1126,10 @@ InternalApiserverV1alpha1API_listStorageVersion(apiClient_t *apiClient, char *pr list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ InternalApiserverV1alpha1API_listStorageVersion(apiClient_t *apiClient, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ InternalApiserverV1alpha1API_listStorageVersion(apiClient_t *apiClient, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_list_t *elementToReturn = v1alpha1_storage_version_list_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_list_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ InternalApiserverV1alpha1API_patchStorageVersion(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ InternalApiserverV1alpha1API_patchStorageVersion(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ InternalApiserverV1alpha1API_patchStorageVersion(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ InternalApiserverV1alpha1API_patchStorageVersion(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_t *elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ InternalApiserverV1alpha1API_patchStorageVersionStatus(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1534,17 +1644,20 @@ InternalApiserverV1alpha1API_patchStorageVersionStatus(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1553,6 +1666,7 @@ InternalApiserverV1alpha1API_patchStorageVersionStatus(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1568,11 +1682,14 @@ InternalApiserverV1alpha1API_patchStorageVersionStatus(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_t *elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1671,15 +1788,20 @@ InternalApiserverV1alpha1API_readStorageVersion(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1704,6 +1826,7 @@ InternalApiserverV1alpha1API_readStorageVersion(apiClient_t *apiClient, char *na list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1712,6 +1835,7 @@ InternalApiserverV1alpha1API_readStorageVersion(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1723,11 +1847,14 @@ InternalApiserverV1alpha1API_readStorageVersion(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_t *elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1773,15 +1900,20 @@ InternalApiserverV1alpha1API_readStorageVersionStatus(apiClient_t *apiClient, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1806,6 +1938,7 @@ InternalApiserverV1alpha1API_readStorageVersionStatus(apiClient_t *apiClient, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1814,6 +1947,7 @@ InternalApiserverV1alpha1API_readStorageVersionStatus(apiClient_t *apiClient, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1825,11 +1959,14 @@ InternalApiserverV1alpha1API_readStorageVersionStatus(apiClient_t *apiClient, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_t *elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1875,15 +2012,20 @@ InternalApiserverV1alpha1API_replaceStorageVersion(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1946,13 +2088,15 @@ InternalApiserverV1alpha1API_replaceStorageVersion(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_storage_version_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1961,6 +2105,7 @@ InternalApiserverV1alpha1API_replaceStorageVersion(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1976,11 +2121,14 @@ InternalApiserverV1alpha1API_replaceStorageVersion(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_t *elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2067,15 +2215,20 @@ InternalApiserverV1alpha1API_replaceStorageVersionStatus(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status"); + char *localVarPath = strdup("/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2138,13 +2291,15 @@ InternalApiserverV1alpha1API_replaceStorageVersionStatus(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_storage_version_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2153,6 +2308,7 @@ InternalApiserverV1alpha1API_replaceStorageVersionStatus(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2168,11 +2324,14 @@ InternalApiserverV1alpha1API_replaceStorageVersionStatus(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_t *elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); - cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *InternalApiserverV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_parseFromJSON(InternalApiserverV1alpha1APIlocalVarJSON); + cJSON_Delete(InternalApiserverV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/InternalApiserverV1alpha1API.h b/kubernetes/api/InternalApiserverV1alpha1API.h index ef42ef08..c756c883 100644 --- a/kubernetes/api/InternalApiserverV1alpha1API.h +++ b/kubernetes/api/InternalApiserverV1alpha1API.h @@ -22,13 +22,13 @@ InternalApiserverV1alpha1API_createStorageVersion(apiClient_t *apiClient, v1alph // delete collection of StorageVersion // v1_status_t* -InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a StorageVersion // v1_status_t* -InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/LogsAPI.c b/kubernetes/api/LogsAPI.c index b9221ae2..5787fb12 100644 --- a/kubernetes/api/LogsAPI.c +++ b/kubernetes/api/LogsAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "LogsAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 void @@ -21,15 +18,20 @@ LogsAPI_logFileHandler(apiClient_t *apiClient, char *logpath) list_t *localVarHeaderType = NULL; list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/logs/{logpath}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/logs/{logpath}"); + char *localVarPath = strdup("/logs/{logpath}"); + + if(!logpath) + goto end; // Path Params - long sizeOfPathParams_logpath = strlen(logpath)+3 + strlen("{ logpath }"); + long sizeOfPathParams_logpath = strlen(logpath)+3 + sizeof("{ logpath }") - 1; if(logpath == NULL) { goto end; } @@ -47,6 +49,7 @@ LogsAPI_logFileHandler(apiClient_t *apiClient, char *logpath) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -79,11 +82,14 @@ LogsAPI_logFileListHandler(apiClient_t *apiClient) list_t *localVarHeaderType = NULL; list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/logs/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/logs/"); + char *localVarPath = strdup("/logs/"); + @@ -95,6 +101,7 @@ LogsAPI_logFileListHandler(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response diff --git a/kubernetes/api/NetworkingAPI.c b/kubernetes/api/NetworkingAPI.c index 5ff0768b..da8b276a 100644 --- a/kubernetes/api/NetworkingAPI.c +++ b/kubernetes/api/NetworkingAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "NetworkingAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ NetworkingAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/"); + char *localVarPath = strdup("/apis/networking.k8s.io/"); + @@ -42,6 +42,7 @@ NetworkingAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ NetworkingAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(NetworkingAPIlocalVarJSON); - cJSON_Delete(NetworkingAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(NetworkingAPIlocalVarJSON); + cJSON_Delete(NetworkingAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/NetworkingV1API.c b/kubernetes/api/NetworkingV1API.c index f8959951..fb0bd865 100644 --- a/kubernetes/api/NetworkingV1API.c +++ b/kubernetes/api/NetworkingV1API.c @@ -1,21 +1,18 @@ #include #include #include + #include "NetworkingV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 -// create an IngressClass +// create an IPAddress // -v1_ingress_class_t* -NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_ip_address_t* +NetworkingV1API_createIPAddress(apiClient_t *apiClient, v1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -23,11 +20,14 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingressclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingressclasses"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses"); + @@ -84,13 +84,15 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_ingress_class_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_ip_address_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_class_t *elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ip_address_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -197,10 +203,10 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b } -// create an Ingress +// create an IngressClass // -v1_ingress_t* -NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace, v1_ingress_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_ingress_class_t* +NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,22 +214,15 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses"); - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -279,13 +278,15 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_ingress_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -294,6 +295,7 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -313,11 +315,14 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_t *elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -332,7 +337,6 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -393,10 +397,10 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace } -// create a NetworkPolicy +// create an Ingress // -v1_network_policy_t* -NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, v1_network_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_ingress_t* +NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace, v1_ingress_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -404,15 +408,20 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -475,13 +484,15 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -490,6 +501,7 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -509,11 +521,14 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_network_policy_t *elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -589,10 +604,10 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam } -// delete collection of IngressClass +// create a NetworkPolicy // -v1_status_t* -NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +v1_network_policy_t* +NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, v1_network_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -600,12 +615,27 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingressclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingressclasses"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -621,18 +651,6 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - // query parameters char *keyQuery_dryRun = NULL; char * valueQuery_dryRun = NULL; @@ -646,141 +664,42 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett } // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); } // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); } // Body Param cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -789,22 +708,34 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett localVarHeaderType, localVarContentType, localVarBodyParameters, - "DELETE"); + localVarBodyLength, + "POST"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_network_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -819,6 +750,7 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett list_freeList(localVarHeaderType); free(localVarPath); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -836,18 +768,6 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } if(keyQuery_dryRun){ free(keyQuery_dryRun); keyQuery_dryRun = NULL; @@ -860,125 +780,223 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett keyValuePair_free(keyPairQuery_dryRun); keyPairQuery_dryRun = NULL; } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_createServiceCIDR(apiClient_t *apiClient, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_service_cidr_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; } return elementToReturn; end: @@ -987,10 +1005,10 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett } -// delete collection of Ingress +// delete collection of IPAddress // v1_status_t* -NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +NetworkingV1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -998,22 +1016,15 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses"); - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -1078,6 +1089,19 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1182,13 +1206,15 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1197,6 +1223,7 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1208,11 +1235,14 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1227,7 +1257,6 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -1293,6 +1322,18 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1396,10 +1437,10 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * } -// delete collection of NetworkPolicy +// delete collection of IngressClass // v1_status_t* -NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1407,22 +1448,15 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses"); - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -1487,6 +1521,19 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1591,13 +1638,15 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1606,6 +1655,7 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1617,11 +1667,14 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1636,7 +1689,6 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -1702,6 +1754,18 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1805,10 +1869,10 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, } -// delete an IngressClass +// delete collection of Ingress // v1_status_t* -NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1816,22 +1880,27 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingressclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingressclasses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { goto end; } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -1847,6 +1916,18 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + // query parameters char *keyQuery_dryRun = NULL; char * valueQuery_dryRun = NULL; @@ -1859,6 +1940,18 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + // query parameters char *keyQuery_gracePeriodSeconds = NULL; char * valueQuery_gracePeriodSeconds = NULL; @@ -1872,6 +1965,44 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1897,17 +2028,69 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); } + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + // Body Param cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1916,6 +2099,7 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1923,19 +2107,18 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1950,7 +2133,7 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace_name); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -1968,6 +2151,18 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } if(keyQuery_dryRun){ free(keyQuery_dryRun); keyQuery_dryRun = NULL; @@ -1980,6 +2175,18 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre keyValuePair_free(keyPairQuery_dryRun); keyPairQuery_dryRun = NULL; } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } if(keyQuery_gracePeriodSeconds){ free(keyQuery_gracePeriodSeconds); keyQuery_gracePeriodSeconds = NULL; @@ -1992,6 +2199,42 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -2016,6 +2259,54 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre keyValuePair_free(keyPairQuery_propagationPolicy); keyPairQuery_propagationPolicy = NULL; } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } return elementToReturn; end: free(localVarPath); @@ -2023,10 +2314,10 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre } -// delete an Ingress +// delete collection of NetworkPolicy // v1_status_t* -NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2034,25 +2325,20 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { + if(!_namespace) goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2076,17 +2362,41 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char } // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + // query parameters char *keyQuery_gracePeriodSeconds = NULL; char * valueQuery_gracePeriodSeconds = NULL; @@ -2100,6 +2410,44 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -2125,17 +2473,69 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); } + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + // Body Param cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2144,6 +2544,7 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2151,19 +2552,18 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2178,7 +2578,6 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace_name); free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); @@ -2197,6 +2596,18 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } if(keyQuery_dryRun){ free(keyQuery_dryRun); keyQuery_dryRun = NULL; @@ -2209,6 +2620,18 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char keyValuePair_free(keyPairQuery_dryRun); keyPairQuery_dryRun = NULL; } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } if(keyQuery_gracePeriodSeconds){ free(keyQuery_gracePeriodSeconds); keyQuery_gracePeriodSeconds = NULL; @@ -2221,6 +2644,42 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -2245,6 +2704,54 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char keyValuePair_free(keyPairQuery_propagationPolicy); keyPairQuery_propagationPolicy = NULL; } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } return elementToReturn; end: free(localVarPath); @@ -2252,10 +2759,10 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char } -// delete a NetworkPolicy +// delete collection of ServiceCIDR // v1_status_t* -NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +NetworkingV1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2263,32 +2770,15 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); + // clear the error code from the previous api call + apiClient->response_code = 0; - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs"); - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -2304,6 +2794,18 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + // query parameters char *keyQuery_dryRun = NULL; char * valueQuery_dryRun = NULL; @@ -2316,6 +2818,18 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + // query parameters char *keyQuery_gracePeriodSeconds = NULL; char * valueQuery_gracePeriodSeconds = NULL; @@ -2330,9 +2844,47 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name } // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; if (orphanDependents) { keyQuery_orphanDependents = strdup("orphanDependents"); @@ -2354,17 +2906,69 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); } + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + // Body Param cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2373,6 +2977,7 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2380,19 +2985,18 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2407,8 +3011,6 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -2426,6 +3028,18 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } if(keyQuery_dryRun){ free(keyQuery_dryRun); keyQuery_dryRun = NULL; @@ -2438,6 +3052,18 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name keyValuePair_free(keyPairQuery_dryRun); keyPairQuery_dryRun = NULL; } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } if(keyQuery_gracePeriodSeconds){ free(keyQuery_gracePeriodSeconds); keyQuery_gracePeriodSeconds = NULL; @@ -2450,6 +3076,42 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -2474,6 +3136,54 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name keyValuePair_free(keyPairQuery_propagationPolicy); keyPairQuery_propagationPolicy = NULL; } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } return elementToReturn; end: free(localVarPath); @@ -2481,90 +3191,38 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name } -// get available resources +// delete an IPAddress // -v1_api_resource_list_t* -NetworkingV1API_getAPIResources(apiClient_t *apiClient) +v1_status_t* +NetworkingV1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { - list_t *localVarQueryParameters = NULL; + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/"); - + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses/{name}"); - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); + if(!name) + goto end; - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind IngressClass -// -v1_ingress_class_list_t* -NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingressclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingressclasses"); + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); @@ -2581,134 +3239,81 @@ NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allo } // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); } // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); } // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); } - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2717,22 +3322,30 @@ NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allo localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "DELETE"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_class_list_t *elementToReturn = v1_ingress_class_list_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2747,6 +3360,12 @@ NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allo list_freeList(localVarHeaderType); free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -2759,125 +3378,65 @@ NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allo keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; } return elementToReturn; end: @@ -2886,10 +3445,10 @@ NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allo } -// list or watch objects of kind Ingress +// delete an IngressClass // -v1_ingress_list_t* -NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_status_t* +NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2897,76 +3456,29 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingresses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingresses"); - + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses/{name}"); + if(!name) + goto end; - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } // query parameters char *keyQuery_pretty = NULL; @@ -2981,72 +3493,81 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa } // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); } // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); } // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3055,22 +3576,30 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "DELETE"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_list_t *elementToReturn = v1_ingress_list_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3085,66 +3614,4546 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa list_freeList(localVarHeaderType); free(localVarPath); - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete an Ingress +// +v1_status_t* +NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a NetworkPolicy +// +v1_status_t* +NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ServiceCIDR +// +v1_status_t* +NetworkingV1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +NetworkingV1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind IPAddress +// +v1_ip_address_list_t* +NetworkingV1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ip_address_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ip_address_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind IngressClass +// +v1_ingress_class_list_t* +NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ingress_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_class_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind Ingress +// +v1_ingress_list_t* +NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingresses"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ingress_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind Ingress +// +v1_ingress_list_t* +NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ingress_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind NetworkPolicy +// +v1_network_policy_list_t* +NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_network_policy_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_network_policy_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind NetworkPolicy +// +v1_network_policy_list_t* +NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/networkpolicies"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_network_policy_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_network_policy_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ServiceCIDR +// +v1_service_cidr_list_t* +NetworkingV1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_service_cidr_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); keyPairQuery_fieldSelector = NULL; } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified IPAddress +// +v1_ip_address_t* +NetworkingV1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ip_address_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified IngressClass +// +v1_ingress_class_t* +NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ingress_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified Ingress +// +v1_ingress_t* +NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ingress_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update status of the specified Ingress +// +v1_ingress_t* +NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_ingress_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified NetworkPolicy +// +v1_network_policy_t* +NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_network_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -3157,65 +8166,53 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; } return elementToReturn; end: @@ -3224,33 +8221,38 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa } -// list or watch objects of kind Ingress +// partially update the specified ServiceCIDR // -v1_ingress_list_t* -NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_service_cidr_t* +NetworkingV1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { goto end; } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); @@ -3267,134 +8269,72 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, } // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); } // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); } // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); } - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3403,22 +8343,30 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PATCH"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_list_t *elementToReturn = v1_ingress_list_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3431,9 +8379,14 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, list_freeList(localVarHeaderType); - + list_freeList(localVarContentType); free(localVarPath); - free(localVarToReplace__namespace); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -3446,125 +8399,53 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; } return elementToReturn; end: @@ -3573,33 +8454,38 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, } -// list or watch objects of kind NetworkPolicy +// partially update status of the specified ServiceCIDR // -v1_network_policy_list_t* -NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_service_cidr_t* +NetworkingV1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { goto end; } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); @@ -3610,140 +8496,78 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names if (pretty) { keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); } // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); } // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); } // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); } // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); } - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3752,22 +8576,30 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PATCH"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_network_policy_list_t *elementToReturn = v1_network_policy_list_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3780,9 +8612,14 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names list_freeList(localVarHeaderType); - + list_freeList(localVarContentType); free(localVarPath); - free(localVarToReplace__namespace); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -3795,125 +8632,53 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; } return elementToReturn; end: @@ -3922,10 +8687,10 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names } -// list or watch objects of kind NetworkPolicy +// read the specified IPAddress // -v1_network_policy_list_t* -NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_ip_address_t* +NetworkingV1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3933,76 +8698,29 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/networkpolicies")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/networkpolicies"); - + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses/{name}"); + if(!name) + goto end; - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } // query parameters char *keyQuery_pretty = NULL; @@ -4015,74 +8733,10 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4091,6 +8745,7 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4102,11 +8757,14 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_network_policy_list_t *elementToReturn = v1_network_policy_list_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ip_address_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4121,66 +8779,7 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a list_freeList(localVarHeaderType); free(localVarPath); - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } + free(localVarToReplace_name); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -4193,66 +8792,6 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } return elementToReturn; end: free(localVarPath); @@ -4260,26 +8799,31 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a } -// partially update the specified IngressClass +// read the specified IngressClass // v1_ingress_class_t* -NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingressclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingressclasses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4301,71 +8845,10 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4374,26 +8857,26 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * localVarHeaderType, localVarContentType, localVarBodyParameters, - "PATCH"); + localVarBodyLength, + "GET"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_class_t *elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4406,14 +8889,9 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * list_freeList(localVarHeaderType); - list_freeList(localVarContentType); + free(localVarPath); free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -4426,54 +8904,6 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } return elementToReturn; end: free(localVarPath); @@ -4481,26 +8911,33 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * } -// partially update the specified Ingress +// read the specified Ingress // v1_ingress_t* -NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4510,7 +8947,7 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4532,71 +8969,10 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4605,26 +8981,26 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, - "PATCH"); + localVarBodyLength, + "GET"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_t *elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4637,74 +9013,21 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char list_freeList(localVarHeaderType); - list_freeList(localVarContentType); + free(localVarPath); free(localVarToReplace_name); free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } return elementToReturn; end: @@ -4713,26 +9036,33 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char } -// partially update status of the specified Ingress +// read status of the specified Ingress // v1_ingress_t* -NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4742,7 +9072,7 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4764,71 +9094,10 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4837,26 +9106,26 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, - "PATCH"); + localVarBodyLength, + "GET"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_t *elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4869,15 +9138,10 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, list_freeList(localVarHeaderType); - list_freeList(localVarContentType); + free(localVarPath); free(localVarToReplace_name); free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -4890,54 +9154,6 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } return elementToReturn; end: free(localVarPath); @@ -4945,26 +9161,33 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, } -// partially update the specified NetworkPolicy +// read the specified NetworkPolicy // v1_network_policy_t* -NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -4974,7 +9197,7 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4996,71 +9219,123 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_network_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } + return elementToReturn; +end: + free(localVarPath); + return NULL; - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); +} + +// read the specified ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5069,26 +9344,26 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, - "PATCH"); + localVarBodyLength, + "GET"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_network_policy_t *elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5101,15 +9376,9 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, list_freeList(localVarHeaderType); - list_freeList(localVarContentType); + free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -5122,54 +9391,6 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } return elementToReturn; end: free(localVarPath); @@ -5177,10 +9398,10 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, } -// read the specified IngressClass +// read status of the specified ServiceCIDR // -v1_ingress_class_t* -NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *pretty) +v1_service_cidr_t* +NetworkingV1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5188,15 +9409,20 @@ NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *prett list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingressclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingressclasses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5221,6 +9447,7 @@ NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *prett list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5229,6 +9456,7 @@ NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *prett localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5240,11 +9468,14 @@ NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *prett // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_class_t *elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5279,10 +9510,10 @@ NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *prett } -// read the specified Ingress +// replace the specified IPAddress // -v1_ingress_t* -NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_ip_address_t* +NetworkingV1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5290,15 +9521,20 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5307,16 +9543,6 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - // query parameters @@ -5330,9 +9556,56 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_ip_address_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5341,22 +9614,30 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_t *elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ip_address_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5372,7 +9653,11 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -5385,6 +9670,42 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } return elementToReturn; end: free(localVarPath); @@ -5392,10 +9713,10 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * } -// read status of the specified Ingress +// replace the specified IngressClass // -v1_ingress_t* -NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_ingress_class_t* +NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingress_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5403,49 +9724,91 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); + //not string, not binary + localVarSingleItemJSON_body = v1_ingress_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5454,22 +9817,30 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_t *elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5485,7 +9856,11 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -5498,6 +9873,42 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } return elementToReturn; end: free(localVarPath); @@ -5505,10 +9916,10 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, } -// read the specified NetworkPolicy +// replace the specified Ingress // -v1_network_policy_t* -NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_ingress_t* +NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, v1_ingress_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5516,15 +9927,22 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5534,7 +9952,7 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5556,9 +9974,56 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5567,22 +10032,30 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_network_policy_t *elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5599,6 +10072,11 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, free(localVarPath); free(localVarToReplace_name); free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -5611,6 +10089,42 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } return elementToReturn; end: free(localVarPath); @@ -5618,10 +10132,10 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, } -// replace the specified IngressClass +// replace status of the specified Ingress // -v1_ingress_class_t* -NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingress_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_ingress_t* +NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *name, char *_namespace, v1_ingress_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5629,15 +10143,22 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/ingressclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/ingressclasses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5646,6 +10167,16 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters @@ -5700,13 +10231,15 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_ingress_class_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5715,6 +10248,7 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5730,11 +10264,14 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_class_t *elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_ingress_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5750,6 +10287,7 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre free(localVarPath); free(localVarToReplace_name); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -5810,10 +10348,10 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre } -// replace the specified Ingress +// replace the specified NetworkPolicy // -v1_ingress_t* -NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, v1_ingress_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_network_policy_t* +NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, v1_network_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5821,15 +10359,22 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5839,7 +10384,7 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5902,13 +10447,15 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5917,6 +10464,7 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -5932,11 +10480,14 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_t *elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_network_policy_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6013,10 +10564,10 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha } -// replace status of the specified Ingress +// replace the specified ServiceCIDR // -v1_ingress_t* -NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *name, char *_namespace, v1_ingress_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_service_cidr_t* +NetworkingV1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -6024,15 +10575,20 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6041,16 +10597,6 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - // query parameters @@ -6105,13 +10651,15 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_service_cidr_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6120,6 +10668,7 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -6135,11 +10684,14 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_ingress_t *elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6155,7 +10707,6 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -6216,10 +10767,10 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam } -// replace the specified NetworkPolicy +// replace status of the specified ServiceCIDR // -v1_network_policy_t* -NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, v1_network_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_service_cidr_t* +NetworkingV1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -6227,15 +10778,20 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6244,16 +10800,6 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - // query parameters @@ -6308,13 +10854,15 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_service_cidr_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6323,6 +10871,7 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -6338,11 +10887,14 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_network_policy_t *elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); - cJSON_Delete(NetworkingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); + cJSON_Delete(NetworkingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6358,7 +10910,6 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; diff --git a/kubernetes/api/NetworkingV1API.h b/kubernetes/api/NetworkingV1API.h index 277e9a26..6a24e47f 100644 --- a/kubernetes/api/NetworkingV1API.h +++ b/kubernetes/api/NetworkingV1API.h @@ -12,11 +12,21 @@ #include "../model/v1_ingress_class.h" #include "../model/v1_ingress_class_list.h" #include "../model/v1_ingress_list.h" +#include "../model/v1_ip_address.h" +#include "../model/v1_ip_address_list.h" #include "../model/v1_network_policy.h" #include "../model/v1_network_policy_list.h" +#include "../model/v1_service_cidr.h" +#include "../model/v1_service_cidr_list.h" #include "../model/v1_status.h" +// create an IPAddress +// +v1_ip_address_t* +NetworkingV1API_createIPAddress(apiClient_t *apiClient, v1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + // create an IngressClass // v1_ingress_class_t* @@ -35,40 +45,70 @@ v1_network_policy_t* NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, v1_network_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// create a ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_createServiceCIDR(apiClient_t *apiClient, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of IPAddress +// +v1_status_t* +NetworkingV1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + // delete collection of IngressClass // v1_status_t* -NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Ingress // v1_status_t* -NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of NetworkPolicy // v1_status_t* -NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ServiceCIDR +// +v1_status_t* +NetworkingV1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete an IPAddress +// +v1_status_t* +NetworkingV1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete an IngressClass // v1_status_t* -NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete an Ingress // v1_status_t* -NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a NetworkPolicy // v1_status_t* -NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ServiceCIDR +// +v1_status_t* +NetworkingV1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources @@ -77,6 +117,12 @@ v1_api_resource_list_t* NetworkingV1API_getAPIResources(apiClient_t *apiClient); +// list or watch objects of kind IPAddress +// +v1_ip_address_list_t* +NetworkingV1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + // list or watch objects of kind IngressClass // v1_ingress_class_list_t* @@ -107,6 +153,18 @@ v1_network_policy_list_t* NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +// list or watch objects of kind ServiceCIDR +// +v1_service_cidr_list_t* +NetworkingV1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified IPAddress +// +v1_ip_address_t* +NetworkingV1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + // partially update the specified IngressClass // v1_ingress_class_t* @@ -131,6 +189,24 @@ v1_network_policy_t* NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +// partially update the specified ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update status of the specified ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified IPAddress +// +v1_ip_address_t* +NetworkingV1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty); + + // read the specified IngressClass // v1_ingress_class_t* @@ -155,6 +231,24 @@ v1_network_policy_t* NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +// read the specified ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty); + + +// read status of the specified ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified IPAddress +// +v1_ip_address_t* +NetworkingV1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + // replace the specified IngressClass // v1_ingress_class_t* @@ -179,3 +273,15 @@ v1_network_policy_t* NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, v1_network_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// replace the specified ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace status of the specified ServiceCIDR +// +v1_service_cidr_t* +NetworkingV1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/NetworkingV1alpha1API.c b/kubernetes/api/NetworkingV1alpha1API.c deleted file mode 100644 index f068e0dc..00000000 --- a/kubernetes/api/NetworkingV1alpha1API.c +++ /dev/null @@ -1,3904 +0,0 @@ -#include -#include -#include -#include "NetworkingV1alpha1API.h" - -#define MAX_NUMBER_LENGTH 16 -#define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) - - -// create an IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_createIPAddress(apiClient_t *apiClient, v1alpha1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/ipaddresses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/ipaddresses"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_ip_address_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_ip_address_t *elementToReturn = v1alpha1_ip_address_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create a ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_createServiceCIDR(apiClient_t *apiClient, v1alpha1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_service_cidr_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_t *elementToReturn = v1alpha1_service_cidr_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of IPAddress -// -v1_status_t* -NetworkingV1alpha1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/ipaddresses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/ipaddresses"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of ServiceCIDR -// -v1_status_t* -NetworkingV1alpha1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete an IPAddress -// -v1_status_t* -NetworkingV1alpha1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a ServiceCIDR -// -v1_status_t* -NetworkingV1alpha1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// get available resources -// -v1_api_resource_list_t* -NetworkingV1alpha1API_getAPIResources(apiClient_t *apiClient) -{ - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/"); - - - - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind IPAddress -// -v1alpha1_ip_address_list_t* -NetworkingV1alpha1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/ipaddresses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/ipaddresses"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_ip_address_list_t *elementToReturn = v1alpha1_ip_address_list_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ServiceCIDR -// -v1alpha1_service_cidr_list_t* -NetworkingV1alpha1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_list_t *elementToReturn = v1alpha1_service_cidr_list_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_ip_address_t *elementToReturn = v1alpha1_ip_address_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_t *elementToReturn = v1alpha1_service_cidr_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update status of the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_t *elementToReturn = v1alpha1_service_cidr_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_ip_address_t *elementToReturn = v1alpha1_ip_address_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_t *elementToReturn = v1alpha1_service_cidr_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read status of the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_t *elementToReturn = v1alpha1_service_cidr_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1alpha1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/ipaddresses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_ip_address_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_ip_address_t *elementToReturn = v1alpha1_ip_address_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1alpha1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_service_cidr_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_t *elementToReturn = v1alpha1_service_cidr_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace status of the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1alpha1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/networking.k8s.io/v1alpha1/servicecidrs/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha1_service_cidr_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *NetworkingV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_service_cidr_t *elementToReturn = v1alpha1_service_cidr_parseFromJSON(NetworkingV1alpha1APIlocalVarJSON); - cJSON_Delete(NetworkingV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - diff --git a/kubernetes/api/NetworkingV1alpha1API.h b/kubernetes/api/NetworkingV1alpha1API.h deleted file mode 100644 index 18132b86..00000000 --- a/kubernetes/api/NetworkingV1alpha1API.h +++ /dev/null @@ -1,125 +0,0 @@ -#include -#include -#include "../include/apiClient.h" -#include "../include/list.h" -#include "../external/cJSON.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "../model/object.h" -#include "../model/v1_api_resource_list.h" -#include "../model/v1_delete_options.h" -#include "../model/v1_status.h" -#include "../model/v1alpha1_ip_address.h" -#include "../model/v1alpha1_ip_address_list.h" -#include "../model/v1alpha1_service_cidr.h" -#include "../model/v1alpha1_service_cidr_list.h" - - -// create an IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_createIPAddress(apiClient_t *apiClient, v1alpha1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create a ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_createServiceCIDR(apiClient_t *apiClient, v1alpha1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// delete collection of IPAddress -// -v1_status_t* -NetworkingV1alpha1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of ServiceCIDR -// -v1_status_t* -NetworkingV1alpha1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete an IPAddress -// -v1_status_t* -NetworkingV1alpha1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete a ServiceCIDR -// -v1_status_t* -NetworkingV1alpha1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// get available resources -// -v1_api_resource_list_t* -NetworkingV1alpha1API_getAPIResources(apiClient_t *apiClient); - - -// list or watch objects of kind IPAddress -// -v1alpha1_ip_address_list_t* -NetworkingV1alpha1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ServiceCIDR -// -v1alpha1_service_cidr_list_t* -NetworkingV1alpha1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// partially update the specified IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update status of the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// read the specified IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty); - - -// read the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty); - - -// read status of the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty); - - -// replace the specified IPAddress -// -v1alpha1_ip_address_t* -NetworkingV1alpha1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1alpha1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1alpha1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace status of the specified ServiceCIDR -// -v1alpha1_service_cidr_t* -NetworkingV1alpha1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1alpha1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - diff --git a/kubernetes/api/NetworkingV1beta1API.c b/kubernetes/api/NetworkingV1beta1API.c new file mode 100644 index 00000000..5804e75c --- /dev/null +++ b/kubernetes/api/NetworkingV1beta1API.c @@ -0,0 +1,4184 @@ +#include +#include +#include + +#include "NetworkingV1beta1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create an IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_createIPAddress(apiClient_t *apiClient, v1beta1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/ipaddresses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_ip_address_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_ip_address_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_createServiceCIDR(apiClient_t *apiClient, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_service_cidr_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of IPAddress +// +v1_status_t* +NetworkingV1beta1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/ipaddresses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ServiceCIDR +// +v1_status_t* +NetworkingV1beta1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete an IPAddress +// +v1_status_t* +NetworkingV1beta1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/ipaddresses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ServiceCIDR +// +v1_status_t* +NetworkingV1beta1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +NetworkingV1beta1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind IPAddress +// +v1beta1_ip_address_list_t* +NetworkingV1beta1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/ipaddresses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_ip_address_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_ip_address_list_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ServiceCIDR +// +v1beta1_service_cidr_list_t* +NetworkingV1beta1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_list_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/ipaddresses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_ip_address_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update status of the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/ipaddresses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_ip_address_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read status of the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1beta1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/ipaddresses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_ip_address_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_ip_address_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_ip_address_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_service_cidr_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace status of the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_service_cidr_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_service_cidr_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NetworkingV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_service_cidr_parseFromJSON(NetworkingV1beta1APIlocalVarJSON); + cJSON_Delete(NetworkingV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/NetworkingV1beta1API.h b/kubernetes/api/NetworkingV1beta1API.h new file mode 100644 index 00000000..6125501b --- /dev/null +++ b/kubernetes/api/NetworkingV1beta1API.h @@ -0,0 +1,125 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1beta1_ip_address.h" +#include "../model/v1beta1_ip_address_list.h" +#include "../model/v1beta1_service_cidr.h" +#include "../model/v1beta1_service_cidr_list.h" + + +// create an IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_createIPAddress(apiClient_t *apiClient, v1beta1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_createServiceCIDR(apiClient_t *apiClient, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of IPAddress +// +v1_status_t* +NetworkingV1beta1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ServiceCIDR +// +v1_status_t* +NetworkingV1beta1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete an IPAddress +// +v1_status_t* +NetworkingV1beta1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ServiceCIDR +// +v1_status_t* +NetworkingV1beta1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +NetworkingV1beta1API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind IPAddress +// +v1beta1_ip_address_list_t* +NetworkingV1beta1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ServiceCIDR +// +v1beta1_service_cidr_list_t* +NetworkingV1beta1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update status of the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty); + + +// read the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty); + + +// read status of the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified IPAddress +// +v1beta1_ip_address_t* +NetworkingV1beta1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1beta1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace status of the specified ServiceCIDR +// +v1beta1_service_cidr_t* +NetworkingV1beta1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/NodeAPI.c b/kubernetes/api/NodeAPI.c index d0b58d33..245a035d 100644 --- a/kubernetes/api/NodeAPI.c +++ b/kubernetes/api/NodeAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "NodeAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ NodeAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/"); + char *localVarPath = strdup("/apis/node.k8s.io/"); + @@ -42,6 +42,7 @@ NodeAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ NodeAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(NodeAPIlocalVarJSON); - cJSON_Delete(NodeAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(NodeAPIlocalVarJSON); + cJSON_Delete(NodeAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/NodeV1API.c b/kubernetes/api/NodeV1API.c index 31598a81..10fe6d45 100644 --- a/kubernetes/api/NodeV1API.c +++ b/kubernetes/api/NodeV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "NodeV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a RuntimeClass @@ -23,11 +20,14 @@ NodeV1API_createRuntimeClass(apiClient_t *apiClient, v1_runtime_class_t *body, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/runtimeclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/runtimeclasses"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/runtimeclasses"); + @@ -84,13 +84,15 @@ NodeV1API_createRuntimeClass(apiClient_t *apiClient, v1_runtime_class_t *body, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_runtime_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ NodeV1API_createRuntimeClass(apiClient_t *apiClient, v1_runtime_class_t *body, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ NodeV1API_createRuntimeClass(apiClient_t *apiClient, v1_runtime_class_t *body, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_runtime_class_t *elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_runtime_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ NodeV1API_createRuntimeClass(apiClient_t *apiClient, v1_runtime_class_t *body, c // delete collection of RuntimeClass // v1_status_t* -NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/runtimeclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/runtimeclasses"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/runtimeclasses"); + @@ -278,6 +287,19 @@ NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, cha list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -382,13 +404,15 @@ NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -397,6 +421,7 @@ NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -408,11 +433,14 @@ NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -492,6 +520,18 @@ NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, cha keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -598,7 +638,7 @@ NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, cha // delete a RuntimeClass // v1_status_t* -NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -606,15 +646,20 @@ NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/runtimeclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/runtimeclasses/{name}"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/runtimeclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -662,6 +707,19 @@ NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, c list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -691,13 +749,15 @@ NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -706,6 +766,7 @@ NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -721,11 +782,14 @@ NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -782,6 +846,18 @@ NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, c keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -824,17 +900,21 @@ NodeV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ NodeV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ NodeV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ NodeV1API_listRuntimeClass(apiClient_t *apiClient, char *pretty, int *allowWatch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/runtimeclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/runtimeclasses"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/runtimeclasses"); + @@ -1039,8 +1126,10 @@ NodeV1API_listRuntimeClass(apiClient_t *apiClient, char *pretty, int *allowWatch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ NodeV1API_listRuntimeClass(apiClient_t *apiClient, char *pretty, int *allowWatch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ NodeV1API_listRuntimeClass(apiClient_t *apiClient, char *pretty, int *allowWatch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_runtime_class_list_t *elementToReturn = v1_runtime_class_list_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_runtime_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_runtime_class_list_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ NodeV1API_patchRuntimeClass(apiClient_t *apiClient, char *name, object_t *body, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/runtimeclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/runtimeclasses/{name}"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/runtimeclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ NodeV1API_patchRuntimeClass(apiClient_t *apiClient, char *name, object_t *body, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ NodeV1API_patchRuntimeClass(apiClient_t *apiClient, char *name, object_t *body, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ NodeV1API_patchRuntimeClass(apiClient_t *apiClient, char *name, object_t *body, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_runtime_class_t *elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_runtime_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ NodeV1API_readRuntimeClass(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/runtimeclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/runtimeclasses/{name}"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/runtimeclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1483,6 +1593,7 @@ NodeV1API_readRuntimeClass(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1491,6 +1602,7 @@ NodeV1API_readRuntimeClass(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1502,11 +1614,14 @@ NodeV1API_readRuntimeClass(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_runtime_class_t *elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_runtime_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1552,15 +1667,20 @@ NodeV1API_replaceRuntimeClass(apiClient_t *apiClient, char *name, v1_runtime_cla list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/node.k8s.io/v1/runtimeclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/node.k8s.io/v1/runtimeclasses/{name}"); + char *localVarPath = strdup("/apis/node.k8s.io/v1/runtimeclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1623,13 +1743,15 @@ NodeV1API_replaceRuntimeClass(apiClient_t *apiClient, char *name, v1_runtime_cla cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_runtime_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1638,6 +1760,7 @@ NodeV1API_replaceRuntimeClass(apiClient_t *apiClient, char *name, v1_runtime_cla localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1653,11 +1776,14 @@ NodeV1API_replaceRuntimeClass(apiClient_t *apiClient, char *name, v1_runtime_cla // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_runtime_class_t *elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); - cJSON_Delete(NodeV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_runtime_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *NodeV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_runtime_class_parseFromJSON(NodeV1APIlocalVarJSON); + cJSON_Delete(NodeV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/NodeV1API.h b/kubernetes/api/NodeV1API.h index 131acb91..ce6926e2 100644 --- a/kubernetes/api/NodeV1API.h +++ b/kubernetes/api/NodeV1API.h @@ -22,13 +22,13 @@ NodeV1API_createRuntimeClass(apiClient_t *apiClient, v1_runtime_class_t *body, c // delete collection of RuntimeClass // v1_status_t* -NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a RuntimeClass // v1_status_t* -NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/OpenidAPI.c b/kubernetes/api/OpenidAPI.c index a577390d..6fc55069 100644 --- a/kubernetes/api/OpenidAPI.c +++ b/kubernetes/api/OpenidAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "OpenidAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get service account issuer OpenID JSON Web Key Set (contains public token verification keys) @@ -23,11 +20,14 @@ OpenidAPI_getServiceAccountIssuerOpenIDKeyset(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/openid/v1/jwks")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/openid/v1/jwks"); + char *localVarPath = strdup("/openid/v1/jwks"); + @@ -40,6 +40,7 @@ OpenidAPI_getServiceAccountIssuerOpenIDKeyset(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -50,8 +51,10 @@ OpenidAPI_getServiceAccountIssuerOpenIDKeyset(apiClient_t *apiClient) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); diff --git a/kubernetes/api/PolicyAPI.c b/kubernetes/api/PolicyAPI.c index 58c25558..afd14df6 100644 --- a/kubernetes/api/PolicyAPI.c +++ b/kubernetes/api/PolicyAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "PolicyAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ PolicyAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/"); + char *localVarPath = strdup("/apis/policy/"); + @@ -42,6 +42,7 @@ PolicyAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ PolicyAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(PolicyAPIlocalVarJSON); - cJSON_Delete(PolicyAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(PolicyAPIlocalVarJSON); + cJSON_Delete(PolicyAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/PolicyV1API.c b/kubernetes/api/PolicyV1API.c index 87ddbffc..2cf56aab 100644 --- a/kubernetes/api/PolicyV1API.c +++ b/kubernetes/api/PolicyV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "PolicyV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a PodDisruptionBudget @@ -23,15 +20,20 @@ PolicyV1API_createNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -94,13 +96,15 @@ PolicyV1API_createNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_disruption_budget_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -109,6 +113,7 @@ PolicyV1API_createNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -128,11 +133,14 @@ PolicyV1API_createNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_t *elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -211,7 +219,7 @@ PolicyV1API_createNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_n // delete collection of PodDisruptionBudget // v1_status_t* -PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -219,15 +227,20 @@ PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -299,6 +312,19 @@ PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -403,13 +429,15 @@ PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -418,6 +446,7 @@ PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -429,11 +458,14 @@ PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -514,6 +546,18 @@ PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -620,7 +664,7 @@ PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient // delete a PodDisruptionBudget // v1_status_t* -PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -628,15 +672,22 @@ PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -646,7 +697,7 @@ PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *na localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -694,6 +745,19 @@ PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -723,13 +787,15 @@ PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -738,6 +804,7 @@ PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -753,11 +820,14 @@ PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -815,6 +885,18 @@ PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -857,17 +939,21 @@ PolicyV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/"); + char *localVarPath = strdup("/apis/policy/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -876,6 +962,7 @@ PolicyV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -887,11 +974,14 @@ PolicyV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -924,15 +1014,20 @@ PolicyV1API_listNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1082,8 +1177,10 @@ PolicyV1API_listNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1092,6 +1189,7 @@ PolicyV1API_listNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1103,11 +1201,14 @@ PolicyV1API_listNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_list_t *elementToReturn = v1_pod_disruption_budget_list_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_list_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1273,11 +1374,14 @@ PolicyV1API_listPodDisruptionBudgetForAllNamespaces(apiClient_t *apiClient, int list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/poddisruptionbudgets")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/poddisruptionbudgets"); + char *localVarPath = strdup("/apis/policy/v1/poddisruptionbudgets"); + @@ -1421,8 +1525,10 @@ PolicyV1API_listPodDisruptionBudgetForAllNamespaces(apiClient_t *apiClient, int list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1431,6 +1537,7 @@ PolicyV1API_listPodDisruptionBudgetForAllNamespaces(apiClient_t *apiClient, int localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1442,11 +1549,14 @@ PolicyV1API_listPodDisruptionBudgetForAllNamespaces(apiClient_t *apiClient, int // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_list_t *elementToReturn = v1_pod_disruption_budget_list_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_list_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1611,15 +1721,22 @@ PolicyV1API_patchNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1629,7 +1746,7 @@ PolicyV1API_patchNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1705,17 +1822,20 @@ PolicyV1API_patchNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1724,6 +1844,7 @@ PolicyV1API_patchNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1739,11 +1860,14 @@ PolicyV1API_patchNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_t *elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1843,15 +1967,22 @@ PolicyV1API_patchNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1861,7 +1992,7 @@ PolicyV1API_patchNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, cha localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -1937,17 +2068,20 @@ PolicyV1API_patchNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1956,6 +2090,7 @@ PolicyV1API_patchNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1971,11 +2106,14 @@ PolicyV1API_patchNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_t *elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2075,15 +2213,22 @@ PolicyV1API_readNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2093,7 +2238,7 @@ PolicyV1API_readNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2118,6 +2263,7 @@ PolicyV1API_readNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2126,6 +2272,7 @@ PolicyV1API_readNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2137,11 +2284,14 @@ PolicyV1API_readNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_t *elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2188,15 +2338,22 @@ PolicyV1API_readNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2206,7 +2363,7 @@ PolicyV1API_readNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2231,6 +2388,7 @@ PolicyV1API_readNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2239,6 +2397,7 @@ PolicyV1API_readNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -2250,11 +2409,14 @@ PolicyV1API_readNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_t *elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2301,15 +2463,22 @@ PolicyV1API_replaceNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2319,7 +2488,7 @@ PolicyV1API_replaceNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2382,13 +2551,15 @@ PolicyV1API_replaceNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_disruption_budget_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2397,6 +2568,7 @@ PolicyV1API_replaceNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2412,11 +2584,14 @@ PolicyV1API_replaceNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_t *elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2504,15 +2679,22 @@ PolicyV1API_replaceNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status"); + char *localVarPath = strdup("/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2522,7 +2704,7 @@ PolicyV1API_replaceNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2585,13 +2767,15 @@ PolicyV1API_replaceNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_pod_disruption_budget_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2600,6 +2784,7 @@ PolicyV1API_replaceNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2615,11 +2800,14 @@ PolicyV1API_replaceNamespacedPodDisruptionBudgetStatus(apiClient_t *apiClient, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_pod_disruption_budget_t *elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); - cJSON_Delete(PolicyV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_pod_disruption_budget_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *PolicyV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_pod_disruption_budget_parseFromJSON(PolicyV1APIlocalVarJSON); + cJSON_Delete(PolicyV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/PolicyV1API.h b/kubernetes/api/PolicyV1API.h index 594006a5..cd32157b 100644 --- a/kubernetes/api/PolicyV1API.h +++ b/kubernetes/api/PolicyV1API.h @@ -22,13 +22,13 @@ PolicyV1API_createNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_n // delete collection of PodDisruptionBudget // v1_status_t* -PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a PodDisruptionBudget // v1_status_t* -PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/RbacAuthorizationAPI.c b/kubernetes/api/RbacAuthorizationAPI.c index 52d945ba..22800dff 100644 --- a/kubernetes/api/RbacAuthorizationAPI.c +++ b/kubernetes/api/RbacAuthorizationAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "RbacAuthorizationAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ RbacAuthorizationAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/"); + @@ -42,6 +42,7 @@ RbacAuthorizationAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ RbacAuthorizationAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(RbacAuthorizationAPIlocalVarJSON); - cJSON_Delete(RbacAuthorizationAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(RbacAuthorizationAPIlocalVarJSON); + cJSON_Delete(RbacAuthorizationAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/RbacAuthorizationV1API.c b/kubernetes/api/RbacAuthorizationV1API.c index 375408e0..a44ff75e 100644 --- a/kubernetes/api/RbacAuthorizationV1API.c +++ b/kubernetes/api/RbacAuthorizationV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "RbacAuthorizationV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a ClusterRole @@ -23,11 +20,14 @@ RbacAuthorizationV1API_createClusterRole(apiClient_t *apiClient, v1_cluster_role list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterroles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterroles"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterroles"); + @@ -84,13 +84,15 @@ RbacAuthorizationV1API_createClusterRole(apiClient_t *apiClient, v1_cluster_role cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_cluster_role_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ RbacAuthorizationV1API_createClusterRole(apiClient_t *apiClient, v1_cluster_role localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ RbacAuthorizationV1API_createClusterRole(apiClient_t *apiClient, v1_cluster_role // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_t *elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -208,11 +214,14 @@ RbacAuthorizationV1API_createClusterRoleBinding(apiClient_t *apiClient, v1_clust list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"); + @@ -269,13 +278,15 @@ RbacAuthorizationV1API_createClusterRoleBinding(apiClient_t *apiClient, v1_clust cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_cluster_role_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -284,6 +295,7 @@ RbacAuthorizationV1API_createClusterRoleBinding(apiClient_t *apiClient, v1_clust localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -303,11 +315,14 @@ RbacAuthorizationV1API_createClusterRoleBinding(apiClient_t *apiClient, v1_clust // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_binding_t *elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -393,15 +408,20 @@ RbacAuthorizationV1API_createNamespacedRole(apiClient_t *apiClient, char *_names list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -464,13 +484,15 @@ RbacAuthorizationV1API_createNamespacedRole(apiClient_t *apiClient, char *_names cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_role_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -479,6 +501,7 @@ RbacAuthorizationV1API_createNamespacedRole(apiClient_t *apiClient, char *_names localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -498,11 +521,14 @@ RbacAuthorizationV1API_createNamespacedRole(apiClient_t *apiClient, char *_names // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_t *elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -589,15 +615,20 @@ RbacAuthorizationV1API_createNamespacedRoleBinding(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -660,13 +691,15 @@ RbacAuthorizationV1API_createNamespacedRoleBinding(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_role_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -675,6 +708,7 @@ RbacAuthorizationV1API_createNamespacedRoleBinding(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -694,11 +728,14 @@ RbacAuthorizationV1API_createNamespacedRoleBinding(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_binding_t *elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -777,7 +814,7 @@ RbacAuthorizationV1API_createNamespacedRoleBinding(apiClient_t *apiClient, char // delete a ClusterRole // v1_status_t* -RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -785,15 +822,20 @@ RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -841,6 +883,19 @@ RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, cha list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -870,13 +925,15 @@ RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -885,6 +942,7 @@ RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -900,11 +958,14 @@ RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -961,6 +1022,18 @@ RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, cha keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -995,7 +1068,7 @@ RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, cha // delete a ClusterRoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1003,15 +1076,20 @@ RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1059,6 +1137,19 @@ RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1088,13 +1179,15 @@ RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1103,6 +1196,7 @@ RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1118,11 +1212,14 @@ RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1179,6 +1276,18 @@ RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1213,7 +1322,7 @@ RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *na // delete collection of ClusterRole // v1_status_t* -RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1221,11 +1330,14 @@ RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterroles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterroles"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterroles"); + @@ -1291,6 +1403,19 @@ RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1395,13 +1520,15 @@ RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1410,6 +1537,7 @@ RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1421,11 +1549,14 @@ RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1505,6 +1636,18 @@ RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1611,7 +1754,7 @@ RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char // delete collection of ClusterRoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1619,11 +1762,14 @@ RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"); + @@ -1689,6 +1835,19 @@ RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1793,13 +1952,15 @@ RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1808,6 +1969,7 @@ RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1819,11 +1981,14 @@ RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1903,6 +2068,18 @@ RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2009,7 +2186,7 @@ RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient // delete collection of Role // v1_status_t* -RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2017,15 +2194,20 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2097,6 +2279,19 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, ch list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2201,13 +2396,15 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2216,6 +2413,7 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2227,11 +2425,14 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2312,6 +2513,18 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, ch keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2418,7 +2631,7 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, ch // delete collection of RoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2426,15 +2639,20 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiCli list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2506,6 +2724,19 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiCli list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2610,13 +2841,15 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiCli cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2625,6 +2858,7 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiCli localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2636,11 +2870,14 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiCli // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2721,6 +2958,18 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiCli keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2827,7 +3076,7 @@ RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiCli // delete a Role // v1_status_t* -RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2835,15 +3084,22 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2853,7 +3109,7 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2901,6 +3157,19 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -2930,13 +3199,15 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2945,6 +3216,7 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2960,11 +3232,14 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3022,6 +3297,18 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3056,7 +3343,7 @@ RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, // delete a RoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3064,15 +3351,22 @@ RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3082,7 +3376,7 @@ RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -3130,6 +3424,19 @@ RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3159,13 +3466,15 @@ RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3174,6 +3483,7 @@ RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3189,11 +3499,14 @@ RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3251,6 +3564,18 @@ RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3293,17 +3618,21 @@ RbacAuthorizationV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3312,6 +3641,7 @@ RbacAuthorizationV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3323,11 +3653,14 @@ RbacAuthorizationV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3360,11 +3693,14 @@ RbacAuthorizationV1API_listClusterRole(apiClient_t *apiClient, char *pretty, int list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterroles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterroles"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterroles"); + @@ -3508,8 +3844,10 @@ RbacAuthorizationV1API_listClusterRole(apiClient_t *apiClient, char *pretty, int list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3518,6 +3856,7 @@ RbacAuthorizationV1API_listClusterRole(apiClient_t *apiClient, char *pretty, int localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3529,11 +3868,14 @@ RbacAuthorizationV1API_listClusterRole(apiClient_t *apiClient, char *pretty, int // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_list_t *elementToReturn = v1_cluster_role_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3698,11 +4040,14 @@ RbacAuthorizationV1API_listClusterRoleBinding(apiClient_t *apiClient, char *pret list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"); + @@ -3846,8 +4191,10 @@ RbacAuthorizationV1API_listClusterRoleBinding(apiClient_t *apiClient, char *pret list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3856,6 +4203,7 @@ RbacAuthorizationV1API_listClusterRoleBinding(apiClient_t *apiClient, char *pret localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -3867,11 +4215,14 @@ RbacAuthorizationV1API_listClusterRoleBinding(apiClient_t *apiClient, char *pret // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_binding_list_t *elementToReturn = v1_cluster_role_binding_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_binding_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_binding_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4036,15 +4387,20 @@ RbacAuthorizationV1API_listNamespacedRole(apiClient_t *apiClient, char *_namespa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4194,8 +4550,10 @@ RbacAuthorizationV1API_listNamespacedRole(apiClient_t *apiClient, char *_namespa list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4204,6 +4562,7 @@ RbacAuthorizationV1API_listNamespacedRole(apiClient_t *apiClient, char *_namespa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4215,11 +4574,14 @@ RbacAuthorizationV1API_listNamespacedRole(apiClient_t *apiClient, char *_namespa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_list_t *elementToReturn = v1_role_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4385,15 +4747,20 @@ RbacAuthorizationV1API_listNamespacedRoleBinding(apiClient_t *apiClient, char *_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -4543,8 +4910,10 @@ RbacAuthorizationV1API_listNamespacedRoleBinding(apiClient_t *apiClient, char *_ list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4553,6 +4922,7 @@ RbacAuthorizationV1API_listNamespacedRoleBinding(apiClient_t *apiClient, char *_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4564,11 +4934,14 @@ RbacAuthorizationV1API_listNamespacedRoleBinding(apiClient_t *apiClient, char *_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_binding_list_t *elementToReturn = v1_role_binding_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_binding_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_binding_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4734,11 +5107,14 @@ RbacAuthorizationV1API_listRoleBindingForAllNamespaces(apiClient_t *apiClient, i list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/rolebindings")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/rolebindings"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/rolebindings"); + @@ -4882,8 +5258,10 @@ RbacAuthorizationV1API_listRoleBindingForAllNamespaces(apiClient_t *apiClient, i list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4892,6 +5270,7 @@ RbacAuthorizationV1API_listRoleBindingForAllNamespaces(apiClient_t *apiClient, i localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4903,11 +5282,14 @@ RbacAuthorizationV1API_listRoleBindingForAllNamespaces(apiClient_t *apiClient, i // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_binding_list_t *elementToReturn = v1_role_binding_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_binding_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_binding_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5072,11 +5454,14 @@ RbacAuthorizationV1API_listRoleForAllNamespaces(apiClient_t *apiClient, int *all list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/roles")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/roles"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/roles"); + @@ -5220,8 +5605,10 @@ RbacAuthorizationV1API_listRoleForAllNamespaces(apiClient_t *apiClient, int *all list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5230,6 +5617,7 @@ RbacAuthorizationV1API_listRoleForAllNamespaces(apiClient_t *apiClient, int *all localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5241,11 +5629,14 @@ RbacAuthorizationV1API_listRoleForAllNamespaces(apiClient_t *apiClient, int *all // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_list_t *elementToReturn = v1_role_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_list_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5410,15 +5801,20 @@ RbacAuthorizationV1API_patchClusterRole(apiClient_t *apiClient, char *name, obje list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5494,17 +5890,20 @@ RbacAuthorizationV1API_patchClusterRole(apiClient_t *apiClient, char *name, obje cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5513,6 +5912,7 @@ RbacAuthorizationV1API_patchClusterRole(apiClient_t *apiClient, char *name, obje localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -5528,11 +5928,14 @@ RbacAuthorizationV1API_patchClusterRole(apiClient_t *apiClient, char *name, obje // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_t *elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5631,15 +6034,20 @@ RbacAuthorizationV1API_patchClusterRoleBinding(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5715,17 +6123,20 @@ RbacAuthorizationV1API_patchClusterRoleBinding(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5734,6 +6145,7 @@ RbacAuthorizationV1API_patchClusterRoleBinding(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -5749,11 +6161,14 @@ RbacAuthorizationV1API_patchClusterRoleBinding(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_binding_t *elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5852,15 +6267,22 @@ RbacAuthorizationV1API_patchNamespacedRole(apiClient_t *apiClient, char *name, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5870,7 +6292,7 @@ RbacAuthorizationV1API_patchNamespacedRole(apiClient_t *apiClient, char *name, c localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -5946,17 +6368,20 @@ RbacAuthorizationV1API_patchNamespacedRole(apiClient_t *apiClient, char *name, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5965,6 +6390,7 @@ RbacAuthorizationV1API_patchNamespacedRole(apiClient_t *apiClient, char *name, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -5980,11 +6406,14 @@ RbacAuthorizationV1API_patchNamespacedRole(apiClient_t *apiClient, char *name, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_t *elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6084,15 +6513,22 @@ RbacAuthorizationV1API_patchNamespacedRoleBinding(apiClient_t *apiClient, char * list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6102,7 +6538,7 @@ RbacAuthorizationV1API_patchNamespacedRoleBinding(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6178,17 +6614,20 @@ RbacAuthorizationV1API_patchNamespacedRoleBinding(apiClient_t *apiClient, char * cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6197,6 +6636,7 @@ RbacAuthorizationV1API_patchNamespacedRoleBinding(apiClient_t *apiClient, char * localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -6212,11 +6652,14 @@ RbacAuthorizationV1API_patchNamespacedRoleBinding(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_binding_t *elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6316,15 +6759,20 @@ RbacAuthorizationV1API_readClusterRole(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6349,6 +6797,7 @@ RbacAuthorizationV1API_readClusterRole(apiClient_t *apiClient, char *name, char list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6357,6 +6806,7 @@ RbacAuthorizationV1API_readClusterRole(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6368,11 +6818,14 @@ RbacAuthorizationV1API_readClusterRole(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_t *elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6418,15 +6871,20 @@ RbacAuthorizationV1API_readClusterRoleBinding(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6451,6 +6909,7 @@ RbacAuthorizationV1API_readClusterRoleBinding(apiClient_t *apiClient, char *name list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6459,6 +6918,7 @@ RbacAuthorizationV1API_readClusterRoleBinding(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6470,11 +6930,14 @@ RbacAuthorizationV1API_readClusterRoleBinding(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_binding_t *elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6520,15 +6983,22 @@ RbacAuthorizationV1API_readNamespacedRole(apiClient_t *apiClient, char *name, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6538,7 +7008,7 @@ RbacAuthorizationV1API_readNamespacedRole(apiClient_t *apiClient, char *name, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6563,6 +7033,7 @@ RbacAuthorizationV1API_readNamespacedRole(apiClient_t *apiClient, char *name, ch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6571,6 +7042,7 @@ RbacAuthorizationV1API_readNamespacedRole(apiClient_t *apiClient, char *name, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6582,11 +7054,14 @@ RbacAuthorizationV1API_readNamespacedRole(apiClient_t *apiClient, char *name, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_t *elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6633,15 +7108,22 @@ RbacAuthorizationV1API_readNamespacedRoleBinding(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6651,7 +7133,7 @@ RbacAuthorizationV1API_readNamespacedRoleBinding(apiClient_t *apiClient, char *n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -6676,6 +7158,7 @@ RbacAuthorizationV1API_readNamespacedRoleBinding(apiClient_t *apiClient, char *n list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6684,6 +7167,7 @@ RbacAuthorizationV1API_readNamespacedRoleBinding(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -6695,11 +7179,14 @@ RbacAuthorizationV1API_readNamespacedRoleBinding(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_binding_t *elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6746,15 +7233,20 @@ RbacAuthorizationV1API_replaceClusterRole(apiClient_t *apiClient, char *name, v1 list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6817,13 +7309,15 @@ RbacAuthorizationV1API_replaceClusterRole(apiClient_t *apiClient, char *name, v1 cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_cluster_role_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6832,6 +7326,7 @@ RbacAuthorizationV1API_replaceClusterRole(apiClient_t *apiClient, char *name, v1 localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -6847,11 +7342,14 @@ RbacAuthorizationV1API_replaceClusterRole(apiClient_t *apiClient, char *name, v1 // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_t *elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6938,15 +7436,20 @@ RbacAuthorizationV1API_replaceClusterRoleBinding(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7009,13 +7512,15 @@ RbacAuthorizationV1API_replaceClusterRoleBinding(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_cluster_role_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7024,6 +7529,7 @@ RbacAuthorizationV1API_replaceClusterRoleBinding(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -7039,11 +7545,14 @@ RbacAuthorizationV1API_replaceClusterRoleBinding(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_cluster_role_binding_t *elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_cluster_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_cluster_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7130,15 +7639,22 @@ RbacAuthorizationV1API_replaceNamespacedRole(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7148,7 +7664,7 @@ RbacAuthorizationV1API_replaceNamespacedRole(apiClient_t *apiClient, char *name, localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7211,13 +7727,15 @@ RbacAuthorizationV1API_replaceNamespacedRole(apiClient_t *apiClient, char *name, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_role_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7226,6 +7744,7 @@ RbacAuthorizationV1API_replaceNamespacedRole(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -7241,11 +7760,14 @@ RbacAuthorizationV1API_replaceNamespacedRole(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_t *elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7333,15 +7855,22 @@ RbacAuthorizationV1API_replaceNamespacedRoleBinding(apiClient_t *apiClient, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + char *localVarPath = strdup("/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7351,7 +7880,7 @@ RbacAuthorizationV1API_replaceNamespacedRoleBinding(apiClient_t *apiClient, char localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -7414,13 +7943,15 @@ RbacAuthorizationV1API_replaceNamespacedRoleBinding(apiClient_t *apiClient, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_role_binding_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7429,6 +7960,7 @@ RbacAuthorizationV1API_replaceNamespacedRoleBinding(apiClient_t *apiClient, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -7444,11 +7976,14 @@ RbacAuthorizationV1API_replaceNamespacedRoleBinding(apiClient_t *apiClient, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_role_binding_t *elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); - cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_role_binding_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *RbacAuthorizationV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_role_binding_parseFromJSON(RbacAuthorizationV1APIlocalVarJSON); + cJSON_Delete(RbacAuthorizationV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/RbacAuthorizationV1API.h b/kubernetes/api/RbacAuthorizationV1API.h index ed439fe0..b4459f9c 100644 --- a/kubernetes/api/RbacAuthorizationV1API.h +++ b/kubernetes/api/RbacAuthorizationV1API.h @@ -46,49 +46,49 @@ RbacAuthorizationV1API_createNamespacedRoleBinding(apiClient_t *apiClient, char // delete a ClusterRole // v1_status_t* -RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a ClusterRoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete collection of ClusterRole // v1_status_t* -RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of ClusterRoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of Role // v1_status_t* -RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of RoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a Role // v1_status_t* -RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a RoleBinding // v1_status_t* -RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/ResourceAPI.c b/kubernetes/api/ResourceAPI.c index dd4ed7e1..b2d985cc 100644 --- a/kubernetes/api/ResourceAPI.c +++ b/kubernetes/api/ResourceAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "ResourceAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ ResourceAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/"); + char *localVarPath = strdup("/apis/resource.k8s.io/"); + @@ -42,6 +42,7 @@ ResourceAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ ResourceAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *ResourceAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(ResourceAPIlocalVarJSON); - cJSON_Delete(ResourceAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(ResourceAPIlocalVarJSON); + cJSON_Delete(ResourceAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/ResourceV1API.c b/kubernetes/api/ResourceV1API.c new file mode 100644 index 00000000..c3dd779d --- /dev/null +++ b/kubernetes/api/ResourceV1API.c @@ -0,0 +1,8649 @@ +#include +#include +#include + +#include "ResourceV1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a DeviceClass +// +v1_device_class_t* +ResourceV1API_createDeviceClass(apiClient_t *apiClient, v1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_device_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_device_class_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = resource_v1_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_resource_claim_template_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_template_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_createResourceSlice(apiClient_t *apiClient, v1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_resource_slice_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_slice_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of DeviceClass +// +v1_status_t* +ResourceV1API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceClaim +// +v1_status_t* +ResourceV1API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceClaimTemplate +// +v1_status_t* +ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceSlice +// +v1_status_t* +ResourceV1API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a DeviceClass +// +v1_device_class_t* +ResourceV1API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_device_class_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_template_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_slice_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +ResourceV1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind DeviceClass +// +v1_device_class_list_t* +ResourceV1API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_device_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_device_class_list_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaim +// +v1_resource_claim_list_t* +ResourceV1API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_list_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaimTemplate +// +v1_resource_claim_template_list_t* +ResourceV1API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_template_list_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaim +// +v1_resource_claim_list_t* +ResourceV1API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceclaims"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_list_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaimTemplate +// +v1_resource_claim_template_list_t* +ResourceV1API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceclaimtemplates"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_template_list_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceSlice +// +v1_resource_slice_list_t* +ResourceV1API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_slice_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_slice_list_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified DeviceClass +// +v1_device_class_t* +ResourceV1API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_device_class_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update status of the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_template_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_slice_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified DeviceClass +// +v1_device_class_t* +ResourceV1API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_device_class_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read status of the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_template_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_slice_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified DeviceClass +// +v1_device_class_t* +ResourceV1API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_device_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_device_class_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = resource_v1_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace status of the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = resource_v1_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + resource_v1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = resource_v1_resource_claim_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_resource_claim_template_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_claim_template_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_resource_slice_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_resource_slice_parseFromJSON(ResourceV1APIlocalVarJSON); + cJSON_Delete(ResourceV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/ResourceV1API.h b/kubernetes/api/ResourceV1API.h new file mode 100644 index 00000000..3a77c1bf --- /dev/null +++ b/kubernetes/api/ResourceV1API.h @@ -0,0 +1,225 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/resource_v1_resource_claim.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_device_class.h" +#include "../model/v1_device_class_list.h" +#include "../model/v1_resource_claim_list.h" +#include "../model/v1_resource_claim_template.h" +#include "../model/v1_resource_claim_template_list.h" +#include "../model/v1_resource_slice.h" +#include "../model/v1_resource_slice_list.h" +#include "../model/v1_status.h" + + +// create a DeviceClass +// +v1_device_class_t* +ResourceV1API_createDeviceClass(apiClient_t *apiClient, v1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_createResourceSlice(apiClient_t *apiClient, v1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of DeviceClass +// +v1_status_t* +ResourceV1API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceClaim +// +v1_status_t* +ResourceV1API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceClaimTemplate +// +v1_status_t* +ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceSlice +// +v1_status_t* +ResourceV1API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a DeviceClass +// +v1_device_class_t* +ResourceV1API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +ResourceV1API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind DeviceClass +// +v1_device_class_list_t* +ResourceV1API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaim +// +v1_resource_claim_list_t* +ResourceV1API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaimTemplate +// +v1_resource_claim_template_list_t* +ResourceV1API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaim +// +v1_resource_claim_list_t* +ResourceV1API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaimTemplate +// +v1_resource_claim_template_list_t* +ResourceV1API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceSlice +// +v1_resource_slice_list_t* +ResourceV1API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified DeviceClass +// +v1_device_class_t* +ResourceV1API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update status of the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified DeviceClass +// +v1_device_class_t* +ResourceV1API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty); + + +// read the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read status of the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read the specified ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified DeviceClass +// +v1_device_class_t* +ResourceV1API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace status of the specified ResourceClaim +// +resource_v1_resource_claim_t* +ResourceV1API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* +ResourceV1API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceSlice +// +v1_resource_slice_t* +ResourceV1API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/ResourceV1alpha2API.c b/kubernetes/api/ResourceV1alpha2API.c deleted file mode 100644 index 48265c74..00000000 --- a/kubernetes/api/ResourceV1alpha2API.c +++ /dev/null @@ -1,14830 +0,0 @@ -#include -#include -#include -#include "ResourceV1alpha2API.h" - -#define MAX_NUMBER_LENGTH 16 -#define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) - - -// create a PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_createNamespacedPodSchedulingContext(apiClient_t *apiClient, char *_namespace, v1alpha2_pod_scheduling_context_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_pod_scheduling_context_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create a ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_claim_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_createNamespacedResourceClaimParameters(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_claim_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_claim_parameters_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_parameters_t *elementToReturn = v1alpha2_resource_claim_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create a ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_claim_template_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_template_t *elementToReturn = v1alpha2_resource_claim_template_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_createNamespacedResourceClassParameters(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_class_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_class_parameters_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_parameters_t *elementToReturn = v1alpha2_resource_class_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create a ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_createResourceClass(apiClient_t *apiClient, v1alpha2_resource_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclasses"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_class_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_t *elementToReturn = v1alpha2_resource_class_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// create a ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_createResourceSlice(apiClient_t *apiClient, v1alpha2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceslices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceslices"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_slice_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_slice_t *elementToReturn = v1alpha2_resource_slice_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of PodSchedulingContext -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedPodSchedulingContext(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of ResourceClaim -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of ResourceClaimParameters -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimParameters(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of ResourceClaimTemplate -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of ResourceClassParameters -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClassParameters(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of ResourceClass -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionResourceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclasses"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete collection of ResourceSlice -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceslices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceslices"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_deleteNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_deleteNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_parameters_t *elementToReturn = v1alpha2_resource_claim_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_template_t *elementToReturn = v1alpha2_resource_claim_template_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_deleteNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_parameters_t *elementToReturn = v1alpha2_resource_class_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_deleteResourceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_t *elementToReturn = v1alpha2_resource_class_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// delete a ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceslices/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_gracePeriodSeconds = NULL; - char * valueQuery_gracePeriodSeconds = NULL; - keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; - if (gracePeriodSeconds) - { - keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); - valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); - } - - // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); - valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); - keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); - list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); - } - - // query parameters - char *keyQuery_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); - valueQuery_propagationPolicy = strdup((propagationPolicy)); - keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); - list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 202) { - // printf("%s\n","Accepted"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_slice_t *elementToReturn = v1alpha2_resource_slice_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_gracePeriodSeconds){ - free(keyQuery_gracePeriodSeconds); - keyQuery_gracePeriodSeconds = NULL; - } - if(valueQuery_gracePeriodSeconds){ - free(valueQuery_gracePeriodSeconds); - valueQuery_gracePeriodSeconds = NULL; - } - if(keyPairQuery_gracePeriodSeconds){ - keyValuePair_free(keyPairQuery_gracePeriodSeconds); - keyPairQuery_gracePeriodSeconds = NULL; - } - if(keyQuery_orphanDependents){ - free(keyQuery_orphanDependents); - keyQuery_orphanDependents = NULL; - } - if(valueQuery_orphanDependents){ - free(valueQuery_orphanDependents); - valueQuery_orphanDependents = NULL; - } - if(keyPairQuery_orphanDependents){ - keyValuePair_free(keyPairQuery_orphanDependents); - keyPairQuery_orphanDependents = NULL; - } - if(keyQuery_propagationPolicy){ - free(keyQuery_propagationPolicy); - keyQuery_propagationPolicy = NULL; - } - if(valueQuery_propagationPolicy){ - free(valueQuery_propagationPolicy); - valueQuery_propagationPolicy = NULL; - } - if(keyPairQuery_propagationPolicy){ - keyValuePair_free(keyPairQuery_propagationPolicy); - keyPairQuery_propagationPolicy = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// get available resources -// -v1_api_resource_list_t* -ResourceV1alpha2API_getAPIResources(apiClient_t *apiClient) -{ - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/"); - - - - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind PodSchedulingContext -// -v1alpha2_pod_scheduling_context_list_t* -ResourceV1alpha2API_listNamespacedPodSchedulingContext(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_list_t *elementToReturn = v1alpha2_pod_scheduling_context_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClaim -// -v1alpha2_resource_claim_list_t* -ResourceV1alpha2API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_list_t *elementToReturn = v1alpha2_resource_claim_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_list_t* -ResourceV1alpha2API_listNamespacedResourceClaimParameters(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_parameters_list_t *elementToReturn = v1alpha2_resource_claim_parameters_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClaimTemplate -// -v1alpha2_resource_claim_template_list_t* -ResourceV1alpha2API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_template_list_t *elementToReturn = v1alpha2_resource_claim_template_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClassParameters -// -v1alpha2_resource_class_parameters_list_t* -ResourceV1alpha2API_listNamespacedResourceClassParameters(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters"); - - - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_parameters_list_t *elementToReturn = v1alpha2_resource_class_parameters_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind PodSchedulingContext -// -v1alpha2_pod_scheduling_context_list_t* -ResourceV1alpha2API_listPodSchedulingContextForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/podschedulingcontexts")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/podschedulingcontexts"); - - - - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_list_t *elementToReturn = v1alpha2_pod_scheduling_context_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClaim -// -v1alpha2_resource_claim_list_t* -ResourceV1alpha2API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclaims")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclaims"); - - - - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_list_t *elementToReturn = v1alpha2_resource_claim_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_list_t* -ResourceV1alpha2API_listResourceClaimParametersForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclaimparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclaimparameters"); - - - - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_parameters_list_t *elementToReturn = v1alpha2_resource_claim_parameters_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClaimTemplate -// -v1alpha2_resource_claim_template_list_t* -ResourceV1alpha2API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclaimtemplates")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclaimtemplates"); - - - - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_template_list_t *elementToReturn = v1alpha2_resource_claim_template_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClass -// -v1alpha2_resource_class_list_t* -ResourceV1alpha2API_listResourceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclasses"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_list_t *elementToReturn = v1alpha2_resource_class_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceClassParameters -// -v1alpha2_resource_class_parameters_list_t* -ResourceV1alpha2API_listResourceClassParametersForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclassparameters")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclassparameters"); - - - - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_parameters_list_t *elementToReturn = v1alpha2_resource_class_parameters_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// list or watch objects of kind ResourceSlice -// -v1alpha2_resource_slice_list_t* -ResourceV1alpha2API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceslices")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceslices"); - - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) - { - keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); - valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); - list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); - } - - // query parameters - char *keyQuery__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) - { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); - } - - // query parameters - char *keyQuery_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) - { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); - } - - // query parameters - char *keyQuery_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) - { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); - } - - // query parameters - char *keyQuery_limit = NULL; - char * valueQuery_limit = NULL; - keyValuePair_t *keyPairQuery_limit = 0; - if (limit) - { - keyQuery_limit = strdup("limit"); - valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); - keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); - list_addElement(localVarQueryParameters,keyPairQuery_limit); - } - - // query parameters - char *keyQuery_resourceVersion = NULL; - char * valueQuery_resourceVersion = NULL; - keyValuePair_t *keyPairQuery_resourceVersion = 0; - if (resourceVersion) - { - keyQuery_resourceVersion = strdup("resourceVersion"); - valueQuery_resourceVersion = strdup((resourceVersion)); - keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); - } - - // query parameters - char *keyQuery_resourceVersionMatch = NULL; - char * valueQuery_resourceVersionMatch = NULL; - keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; - if (resourceVersionMatch) - { - keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); - valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); - keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); - list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); - } - - // query parameters - char *keyQuery_sendInitialEvents = NULL; - char * valueQuery_sendInitialEvents = NULL; - keyValuePair_t *keyPairQuery_sendInitialEvents = 0; - if (sendInitialEvents) - { - keyQuery_sendInitialEvents = strdup("sendInitialEvents"); - valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); - keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); - list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); - } - - // query parameters - char *keyQuery_timeoutSeconds = NULL; - char * valueQuery_timeoutSeconds = NULL; - keyValuePair_t *keyPairQuery_timeoutSeconds = 0; - if (timeoutSeconds) - { - keyQuery_timeoutSeconds = strdup("timeoutSeconds"); - valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); - keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); - list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); - } - - // query parameters - char *keyQuery_watch = NULL; - char * valueQuery_watch = NULL; - keyValuePair_t *keyPairQuery_watch = 0; - if (watch) - { - keyQuery_watch = strdup("watch"); - valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); - keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); - list_addElement(localVarQueryParameters,keyPairQuery_watch); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_slice_list_t *elementToReturn = v1alpha2_resource_slice_list_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; - } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; - } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; - } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; - } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; - } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; - } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; - } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; - } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; - } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; - } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; - } - if(keyPairQuery_labelSelector){ - keyValuePair_free(keyPairQuery_labelSelector); - keyPairQuery_labelSelector = NULL; - } - if(keyQuery_limit){ - free(keyQuery_limit); - keyQuery_limit = NULL; - } - if(valueQuery_limit){ - free(valueQuery_limit); - valueQuery_limit = NULL; - } - if(keyPairQuery_limit){ - keyValuePair_free(keyPairQuery_limit); - keyPairQuery_limit = NULL; - } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; - } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; - } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; - } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; - } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; - } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; - } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; - } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; - } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; - } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; - } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; - } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; - } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; - } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; - } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_patchNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update status of the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_patchNamespacedPodSchedulingContextStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_patchNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_parameters_t *elementToReturn = v1alpha2_resource_claim_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update status of the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_template_t *elementToReturn = v1alpha2_resource_claim_template_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_patchNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_parameters_t *elementToReturn = v1alpha2_resource_class_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_patchResourceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_t *elementToReturn = v1alpha2_resource_class_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// partially update the specified ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = list_createList(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceslices/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // query parameters - char *keyQuery_force = NULL; - char * valueQuery_force = NULL; - keyValuePair_t *keyPairQuery_force = 0; - if (force) - { - keyQuery_force = strdup("force"); - valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); - snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); - keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); - list_addElement(localVarQueryParameters,keyPairQuery_force); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - list_addElement(localVarContentType,"application/json-patch+json"); //consumes - list_addElement(localVarContentType,"application/merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes - list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PATCH"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_slice_t *elementToReturn = v1alpha2_resource_slice_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - list_freeList(localVarContentType); - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - if(keyQuery_force){ - free(keyQuery_force); - keyQuery_force = NULL; - } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; - } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_readNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read status of the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_readNamespacedPodSchedulingContextStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_readNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_parameters_t *elementToReturn = v1alpha2_resource_claim_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read status of the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_template_t *elementToReturn = v1alpha2_resource_claim_template_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_readNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_parameters_t *elementToReturn = v1alpha2_resource_class_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_readResourceClass(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_t *elementToReturn = v1alpha2_resource_class_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// read the specified ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceslices/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_slice_t *elementToReturn = v1alpha2_resource_slice_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_replaceNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_pod_scheduling_context_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_pod_scheduling_context_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace status of the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_replaceNamespacedPodSchedulingContextStatus(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_pod_scheduling_context_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_pod_scheduling_context_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_pod_scheduling_context_t *elementToReturn = v1alpha2_pod_scheduling_context_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_claim_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_replaceNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_claim_parameters_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_parameters_t *elementToReturn = v1alpha2_resource_claim_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace status of the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_claim_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_t *elementToReturn = v1alpha2_resource_claim_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_claim_template_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_claim_template_t *elementToReturn = v1alpha2_resource_claim_template_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_replaceNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_class_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_class_parameters_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_parameters_t *elementToReturn = v1alpha2_resource_class_parameters_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - free(localVarToReplace__namespace); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_replaceResourceClass(apiClient_t *apiClient, char *name, v1alpha2_resource_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_class_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_class_t *elementToReturn = v1alpha2_resource_class_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - -// replace the specified ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1alpha2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) -{ - list_t *localVarQueryParameters = list_createList(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_createList(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/apis/resource.k8s.io/v1alpha2/resourceslices/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/v1alpha2/resourceslices/{name}"); - - - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); - if(name == NULL) { - goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - - - - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - - // query parameters - char *keyQuery_dryRun = NULL; - char * valueQuery_dryRun = NULL; - keyValuePair_t *keyPairQuery_dryRun = 0; - if (dryRun) - { - keyQuery_dryRun = strdup("dryRun"); - valueQuery_dryRun = strdup((dryRun)); - keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); - list_addElement(localVarQueryParameters,keyPairQuery_dryRun); - } - - // query parameters - char *keyQuery_fieldManager = NULL; - char * valueQuery_fieldManager = NULL; - keyValuePair_t *keyPairQuery_fieldManager = 0; - if (fieldManager) - { - keyQuery_fieldManager = strdup("fieldManager"); - valueQuery_fieldManager = strdup((fieldManager)); - keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); - list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); - } - - // query parameters - char *keyQuery_fieldValidation = NULL; - char * valueQuery_fieldValidation = NULL; - keyValuePair_t *keyPairQuery_fieldValidation = 0; - if (fieldValidation) - { - keyQuery_fieldValidation = strdup("fieldValidation"); - valueQuery_fieldValidation = strdup((fieldValidation)); - keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); - list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); - } - - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) - { - //string - localVarSingleItemJSON_body = v1alpha2_resource_slice_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType,"application/json"); //produces - list_addElement(localVarHeaderType,"application/yaml"); //produces - list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - // uncomment below to debug the error response - //if (apiClient->response_code == 200) { - // printf("%s\n","OK"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 201) { - // printf("%s\n","Created"); - //} - // uncomment below to debug the error response - //if (apiClient->response_code == 401) { - // printf("%s\n","Unauthorized"); - //} - //nonprimitive not container - cJSON *ResourceV1alpha2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha2_resource_slice_t *elementToReturn = v1alpha2_resource_slice_parseFromJSON(ResourceV1alpha2APIlocalVarJSON); - cJSON_Delete(ResourceV1alpha2APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 0; - } - list_freeList(localVarQueryParameters); - - - list_freeList(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_name); - if (localVarSingleItemJSON_body) { - cJSON_Delete(localVarSingleItemJSON_body); - localVarSingleItemJSON_body = NULL; - } - free(localVarBodyParameters); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } - if(keyQuery_dryRun){ - free(keyQuery_dryRun); - keyQuery_dryRun = NULL; - } - if(valueQuery_dryRun){ - free(valueQuery_dryRun); - valueQuery_dryRun = NULL; - } - if(keyPairQuery_dryRun){ - keyValuePair_free(keyPairQuery_dryRun); - keyPairQuery_dryRun = NULL; - } - if(keyQuery_fieldManager){ - free(keyQuery_fieldManager); - keyQuery_fieldManager = NULL; - } - if(valueQuery_fieldManager){ - free(valueQuery_fieldManager); - valueQuery_fieldManager = NULL; - } - if(keyPairQuery_fieldManager){ - keyValuePair_free(keyPairQuery_fieldManager); - keyPairQuery_fieldManager = NULL; - } - if(keyQuery_fieldValidation){ - free(keyQuery_fieldValidation); - keyQuery_fieldValidation = NULL; - } - if(valueQuery_fieldValidation){ - free(valueQuery_fieldValidation); - valueQuery_fieldValidation = NULL; - } - if(keyPairQuery_fieldValidation){ - keyValuePair_free(keyPairQuery_fieldValidation); - keyPairQuery_fieldValidation = NULL; - } - return elementToReturn; -end: - free(localVarPath); - return NULL; - -} - diff --git a/kubernetes/api/ResourceV1alpha2API.h b/kubernetes/api/ResourceV1alpha2API.h deleted file mode 100644 index 10a88dfe..00000000 --- a/kubernetes/api/ResourceV1alpha2API.h +++ /dev/null @@ -1,393 +0,0 @@ -#include -#include -#include "../include/apiClient.h" -#include "../include/list.h" -#include "../external/cJSON.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "../model/object.h" -#include "../model/v1_api_resource_list.h" -#include "../model/v1_delete_options.h" -#include "../model/v1_status.h" -#include "../model/v1alpha2_pod_scheduling_context.h" -#include "../model/v1alpha2_pod_scheduling_context_list.h" -#include "../model/v1alpha2_resource_claim.h" -#include "../model/v1alpha2_resource_claim_list.h" -#include "../model/v1alpha2_resource_claim_parameters.h" -#include "../model/v1alpha2_resource_claim_parameters_list.h" -#include "../model/v1alpha2_resource_claim_template.h" -#include "../model/v1alpha2_resource_claim_template_list.h" -#include "../model/v1alpha2_resource_class.h" -#include "../model/v1alpha2_resource_class_list.h" -#include "../model/v1alpha2_resource_class_parameters.h" -#include "../model/v1alpha2_resource_class_parameters_list.h" -#include "../model/v1alpha2_resource_slice.h" -#include "../model/v1alpha2_resource_slice_list.h" - - -// create a PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_createNamespacedPodSchedulingContext(apiClient_t *apiClient, char *_namespace, v1alpha2_pod_scheduling_context_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create a ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_createNamespacedResourceClaimParameters(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_claim_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create a ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_createNamespacedResourceClassParameters(apiClient_t *apiClient, char *_namespace, v1alpha2_resource_class_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create a ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_createResourceClass(apiClient_t *apiClient, v1alpha2_resource_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// create a ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_createResourceSlice(apiClient_t *apiClient, v1alpha2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// delete collection of PodSchedulingContext -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedPodSchedulingContext(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of ResourceClaim -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of ResourceClaimParameters -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimParameters(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of ResourceClaimTemplate -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of ResourceClassParameters -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionNamespacedResourceClassParameters(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of ResourceClass -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionResourceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete collection of ResourceSlice -// -v1_status_t* -ResourceV1alpha2API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); - - -// delete a PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_deleteNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete a ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_deleteNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete a ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_deleteNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete a ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_deleteResourceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// delete a ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); - - -// get available resources -// -v1_api_resource_list_t* -ResourceV1alpha2API_getAPIResources(apiClient_t *apiClient); - - -// list or watch objects of kind PodSchedulingContext -// -v1alpha2_pod_scheduling_context_list_t* -ResourceV1alpha2API_listNamespacedPodSchedulingContext(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClaim -// -v1alpha2_resource_claim_list_t* -ResourceV1alpha2API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_list_t* -ResourceV1alpha2API_listNamespacedResourceClaimParameters(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClaimTemplate -// -v1alpha2_resource_claim_template_list_t* -ResourceV1alpha2API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClassParameters -// -v1alpha2_resource_class_parameters_list_t* -ResourceV1alpha2API_listNamespacedResourceClassParameters(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind PodSchedulingContext -// -v1alpha2_pod_scheduling_context_list_t* -ResourceV1alpha2API_listPodSchedulingContextForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClaim -// -v1alpha2_resource_claim_list_t* -ResourceV1alpha2API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_list_t* -ResourceV1alpha2API_listResourceClaimParametersForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClaimTemplate -// -v1alpha2_resource_claim_template_list_t* -ResourceV1alpha2API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClass -// -v1alpha2_resource_class_list_t* -ResourceV1alpha2API_listResourceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceClassParameters -// -v1alpha2_resource_class_parameters_list_t* -ResourceV1alpha2API_listResourceClassParametersForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// list or watch objects of kind ResourceSlice -// -v1alpha2_resource_slice_list_t* -ResourceV1alpha2API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); - - -// partially update the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_patchNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update status of the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_patchNamespacedPodSchedulingContextStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_patchNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update status of the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_patchNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_patchResourceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// partially update the specified ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); - - -// read the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_readNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); - - -// read status of the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_readNamespacedPodSchedulingContextStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); - - -// read the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); - - -// read the specified ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_readNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); - - -// read status of the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); - - -// read the specified ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); - - -// read the specified ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_readNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); - - -// read the specified ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_readResourceClass(apiClient_t *apiClient, char *name, char *pretty); - - -// read the specified ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty); - - -// replace the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_replaceNamespacedPodSchedulingContext(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_pod_scheduling_context_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace status of the specified PodSchedulingContext -// -v1alpha2_pod_scheduling_context_t* -ResourceV1alpha2API_replaceNamespacedPodSchedulingContextStatus(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_pod_scheduling_context_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ResourceClaimParameters -// -v1alpha2_resource_claim_parameters_t* -ResourceV1alpha2API_replaceNamespacedResourceClaimParameters(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace status of the specified ResourceClaim -// -v1alpha2_resource_claim_t* -ResourceV1alpha2API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ResourceClaimTemplate -// -v1alpha2_resource_claim_template_t* -ResourceV1alpha2API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ResourceClassParameters -// -v1alpha2_resource_class_parameters_t* -ResourceV1alpha2API_replaceNamespacedResourceClassParameters(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_resource_class_parameters_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ResourceClass -// -v1alpha2_resource_class_t* -ResourceV1alpha2API_replaceResourceClass(apiClient_t *apiClient, char *name, v1alpha2_resource_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - -// replace the specified ResourceSlice -// -v1alpha2_resource_slice_t* -ResourceV1alpha2API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1alpha2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); - - diff --git a/kubernetes/api/ResourceV1alpha3API.c b/kubernetes/api/ResourceV1alpha3API.c new file mode 100644 index 00000000..2247d964 --- /dev/null +++ b/kubernetes/api/ResourceV1alpha3API.c @@ -0,0 +1,1861 @@ +#include +#include +#include + +#include "ResourceV1alpha3API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_createDeviceTaintRule(apiClient_t *apiClient, v1alpha3_device_taint_rule_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1alpha3_device_taint_rule_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha3_device_taint_rule_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of DeviceTaintRule +// +v1_status_t* +ResourceV1alpha3API_deleteCollectionDeviceTaintRule(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_deleteDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha3_device_taint_rule_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +ResourceV1alpha3API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind DeviceTaintRule +// +v1alpha3_device_taint_rule_list_t* +ResourceV1alpha3API_listDeviceTaintRule(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha3_device_taint_rule_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_taint_rule_list_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_patchDeviceTaintRule(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha3_device_taint_rule_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_readDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha3_device_taint_rule_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_replaceDeviceTaintRule(apiClient_t *apiClient, char *name, v1alpha3_device_taint_rule_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1alpha3_device_taint_rule_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1alpha3_device_taint_rule_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/ResourceV1alpha3API.h b/kubernetes/api/ResourceV1alpha3API.h new file mode 100644 index 00000000..ac3f74e4 --- /dev/null +++ b/kubernetes/api/ResourceV1alpha3API.h @@ -0,0 +1,63 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1alpha3_device_taint_rule.h" +#include "../model/v1alpha3_device_taint_rule_list.h" + + +// create a DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_createDeviceTaintRule(apiClient_t *apiClient, v1alpha3_device_taint_rule_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of DeviceTaintRule +// +v1_status_t* +ResourceV1alpha3API_deleteCollectionDeviceTaintRule(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_deleteDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +ResourceV1alpha3API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind DeviceTaintRule +// +v1alpha3_device_taint_rule_list_t* +ResourceV1alpha3API_listDeviceTaintRule(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_patchDeviceTaintRule(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_readDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_replaceDeviceTaintRule(apiClient_t *apiClient, char *name, v1alpha3_device_taint_rule_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/ResourceV1beta1API.c b/kubernetes/api/ResourceV1beta1API.c new file mode 100644 index 00000000..d0ea2248 --- /dev/null +++ b/kubernetes/api/ResourceV1beta1API.c @@ -0,0 +1,8649 @@ +#include +#include +#include + +#include "ResourceV1beta1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_createDeviceClass(apiClient_t *apiClient, v1beta1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_device_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_device_class_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1beta1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_resource_claim_template_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_template_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_createResourceSlice(apiClient_t *apiClient, v1beta1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_resource_slice_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_slice_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of DeviceClass +// +v1_status_t* +ResourceV1beta1API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceClaim +// +v1_status_t* +ResourceV1beta1API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceClaimTemplate +// +v1_status_t* +ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceSlice +// +v1_status_t* +ResourceV1beta1API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_device_class_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_template_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_slice_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +ResourceV1beta1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind DeviceClass +// +v1beta1_device_class_list_t* +ResourceV1beta1API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_device_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_device_class_list_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaim +// +v1beta1_resource_claim_list_t* +ResourceV1beta1API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_list_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta1_resource_claim_template_list_t* +ResourceV1beta1API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_template_list_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaim +// +v1beta1_resource_claim_list_t* +ResourceV1beta1API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceclaims"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_list_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta1_resource_claim_template_list_t* +ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceclaimtemplates"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_template_list_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceSlice +// +v1beta1_resource_slice_list_t* +ResourceV1beta1API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_slice_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_slice_list_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_device_class_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update status of the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_template_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_slice_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_device_class_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read status of the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_template_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_slice_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1beta1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_device_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_device_class_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace status of the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_resource_claim_template_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_claim_template_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1beta1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta1/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_resource_slice_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_resource_slice_parseFromJSON(ResourceV1beta1APIlocalVarJSON); + cJSON_Delete(ResourceV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/ResourceV1beta1API.h b/kubernetes/api/ResourceV1beta1API.h new file mode 100644 index 00000000..2228f9c1 --- /dev/null +++ b/kubernetes/api/ResourceV1beta1API.h @@ -0,0 +1,225 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1beta1_device_class.h" +#include "../model/v1beta1_device_class_list.h" +#include "../model/v1beta1_resource_claim.h" +#include "../model/v1beta1_resource_claim_list.h" +#include "../model/v1beta1_resource_claim_template.h" +#include "../model/v1beta1_resource_claim_template_list.h" +#include "../model/v1beta1_resource_slice.h" +#include "../model/v1beta1_resource_slice_list.h" + + +// create a DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_createDeviceClass(apiClient_t *apiClient, v1beta1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1beta1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_createResourceSlice(apiClient_t *apiClient, v1beta1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of DeviceClass +// +v1_status_t* +ResourceV1beta1API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceClaim +// +v1_status_t* +ResourceV1beta1API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceClaimTemplate +// +v1_status_t* +ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceSlice +// +v1_status_t* +ResourceV1beta1API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +ResourceV1beta1API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind DeviceClass +// +v1beta1_device_class_list_t* +ResourceV1beta1API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaim +// +v1beta1_resource_claim_list_t* +ResourceV1beta1API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta1_resource_claim_template_list_t* +ResourceV1beta1API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaim +// +v1beta1_resource_claim_list_t* +ResourceV1beta1API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta1_resource_claim_template_list_t* +ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceSlice +// +v1beta1_resource_slice_list_t* +ResourceV1beta1API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update status of the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty); + + +// read the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read status of the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read the specified ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified DeviceClass +// +v1beta1_device_class_t* +ResourceV1beta1API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1beta1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace status of the specified ResourceClaim +// +v1beta1_resource_claim_t* +ResourceV1beta1API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* +ResourceV1beta1API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceSlice +// +v1beta1_resource_slice_t* +ResourceV1beta1API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1beta1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/ResourceV1beta2API.c b/kubernetes/api/ResourceV1beta2API.c new file mode 100644 index 00000000..35055949 --- /dev/null +++ b/kubernetes/api/ResourceV1beta2API.c @@ -0,0 +1,8649 @@ +#include +#include +#include + +#include "ResourceV1beta2API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_createDeviceClass(apiClient_t *apiClient, v1beta2_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_device_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_device_class_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1beta2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_resource_claim_template_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_template_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_createResourceSlice(apiClient_t *apiClient, v1beta2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_resource_slice_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_slice_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of DeviceClass +// +v1_status_t* +ResourceV1beta2API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceClaim +// +v1_status_t* +ResourceV1beta2API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceClaimTemplate +// +v1_status_t* +ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of ResourceSlice +// +v1_status_t* +ResourceV1beta2API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_device_class_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_template_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_slice_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +ResourceV1beta2API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind DeviceClass +// +v1beta2_device_class_list_t* +ResourceV1beta2API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/deviceclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_device_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_device_class_list_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaim +// +v1beta2_resource_claim_list_t* +ResourceV1beta2API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_list_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta2_resource_claim_template_list_t* +ResourceV1beta2API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_template_list_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaim +// +v1beta2_resource_claim_list_t* +ResourceV1beta2API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceclaims"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_list_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta2_resource_claim_template_list_t* +ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceclaimtemplates"); + + + + + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_template_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_template_list_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind ResourceSlice +// +v1beta2_resource_slice_list_t* +ResourceV1beta2API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceslices"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_slice_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_slice_list_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_device_class_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update status of the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_template_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_slice_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_device_class_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read status of the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_template_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_slice_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1beta2_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/deviceclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_device_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_device_class_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace status of the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_resource_claim_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_resource_claim_template_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_claim_template_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_claim_template_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1beta2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/resource.k8s.io/v1beta2/resourceslices/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta2_resource_slice_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta2_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1beta2APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta2_resource_slice_parseFromJSON(ResourceV1beta2APIlocalVarJSON); + cJSON_Delete(ResourceV1beta2APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/ResourceV1beta2API.h b/kubernetes/api/ResourceV1beta2API.h new file mode 100644 index 00000000..ffd22bed --- /dev/null +++ b/kubernetes/api/ResourceV1beta2API.h @@ -0,0 +1,225 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1beta2_device_class.h" +#include "../model/v1beta2_device_class_list.h" +#include "../model/v1beta2_resource_claim.h" +#include "../model/v1beta2_resource_claim_list.h" +#include "../model/v1beta2_resource_claim_template.h" +#include "../model/v1beta2_resource_claim_template_list.h" +#include "../model/v1beta2_resource_slice.h" +#include "../model/v1beta2_resource_slice_list.h" + + +// create a DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_createDeviceClass(apiClient_t *apiClient, v1beta2_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1beta2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// create a ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_createResourceSlice(apiClient_t *apiClient, v1beta2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of DeviceClass +// +v1_status_t* +ResourceV1beta2API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceClaim +// +v1_status_t* +ResourceV1beta2API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceClaimTemplate +// +v1_status_t* +ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of ResourceSlice +// +v1_status_t* +ResourceV1beta2API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +ResourceV1beta2API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind DeviceClass +// +v1beta2_device_class_list_t* +ResourceV1beta2API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaim +// +v1beta2_resource_claim_list_t* +ResourceV1beta2API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta2_resource_claim_template_list_t* +ResourceV1beta2API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaim +// +v1beta2_resource_claim_list_t* +ResourceV1beta2API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceClaimTemplate +// +v1beta2_resource_claim_template_list_t* +ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// list or watch objects of kind ResourceSlice +// +v1beta2_resource_slice_list_t* +ResourceV1beta2API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update status of the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// partially update the specified ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty); + + +// read the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read status of the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); + + +// read the specified ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified DeviceClass +// +v1beta2_device_class_t* +ResourceV1beta2API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1beta2_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace status of the specified ResourceClaim +// +v1beta2_resource_claim_t* +ResourceV1beta2API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* +ResourceV1beta2API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// replace the specified ResourceSlice +// +v1beta2_resource_slice_t* +ResourceV1beta2API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1beta2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/SchedulingAPI.c b/kubernetes/api/SchedulingAPI.c index 4298b9ea..55ff0bc4 100644 --- a/kubernetes/api/SchedulingAPI.c +++ b/kubernetes/api/SchedulingAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "SchedulingAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ SchedulingAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/"); + @@ -42,6 +42,7 @@ SchedulingAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ SchedulingAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(SchedulingAPIlocalVarJSON); - cJSON_Delete(SchedulingAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(SchedulingAPIlocalVarJSON); + cJSON_Delete(SchedulingAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/SchedulingV1API.c b/kubernetes/api/SchedulingV1API.c index b5e60137..3acb6462 100644 --- a/kubernetes/api/SchedulingV1API.c +++ b/kubernetes/api/SchedulingV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "SchedulingV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a PriorityClass @@ -23,11 +20,14 @@ SchedulingV1API_createPriorityClass(apiClient_t *apiClient, v1_priority_class_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/priorityclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/priorityclasses"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/priorityclasses"); + @@ -84,13 +84,15 @@ SchedulingV1API_createPriorityClass(apiClient_t *apiClient, v1_priority_class_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_priority_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ SchedulingV1API_createPriorityClass(apiClient_t *apiClient, v1_priority_class_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ SchedulingV1API_createPriorityClass(apiClient_t *apiClient, v1_priority_class_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_class_t *elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ SchedulingV1API_createPriorityClass(apiClient_t *apiClient, v1_priority_class_t // delete collection of PriorityClass // v1_status_t* -SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pret list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/priorityclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/priorityclasses"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/priorityclasses"); + @@ -278,6 +287,19 @@ SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pret list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -382,13 +404,15 @@ SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pret cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -397,6 +421,7 @@ SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pret localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -408,11 +433,14 @@ SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pret // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -492,6 +520,18 @@ SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pret keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -598,7 +638,7 @@ SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pret // delete a PriorityClass // v1_status_t* -SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -606,15 +646,20 @@ SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/priorityclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -662,6 +707,19 @@ SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pr list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -691,13 +749,15 @@ SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pr cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -706,6 +766,7 @@ SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -721,11 +782,14 @@ SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -782,6 +846,18 @@ SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pr keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -824,17 +900,21 @@ SchedulingV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ SchedulingV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ SchedulingV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ SchedulingV1API_listPriorityClass(apiClient_t *apiClient, char *pretty, int *all list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/priorityclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/priorityclasses"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/priorityclasses"); + @@ -1039,8 +1126,10 @@ SchedulingV1API_listPriorityClass(apiClient_t *apiClient, char *pretty, int *all list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ SchedulingV1API_listPriorityClass(apiClient_t *apiClient, char *pretty, int *all localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ SchedulingV1API_listPriorityClass(apiClient_t *apiClient, char *pretty, int *all // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_class_list_t *elementToReturn = v1_priority_class_list_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_class_list_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ SchedulingV1API_patchPriorityClass(apiClient_t *apiClient, char *name, object_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/priorityclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ SchedulingV1API_patchPriorityClass(apiClient_t *apiClient, char *name, object_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ SchedulingV1API_patchPriorityClass(apiClient_t *apiClient, char *name, object_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ SchedulingV1API_patchPriorityClass(apiClient_t *apiClient, char *name, object_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_class_t *elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ SchedulingV1API_readPriorityClass(apiClient_t *apiClient, char *name, char *pret list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/priorityclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1483,6 +1593,7 @@ SchedulingV1API_readPriorityClass(apiClient_t *apiClient, char *name, char *pret list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1491,6 +1602,7 @@ SchedulingV1API_readPriorityClass(apiClient_t *apiClient, char *name, char *pret localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1502,11 +1614,14 @@ SchedulingV1API_readPriorityClass(apiClient_t *apiClient, char *name, char *pret // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_class_t *elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1552,15 +1667,20 @@ SchedulingV1API_replacePriorityClass(apiClient_t *apiClient, char *name, v1_prio list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/scheduling.k8s.io/v1/priorityclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + char *localVarPath = strdup("/apis/scheduling.k8s.io/v1/priorityclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1623,13 +1743,15 @@ SchedulingV1API_replacePriorityClass(apiClient_t *apiClient, char *name, v1_prio cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_priority_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1638,6 +1760,7 @@ SchedulingV1API_replacePriorityClass(apiClient_t *apiClient, char *name, v1_prio localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1653,11 +1776,14 @@ SchedulingV1API_replacePriorityClass(apiClient_t *apiClient, char *name, v1_prio // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_priority_class_t *elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); - cJSON_Delete(SchedulingV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_priority_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *SchedulingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_priority_class_parseFromJSON(SchedulingV1APIlocalVarJSON); + cJSON_Delete(SchedulingV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/SchedulingV1API.h b/kubernetes/api/SchedulingV1API.h index 27492a4c..4031629b 100644 --- a/kubernetes/api/SchedulingV1API.h +++ b/kubernetes/api/SchedulingV1API.h @@ -22,13 +22,13 @@ SchedulingV1API_createPriorityClass(apiClient_t *apiClient, v1_priority_class_t // delete collection of PriorityClass // v1_status_t* -SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a PriorityClass // v1_status_t* -SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/StorageAPI.c b/kubernetes/api/StorageAPI.c index 51efb0e5..05eb4d23 100644 --- a/kubernetes/api/StorageAPI.c +++ b/kubernetes/api/StorageAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "StorageAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ StorageAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/"); + char *localVarPath = strdup("/apis/storage.k8s.io/"); + @@ -42,6 +42,7 @@ StorageAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ StorageAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(StorageAPIlocalVarJSON); - cJSON_Delete(StorageAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(StorageAPIlocalVarJSON); + cJSON_Delete(StorageAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/StorageV1API.c b/kubernetes/api/StorageV1API.c index 4a699d74..bdee64d4 100644 --- a/kubernetes/api/StorageV1API.c +++ b/kubernetes/api/StorageV1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "StorageV1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a CSIDriver @@ -23,11 +20,14 @@ StorageV1API_createCSIDriver(apiClient_t *apiClient, v1_csi_driver_t *body, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csidrivers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csidrivers"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csidrivers"); + @@ -84,13 +84,15 @@ StorageV1API_createCSIDriver(apiClient_t *apiClient, v1_csi_driver_t *body, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_csi_driver_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ StorageV1API_createCSIDriver(apiClient_t *apiClient, v1_csi_driver_t *body, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ StorageV1API_createCSIDriver(apiClient_t *apiClient, v1_csi_driver_t *body, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_driver_t *elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_driver_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -208,11 +214,14 @@ StorageV1API_createCSINode(apiClient_t *apiClient, v1_csi_node_t *body, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csinodes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csinodes"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csinodes"); + @@ -269,13 +278,15 @@ StorageV1API_createCSINode(apiClient_t *apiClient, v1_csi_node_t *body, char *pr cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_csi_node_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -284,6 +295,7 @@ StorageV1API_createCSINode(apiClient_t *apiClient, v1_csi_node_t *body, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -303,11 +315,14 @@ StorageV1API_createCSINode(apiClient_t *apiClient, v1_csi_node_t *body, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_node_t *elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -393,15 +408,20 @@ StorageV1API_createNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -464,13 +484,15 @@ StorageV1API_createNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_csi_storage_capacity_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -479,6 +501,7 @@ StorageV1API_createNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -498,11 +521,14 @@ StorageV1API_createNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_storage_capacity_t *elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_storage_capacity_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -589,11 +615,14 @@ StorageV1API_createStorageClass(apiClient_t *apiClient, v1_storage_class_t *body list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/storageclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/storageclasses"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/storageclasses"); + @@ -650,13 +679,15 @@ StorageV1API_createStorageClass(apiClient_t *apiClient, v1_storage_class_t *body cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_storage_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -665,6 +696,7 @@ StorageV1API_createStorageClass(apiClient_t *apiClient, v1_storage_class_t *body localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -684,11 +716,14 @@ StorageV1API_createStorageClass(apiClient_t *apiClient, v1_storage_class_t *body // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_storage_class_t *elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_storage_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -774,11 +809,14 @@ StorageV1API_createVolumeAttachment(apiClient_t *apiClient, v1_volume_attachment list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments"); + @@ -835,13 +873,209 @@ StorageV1API_createVolumeAttachment(apiClient_t *apiClient, v1_volume_attachment cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_volume_attachment_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// create a VolumeAttributesClass +// +v1_volume_attributes_class_t* +StorageV1API_createVolumeAttributesClass(apiClient_t *apiClient, v1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattributesclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_volume_attributes_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -850,6 +1084,7 @@ StorageV1API_createVolumeAttachment(apiClient_t *apiClient, v1_volume_attachment localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -869,11 +1104,14 @@ StorageV1API_createVolumeAttachment(apiClient_t *apiClient, v1_volume_attachment // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attributes_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -951,7 +1189,7 @@ StorageV1API_createVolumeAttachment(apiClient_t *apiClient, v1_volume_attachment // delete a CSIDriver // v1_csi_driver_t* -StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -959,15 +1197,20 @@ StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, c list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csidrivers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csidrivers/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csidrivers/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1015,6 +1258,19 @@ StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, c list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1044,13 +1300,15 @@ StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, c cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1059,6 +1317,7 @@ StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, c localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1074,11 +1333,14 @@ StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, c // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_driver_t *elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_driver_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1135,6 +1397,18 @@ StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, c keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1169,7 +1443,7 @@ StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, c // delete a CSINode // v1_csi_node_t* -StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1177,15 +1451,20 @@ StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csinodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csinodes/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csinodes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1233,6 +1512,19 @@ StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, cha list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -1262,13 +1554,15 @@ StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1277,6 +1571,7 @@ StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1292,11 +1587,14 @@ StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_node_t *elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1353,6 +1651,18 @@ StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, cha keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -1387,7 +1697,7 @@ StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, cha // delete collection of CSIDriver // v1_status_t* -StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1395,11 +1705,14 @@ StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, cha list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csidrivers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csidrivers"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csidrivers"); + @@ -1465,6 +1778,19 @@ StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, cha list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1569,13 +1895,15 @@ StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, cha cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1584,6 +1912,7 @@ StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, cha localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1595,11 +1924,14 @@ StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1679,6 +2011,18 @@ StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, cha keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -1785,7 +2129,7 @@ StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, cha // delete collection of CSINode // v1_status_t* -StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -1793,11 +2137,14 @@ StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csinodes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csinodes"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csinodes"); + @@ -1863,6 +2210,19 @@ StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -1967,13 +2327,15 @@ StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1982,6 +2344,7 @@ StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -1993,11 +2356,14 @@ StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2077,6 +2443,18 @@ StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2183,7 +2561,7 @@ StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char // delete collection of CSIStorageCapacity // v1_status_t* -StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2191,15 +2569,20 @@ StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities"); + + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2271,6 +2654,19 @@ StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2375,13 +2771,15 @@ StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2390,6 +2788,7 @@ StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2401,11 +2800,14 @@ StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2486,6 +2888,18 @@ StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2592,7 +3006,7 @@ StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient // delete collection of StorageClass // v1_status_t* -StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2600,11 +3014,14 @@ StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/storageclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/storageclasses"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/storageclasses"); + @@ -2670,6 +3087,19 @@ StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -2774,13 +3204,15 @@ StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2789,6 +3221,7 @@ StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -2800,11 +3233,14 @@ StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2884,6 +3320,18 @@ StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -2990,7 +3438,7 @@ StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, // delete collection of VolumeAttachment // v1_status_t* -StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -2998,11 +3446,14 @@ StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pret list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments"); + @@ -3068,6 +3519,19 @@ StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pret list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -3172,13 +3636,15 @@ StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pret cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3187,6 +3653,7 @@ StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pret localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3198,11 +3665,14 @@ StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pret // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3282,6 +3752,18 @@ StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pret keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -3385,10 +3867,10 @@ StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pret } -// delete a CSIStorageCapacity +// delete collection of VolumeAttributesClass // v1_status_t* -StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +StorageV1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3396,32 +3878,726 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattributesclasses"); - // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); - if(name == NULL) { + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a CSIStorageCapacity +// +v1_status_t* +StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + free(localVarToReplace__namespace); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a StorageClass +// +v1_storage_class_t* +StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/storageclasses/{name}"); + + if(!name) goto end; - } - char* localVarToReplace_name = malloc(sizeOfPathParams_name); - sprintf(localVarToReplace_name, "{%s}", "name"); - localVarPath = strReplace(localVarPath, localVarToReplace_name, name); // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { goto end; } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); @@ -3462,6 +4638,19 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3491,13 +4680,15 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3506,6 +4697,7 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3521,11 +4713,14 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_storage_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3541,7 +4736,6 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -3583,6 +4777,18 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3614,10 +4820,10 @@ StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *na } -// delete a StorageClass +// delete a VolumeAttachment // -v1_storage_class_t* -StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +v1_volume_attachment_t* +StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3625,15 +4831,20 @@ StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/storageclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/storageclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3681,6 +4892,19 @@ StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3710,13 +4934,15 @@ StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3725,6 +4951,7 @@ StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3740,11 +4967,14 @@ StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_storage_class_t *elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -3801,6 +5031,18 @@ StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -3832,10 +5074,10 @@ StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty } -// delete a VolumeAttachment +// delete a VolumeAttributesClass // -v1_volume_attachment_t* -StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +v1_volume_attributes_class_t* +StorageV1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -3843,15 +5085,20 @@ StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pr list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3899,6 +5146,19 @@ StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pr list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -3928,13 +5188,15 @@ StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pr cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -3943,6 +5205,7 @@ StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pr localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -3958,11 +5221,14 @@ StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attributes_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4019,6 +5285,18 @@ StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pr keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -4061,17 +5339,236 @@ StorageV1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind CSIDriver +// +v1_csi_driver_list_t* +StorageV1API_listCSIDriver(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csidrivers"); + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4080,6 +5577,7 @@ StorageV1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4091,11 +5589,14 @@ StorageV1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_driver_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_driver_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4104,12 +5605,144 @@ StorageV1API_getAPIResources(apiClient_t *apiClient) apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - + list_freeList(localVarQueryParameters); list_freeList(localVarHeaderType); free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } return elementToReturn; end: free(localVarPath); @@ -4117,10 +5750,10 @@ StorageV1API_getAPIResources(apiClient_t *apiClient) } -// list or watch objects of kind CSIDriver +// list or watch objects of kind CSINode // -v1_csi_driver_list_t* -StorageV1API_listCSIDriver(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_csi_node_list_t* +StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -4128,11 +5761,14 @@ StorageV1API_listCSIDriver(apiClient_t *apiClient, char *pretty, int *allowWatch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csidrivers")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csidrivers"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csinodes"); + @@ -4276,8 +5912,10 @@ StorageV1API_listCSIDriver(apiClient_t *apiClient, char *pretty, int *allowWatch list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4286,6 +5924,7 @@ StorageV1API_listCSIDriver(apiClient_t *apiClient, char *pretty, int *allowWatch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4297,11 +5936,14 @@ StorageV1API_listCSIDriver(apiClient_t *apiClient, char *pretty, int *allowWatch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_driver_list_t *elementToReturn = v1_csi_driver_list_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_node_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_node_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4455,10 +6097,10 @@ StorageV1API_listCSIDriver(apiClient_t *apiClient, char *pretty, int *allowWatch } -// list or watch objects of kind CSINode +// list or watch objects of kind CSIStorageCapacity // -v1_csi_node_list_t* -StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_csi_storage_capacity_list_t* +StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -4466,26 +6108,17 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csinodes")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csinodes"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csistoragecapacities"); - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } // query parameters char *keyQuery_allowWatchBookmarks = NULL; @@ -4549,6 +6182,18 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo list_addElement(localVarQueryParameters,keyPairQuery_limit); } + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + // query parameters char *keyQuery_resourceVersion = NULL; char * valueQuery_resourceVersion = NULL; @@ -4614,8 +6259,10 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4624,6 +6271,7 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4635,11 +6283,14 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_node_list_t *elementToReturn = v1_csi_node_list_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_storage_capacity_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_storage_capacity_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4654,18 +6305,6 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo list_freeList(localVarHeaderType); free(localVarPath); - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } if(keyQuery_allowWatchBookmarks){ free(keyQuery_allowWatchBookmarks); keyQuery_allowWatchBookmarks = NULL; @@ -4726,6 +6365,18 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo keyValuePair_free(keyPairQuery_limit); keyPairQuery_limit = NULL; } + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } if(keyQuery_resourceVersion){ free(keyQuery_resourceVersion); keyQuery_resourceVersion = NULL; @@ -4796,7 +6447,7 @@ StorageV1API_listCSINode(apiClient_t *apiClient, char *pretty, int *allowWatchBo // list or watch objects of kind CSIStorageCapacity // v1_csi_storage_capacity_list_t* -StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -4804,14 +6455,41 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csistoragecapacities")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csistoragecapacities"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities"); + + if(!_namespace) + goto end; + + + // Path Params + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } // query parameters char *keyQuery_allowWatchBookmarks = NULL; @@ -4875,18 +6553,6 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int list_addElement(localVarQueryParameters,keyPairQuery_limit); } - // query parameters - char *keyQuery_pretty = NULL; - char * valueQuery_pretty = NULL; - keyValuePair_t *keyPairQuery_pretty = 0; - if (pretty) - { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_pretty); - } - // query parameters char *keyQuery_resourceVersion = NULL; char * valueQuery_resourceVersion = NULL; @@ -4952,8 +6618,10 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -4962,6 +6630,7 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -4973,11 +6642,14 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_storage_capacity_list_t *elementToReturn = v1_csi_storage_capacity_list_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_storage_capacity_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_storage_capacity_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -4992,6 +6664,19 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int list_freeList(localVarHeaderType); free(localVarPath); + free(localVarToReplace__namespace); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } if(keyQuery_allowWatchBookmarks){ free(keyQuery_allowWatchBookmarks); keyQuery_allowWatchBookmarks = NULL; @@ -5052,18 +6737,6 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int keyValuePair_free(keyPairQuery_limit); keyPairQuery_limit = NULL; } - if(keyQuery_pretty){ - free(keyQuery_pretty); - keyQuery_pretty = NULL; - } - if(valueQuery_pretty){ - free(valueQuery_pretty); - valueQuery_pretty = NULL; - } - if(keyPairQuery_pretty){ - keyValuePair_free(keyPairQuery_pretty); - keyPairQuery_pretty = NULL; - } if(keyQuery_resourceVersion){ free(keyQuery_resourceVersion); keyQuery_resourceVersion = NULL; @@ -5131,10 +6804,10 @@ StorageV1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int } -// list or watch objects of kind CSIStorageCapacity +// list or watch objects of kind StorageClass // -v1_csi_storage_capacity_list_t* -StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_storage_class_list_t* +StorageV1API_listStorageClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5142,22 +6815,15 @@ StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; - // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities"); + // clear the error code from the previous api call + apiClient->response_code = 0; + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/storageclasses"); - // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); @@ -5300,8 +6966,10 @@ StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_nam list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5310,6 +6978,7 @@ StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5321,11 +6990,14 @@ StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_storage_capacity_list_t *elementToReturn = v1_csi_storage_capacity_list_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_storage_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_storage_class_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5340,7 +7012,6 @@ StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_nam list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace__namespace); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -5480,10 +7151,10 @@ StorageV1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_nam } -// list or watch objects of kind StorageClass +// list or watch objects of kind VolumeAttachment // -v1_storage_class_list_t* -StorageV1API_listStorageClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_volume_attachment_list_t* +StorageV1API_listVolumeAttachment(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5491,11 +7162,14 @@ StorageV1API_listStorageClass(apiClient_t *apiClient, char *pretty, int *allowWa list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/storageclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/storageclasses"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments"); + @@ -5639,8 +7313,10 @@ StorageV1API_listStorageClass(apiClient_t *apiClient, char *pretty, int *allowWa list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5649,6 +7325,7 @@ StorageV1API_listStorageClass(apiClient_t *apiClient, char *pretty, int *allowWa localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5660,11 +7337,14 @@ StorageV1API_listStorageClass(apiClient_t *apiClient, char *pretty, int *allowWa // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_storage_class_list_t *elementToReturn = v1_storage_class_list_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -5818,10 +7498,10 @@ StorageV1API_listStorageClass(apiClient_t *apiClient, char *pretty, int *allowWa } -// list or watch objects of kind VolumeAttachment +// list or watch objects of kind VolumeAttributesClass // -v1_volume_attachment_list_t* -StorageV1API_listVolumeAttachment(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +v1_volume_attributes_class_list_t* +StorageV1API_listVolumeAttributesClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -5829,11 +7509,14 @@ StorageV1API_listVolumeAttachment(apiClient_t *apiClient, char *pretty, int *all list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattributesclasses"); + @@ -5977,8 +7660,10 @@ StorageV1API_listVolumeAttachment(apiClient_t *apiClient, char *pretty, int *all list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -5987,6 +7672,7 @@ StorageV1API_listVolumeAttachment(apiClient_t *apiClient, char *pretty, int *all localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -5998,11 +7684,14 @@ StorageV1API_listVolumeAttachment(apiClient_t *apiClient, char *pretty, int *all // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_list_t *elementToReturn = v1_volume_attachment_list_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attributes_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attributes_class_list_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6167,15 +7856,253 @@ StorageV1API_patchCSIDriver(apiClient_t *apiClient, char *name, object_t *body, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csidrivers/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_csi_driver_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified CSINode +// +v1_csi_node_t* +StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csidrivers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csidrivers/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csinodes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6251,17 +8178,20 @@ StorageV1API_patchCSIDriver(apiClient_t *apiClient, char *name, object_t *body, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6270,6 +8200,7 @@ StorageV1API_patchCSIDriver(apiClient_t *apiClient, char *name, object_t *body, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -6285,11 +8216,14 @@ StorageV1API_patchCSIDriver(apiClient_t *apiClient, char *name, object_t *body, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_driver_t *elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6377,10 +8311,10 @@ StorageV1API_patchCSIDriver(apiClient_t *apiClient, char *name, object_t *body, } -// partially update the specified CSINode +// partially update the specified CSIStorageCapacity // -v1_csi_node_t* -StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_csi_storage_capacity_t* +StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -6388,15 +8322,22 @@ StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, ch list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csinodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csinodes/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6405,6 +8346,16 @@ StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, ch localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters @@ -6472,17 +8423,20 @@ StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, ch cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6491,6 +8445,7 @@ StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, ch localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -6506,11 +8461,14 @@ StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, ch // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_node_t *elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_storage_capacity_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6526,6 +8484,7 @@ StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, ch list_freeList(localVarContentType); free(localVarPath); free(localVarToReplace_name); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -6598,10 +8557,10 @@ StorageV1API_patchCSINode(apiClient_t *apiClient, char *name, object_t *body, ch } -// partially update the specified CSIStorageCapacity +// partially update the specified StorageClass // -v1_csi_storage_capacity_t* -StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_storage_class_t* +StorageV1API_patchStorageClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -6609,15 +8568,20 @@ StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/storageclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6626,16 +8590,6 @@ StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *nam localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - // query parameters @@ -6703,17 +8657,20 @@ StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6722,6 +8679,7 @@ StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -6737,11 +8695,14 @@ StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_storage_capacity_t *elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_storage_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -6757,7 +8718,6 @@ StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *nam list_freeList(localVarContentType); free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -6830,10 +8790,10 @@ StorageV1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *nam } -// partially update the specified StorageClass +// partially update the specified VolumeAttachment // -v1_storage_class_t* -StorageV1API_patchStorageClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_volume_attachment_t* +StorageV1API_patchVolumeAttachment(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -6841,15 +8801,20 @@ StorageV1API_patchStorageClass(apiClient_t *apiClient, char *name, object_t *bod list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/storageclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/storageclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6925,17 +8890,20 @@ StorageV1API_patchStorageClass(apiClient_t *apiClient, char *name, object_t *bod cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -6944,6 +8912,7 @@ StorageV1API_patchStorageClass(apiClient_t *apiClient, char *name, object_t *bod localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -6959,11 +8928,14 @@ StorageV1API_patchStorageClass(apiClient_t *apiClient, char *name, object_t *bod // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_storage_class_t *elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7051,10 +9023,10 @@ StorageV1API_patchStorageClass(apiClient_t *apiClient, char *name, object_t *bod } -// partially update the specified VolumeAttachment +// partially update status of the specified VolumeAttachment // v1_volume_attachment_t* -StorageV1API_patchVolumeAttachment(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7062,15 +9034,20 @@ StorageV1API_patchVolumeAttachment(apiClient_t *apiClient, char *name, object_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7146,17 +9123,20 @@ StorageV1API_patchVolumeAttachment(apiClient_t *apiClient, char *name, object_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7165,6 +9145,7 @@ StorageV1API_patchVolumeAttachment(apiClient_t *apiClient, char *name, object_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -7180,11 +9161,14 @@ StorageV1API_patchVolumeAttachment(apiClient_t *apiClient, char *name, object_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7272,10 +9256,10 @@ StorageV1API_patchVolumeAttachment(apiClient_t *apiClient, char *name, object_t } -// partially update status of the specified VolumeAttachment +// partially update the specified VolumeAttributesClass // -v1_volume_attachment_t* -StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +v1_volume_attributes_class_t* +StorageV1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7283,15 +9267,20 @@ StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, obj list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments/{name}/status"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7367,17 +9356,20 @@ StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, obj cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7386,6 +9378,7 @@ StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, obj localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -7401,11 +9394,14 @@ StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, obj // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attributes_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7478,13 +9474,237 @@ StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, obj free(keyQuery_force); keyQuery_force = NULL; } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = NULL; + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified CSIDriver +// +v1_csi_driver_t* +StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csidrivers/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_csi_driver_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified CSINode +// +v1_csi_node_t* +StorageV1API_readCSINode(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csinodes/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_csi_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; } - if(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } return elementToReturn; end: @@ -7493,10 +9713,10 @@ StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, obj } -// read the specified CSIDriver +// read the specified CSIStorageCapacity // -v1_csi_driver_t* -StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) +v1_csi_storage_capacity_t* +StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7504,15 +9724,22 @@ StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csidrivers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csidrivers/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7521,6 +9748,16 @@ StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters @@ -7537,6 +9774,7 @@ StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7545,6 +9783,7 @@ StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -7556,11 +9795,14 @@ StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_driver_t *elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_storage_capacity_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7576,6 +9818,7 @@ StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) free(localVarPath); free(localVarToReplace_name); + free(localVarToReplace__namespace); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -7595,10 +9838,10 @@ StorageV1API_readCSIDriver(apiClient_t *apiClient, char *name, char *pretty) } -// read the specified CSINode +// read the specified StorageClass // -v1_csi_node_t* -StorageV1API_readCSINode(apiClient_t *apiClient, char *name, char *pretty) +v1_storage_class_t* +StorageV1API_readStorageClass(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7606,15 +9849,20 @@ StorageV1API_readCSINode(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csinodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csinodes/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/storageclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7639,6 +9887,7 @@ StorageV1API_readCSINode(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7647,6 +9896,7 @@ StorageV1API_readCSINode(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -7658,11 +9908,14 @@ StorageV1API_readCSINode(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_node_t *elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_storage_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7697,10 +9950,10 @@ StorageV1API_readCSINode(apiClient_t *apiClient, char *name, char *pretty) } -// read the specified CSIStorageCapacity +// read the specified VolumeAttachment // -v1_csi_storage_capacity_t* -StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty) +v1_volume_attachment_t* +StorageV1API_readVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7708,15 +9961,20 @@ StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7725,16 +9983,6 @@ StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - // query parameters @@ -7751,6 +9999,7 @@ StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7759,6 +10008,7 @@ StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -7770,11 +10020,14 @@ StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_storage_capacity_t *elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7790,7 +10043,6 @@ StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -7810,10 +10062,10 @@ StorageV1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name } -// read the specified StorageClass +// read status of the specified VolumeAttachment // -v1_storage_class_t* -StorageV1API_readStorageClass(apiClient_t *apiClient, char *name, char *pretty) +v1_volume_attachment_t* +StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7821,15 +10073,20 @@ StorageV1API_readStorageClass(apiClient_t *apiClient, char *name, char *pretty) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/storageclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/storageclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7854,6 +10111,7 @@ StorageV1API_readStorageClass(apiClient_t *apiClient, char *name, char *pretty) list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7862,6 +10120,7 @@ StorageV1API_readStorageClass(apiClient_t *apiClient, char *name, char *pretty) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -7873,11 +10132,14 @@ StorageV1API_readStorageClass(apiClient_t *apiClient, char *name, char *pretty) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_storage_class_t *elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -7912,10 +10174,10 @@ StorageV1API_readStorageClass(apiClient_t *apiClient, char *name, char *pretty) } -// read the specified VolumeAttachment +// read the specified VolumeAttributesClass // -v1_volume_attachment_t* -StorageV1API_readVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty) +v1_volume_attributes_class_t* +StorageV1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7923,15 +10185,20 @@ StorageV1API_readVolumeAttachment(apiClient_t *apiClient, char *name, char *pret list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -7956,6 +10223,7 @@ StorageV1API_readVolumeAttachment(apiClient_t *apiClient, char *name, char *pret list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -7964,6 +10232,7 @@ StorageV1API_readVolumeAttachment(apiClient_t *apiClient, char *name, char *pret localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -7975,11 +10244,14 @@ StorageV1API_readVolumeAttachment(apiClient_t *apiClient, char *name, char *pret // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attributes_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8014,10 +10286,10 @@ StorageV1API_readVolumeAttachment(apiClient_t *apiClient, char *name, char *pret } -// read status of the specified VolumeAttachment +// replace the specified CSIDriver // -v1_volume_attachment_t* -StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char *pretty) +v1_csi_driver_t* +StorageV1API_replaceCSIDriver(apiClient_t *apiClient, char *name, v1_csi_driver_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -8025,15 +10297,20 @@ StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments/{name}/status"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csidrivers/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8055,9 +10332,56 @@ StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); list_addElement(localVarQueryParameters,keyPairQuery_pretty); } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_csi_driver_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8066,22 +10390,30 @@ StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char localVarHeaderType, localVarContentType, localVarBodyParameters, - "GET"); + localVarBodyLength, + "PUT"); // uncomment below to debug the error response //if (apiClient->response_code == 200) { // printf("%s\n","OK"); //} // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_driver_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8097,6 +10429,11 @@ StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char free(localVarPath); free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -8109,6 +10446,42 @@ StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } return elementToReturn; end: free(localVarPath); @@ -8116,10 +10489,10 @@ StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char } -// replace the specified CSIDriver +// replace the specified CSINode // -v1_csi_driver_t* -StorageV1API_replaceCSIDriver(apiClient_t *apiClient, char *name, v1_csi_driver_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_csi_node_t* +StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -8127,15 +10500,20 @@ StorageV1API_replaceCSIDriver(apiClient_t *apiClient, char *name, v1_csi_driver_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csidrivers/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csidrivers/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/csinodes/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8198,13 +10576,15 @@ StorageV1API_replaceCSIDriver(apiClient_t *apiClient, char *name, v1_csi_driver_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_csi_driver_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_csi_node_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8213,6 +10593,7 @@ StorageV1API_replaceCSIDriver(apiClient_t *apiClient, char *name, v1_csi_driver_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -8228,11 +10609,14 @@ StorageV1API_replaceCSIDriver(apiClient_t *apiClient, char *name, v1_csi_driver_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_driver_t *elementToReturn = v1_csi_driver_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_node_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8308,10 +10692,10 @@ StorageV1API_replaceCSIDriver(apiClient_t *apiClient, char *name, v1_csi_driver_ } -// replace the specified CSINode +// replace the specified CSIStorageCapacity // -v1_csi_node_t* -StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_csi_storage_capacity_t* +StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, v1_csi_storage_capacity_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -8319,15 +10703,22 @@ StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *b list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/csinodes/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/csinodes/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + + if(!name) + goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8336,6 +10727,16 @@ StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *b localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + // Path Params + long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + if(_namespace == NULL) { + goto end; + } + char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); + sprintf(localVarToReplace__namespace, "{%s}", "namespace"); + + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + // query parameters @@ -8390,13 +10791,15 @@ StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *b cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_csi_node_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_csi_storage_capacity_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8405,6 +10808,7 @@ StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *b localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -8420,11 +10824,14 @@ StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *b // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_node_t *elementToReturn = v1_csi_node_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_csi_storage_capacity_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8440,6 +10847,7 @@ StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *b free(localVarPath); free(localVarToReplace_name); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -8500,10 +10908,10 @@ StorageV1API_replaceCSINode(apiClient_t *apiClient, char *name, v1_csi_node_t *b } -// replace the specified CSIStorageCapacity +// replace the specified StorageClass // -v1_csi_storage_capacity_t* -StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, v1_csi_storage_capacity_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_storage_class_t* +StorageV1API_replaceStorageClass(apiClient_t *apiClient, char *name, v1_storage_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -8511,15 +10919,20 @@ StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *n list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/storageclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8528,16 +10941,6 @@ StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *n localVarPath = strReplace(localVarPath, localVarToReplace_name, name); - // Path Params - long sizeOfPathParams__namespace = strlen(name)+3 + strlen(_namespace)+3 + strlen("{ namespace }"); - if(_namespace == NULL) { - goto end; - } - char* localVarToReplace__namespace = malloc(sizeOfPathParams__namespace); - sprintf(localVarToReplace__namespace, "{%s}", "namespace"); - - localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); - // query parameters @@ -8592,13 +10995,15 @@ StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *n cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_csi_storage_capacity_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_storage_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8607,6 +11012,7 @@ StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *n localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -8622,11 +11028,14 @@ StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *n // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_csi_storage_capacity_t *elementToReturn = v1_csi_storage_capacity_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_storage_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8642,7 +11051,6 @@ StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *n free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -8703,10 +11111,10 @@ StorageV1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *n } -// replace the specified StorageClass +// replace the specified VolumeAttachment // -v1_storage_class_t* -StorageV1API_replaceStorageClass(apiClient_t *apiClient, char *name, v1_storage_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_volume_attachment_t* +StorageV1API_replaceVolumeAttachment(apiClient_t *apiClient, char *name, v1_volume_attachment_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -8714,15 +11122,20 @@ StorageV1API_replaceStorageClass(apiClient_t *apiClient, char *name, v1_storage_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/storageclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/storageclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8785,13 +11198,15 @@ StorageV1API_replaceStorageClass(apiClient_t *apiClient, char *name, v1_storage_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_storage_class_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_volume_attachment_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8800,6 +11215,7 @@ StorageV1API_replaceStorageClass(apiClient_t *apiClient, char *name, v1_storage_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -8815,11 +11231,14 @@ StorageV1API_replaceStorageClass(apiClient_t *apiClient, char *name, v1_storage_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_storage_class_t *elementToReturn = v1_storage_class_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -8895,10 +11314,10 @@ StorageV1API_replaceStorageClass(apiClient_t *apiClient, char *name, v1_storage_ } -// replace the specified VolumeAttachment +// replace status of the specified VolumeAttachment // v1_volume_attachment_t* -StorageV1API_replaceVolumeAttachment(apiClient_t *apiClient, char *name, v1_volume_attachment_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +StorageV1API_replaceVolumeAttachmentStatus(apiClient_t *apiClient, char *name, v1_volume_attachment_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -8906,15 +11325,20 @@ StorageV1API_replaceVolumeAttachment(apiClient_t *apiClient, char *name, v1_volu list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattachments/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -8977,13 +11401,15 @@ StorageV1API_replaceVolumeAttachment(apiClient_t *apiClient, char *name, v1_volu cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_volume_attachment_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -8992,6 +11418,7 @@ StorageV1API_replaceVolumeAttachment(apiClient_t *apiClient, char *name, v1_volu localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -9007,11 +11434,14 @@ StorageV1API_replaceVolumeAttachment(apiClient_t *apiClient, char *name, v1_volu // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attachment_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -9087,10 +11517,10 @@ StorageV1API_replaceVolumeAttachment(apiClient_t *apiClient, char *name, v1_volu } -// replace status of the specified VolumeAttachment +// replace the specified VolumeAttributesClass // -v1_volume_attachment_t* -StorageV1API_replaceVolumeAttachmentStatus(apiClient_t *apiClient, char *name, v1_volume_attachment_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +v1_volume_attributes_class_t* +StorageV1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *name, v1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -9098,15 +11528,20 @@ StorageV1API_replaceVolumeAttachmentStatus(apiClient_t *apiClient, char *name, v list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1/volumeattachments/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1/volumeattachments/{name}/status"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -9169,13 +11604,15 @@ StorageV1API_replaceVolumeAttachmentStatus(apiClient_t *apiClient, char *name, v cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string - localVarSingleItemJSON_body = v1_volume_attachment_convertToJSON(body); + //not string, not binary + localVarSingleItemJSON_body = v1_volume_attributes_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -9184,6 +11621,7 @@ StorageV1API_replaceVolumeAttachmentStatus(apiClient_t *apiClient, char *name, v localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -9199,11 +11637,14 @@ StorageV1API_replaceVolumeAttachmentStatus(apiClient_t *apiClient, char *name, v // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_volume_attachment_t *elementToReturn = v1_volume_attachment_parseFromJSON(StorageV1APIlocalVarJSON); - cJSON_Delete(StorageV1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_volume_attributes_class_parseFromJSON(StorageV1APIlocalVarJSON); + cJSON_Delete(StorageV1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/StorageV1API.h b/kubernetes/api/StorageV1API.h index 4b394ad1..ccba577c 100644 --- a/kubernetes/api/StorageV1API.h +++ b/kubernetes/api/StorageV1API.h @@ -19,6 +19,8 @@ #include "../model/v1_storage_class_list.h" #include "../model/v1_volume_attachment.h" #include "../model/v1_volume_attachment_list.h" +#include "../model/v1_volume_attributes_class.h" +#include "../model/v1_volume_attributes_class_list.h" // create a CSIDriver @@ -51,64 +53,82 @@ v1_volume_attachment_t* StorageV1API_createVolumeAttachment(apiClient_t *apiClient, v1_volume_attachment_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// create a VolumeAttributesClass +// +v1_volume_attributes_class_t* +StorageV1API_createVolumeAttributesClass(apiClient_t *apiClient, v1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + // delete a CSIDriver // v1_csi_driver_t* -StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a CSINode // v1_csi_node_t* -StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete collection of CSIDriver // v1_status_t* -StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of CSINode // v1_status_t* -StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of CSIStorageCapacity // v1_status_t* -StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of StorageClass // v1_status_t* -StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete collection of VolumeAttachment // v1_status_t* -StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete collection of VolumeAttributesClass +// +v1_status_t* +StorageV1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a CSIStorageCapacity // v1_status_t* -StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a StorageClass // v1_storage_class_t* -StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // delete a VolumeAttachment // v1_volume_attachment_t* -StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// delete a VolumeAttributesClass +// +v1_volume_attributes_class_t* +StorageV1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources @@ -153,6 +173,12 @@ v1_volume_attachment_list_t* StorageV1API_listVolumeAttachment(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +// list or watch objects of kind VolumeAttributesClass +// +v1_volume_attributes_class_list_t* +StorageV1API_listVolumeAttributesClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + // partially update the specified CSIDriver // v1_csi_driver_t* @@ -189,6 +215,12 @@ v1_volume_attachment_t* StorageV1API_patchVolumeAttachmentStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +// partially update the specified VolumeAttributesClass +// +v1_volume_attributes_class_t* +StorageV1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + // read the specified CSIDriver // v1_csi_driver_t* @@ -225,6 +257,12 @@ v1_volume_attachment_t* StorageV1API_readVolumeAttachmentStatus(apiClient_t *apiClient, char *name, char *pretty); +// read the specified VolumeAttributesClass +// +v1_volume_attributes_class_t* +StorageV1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty); + + // replace the specified CSIDriver // v1_csi_driver_t* @@ -261,3 +299,9 @@ v1_volume_attachment_t* StorageV1API_replaceVolumeAttachmentStatus(apiClient_t *apiClient, char *name, v1_volume_attachment_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// replace the specified VolumeAttributesClass +// +v1_volume_attributes_class_t* +StorageV1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *name, v1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/StorageV1alpha1API.c b/kubernetes/api/StorageV1alpha1API.c index 1fef82cf..ddaa0f71 100644 --- a/kubernetes/api/StorageV1alpha1API.c +++ b/kubernetes/api/StorageV1alpha1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "StorageV1alpha1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a VolumeAttributesClass @@ -23,11 +20,14 @@ StorageV1alpha1API_createVolumeAttributesClass(apiClient_t *apiClient, v1alpha1_ list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"); + @@ -84,13 +84,15 @@ StorageV1alpha1API_createVolumeAttributesClass(apiClient_t *apiClient, v1alpha1_ cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_volume_attributes_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ StorageV1alpha1API_createVolumeAttributesClass(apiClient_t *apiClient, v1alpha1_ localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ StorageV1alpha1API_createVolumeAttributesClass(apiClient_t *apiClient, v1alpha1_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_volume_attributes_class_t *elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ StorageV1alpha1API_createVolumeAttributesClass(apiClient_t *apiClient, v1alpha1_ // delete collection of VolumeAttributesClass // v1_status_t* -StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"); + @@ -278,6 +287,19 @@ StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -382,13 +404,15 @@ StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -397,6 +421,7 @@ StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -408,11 +433,14 @@ StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -492,6 +520,18 @@ StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -598,7 +638,7 @@ StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, // delete a VolumeAttributesClass // v1alpha1_volume_attributes_class_t* -StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -606,15 +646,20 @@ StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *nam list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -662,6 +707,19 @@ StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *nam list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -691,13 +749,15 @@ StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *nam cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -706,6 +766,7 @@ StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *nam localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -721,11 +782,14 @@ StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_volume_attributes_class_t *elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -782,6 +846,18 @@ StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *nam keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -824,17 +900,21 @@ StorageV1alpha1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ StorageV1alpha1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ StorageV1alpha1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ StorageV1alpha1API_listVolumeAttributesClass(apiClient_t *apiClient, char *prett list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"); + @@ -1039,8 +1126,10 @@ StorageV1alpha1API_listVolumeAttributesClass(apiClient_t *apiClient, char *prett list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ StorageV1alpha1API_listVolumeAttributesClass(apiClient_t *apiClient, char *prett localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ StorageV1alpha1API_listVolumeAttributesClass(apiClient_t *apiClient, char *prett // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_volume_attributes_class_list_t *elementToReturn = v1alpha1_volume_attributes_class_list_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_volume_attributes_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_volume_attributes_class_list_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ StorageV1alpha1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ StorageV1alpha1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ StorageV1alpha1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ StorageV1alpha1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_volume_attributes_class_t *elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ StorageV1alpha1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1483,6 +1593,7 @@ StorageV1alpha1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1491,6 +1602,7 @@ StorageV1alpha1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1502,11 +1614,14 @@ StorageV1alpha1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_volume_attributes_class_t *elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1552,15 +1667,20 @@ StorageV1alpha1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *na list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + char *localVarPath = strdup("/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1623,13 +1743,15 @@ StorageV1alpha1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *na cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_volume_attributes_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1638,6 +1760,7 @@ StorageV1alpha1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *na localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1653,11 +1776,14 @@ StorageV1alpha1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *na // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_volume_attributes_class_t *elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); - cJSON_Delete(StorageV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_volume_attributes_class_parseFromJSON(StorageV1alpha1APIlocalVarJSON); + cJSON_Delete(StorageV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/StorageV1alpha1API.h b/kubernetes/api/StorageV1alpha1API.h index 5d3b2722..a5b177a0 100644 --- a/kubernetes/api/StorageV1alpha1API.h +++ b/kubernetes/api/StorageV1alpha1API.h @@ -22,13 +22,13 @@ StorageV1alpha1API_createVolumeAttributesClass(apiClient_t *apiClient, v1alpha1_ // delete collection of VolumeAttributesClass // v1_status_t* -StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a VolumeAttributesClass // v1alpha1_volume_attributes_class_t* -StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/StorageV1beta1API.c b/kubernetes/api/StorageV1beta1API.c new file mode 100644 index 00000000..0bd26588 --- /dev/null +++ b/kubernetes/api/StorageV1beta1API.c @@ -0,0 +1,1861 @@ +#include +#include +#include + +#include "StorageV1beta1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define MAX_NUMBER_LENGTH_LONG 21 + + +// create a VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_createVolumeAttributesClass(apiClient_t *apiClient, v1beta1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/volumeattributesclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_volume_attributes_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_volume_attributes_class_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete collection of VolumeAttributesClass +// +v1_status_t* +StorageV1beta1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/volumeattributesclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// delete a VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) + { + keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds"); + valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", *gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); + } + + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + + // query parameters + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) + { + keyQuery_orphanDependents = strdup("orphanDependents"); + valueQuery_orphanDependents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_orphanDependents, MAX_NUMBER_LENGTH, "%d", *orphanDependents); + keyPairQuery_orphanDependents = keyValuePair_create(keyQuery_orphanDependents, valueQuery_orphanDependents); + list_addElement(localVarQueryParameters,keyPairQuery_orphanDependents); + } + + // query parameters + char *keyQuery_propagationPolicy = NULL; + char * valueQuery_propagationPolicy = NULL; + keyValuePair_t *keyPairQuery_propagationPolicy = 0; + if (propagationPolicy) + { + keyQuery_propagationPolicy = strdup("propagationPolicy"); + valueQuery_propagationPolicy = strdup((propagationPolicy)); + keyPairQuery_propagationPolicy = keyValuePair_create(keyQuery_propagationPolicy, valueQuery_propagationPolicy); + list_addElement(localVarQueryParameters,keyPairQuery_propagationPolicy); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "DELETE"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 202) { + // printf("%s\n","Accepted"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_volume_attributes_class_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; + } + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; + } + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; + } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; + } + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; + } + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; + } + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; + } + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; + } + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// get available resources +// +v1_api_resource_list_t* +StorageV1beta1API_getAPIResources(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/"); + + + + + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// list or watch objects of kind VolumeAttributesClass +// +v1beta1_volume_attributes_class_list_t* +StorageV1beta1API_listVolumeAttributesClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/volumeattributesclasses"); + + + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_allowWatchBookmarks = NULL; + char * valueQuery_allowWatchBookmarks = NULL; + keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; + if (allowWatchBookmarks) + { + keyQuery_allowWatchBookmarks = strdup("allowWatchBookmarks"); + valueQuery_allowWatchBookmarks = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_allowWatchBookmarks, MAX_NUMBER_LENGTH, "%d", *allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = keyValuePair_create(keyQuery_allowWatchBookmarks, valueQuery_allowWatchBookmarks); + list_addElement(localVarQueryParameters,keyPairQuery_allowWatchBookmarks); + } + + // query parameters + char *keyQuery__continue = NULL; + char * valueQuery__continue = NULL; + keyValuePair_t *keyPairQuery__continue = 0; + if (_continue) + { + keyQuery__continue = strdup("continue"); + valueQuery__continue = strdup((_continue)); + keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); + list_addElement(localVarQueryParameters,keyPairQuery__continue); + } + + // query parameters + char *keyQuery_fieldSelector = NULL; + char * valueQuery_fieldSelector = NULL; + keyValuePair_t *keyPairQuery_fieldSelector = 0; + if (fieldSelector) + { + keyQuery_fieldSelector = strdup("fieldSelector"); + valueQuery_fieldSelector = strdup((fieldSelector)); + keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); + list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + } + + // query parameters + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) + { + keyQuery_labelSelector = strdup("labelSelector"); + valueQuery_labelSelector = strdup((labelSelector)); + keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); + list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + } + + // query parameters + char *keyQuery_limit = NULL; + char * valueQuery_limit = NULL; + keyValuePair_t *keyPairQuery_limit = 0; + if (limit) + { + keyQuery_limit = strdup("limit"); + valueQuery_limit = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_limit, MAX_NUMBER_LENGTH, "%d", *limit); + keyPairQuery_limit = keyValuePair_create(keyQuery_limit, valueQuery_limit); + list_addElement(localVarQueryParameters,keyPairQuery_limit); + } + + // query parameters + char *keyQuery_resourceVersion = NULL; + char * valueQuery_resourceVersion = NULL; + keyValuePair_t *keyPairQuery_resourceVersion = 0; + if (resourceVersion) + { + keyQuery_resourceVersion = strdup("resourceVersion"); + valueQuery_resourceVersion = strdup((resourceVersion)); + keyPairQuery_resourceVersion = keyValuePair_create(keyQuery_resourceVersion, valueQuery_resourceVersion); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersion); + } + + // query parameters + char *keyQuery_resourceVersionMatch = NULL; + char * valueQuery_resourceVersionMatch = NULL; + keyValuePair_t *keyPairQuery_resourceVersionMatch = 0; + if (resourceVersionMatch) + { + keyQuery_resourceVersionMatch = strdup("resourceVersionMatch"); + valueQuery_resourceVersionMatch = strdup((resourceVersionMatch)); + keyPairQuery_resourceVersionMatch = keyValuePair_create(keyQuery_resourceVersionMatch, valueQuery_resourceVersionMatch); + list_addElement(localVarQueryParameters,keyPairQuery_resourceVersionMatch); + } + + // query parameters + char *keyQuery_sendInitialEvents = NULL; + char * valueQuery_sendInitialEvents = NULL; + keyValuePair_t *keyPairQuery_sendInitialEvents = 0; + if (sendInitialEvents) + { + keyQuery_sendInitialEvents = strdup("sendInitialEvents"); + valueQuery_sendInitialEvents = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_sendInitialEvents, MAX_NUMBER_LENGTH, "%d", *sendInitialEvents); + keyPairQuery_sendInitialEvents = keyValuePair_create(keyQuery_sendInitialEvents, valueQuery_sendInitialEvents); + list_addElement(localVarQueryParameters,keyPairQuery_sendInitialEvents); + } + + // query parameters + char *keyQuery_timeoutSeconds = NULL; + char * valueQuery_timeoutSeconds = NULL; + keyValuePair_t *keyPairQuery_timeoutSeconds = 0; + if (timeoutSeconds) + { + keyQuery_timeoutSeconds = strdup("timeoutSeconds"); + valueQuery_timeoutSeconds = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_timeoutSeconds, MAX_NUMBER_LENGTH, "%d", *timeoutSeconds); + keyPairQuery_timeoutSeconds = keyValuePair_create(keyQuery_timeoutSeconds, valueQuery_timeoutSeconds); + list_addElement(localVarQueryParameters,keyPairQuery_timeoutSeconds); + } + + // query parameters + char *keyQuery_watch = NULL; + char * valueQuery_watch = NULL; + keyValuePair_t *keyPairQuery_watch = 0; + if (watch) + { + keyQuery_watch = strdup("watch"); + valueQuery_watch = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_watch, MAX_NUMBER_LENGTH, "%d", *watch); + keyPairQuery_watch = keyValuePair_create(keyQuery_watch, valueQuery_watch); + list_addElement(localVarQueryParameters,keyPairQuery_watch); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_volume_attributes_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_volume_attributes_class_list_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_allowWatchBookmarks){ + free(keyQuery_allowWatchBookmarks); + keyQuery_allowWatchBookmarks = NULL; + } + if(valueQuery_allowWatchBookmarks){ + free(valueQuery_allowWatchBookmarks); + valueQuery_allowWatchBookmarks = NULL; + } + if(keyPairQuery_allowWatchBookmarks){ + keyValuePair_free(keyPairQuery_allowWatchBookmarks); + keyPairQuery_allowWatchBookmarks = NULL; + } + if(keyQuery__continue){ + free(keyQuery__continue); + keyQuery__continue = NULL; + } + if(valueQuery__continue){ + free(valueQuery__continue); + valueQuery__continue = NULL; + } + if(keyPairQuery__continue){ + keyValuePair_free(keyPairQuery__continue); + keyPairQuery__continue = NULL; + } + if(keyQuery_fieldSelector){ + free(keyQuery_fieldSelector); + keyQuery_fieldSelector = NULL; + } + if(valueQuery_fieldSelector){ + free(valueQuery_fieldSelector); + valueQuery_fieldSelector = NULL; + } + if(keyPairQuery_fieldSelector){ + keyValuePair_free(keyPairQuery_fieldSelector); + keyPairQuery_fieldSelector = NULL; + } + if(keyQuery_labelSelector){ + free(keyQuery_labelSelector); + keyQuery_labelSelector = NULL; + } + if(valueQuery_labelSelector){ + free(valueQuery_labelSelector); + valueQuery_labelSelector = NULL; + } + if(keyPairQuery_labelSelector){ + keyValuePair_free(keyPairQuery_labelSelector); + keyPairQuery_labelSelector = NULL; + } + if(keyQuery_limit){ + free(keyQuery_limit); + keyQuery_limit = NULL; + } + if(valueQuery_limit){ + free(valueQuery_limit); + valueQuery_limit = NULL; + } + if(keyPairQuery_limit){ + keyValuePair_free(keyPairQuery_limit); + keyPairQuery_limit = NULL; + } + if(keyQuery_resourceVersion){ + free(keyQuery_resourceVersion); + keyQuery_resourceVersion = NULL; + } + if(valueQuery_resourceVersion){ + free(valueQuery_resourceVersion); + valueQuery_resourceVersion = NULL; + } + if(keyPairQuery_resourceVersion){ + keyValuePair_free(keyPairQuery_resourceVersion); + keyPairQuery_resourceVersion = NULL; + } + if(keyQuery_resourceVersionMatch){ + free(keyQuery_resourceVersionMatch); + keyQuery_resourceVersionMatch = NULL; + } + if(valueQuery_resourceVersionMatch){ + free(valueQuery_resourceVersionMatch); + valueQuery_resourceVersionMatch = NULL; + } + if(keyPairQuery_resourceVersionMatch){ + keyValuePair_free(keyPairQuery_resourceVersionMatch); + keyPairQuery_resourceVersionMatch = NULL; + } + if(keyQuery_sendInitialEvents){ + free(keyQuery_sendInitialEvents); + keyQuery_sendInitialEvents = NULL; + } + if(valueQuery_sendInitialEvents){ + free(valueQuery_sendInitialEvents); + valueQuery_sendInitialEvents = NULL; + } + if(keyPairQuery_sendInitialEvents){ + keyValuePair_free(keyPairQuery_sendInitialEvents); + keyPairQuery_sendInitialEvents = NULL; + } + if(keyQuery_timeoutSeconds){ + free(keyQuery_timeoutSeconds); + keyQuery_timeoutSeconds = NULL; + } + if(valueQuery_timeoutSeconds){ + free(valueQuery_timeoutSeconds); + valueQuery_timeoutSeconds = NULL; + } + if(keyPairQuery_timeoutSeconds){ + keyValuePair_free(keyPairQuery_timeoutSeconds); + keyPairQuery_timeoutSeconds = NULL; + } + if(keyQuery_watch){ + free(keyQuery_watch); + keyQuery_watch = NULL; + } + if(valueQuery_watch){ + free(valueQuery_watch); + valueQuery_watch = NULL; + } + if(keyPairQuery_watch){ + keyValuePair_free(keyPairQuery_watch); + keyPairQuery_watch = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// partially update the specified VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // query parameters + char *keyQuery_force = NULL; + char * valueQuery_force = NULL; + keyValuePair_t *keyPairQuery_force = 0; + if (force) + { + keyQuery_force = strdup("force"); + valueQuery_force = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_force, MAX_NUMBER_LENGTH, "%d", *force); + keyPairQuery_force = keyValuePair_create(keyQuery_force, valueQuery_force); + list_addElement(localVarQueryParameters,keyPairQuery_force); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = object_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + list_addElement(localVarContentType,"application/json-patch+json"); //consumes + list_addElement(localVarContentType,"application/merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes + list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PATCH"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_volume_attributes_class_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + if(keyQuery_force){ + free(keyQuery_force); + keyQuery_force = NULL; + } + if(valueQuery_force){ + free(valueQuery_force); + valueQuery_force = NULL; + } + if(keyPairQuery_force){ + keyValuePair_free(keyPairQuery_force); + keyPairQuery_force = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// read the specified VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_volume_attributes_class_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// replace the specified VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *name, v1beta1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation) +{ + list_t *localVarQueryParameters = list_createList(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; + + // create the path + char *localVarPath = strdup("/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}"); + + if(!name) + goto end; + + + // Path Params + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + if(name == NULL) { + goto end; + } + char* localVarToReplace_name = malloc(sizeOfPathParams_name); + sprintf(localVarToReplace_name, "{%s}", "name"); + + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) + { + keyQuery_pretty = strdup("pretty"); + valueQuery_pretty = strdup((pretty)); + keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); + list_addElement(localVarQueryParameters,keyPairQuery_pretty); + } + + // query parameters + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) + { + keyQuery_dryRun = strdup("dryRun"); + valueQuery_dryRun = strdup((dryRun)); + keyPairQuery_dryRun = keyValuePair_create(keyQuery_dryRun, valueQuery_dryRun); + list_addElement(localVarQueryParameters,keyPairQuery_dryRun); + } + + // query parameters + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) + { + keyQuery_fieldManager = strdup("fieldManager"); + valueQuery_fieldManager = strdup((fieldManager)); + keyPairQuery_fieldManager = keyValuePair_create(keyQuery_fieldManager, valueQuery_fieldManager); + list_addElement(localVarQueryParameters,keyPairQuery_fieldManager); + } + + // query parameters + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) + { + keyQuery_fieldValidation = strdup("fieldValidation"); + valueQuery_fieldValidation = strdup((fieldValidation)); + keyPairQuery_fieldValidation = keyValuePair_create(keyQuery_fieldValidation, valueQuery_fieldValidation); + list_addElement(localVarQueryParameters,keyPairQuery_fieldValidation); + } + + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) + { + //not string, not binary + localVarSingleItemJSON_body = v1beta1_volume_attributes_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarHeaderType,"application/yaml"); //produces + list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "PUT"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","OK"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 201) { + // printf("%s\n","Created"); + //} + // uncomment below to debug the error response + //if (apiClient->response_code == 401) { + // printf("%s\n","Unauthorized"); + //} + //nonprimitive not container + v1beta1_volume_attributes_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StorageV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1beta1_volume_attributes_class_parseFromJSON(StorageV1beta1APIlocalVarJSON); + cJSON_Delete(StorageV1beta1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + list_freeList(localVarQueryParameters); + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_name); + if (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; + } + free(localVarBodyParameters); + if(keyQuery_pretty){ + free(keyQuery_pretty); + keyQuery_pretty = NULL; + } + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; + } + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; + } + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; + } + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; + } + if(keyQuery_fieldManager){ + free(keyQuery_fieldManager); + keyQuery_fieldManager = NULL; + } + if(valueQuery_fieldManager){ + free(valueQuery_fieldManager); + valueQuery_fieldManager = NULL; + } + if(keyPairQuery_fieldManager){ + keyValuePair_free(keyPairQuery_fieldManager); + keyPairQuery_fieldManager = NULL; + } + if(keyQuery_fieldValidation){ + free(keyQuery_fieldValidation); + keyQuery_fieldValidation = NULL; + } + if(valueQuery_fieldValidation){ + free(valueQuery_fieldValidation); + valueQuery_fieldValidation = NULL; + } + if(keyPairQuery_fieldValidation){ + keyValuePair_free(keyPairQuery_fieldValidation); + keyPairQuery_fieldValidation = NULL; + } + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/kubernetes/api/StorageV1beta1API.h b/kubernetes/api/StorageV1beta1API.h new file mode 100644 index 00000000..afbf484d --- /dev/null +++ b/kubernetes/api/StorageV1beta1API.h @@ -0,0 +1,63 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" +#include "../model/v1_api_resource_list.h" +#include "../model/v1_delete_options.h" +#include "../model/v1_status.h" +#include "../model/v1beta1_volume_attributes_class.h" +#include "../model/v1beta1_volume_attributes_class_list.h" + + +// create a VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_createVolumeAttributesClass(apiClient_t *apiClient, v1beta1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + +// delete collection of VolumeAttributesClass +// +v1_status_t* +StorageV1beta1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); + + +// delete a VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); + + +// get available resources +// +v1_api_resource_list_t* +StorageV1beta1API_getAPIResources(apiClient_t *apiClient); + + +// list or watch objects of kind VolumeAttributesClass +// +v1beta1_volume_attributes_class_list_t* +StorageV1beta1API_listVolumeAttributesClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); + + +// partially update the specified VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); + + +// read the specified VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty); + + +// replace the specified VolumeAttributesClass +// +v1beta1_volume_attributes_class_t* +StorageV1beta1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *name, v1beta1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); + + diff --git a/kubernetes/api/StoragemigrationAPI.c b/kubernetes/api/StoragemigrationAPI.c index 653fd262..760b00a9 100644 --- a/kubernetes/api/StoragemigrationAPI.c +++ b/kubernetes/api/StoragemigrationAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "StoragemigrationAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get information of a group @@ -23,11 +20,14 @@ StoragemigrationAPI_getAPIGroup(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/"); + @@ -42,6 +42,7 @@ StoragemigrationAPI_getAPIGroup(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -53,11 +54,14 @@ StoragemigrationAPI_getAPIGroup(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(StoragemigrationAPIlocalVarJSON); - cJSON_Delete(StoragemigrationAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_group_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_group_parseFromJSON(StoragemigrationAPIlocalVarJSON); + cJSON_Delete(StoragemigrationAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/StoragemigrationV1alpha1API.c b/kubernetes/api/StoragemigrationV1alpha1API.c index f8a3d824..131bf5ec 100644 --- a/kubernetes/api/StoragemigrationV1alpha1API.c +++ b/kubernetes/api/StoragemigrationV1alpha1API.c @@ -1,15 +1,12 @@ #include #include #include + #include "StoragemigrationV1alpha1API.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // create a StorageVersionMigration @@ -23,11 +20,14 @@ StoragemigrationV1alpha1API_createStorageVersionMigration(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"); + @@ -84,13 +84,15 @@ StoragemigrationV1alpha1API_createStorageVersionMigration(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_storage_version_migration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -99,6 +101,7 @@ StoragemigrationV1alpha1API_createStorageVersionMigration(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "POST"); // uncomment below to debug the error response @@ -118,11 +121,14 @@ StoragemigrationV1alpha1API_createStorageVersionMigration(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_t *elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -200,7 +206,7 @@ StoragemigrationV1alpha1API_createStorageVersionMigration(apiClient_t *apiClient // delete collection of StorageVersionMigration // v1_status_t* -StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) +StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -208,11 +214,14 @@ StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"); + @@ -278,6 +287,19 @@ StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_labelSelector = NULL; char * valueQuery_labelSelector = NULL; @@ -382,13 +404,15 @@ StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -397,6 +421,7 @@ StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -408,11 +433,14 @@ StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -492,6 +520,18 @@ StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_labelSelector){ free(keyQuery_labelSelector); keyQuery_labelSelector = NULL; @@ -598,7 +638,7 @@ StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t // delete a StorageVersionMigration // v1_status_t* -StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -606,15 +646,20 @@ StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -662,6 +707,19 @@ StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds); } + // query parameters + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) + { + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = strdup("ignoreStoreReadErrorWithClusterBreakingPotential"); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = calloc(1,MAX_NUMBER_LENGTH); + snprintf(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential, MAX_NUMBER_LENGTH, "%d", *ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = keyValuePair_create(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential, valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + list_addElement(localVarQueryParameters,keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + } + // query parameters char *keyQuery_orphanDependents = NULL; char * valueQuery_orphanDependents = NULL; @@ -691,13 +749,15 @@ StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -706,6 +766,7 @@ StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "DELETE"); // uncomment below to debug the error response @@ -721,11 +782,14 @@ StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_status_t *elementToReturn = v1_status_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_status_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_status_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -782,6 +846,18 @@ StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient keyValuePair_free(keyPairQuery_gracePeriodSeconds); keyPairQuery_gracePeriodSeconds = NULL; } + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + } if(keyQuery_orphanDependents){ free(keyQuery_orphanDependents); keyQuery_orphanDependents = NULL; @@ -824,17 +900,21 @@ StoragemigrationV1alpha1API_getAPIResources(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/"); + list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -843,6 +923,7 @@ StoragemigrationV1alpha1API_getAPIResources(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -854,11 +935,14 @@ StoragemigrationV1alpha1API_getAPIResources(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1_api_resource_list_t *elementToReturn = v1_api_resource_list_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1_api_resource_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1_api_resource_list_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -891,11 +975,14 @@ StoragemigrationV1alpha1API_listStorageVersionMigration(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"); + @@ -1039,8 +1126,10 @@ StoragemigrationV1alpha1API_listStorageVersionMigration(apiClient_t *apiClient, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarHeaderType,"application/json;stream=watch"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf;stream=watch"); //produces + list_addElement(localVarHeaderType,"application/cbor-seq"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1049,6 +1138,7 @@ StoragemigrationV1alpha1API_listStorageVersionMigration(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1060,11 +1150,14 @@ StoragemigrationV1alpha1API_listStorageVersionMigration(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_list_t *elementToReturn = v1alpha1_storage_version_migration_list_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_list_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1229,15 +1322,20 @@ StoragemigrationV1alpha1API_patchStorageVersionMigration(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1313,17 +1411,20 @@ StoragemigrationV1alpha1API_patchStorageVersionMigration(apiClient_t *apiClient, cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1332,6 +1433,7 @@ StoragemigrationV1alpha1API_patchStorageVersionMigration(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1347,11 +1449,14 @@ StoragemigrationV1alpha1API_patchStorageVersionMigration(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_t *elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1450,15 +1555,20 @@ StoragemigrationV1alpha1API_patchStorageVersionMigrationStatus(apiClient_t *apiC list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1534,17 +1644,20 @@ StoragemigrationV1alpha1API_patchStorageVersionMigrationStatus(apiClient_t *apiC cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = object_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces list_addElement(localVarContentType,"application/json-patch+json"); //consumes list_addElement(localVarContentType,"application/merge-patch+json"); //consumes list_addElement(localVarContentType,"application/strategic-merge-patch+json"); //consumes list_addElement(localVarContentType,"application/apply-patch+yaml"); //consumes + list_addElement(localVarContentType,"application/apply-patch+cbor"); //consumes apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1553,6 +1666,7 @@ StoragemigrationV1alpha1API_patchStorageVersionMigrationStatus(apiClient_t *apiC localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PATCH"); // uncomment below to debug the error response @@ -1568,11 +1682,14 @@ StoragemigrationV1alpha1API_patchStorageVersionMigrationStatus(apiClient_t *apiC // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_t *elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1671,15 +1788,20 @@ StoragemigrationV1alpha1API_readStorageVersionMigration(apiClient_t *apiClient, list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1704,6 +1826,7 @@ StoragemigrationV1alpha1API_readStorageVersionMigration(apiClient_t *apiClient, list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1712,6 +1835,7 @@ StoragemigrationV1alpha1API_readStorageVersionMigration(apiClient_t *apiClient, localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1723,11 +1847,14 @@ StoragemigrationV1alpha1API_readStorageVersionMigration(apiClient_t *apiClient, // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_t *elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1773,15 +1900,20 @@ StoragemigrationV1alpha1API_readStorageVersionMigrationStatus(apiClient_t *apiCl list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1806,6 +1938,7 @@ StoragemigrationV1alpha1API_readStorageVersionMigrationStatus(apiClient_t *apiCl list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1814,6 +1947,7 @@ StoragemigrationV1alpha1API_readStorageVersionMigrationStatus(apiClient_t *apiCl localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -1825,11 +1959,14 @@ StoragemigrationV1alpha1API_readStorageVersionMigrationStatus(apiClient_t *apiCl // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_t *elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -1875,15 +2012,20 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigration(apiClient_t *apiClien list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -1946,13 +2088,15 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigration(apiClient_t *apiClien cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_storage_version_migration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -1961,6 +2105,7 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigration(apiClient_t *apiClien localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -1976,11 +2121,14 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigration(apiClient_t *apiClien // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_t *elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type @@ -2067,15 +2215,20 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigrationStatus(apiClient_t *ap list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status"); + char *localVarPath = strdup("/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status"); + + if(!name) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen("{ name }"); + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2138,13 +2291,15 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigrationStatus(apiClient_t *ap cJSON *localVarSingleItemJSON_body = NULL; if (body != NULL) { - //string + //not string, not binary localVarSingleItemJSON_body = v1alpha1_storage_version_migration_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces list_addElement(localVarHeaderType,"application/vnd.kubernetes.protobuf"); //produces + list_addElement(localVarHeaderType,"application/cbor"); //produces apiClient_invoke(apiClient, localVarPath, localVarQueryParameters, @@ -2153,6 +2308,7 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigrationStatus(apiClient_t *ap localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "PUT"); // uncomment below to debug the error response @@ -2168,11 +2324,14 @@ StoragemigrationV1alpha1API_replaceStorageVersionMigrationStatus(apiClient_t *ap // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - v1alpha1_storage_version_migration_t *elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); - cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + v1alpha1_storage_version_migration_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *StoragemigrationV1alpha1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha1_storage_version_migration_parseFromJSON(StoragemigrationV1alpha1APIlocalVarJSON); + cJSON_Delete(StoragemigrationV1alpha1APIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/StoragemigrationV1alpha1API.h b/kubernetes/api/StoragemigrationV1alpha1API.h index 50e0b91b..5e1f4c57 100644 --- a/kubernetes/api/StoragemigrationV1alpha1API.h +++ b/kubernetes/api/StoragemigrationV1alpha1API.h @@ -22,13 +22,13 @@ StoragemigrationV1alpha1API_createStorageVersionMigration(apiClient_t *apiClient // delete collection of StorageVersionMigration // v1_status_t* -StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); // delete a StorageVersionMigration // v1_status_t* -StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); // get available resources diff --git a/kubernetes/api/VersionAPI.c b/kubernetes/api/VersionAPI.c index b1aeaf24..4df2150c 100644 --- a/kubernetes/api/VersionAPI.c +++ b/kubernetes/api/VersionAPI.c @@ -1,18 +1,15 @@ #include #include #include + #include "VersionAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 -// get the code version +// get the version information for this server // version_info_t* VersionAPI_getCode(apiClient_t *apiClient) @@ -23,11 +20,14 @@ VersionAPI_getCode(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/version/")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/version/"); + char *localVarPath = strdup("/version/"); + @@ -40,6 +40,7 @@ VersionAPI_getCode(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -51,11 +52,14 @@ VersionAPI_getCode(apiClient_t *apiClient) // printf("%s\n","Unauthorized"); //} //nonprimitive not container - cJSON *VersionAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - version_info_t *elementToReturn = version_info_parseFromJSON(VersionAPIlocalVarJSON); - cJSON_Delete(VersionAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; + version_info_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *VersionAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = version_info_parseFromJSON(VersionAPIlocalVarJSON); + cJSON_Delete(VersionAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } } //return type diff --git a/kubernetes/api/VersionAPI.h b/kubernetes/api/VersionAPI.h index 4c21cba2..090737e3 100644 --- a/kubernetes/api/VersionAPI.h +++ b/kubernetes/api/VersionAPI.h @@ -8,7 +8,7 @@ #include "../model/version_info.h" -// get the code version +// get the version information for this server // version_info_t* VersionAPI_getCode(apiClient_t *apiClient); diff --git a/kubernetes/api/WellKnownAPI.c b/kubernetes/api/WellKnownAPI.c index 0eee0a54..9927b75a 100644 --- a/kubernetes/api/WellKnownAPI.c +++ b/kubernetes/api/WellKnownAPI.c @@ -1,15 +1,12 @@ #include #include #include + #include "WellKnownAPI.h" #define MAX_NUMBER_LENGTH 16 #define MAX_BUFFER_LENGTH 4096 -#define intToStr(dst, src) \ - do {\ - char dst[256];\ - snprintf(dst, 256, "%ld", (long int)(src));\ -}while(0) +#define MAX_NUMBER_LENGTH_LONG 21 // get service account issuer OpenID configuration, also known as the 'OIDC discovery doc' @@ -23,11 +20,14 @@ WellKnownAPI_getServiceAccountIssuerOpenIDConfiguration(apiClient_t *apiClient) list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; + size_t localVarBodyLength = 0; + + // clear the error code from the previous api call + apiClient->response_code = 0; // create the path - long sizeOfPath = strlen("/.well-known/openid-configuration")+1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/.well-known/openid-configuration"); + char *localVarPath = strdup("/.well-known/openid-configuration"); + @@ -40,6 +40,7 @@ WellKnownAPI_getServiceAccountIssuerOpenIDConfiguration(apiClient_t *apiClient) localVarHeaderType, localVarContentType, localVarBodyParameters, + localVarBodyLength, "GET"); // uncomment below to debug the error response @@ -50,8 +51,10 @@ WellKnownAPI_getServiceAccountIssuerOpenIDConfiguration(apiClient_t *apiClient) //if (apiClient->response_code == 401) { // printf("%s\n","Unauthorized"); //} - //primitive return type simple - char* elementToReturn = strdup((char*)apiClient->dataReceived); + //primitive return type simple string + char* elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) + elementToReturn = strdup((char*)apiClient->dataReceived); if (apiClient->dataReceived) { free(apiClient->dataReceived); diff --git a/kubernetes/config/authn_plugin/authn_plugin_util.c b/kubernetes/config/authn_plugin/authn_plugin_util.c index 5ab912d3..ee4ed7c3 100644 --- a/kubernetes/config/authn_plugin/authn_plugin_util.c +++ b/kubernetes/config/authn_plugin/authn_plugin_util.c @@ -11,7 +11,11 @@ int shc_request(char **p_http_response, int *p_http_response_length, char *type, fprintf(stderr, "%s: Cannot create http client. [%s].\n", fname, strerror(errno)); return -1; } - apiClient_invoke(http_client, NULL, NULL, NULL, NULL, NULL, contentType, post_data, type); + size_t len = 0; + if (post_data != NULL) { + len = strlen(post_data); + } + apiClient_invoke(http_client, NULL, NULL, NULL, NULL, NULL, contentType, post_data, len, type); int rc = http_client->response_code; switch (rc) { diff --git a/kubernetes/config/exec_provider.c b/kubernetes/config/exec_provider.c index f0dfa833..eb42d0e6 100644 --- a/kubernetes/config/exec_provider.c +++ b/kubernetes/config/exec_provider.c @@ -75,7 +75,8 @@ int kube_exec_and_get_result(ExecCredential_t * exec_credential, const kubeconfi result_string = calloc(1, KUBECONFIG_EXEC_RESULT_BUFFER_SIZE); if (!result_string) { fprintf(stderr, "%s: Cannot allocate memory for command result.[%s]\n", fname, strerror(errno)); - return -1; + rc = -1; + goto end; } int result_string_remaining_size = KUBECONFIG_EXEC_RESULT_BUFFER_SIZE - 1; char string_buf[KUBECONFIG_STRING_BUFFER_SIZE]; @@ -90,11 +91,6 @@ int kube_exec_and_get_result(ExecCredential_t * exec_credential, const kubeconfi strncat(result_string, string_buf, strlen(string_buf)); memset(string_buf, 0, sizeof(string_buf)); } -#ifndef _WIN32 - pclose(fp); -#else - _pclose(fp); -#endif } else { fprintf(stderr, "%s: Cannot open pipe to run command.[%s]\n", fname, strerror(errno)); return -1; @@ -105,7 +101,16 @@ int kube_exec_and_get_result(ExecCredential_t * exec_credential, const kubeconfi end: if (result_string) { free(result_string); + result_string = NULL; } + if (fp) { +#ifndef _WIN32 + pclose(fp); +#else + _pclose(fp); +#endif + fp = NULL; + } return rc; } diff --git a/kubernetes/config/kube_config.c b/kubernetes/config/kube_config.c index 115f2088..7f314836 100644 --- a/kubernetes/config/kube_config.c +++ b/kubernetes/config/kube_config.c @@ -29,6 +29,8 @@ #define KUBE_CONFIG_DEFAULT_LOCATION "%s/.kube/config" +int load_kube_config_common(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, kubeconfig_t * kubeconfig); + static int setBasePath(char **pBasePath, char *basePath) { char *_basePath = strdup(basePath); @@ -304,24 +306,17 @@ static int kuberconfig_auth_provider(kubeconfig_property_t * current_user, kubec return rc; } -int load_kube_config(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, const char *configFileName) +int load_kube_config_common(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, kubeconfig_t * kubeconfig) { - static char fname[] = "load_kube_config()"; + static char fname[] = "load_kube_config_common()"; int rc = 0; const kubeconfig_property_t *current_context = NULL; const kubeconfig_property_t *current_cluster = NULL; kubeconfig_property_t *current_user = NULL; - kubeconfig_t *kubeconfig = kubeconfig_create(); - if (!kubeconfig) { - fprintf(stderr, "%s: Cannot create kubeconfig.[%s]\n", fname, strerror(errno)); - return -1; - } - - kubeconfig->fileName = getWorkingConfigFile(configFileName); rc = kubeyaml_load_kubeconfig(kubeconfig); if (0 != rc) { - fprintf(stderr, "%s: Cannot load the kubeconfig %s\n", fname, kubeconfig->fileName); + fprintf(stderr, "%s: Cannot load the kubeconfig %s\n", fname, kubeconfig->fileName ? kubeconfig->fileName : kubeconfig->buffer); rc = -1; goto end; } @@ -393,8 +388,40 @@ int load_kube_config(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApi } end: - kubeconfig_free(kubeconfig); - kubeconfig = NULL; + return rc; +} + +int load_kube_config(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, const char *configFileName) +{ + static char fname[] = "load_kube_config()"; + int rc = 0; + + kubeconfig_t kubeconfig; + memset(&kubeconfig, 0, sizeof(kubeconfig_t)); + + kubeconfig.fileName = getWorkingConfigFile(configFileName); + + rc = load_kube_config_common(pBasePath, pSslConfig, pApiKeys, &kubeconfig); + + kubeconfig_free_members(&kubeconfig); + + return rc; +} + +int load_kube_config_buffer(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, const char *buffer) +{ + static char fname[] = "load_kube_config_buffer()"; + int rc = 0; + + kubeconfig_t kubeconfig; + memset(&kubeconfig, 0, sizeof(kubeconfig_t)); + + kubeconfig.buffer = strdup(buffer); + + rc = load_kube_config_common(pBasePath, pSslConfig, pApiKeys, &kubeconfig); + + kubeconfig_free_members(&kubeconfig); + return rc; } diff --git a/kubernetes/config/kube_config.h b/kubernetes/config/kube_config.h index 9d29f729..31d06054 100644 --- a/kubernetes/config/kube_config.h +++ b/kubernetes/config/kube_config.h @@ -46,6 +46,44 @@ extern "C" { int load_kube_config(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, const char *configFileName); +/* + * load_kube_config_buffer + * + * + * Description: + * + * + * Load kubernetes cluster configuration from specfied buffer + * + * + * Return: + * + * 0 Success + * -1 Failed + * + * + * Parameter: + * + * + * IN: + + * buffer : kubernetes cluster configuration data + * + * + * OUT: + * + * pBasePath: The pointer to API server address + * pSslConfig: The pointer to SSL configuration for client + * pApiKeys: The pointer to API tokens for client + * + * The memory will be allocated inside this function. User + * should call free_client_config to free the memory after + * these parameters are not used. + * + */ + + int load_kube_config_buffer(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, const char *buffer); + /* * free_client_config * diff --git a/kubernetes/config/kube_config_model.c b/kubernetes/config/kube_config_model.c index 8076c596..4d585096 100644 --- a/kubernetes/config/kube_config_model.c +++ b/kubernetes/config/kube_config_model.c @@ -1,6 +1,11 @@ #include "kube_config_model.h" #include +void kubeconfig_free_string_list(char **string_list, int count); +void kubeconfig_free_string_map_list(keyValuePair_t ** map_list, int count); + +char *kubeconfig_mk_cert_key_tempfile(const char *data); + void kubeconfig_free_string_list(char **string_list, int count) { if (string_list && count > 0) { @@ -214,7 +219,7 @@ kubeconfig_t *kubeconfig_create() return config; } -void kubeconfig_free(kubeconfig_t * kubeconfig) +void kubeconfig_free_members(kubeconfig_t * kubeconfig) { if (!kubeconfig) { return; @@ -224,6 +229,10 @@ void kubeconfig_free(kubeconfig_t * kubeconfig) free(kubeconfig->fileName); kubeconfig->fileName = NULL; } + if (kubeconfig->buffer) { + free(kubeconfig->buffer); + kubeconfig->buffer = NULL; + } if (kubeconfig->apiVersion) { free(kubeconfig->apiVersion); kubeconfig->apiVersion = NULL; @@ -252,6 +261,15 @@ void kubeconfig_free(kubeconfig_t * kubeconfig) kubeconfig_properties_free(kubeconfig->contexts, kubeconfig->contexts_count); kubeconfig->contexts = NULL; } +} + +void kubeconfig_free(kubeconfig_t * kubeconfig) +{ + if (!kubeconfig) { + return; + } + + kubeconfig_free_members(kubeconfig); free(kubeconfig); } diff --git a/kubernetes/config/kube_config_model.h b/kubernetes/config/kube_config_model.h index 45833a21..8915f5c7 100644 --- a/kubernetes/config/kube_config_model.h +++ b/kubernetes/config/kube_config_model.h @@ -88,6 +88,7 @@ extern "C" { typedef struct kubeconfig_t { char *fileName; + char *buffer; char *apiVersion; char *preferences; char *kind; @@ -112,9 +113,17 @@ extern "C" { kubeconfig_property_t **kubeconfig_properties_create(int contexts_count, kubeconfig_property_type_t type); void kubeconfig_properties_free(kubeconfig_property_t ** properties, int properties_count); + // allocate kubeconfig_t structure on heap kubeconfig_t *kubeconfig_create(); + + // free a kubeconfig_t structure allocated on heap by a call to kubeconfig_create void kubeconfig_free(kubeconfig_t * kubeconfig); + // free internal members of a kubeconfig_t structure. + // used when releasing resources for a kubeconfig_t that was not allocated using kubeconfig_create + // for example a kubeconfig_t allocated on stack + void kubeconfig_free_members(kubeconfig_t * kubeconfig); + #ifdef __cplusplus } #endif diff --git a/kubernetes/config/kube_config_util.c b/kubernetes/config/kube_config_util.c index 250fa304..40a960a3 100644 --- a/kubernetes/config/kube_config_util.c +++ b/kubernetes/config/kube_config_util.c @@ -13,6 +13,10 @@ #endif #include "../include/apiClient.h" +char *kubeconfig_mk_cert_key_tempfile(const char *data); +void unsetSslConfig(sslConfig_t * sslConfig); +void clear_and_free_string_pair_list(list_t * list); + static bool is_cert_or_key_base64_encoded(const char *data) { if (NULL == strstr(data, "BEGIN")) { diff --git a/kubernetes/config/kube_config_yaml.c b/kubernetes/config/kube_config_yaml.c index 3007f6eb..7a2967b5 100644 --- a/kubernetes/config/kube_config_yaml.c +++ b/kubernetes/config/kube_config_yaml.c @@ -58,6 +58,11 @@ mapping :: = MAPPING - START(node node) * MAPPING - END #define VALUE_TRUE_LOWERCASE_STRING "true" +int append_key_stringseq_to_mapping_node(yaml_document_t * output_document, int parent_node, const char *key_string, char **strings, int strings_count); +int append_auth_provider_config_to_mapping_node(yaml_document_t * output_document, int parent_node, const kubeconfig_property_t * auth_provider_config); +int append_key_kvpseq_to_mapping_node(yaml_document_t * output_document, int parent_node, const char *key_string, keyValuePair_t ** kvps, int kvps_count); + + static char *load_file_content(const char *path) { @@ -430,7 +435,12 @@ int kubeyaml_load_kubeconfig(kubeconfig_t * kubeconfig) { static char fname[] = "kubeyaml_load_kubeconfig()"; - /* Set a file input. */ + if (kubeconfig->fileName && kubeconfig->buffer) { + fprintf(stderr, "%s: Cannot use both kubeconfig->fileName and kubeconfig->buffer.\n", fname); + return -1; + } + + /* Set a file input or use the provided buffer. */ FILE *input = NULL; if (kubeconfig->fileName) { input = fopen(kubeconfig->fileName, "rb"); @@ -438,17 +448,23 @@ int kubeyaml_load_kubeconfig(kubeconfig_t * kubeconfig) fprintf(stderr, "%s: Cannot open the file %s.[%s]\n", fname, kubeconfig->fileName, strerror(errno)); return -1; } + } else if (kubeconfig->buffer) { + // Nothing to do here for now. } else { - fprintf(stderr, "%s: The kubeconf file name needs be set by kubeconfig->fileName .\n", fname); + fprintf(stderr, "%s: One of the kubeconfig->fileName or kubeconfig->buffer needs to be set.\n", fname); return -1; } + /* Create the Parser object. */ yaml_parser_t parser; yaml_document_t document; - /* Create the Parser object. */ yaml_parser_initialize(&parser); - yaml_parser_set_input_file(&parser, input); + if (input) { + yaml_parser_set_input_file(&parser, input); + } else { + yaml_parser_set_input_string(&parser, (const unsigned char *) kubeconfig->buffer, strlen(kubeconfig->buffer)); + } int done = 0; while (!done) { @@ -469,12 +485,16 @@ int kubeyaml_load_kubeconfig(kubeconfig_t * kubeconfig) /* Cleanup */ yaml_parser_delete(&parser); - fclose(input); + if (input) { + fclose(input); + } return 0; error: yaml_parser_delete(&parser); - fclose(input); + if (input) { + fclose(input); + } return -1; } @@ -1050,6 +1070,7 @@ int kubeyaml_save_kubeconfig(const kubeconfig_t * kubeconfig) /* Initialize the emitter object. */ if (!yaml_emitter_initialize(&emitter)) { fprintf(stderr, "%s: Could not initialize the emitter object\n", fname); + fclose(output); return -1; } diff --git a/kubernetes/config/kube_config_yaml.h b/kubernetes/config/kube_config_yaml.h index b162b5cf..82bb73ee 100644 --- a/kubernetes/config/kube_config_yaml.h +++ b/kubernetes/config/kube_config_yaml.h @@ -24,7 +24,10 @@ extern "C" { * * IN: * kubeconfig->fileName: kubernetes cluster configuration file name - * + * kubeconfig->buffer: kubernetes cluster configuration data; this is considered only if kubeconfig->fileName is set to NULL + * + * Note: One may use either kubeconfig->fileName or kubeconfig->buffer but not both at the same time. + * * OUT: * kubeconfig: kubernetes cluster configuration * diff --git a/kubernetes/docs/AdmissionregistrationV1API.md b/kubernetes/docs/AdmissionregistrationV1API.md index 48a70100..b4333b2e 100644 --- a/kubernetes/docs/AdmissionregistrationV1API.md +++ b/kubernetes/docs/AdmissionregistrationV1API.md @@ -67,7 +67,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -100,7 +100,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -133,7 +133,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -166,7 +166,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -174,7 +174,7 @@ Name | Type | Description | Notes ```c // delete collection of MutatingWebhookConfiguration // -v1_status_t* AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteCollectionMutatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -186,6 +186,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -208,7 +209,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -216,7 +217,7 @@ Name | Type | Description | Notes ```c // delete collection of ValidatingAdmissionPolicy // -v1_status_t* AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -228,6 +229,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -250,7 +252,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -258,7 +260,7 @@ Name | Type | Description | Notes ```c // delete collection of ValidatingAdmissionPolicyBinding // -v1_status_t* AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -270,6 +272,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -292,7 +295,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -300,7 +303,7 @@ Name | Type | Description | Notes ```c // delete collection of ValidatingWebhookConfiguration // -v1_status_t* AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteCollectionValidatingWebhookConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -312,6 +315,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -334,7 +338,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -342,7 +346,7 @@ Name | Type | Description | Notes ```c // delete a MutatingWebhookConfiguration // -v1_status_t* AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteMutatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -353,6 +357,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -369,7 +374,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -377,7 +382,7 @@ Name | Type | Description | Notes ```c // delete a ValidatingAdmissionPolicy // -v1_status_t* AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -388,6 +393,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -404,7 +410,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -412,7 +418,7 @@ Name | Type | Description | Notes ```c // delete a ValidatingAdmissionPolicyBinding // -v1_status_t* AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -423,6 +429,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -439,7 +446,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -447,7 +454,7 @@ Name | Type | Description | Notes ```c // delete a ValidatingWebhookConfiguration // -v1_status_t* AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1API_deleteValidatingWebhookConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -458,6 +465,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -474,7 +482,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -502,7 +510,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -541,7 +549,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -580,7 +588,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -619,7 +627,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -658,7 +666,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -692,8 +700,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -727,8 +735,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -762,8 +770,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -797,8 +805,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -832,8 +840,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -863,7 +871,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -893,7 +901,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -923,7 +931,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -953,7 +961,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -983,7 +991,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1017,7 +1025,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1051,7 +1059,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1085,7 +1093,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1119,7 +1127,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1153,7 +1161,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AdmissionregistrationV1alpha1API.md b/kubernetes/docs/AdmissionregistrationV1alpha1API.md index 0fedbfd4..048b40b7 100644 --- a/kubernetes/docs/AdmissionregistrationV1alpha1API.md +++ b/kubernetes/docs/AdmissionregistrationV1alpha1API.md @@ -4,38 +4,35 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies | -[**AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings | -[**AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies | -[**AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings | -[**AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | +[**AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +[**AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +[**AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +[**AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +[**AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | [**AdmissionregistrationV1alpha1API_getAPIResources**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_getAPIResources) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/ | -[**AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies | -[**AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings | -[**AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | -[**AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status | -[**AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | -[**AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status | -[**AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicybindings/{name} | -[**AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/validatingadmissionpolicies/{name}/status | - - -# **AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy** +[**AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +[**AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +[**AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +[**AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +[**AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding**](AdmissionregistrationV1alpha1API.md#AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | + + +# **AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy** ```c -// create a ValidatingAdmissionPolicy +// create a MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicy(apiClient_t *apiClient, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1alpha1_mutating_admission_policy_t* AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicy(apiClient_t *apiClient, v1alpha1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**body** | **[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) \*** | | +**body** | **[v1alpha1_mutating_admission_policy_t](v1alpha1_mutating_admission_policy.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -43,7 +40,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) * +[v1alpha1_mutating_admission_policy_t](v1alpha1_mutating_admission_policy.md) * ### Authorization @@ -53,22 +50,22 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding** ```c -// create a ValidatingAdmissionPolicyBinding +// create a MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_createValidatingAdmissionPolicyBinding(apiClient_t *apiClient, v1alpha1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1alpha1_mutating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_createMutatingAdmissionPolicyBinding(apiClient_t *apiClient, v1alpha1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**body** | **[v1alpha1_validating_admission_policy_binding_t](v1alpha1_validating_admission_policy_binding.md) \*** | | +**body** | **[v1alpha1_mutating_admission_policy_binding_t](v1alpha1_mutating_admission_policy_binding.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -76,7 +73,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_binding_t](v1alpha1_validating_admission_policy_binding.md) * +[v1alpha1_mutating_admission_policy_binding_t](v1alpha1_mutating_admission_policy_binding.md) * ### Authorization @@ -86,15 +83,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy** +# **AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy** ```c -// delete collection of ValidatingAdmissionPolicy +// delete collection of MutatingAdmissionPolicy // -v1_status_t* AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -106,6 +103,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -128,15 +126,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding** ```c -// delete collection of ValidatingAdmissionPolicyBinding +// delete collection of MutatingAdmissionPolicyBinding // -v1_status_t* AdmissionregistrationV1alpha1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1alpha1API_deleteCollectionMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -148,6 +146,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -170,25 +169,26 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy** +# **AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy** ```c -// delete a ValidatingAdmissionPolicy +// delete a MutatingAdmissionPolicy // -v1_status_t* AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | +**name** | **char \*** | name of the MutatingAdmissionPolicy | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -205,25 +205,26 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding** ```c -// delete a ValidatingAdmissionPolicyBinding +// delete a MutatingAdmissionPolicyBinding // -v1_status_t* AdmissionregistrationV1alpha1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1alpha1API_deleteMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -240,7 +241,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -268,15 +269,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy** +# **AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy** ```c -// list or watch objects of kind ValidatingAdmissionPolicy +// list or watch objects of kind MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_list_t* AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1alpha1_mutating_admission_policy_list_t* AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters @@ -297,7 +298,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_list_t](v1alpha1_validating_admission_policy_list.md) * +[v1alpha1_mutating_admission_policy_list_t](v1alpha1_mutating_admission_policy_list.md) * ### Authorization @@ -307,15 +308,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding** ```c -// list or watch objects of kind ValidatingAdmissionPolicyBinding +// list or watch objects of kind MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_list_t* AdmissionregistrationV1alpha1API_listValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1alpha1_mutating_admission_policy_binding_list_t* AdmissionregistrationV1alpha1API_listMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters @@ -336,7 +337,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_binding_list_t](v1alpha1_validating_admission_policy_binding_list.md) * +[v1alpha1_mutating_admission_policy_binding_list_t](v1alpha1_mutating_admission_policy_binding_list.md) * ### Authorization @@ -346,22 +347,22 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy** +# **AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy** ```c -// partially update the specified ValidatingAdmissionPolicy +// partially update the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1alpha1_mutating_admission_policy_t* AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | +**name** | **char \*** | name of the MutatingAdmissionPolicy | **body** | **[object_t](object.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] @@ -371,7 +372,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) * +[v1alpha1_mutating_admission_policy_t](v1alpha1_mutating_admission_policy.md) * ### Authorization @@ -380,23 +381,23 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding** ```c -// partially update the specified ValidatingAdmissionPolicyBinding +// partially update the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1alpha1_mutating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_patchMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | **body** | **[object_t](object.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] @@ -406,7 +407,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_binding_t](v1alpha1_validating_admission_policy_binding.md) * +[v1alpha1_mutating_admission_policy_binding_t](v1alpha1_mutating_admission_policy_binding.md) * ### Authorization @@ -415,63 +416,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus** +# **AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy** ```c -// partially update status of the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_t* AdmissionregistrationV1alpha1API_patchValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1alpha1_mutating_admission_policy_t* AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**body** | **[object_t](object.md) \*** | | +**name** | **char \*** | name of the MutatingAdmissionPolicy | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] -**dryRun** | **char \*** | 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] -**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] -**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] ### Return type -[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy** -```c -// read the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - -### Return type - -[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) * +[v1alpha1_mutating_admission_policy_t](v1alpha1_mutating_admission_policy.md) * ### Authorization @@ -481,91 +447,27 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding** ```c -// read the specified ValidatingAdmissionPolicyBinding +// read the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); +v1alpha1_mutating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_readMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] ### Return type -[v1alpha1_validating_admission_policy_binding_t](v1alpha1_validating_admission_policy_binding.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus** -```c -// read status of the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* AdmissionregistrationV1alpha1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, char *pretty); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - -### Return type - -[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy** -```c -// replace the specified ValidatingAdmissionPolicy -// -v1alpha1_validating_admission_policy_t* AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**body** | **[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] -**dryRun** | **char \*** | 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] -**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] -**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - -### Return type - -[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) * +[v1alpha1_mutating_admission_policy_binding_t](v1alpha1_mutating_admission_policy_binding.md) * ### Authorization @@ -575,23 +477,23 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy** ```c -// replace the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicy // -v1alpha1_validating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1alpha1_mutating_admission_policy_t* AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1alpha1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | -**body** | **[v1alpha1_validating_admission_policy_binding_t](v1alpha1_validating_admission_policy_binding.md) \*** | | +**name** | **char \*** | name of the MutatingAdmissionPolicy | +**body** | **[v1alpha1_mutating_admission_policy_t](v1alpha1_mutating_admission_policy.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -599,7 +501,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_binding_t](v1alpha1_validating_admission_policy_binding.md) * +[v1alpha1_mutating_admission_policy_t](v1alpha1_mutating_admission_policy.md) * ### Authorization @@ -609,23 +511,23 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus** +# **AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding** ```c -// replace status of the specified ValidatingAdmissionPolicy +// replace the specified MutatingAdmissionPolicyBinding // -v1alpha1_validating_admission_policy_t* AdmissionregistrationV1alpha1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, v1alpha1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1alpha1_mutating_admission_policy_binding_t* AdmissionregistrationV1alpha1API_replaceMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1alpha1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**body** | **[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) \*** | | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | +**body** | **[v1alpha1_mutating_admission_policy_binding_t](v1alpha1_mutating_admission_policy_binding.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -633,7 +535,7 @@ Name | Type | Description | Notes ### Return type -[v1alpha1_validating_admission_policy_t](v1alpha1_validating_admission_policy.md) * +[v1alpha1_mutating_admission_policy_binding_t](v1alpha1_mutating_admission_policy_binding.md) * ### Authorization @@ -643,7 +545,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AdmissionregistrationV1beta1API.md b/kubernetes/docs/AdmissionregistrationV1beta1API.md index 0c99a2e3..3357477d 100644 --- a/kubernetes/docs/AdmissionregistrationV1beta1API.md +++ b/kubernetes/docs/AdmissionregistrationV1beta1API.md @@ -4,38 +4,35 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies | -[**AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings | -[**AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies | -[**AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings | -[**AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | +[**AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy) | **POST** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +[**AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding) | **POST** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +[**AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +[**AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +[**AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | [**AdmissionregistrationV1beta1API_getAPIResources**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_getAPIResources) | **GET** /apis/admissionregistration.k8s.io/v1beta1/ | -[**AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies | -[**AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings | -[**AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | -[**AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status | -[**AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | -[**AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus) | **GET** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status | -[**AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name} | -[**AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicybindings/{name} | -[**AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/validatingadmissionpolicies/{name}/status | - - -# **AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy** +[**AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +[**AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +[**AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +[**AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +[**AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +[**AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding**](AdmissionregistrationV1beta1API.md#AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | + + +# **AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy** ```c -// create a ValidatingAdmissionPolicy +// create a MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* AdmissionregistrationV1beta1API_createValidatingAdmissionPolicy(apiClient_t *apiClient, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta1_mutating_admission_policy_t* AdmissionregistrationV1beta1API_createMutatingAdmissionPolicy(apiClient_t *apiClient, v1beta1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**body** | **[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) \*** | | +**body** | **[v1beta1_mutating_admission_policy_t](v1beta1_mutating_admission_policy.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -43,7 +40,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) * +[v1beta1_mutating_admission_policy_t](v1beta1_mutating_admission_policy.md) * ### Authorization @@ -53,22 +50,22 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding** ```c -// create a ValidatingAdmissionPolicyBinding +// create a MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* AdmissionregistrationV1beta1API_createValidatingAdmissionPolicyBinding(apiClient_t *apiClient, v1beta1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta1_mutating_admission_policy_binding_t* AdmissionregistrationV1beta1API_createMutatingAdmissionPolicyBinding(apiClient_t *apiClient, v1beta1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**body** | **[v1beta1_validating_admission_policy_binding_t](v1beta1_validating_admission_policy_binding.md) \*** | | +**body** | **[v1beta1_mutating_admission_policy_binding_t](v1beta1_mutating_admission_policy_binding.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -76,7 +73,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_binding_t](v1beta1_validating_admission_policy_binding.md) * +[v1beta1_mutating_admission_policy_binding_t](v1beta1_mutating_admission_policy_binding.md) * ### Authorization @@ -86,15 +83,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy** +# **AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy** ```c -// delete collection of ValidatingAdmissionPolicy +// delete collection of MutatingAdmissionPolicy // -v1_status_t* AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -106,6 +103,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -128,15 +126,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding** ```c -// delete collection of ValidatingAdmissionPolicyBinding +// delete collection of MutatingAdmissionPolicyBinding // -v1_status_t* AdmissionregistrationV1beta1API_deleteCollectionValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1beta1API_deleteCollectionMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -148,6 +146,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -170,25 +169,26 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy** +# **AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy** ```c -// delete a ValidatingAdmissionPolicy +// delete a MutatingAdmissionPolicy // -v1_status_t* AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | +**name** | **char \*** | name of the MutatingAdmissionPolicy | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -205,25 +205,26 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding** ```c -// delete a ValidatingAdmissionPolicyBinding +// delete a MutatingAdmissionPolicyBinding // -v1_status_t* AdmissionregistrationV1beta1API_deleteValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AdmissionregistrationV1beta1API_deleteMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -240,7 +241,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -268,15 +269,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy** +# **AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy** ```c -// list or watch objects of kind ValidatingAdmissionPolicy +// list or watch objects of kind MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_list_t* AdmissionregistrationV1beta1API_listValidatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1beta1_mutating_admission_policy_list_t* AdmissionregistrationV1beta1API_listMutatingAdmissionPolicy(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters @@ -297,7 +298,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_list_t](v1beta1_validating_admission_policy_list.md) * +[v1beta1_mutating_admission_policy_list_t](v1beta1_mutating_admission_policy_list.md) * ### Authorization @@ -307,15 +308,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding** ```c -// list or watch objects of kind ValidatingAdmissionPolicyBinding +// list or watch objects of kind MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_list_t* AdmissionregistrationV1beta1API_listValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1beta1_mutating_admission_policy_binding_list_t* AdmissionregistrationV1beta1API_listMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters @@ -336,7 +337,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_binding_list_t](v1beta1_validating_admission_policy_binding_list.md) * +[v1beta1_mutating_admission_policy_binding_list_t](v1beta1_mutating_admission_policy_binding_list.md) * ### Authorization @@ -346,22 +347,22 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy** +# **AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy** ```c -// partially update the specified ValidatingAdmissionPolicy +// partially update the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta1_mutating_admission_policy_t* AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | +**name** | **char \*** | name of the MutatingAdmissionPolicy | **body** | **[object_t](object.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] @@ -371,7 +372,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) * +[v1beta1_mutating_admission_policy_t](v1beta1_mutating_admission_policy.md) * ### Authorization @@ -380,23 +381,23 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding** ```c -// partially update the specified ValidatingAdmissionPolicyBinding +// partially update the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta1_mutating_admission_policy_binding_t* AdmissionregistrationV1beta1API_patchMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | **body** | **[object_t](object.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] @@ -406,7 +407,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_binding_t](v1beta1_validating_admission_policy_binding.md) * +[v1beta1_mutating_admission_policy_binding_t](v1beta1_mutating_admission_policy_binding.md) * ### Authorization @@ -415,63 +416,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus** +# **AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy** ```c -// partially update status of the specified ValidatingAdmissionPolicy +// read the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_t* AdmissionregistrationV1beta1API_patchValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta1_mutating_admission_policy_t* AdmissionregistrationV1beta1API_readMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**body** | **[object_t](object.md) \*** | | +**name** | **char \*** | name of the MutatingAdmissionPolicy | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] -**dryRun** | **char \*** | 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] -**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] -**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] ### Return type -[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy** -```c -// read the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* AdmissionregistrationV1beta1API_readValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, char *pretty); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - -### Return type - -[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) * +[v1beta1_mutating_admission_policy_t](v1beta1_mutating_admission_policy.md) * ### Authorization @@ -481,91 +447,27 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding** ```c -// read the specified ValidatingAdmissionPolicyBinding +// read the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_binding_t* AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); +v1beta1_mutating_admission_policy_binding_t* AdmissionregistrationV1beta1API_readMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] ### Return type -[v1beta1_validating_admission_policy_binding_t](v1beta1_validating_admission_policy_binding.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus** -```c -// read status of the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* AdmissionregistrationV1beta1API_readValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, char *pretty); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - -### Return type - -[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy** -```c -// replace the specified ValidatingAdmissionPolicy -// -v1beta1_validating_admission_policy_t* AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**body** | **[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] -**dryRun** | **char \*** | 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] -**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] -**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - -### Return type - -[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) * +[v1beta1_mutating_admission_policy_binding_t](v1beta1_mutating_admission_policy_binding.md) * ### Authorization @@ -575,23 +477,23 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding** +# **AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy** ```c -// replace the specified ValidatingAdmissionPolicyBinding +// replace the specified MutatingAdmissionPolicy // -v1beta1_validating_admission_policy_binding_t* AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta1_mutating_admission_policy_t* AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicy(apiClient_t *apiClient, char *name, v1beta1_mutating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicyBinding | -**body** | **[v1beta1_validating_admission_policy_binding_t](v1beta1_validating_admission_policy_binding.md) \*** | | +**name** | **char \*** | name of the MutatingAdmissionPolicy | +**body** | **[v1beta1_mutating_admission_policy_t](v1beta1_mutating_admission_policy.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -599,7 +501,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_binding_t](v1beta1_validating_admission_policy_binding.md) * +[v1beta1_mutating_admission_policy_t](v1beta1_mutating_admission_policy.md) * ### Authorization @@ -609,23 +511,23 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus** +# **AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding** ```c -// replace status of the specified ValidatingAdmissionPolicy +// replace the specified MutatingAdmissionPolicyBinding // -v1beta1_validating_admission_policy_t* AdmissionregistrationV1beta1API_replaceValidatingAdmissionPolicyStatus(apiClient_t *apiClient, char *name, v1beta1_validating_admission_policy_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta1_mutating_admission_policy_binding_t* AdmissionregistrationV1beta1API_replaceMutatingAdmissionPolicyBinding(apiClient_t *apiClient, char *name, v1beta1_mutating_admission_policy_binding_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the ValidatingAdmissionPolicy | -**body** | **[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) \*** | | +**name** | **char \*** | name of the MutatingAdmissionPolicyBinding | +**body** | **[v1beta1_mutating_admission_policy_binding_t](v1beta1_mutating_admission_policy_binding.md) \*** | | **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] @@ -633,7 +535,7 @@ Name | Type | Description | Notes ### Return type -[v1beta1_validating_admission_policy_t](v1beta1_validating_admission_policy.md) * +[v1beta1_mutating_admission_policy_binding_t](v1beta1_mutating_admission_policy_binding.md) * ### Authorization @@ -643,7 +545,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/ApiextensionsV1API.md b/kubernetes/docs/ApiextensionsV1API.md index afd6d369..a177f758 100644 --- a/kubernetes/docs/ApiextensionsV1API.md +++ b/kubernetes/docs/ApiextensionsV1API.md @@ -46,7 +46,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -54,7 +54,7 @@ Name | Type | Description | Notes ```c // delete collection of CustomResourceDefinition // -v1_status_t* ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* ApiextensionsV1API_deleteCollectionCustomResourceDefinition(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -66,6 +66,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +97,7 @@ Name | Type | Description | Notes ```c // delete a CustomResourceDefinition // -v1_status_t* ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* ApiextensionsV1API_deleteCustomResourceDefinition(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -107,6 +108,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -123,7 +125,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,7 +153,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -190,7 +192,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -224,8 +226,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -259,8 +261,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -290,7 +292,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -320,7 +322,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -354,7 +356,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -388,7 +390,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/ApiregistrationV1API.md b/kubernetes/docs/ApiregistrationV1API.md index 359b65b1..4a95d9b3 100644 --- a/kubernetes/docs/ApiregistrationV1API.md +++ b/kubernetes/docs/ApiregistrationV1API.md @@ -46,7 +46,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -54,7 +54,7 @@ Name | Type | Description | Notes ```c // delete an APIService // -v1_status_t* ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* ApiregistrationV1API_deleteAPIService(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -65,6 +65,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -81,7 +82,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -89,7 +90,7 @@ Name | Type | Description | Notes ```c // delete collection of APIService // -v1_status_t* ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* ApiregistrationV1API_deleteCollectionAPIService(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -101,6 +102,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -123,7 +125,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,7 +153,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -190,7 +192,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -224,8 +226,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -259,8 +261,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -290,7 +292,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -320,7 +322,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -354,7 +356,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -388,7 +390,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AppsV1API.md b/kubernetes/docs/AppsV1API.md index 0d2ea730..4ffa79a6 100644 --- a/kubernetes/docs/AppsV1API.md +++ b/kubernetes/docs/AppsV1API.md @@ -98,7 +98,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -132,7 +132,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -166,7 +166,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -200,7 +200,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -234,7 +234,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -242,7 +242,7 @@ Name | Type | Description | Notes ```c // delete collection of ControllerRevision // -v1_status_t* AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteCollectionNamespacedControllerRevision(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -255,6 +255,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -277,7 +278,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -285,7 +286,7 @@ Name | Type | Description | Notes ```c // delete collection of DaemonSet // -v1_status_t* AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteCollectionNamespacedDaemonSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -298,6 +299,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -320,7 +322,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -328,7 +330,7 @@ Name | Type | Description | Notes ```c // delete collection of Deployment // -v1_status_t* AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteCollectionNamespacedDeployment(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -341,6 +343,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -363,7 +366,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -371,7 +374,7 @@ Name | Type | Description | Notes ```c // delete collection of ReplicaSet // -v1_status_t* AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteCollectionNamespacedReplicaSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -384,6 +387,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -406,7 +410,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -414,7 +418,7 @@ Name | Type | Description | Notes ```c // delete collection of StatefulSet // -v1_status_t* AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteCollectionNamespacedStatefulSet(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -427,6 +431,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -449,7 +454,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -457,7 +462,7 @@ Name | Type | Description | Notes ```c // delete a ControllerRevision // -v1_status_t* AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteNamespacedControllerRevision(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -469,6 +474,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -485,7 +491,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -493,7 +499,7 @@ Name | Type | Description | Notes ```c // delete a DaemonSet // -v1_status_t* AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteNamespacedDaemonSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -505,6 +511,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -521,7 +528,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -529,7 +536,7 @@ Name | Type | Description | Notes ```c // delete a Deployment // -v1_status_t* AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteNamespacedDeployment(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -541,6 +548,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -557,7 +565,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -565,7 +573,7 @@ Name | Type | Description | Notes ```c // delete a ReplicaSet // -v1_status_t* AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteNamespacedReplicaSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -577,6 +585,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -593,7 +602,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -601,7 +610,7 @@ Name | Type | Description | Notes ```c // delete a StatefulSet // -v1_status_t* AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AppsV1API_deleteNamespacedStatefulSet(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -613,6 +622,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -629,7 +639,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -657,7 +667,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -696,7 +706,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -735,7 +745,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -774,7 +784,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -814,7 +824,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -854,7 +864,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -894,7 +904,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -934,7 +944,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -974,7 +984,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1013,7 +1023,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1052,7 +1062,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1087,8 +1097,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1123,8 +1133,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1159,8 +1169,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1195,8 +1205,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1231,8 +1241,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1267,8 +1277,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1303,8 +1313,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1339,8 +1349,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1375,8 +1385,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1411,8 +1421,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1447,8 +1457,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1483,8 +1493,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1515,7 +1525,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1546,7 +1556,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1577,7 +1587,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1608,7 +1618,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1639,7 +1649,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1670,7 +1680,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1701,7 +1711,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1732,7 +1742,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1763,7 +1773,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1794,7 +1804,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1825,7 +1835,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1856,7 +1866,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1891,7 +1901,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1926,7 +1936,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1961,7 +1971,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1996,7 +2006,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2031,7 +2041,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2066,7 +2076,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2101,7 +2111,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2136,7 +2146,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2171,7 +2181,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2206,7 +2216,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2241,7 +2251,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2276,7 +2286,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AuthenticationV1API.md b/kubernetes/docs/AuthenticationV1API.md index 8898b36c..75922119 100644 --- a/kubernetes/docs/AuthenticationV1API.md +++ b/kubernetes/docs/AuthenticationV1API.md @@ -38,7 +38,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -71,7 +71,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -99,7 +99,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AuthenticationV1alpha1API.md b/kubernetes/docs/AuthenticationV1alpha1API.md index 1b52b873..a948450b 100644 --- a/kubernetes/docs/AuthenticationV1alpha1API.md +++ b/kubernetes/docs/AuthenticationV1alpha1API.md @@ -4,15 +4,15 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AuthenticationV1alpha1API_createSelfSubjectReview**](AuthenticationV1alpha1API.md#AuthenticationV1alpha1API_createSelfSubjectReview) | **POST** /apis/authentication.k8s.io/v1alpha1/selfsubjectreviews | -[**AuthenticationV1alpha1API_getAPIResources**](AuthenticationV1alpha1API.md#AuthenticationV1alpha1API_getAPIResources) | **GET** /apis/authentication.k8s.io/v1alpha1/ | +[**AuthenticationV1alpha1API_createSelfSubjectReview_0**](AuthenticationV1alpha1API.md#AuthenticationV1alpha1API_createSelfSubjectReview_0) | **POST** /apis/authentication.k8s.io/v1alpha1/selfsubjectreviews | +[**AuthenticationV1alpha1API_getAPIResources_7**](AuthenticationV1alpha1API.md#AuthenticationV1alpha1API_getAPIResources_7) | **GET** /apis/authentication.k8s.io/v1alpha1/ | -# **AuthenticationV1alpha1API_createSelfSubjectReview** +# **AuthenticationV1alpha1API_createSelfSubjectReview_0** ```c // create a SelfSubjectReview // -v1alpha1_self_subject_review_t* AuthenticationV1alpha1API_createSelfSubjectReview(apiClient_t *apiClient, v1alpha1_self_subject_review_t *body, char *dryRun, char *fieldManager, char *fieldValidation, char *pretty); +v1alpha1_self_subject_review_t* AuthenticationV1alpha1API_createSelfSubjectReview_0(apiClient_t *apiClient, v1alpha1_self_subject_review_t *body, char *dryRun, char *fieldManager, char *fieldValidation, char *pretty); ``` ### Parameters @@ -41,11 +41,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **AuthenticationV1alpha1API_getAPIResources** +# **AuthenticationV1alpha1API_getAPIResources_7** ```c // get available resources // -v1_api_resource_list_t* AuthenticationV1alpha1API_getAPIResources(apiClient_t *apiClient); +v1_api_resource_list_t* AuthenticationV1alpha1API_getAPIResources_7(apiClient_t *apiClient); ``` ### Parameters diff --git a/kubernetes/docs/AuthenticationV1beta1API.md b/kubernetes/docs/AuthenticationV1beta1API.md index 6183ab9d..a72aa55b 100644 --- a/kubernetes/docs/AuthenticationV1beta1API.md +++ b/kubernetes/docs/AuthenticationV1beta1API.md @@ -37,7 +37,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -65,7 +65,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AuthorizationV1API.md b/kubernetes/docs/AuthorizationV1API.md index a890eda1..9bd500c5 100644 --- a/kubernetes/docs/AuthorizationV1API.md +++ b/kubernetes/docs/AuthorizationV1API.md @@ -41,7 +41,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -74,7 +74,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -107,7 +107,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -140,7 +140,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -168,7 +168,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AutoscalingV1API.md b/kubernetes/docs/AutoscalingV1API.md index ea8edf7a..cdbcdd4d 100644 --- a/kubernetes/docs/AutoscalingV1API.md +++ b/kubernetes/docs/AutoscalingV1API.md @@ -48,7 +48,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -56,7 +56,7 @@ Name | Type | Description | Notes ```c // delete collection of HorizontalPodAutoscaler // -v1_status_t* AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AutoscalingV1API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -69,6 +69,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -91,7 +92,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -99,7 +100,7 @@ Name | Type | Description | Notes ```c // delete a HorizontalPodAutoscaler // -v1_status_t* AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AutoscalingV1API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -111,6 +112,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -127,7 +129,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -155,7 +157,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -194,7 +196,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -234,7 +236,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -269,8 +271,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -305,8 +307,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -337,7 +339,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -368,7 +370,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -403,7 +405,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -438,7 +440,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/AutoscalingV2API.md b/kubernetes/docs/AutoscalingV2API.md index 6676faf8..9643e528 100644 --- a/kubernetes/docs/AutoscalingV2API.md +++ b/kubernetes/docs/AutoscalingV2API.md @@ -48,7 +48,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -56,7 +56,7 @@ Name | Type | Description | Notes ```c // delete collection of HorizontalPodAutoscaler // -v1_status_t* AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* AutoscalingV2API_deleteCollectionNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -69,6 +69,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -91,7 +92,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -99,7 +100,7 @@ Name | Type | Description | Notes ```c // delete a HorizontalPodAutoscaler // -v1_status_t* AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* AutoscalingV2API_deleteNamespacedHorizontalPodAutoscaler(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -111,6 +112,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -127,7 +129,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -155,7 +157,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -194,7 +196,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -234,7 +236,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -269,8 +271,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -305,8 +307,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -337,7 +339,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -368,7 +370,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -403,7 +405,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -438,7 +440,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/BatchV1API.md b/kubernetes/docs/BatchV1API.md index b20f840b..1000d275 100644 --- a/kubernetes/docs/BatchV1API.md +++ b/kubernetes/docs/BatchV1API.md @@ -59,7 +59,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -93,7 +93,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -101,7 +101,7 @@ Name | Type | Description | Notes ```c // delete collection of CronJob // -v1_status_t* BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* BatchV1API_deleteCollectionNamespacedCronJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -114,6 +114,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -136,7 +137,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -144,7 +145,7 @@ Name | Type | Description | Notes ```c // delete collection of Job // -v1_status_t* BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* BatchV1API_deleteCollectionNamespacedJob(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -157,6 +158,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -179,7 +181,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -187,7 +189,7 @@ Name | Type | Description | Notes ```c // delete a CronJob // -v1_status_t* BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* BatchV1API_deleteNamespacedCronJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -199,6 +201,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -215,7 +218,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -223,7 +226,7 @@ Name | Type | Description | Notes ```c // delete a Job // -v1_status_t* BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* BatchV1API_deleteNamespacedJob(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -235,6 +238,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -251,7 +255,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -279,7 +283,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -318,7 +322,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -357,7 +361,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -397,7 +401,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -437,7 +441,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -472,8 +476,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -508,8 +512,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -544,8 +548,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -580,8 +584,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -612,7 +616,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -643,7 +647,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -674,7 +678,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -705,7 +709,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -740,7 +744,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -775,7 +779,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -810,7 +814,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -845,7 +849,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/CertificatesV1API.md b/kubernetes/docs/CertificatesV1API.md index 9d9fb814..137377cc 100644 --- a/kubernetes/docs/CertificatesV1API.md +++ b/kubernetes/docs/CertificatesV1API.md @@ -49,7 +49,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -57,7 +57,7 @@ Name | Type | Description | Notes ```c // delete a CertificateSigningRequest // -v1_status_t* CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CertificatesV1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -68,6 +68,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -84,7 +85,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -92,7 +93,7 @@ Name | Type | Description | Notes ```c // delete collection of CertificateSigningRequest // -v1_status_t* CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CertificatesV1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -104,6 +105,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -126,7 +128,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -154,7 +156,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -193,7 +195,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -227,8 +229,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -262,8 +264,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -297,8 +299,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -328,7 +330,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -358,7 +360,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -388,7 +390,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -422,7 +424,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -456,7 +458,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -490,7 +492,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/CertificatesV1alpha1API.md b/kubernetes/docs/CertificatesV1alpha1API.md index 30097f21..37dbe402 100644 --- a/kubernetes/docs/CertificatesV1alpha1API.md +++ b/kubernetes/docs/CertificatesV1alpha1API.md @@ -5,13 +5,24 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**CertificatesV1alpha1API_createClusterTrustBundle**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_createClusterTrustBundle) | **POST** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +[**CertificatesV1alpha1API_createNamespacedPodCertificateRequest**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_createNamespacedPodCertificateRequest) | **POST** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests | [**CertificatesV1alpha1API_deleteClusterTrustBundle**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | [**CertificatesV1alpha1API_deleteCollectionClusterTrustBundle**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteCollectionClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +[**CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest) | **DELETE** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests | +[**CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest) | **DELETE** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | [**CertificatesV1alpha1API_getAPIResources**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_getAPIResources) | **GET** /apis/certificates.k8s.io/v1alpha1/ | [**CertificatesV1alpha1API_listClusterTrustBundle**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_listClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +[**CertificatesV1alpha1API_listNamespacedPodCertificateRequest**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_listNamespacedPodCertificateRequest) | **GET** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests | +[**CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces) | **GET** /apis/certificates.k8s.io/v1alpha1/podcertificaterequests | [**CertificatesV1alpha1API_patchClusterTrustBundle**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_patchClusterTrustBundle) | **PATCH** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +[**CertificatesV1alpha1API_patchNamespacedPodCertificateRequest**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_patchNamespacedPodCertificateRequest) | **PATCH** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | +[**CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus) | **PATCH** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status | [**CertificatesV1alpha1API_readClusterTrustBundle**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_readClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +[**CertificatesV1alpha1API_readNamespacedPodCertificateRequest**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_readNamespacedPodCertificateRequest) | **GET** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | +[**CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus) | **GET** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status | [**CertificatesV1alpha1API_replaceClusterTrustBundle**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_replaceClusterTrustBundle) | **PUT** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +[**CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest) | **PUT** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name} | +[**CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus**](CertificatesV1alpha1API.md#CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus) | **PUT** /apis/certificates.k8s.io/v1alpha1/namespaces/{namespace}/podcertificaterequests/{name}/status | # **CertificatesV1alpha1API_createClusterTrustBundle** @@ -43,7 +54,41 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_createNamespacedPodCertificateRequest** +```c +// create a PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* CertificatesV1alpha1API_createNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -51,7 +96,7 @@ Name | Type | Description | Notes ```c // delete a ClusterTrustBundle // -v1_status_t* CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CertificatesV1alpha1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -62,6 +107,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -78,7 +124,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -86,7 +132,7 @@ Name | Type | Description | Notes ```c // delete collection of ClusterTrustBundle // -v1_status_t* CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CertificatesV1alpha1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -98,6 +144,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -120,7 +167,88 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest** +```c +// delete collection of PodCertificateRequest +// +v1_status_t* CertificatesV1alpha1API_deleteCollectionNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest** +```c +// delete a PodCertificateRequest +// +v1_status_t* CertificatesV1alpha1API_deleteNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the PodCertificateRequest | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -148,7 +276,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -187,7 +315,86 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_listNamespacedPodCertificateRequest** +```c +// list or watch objects of kind PodCertificateRequest +// +v1alpha1_pod_certificate_request_list_t* CertificatesV1alpha1API_listNamespacedPodCertificateRequest(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_list_t](v1alpha1_pod_certificate_request_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces** +```c +// list or watch objects of kind PodCertificateRequest +// +v1alpha1_pod_certificate_request_list_t* CertificatesV1alpha1API_listPodCertificateRequestForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_list_t](v1alpha1_pod_certificate_request_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -221,8 +428,80 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_patchNamespacedPodCertificateRequest** +```c +// partially update the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* CertificatesV1alpha1API_patchNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the PodCertificateRequest | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus** +```c +// partially update status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* CertificatesV1alpha1API_patchNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the PodCertificateRequest | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -252,7 +531,69 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_readNamespacedPodCertificateRequest** +```c +// read the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* CertificatesV1alpha1API_readNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the PodCertificateRequest | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus** +```c +// read status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* CertificatesV1alpha1API_readNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the PodCertificateRequest | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -286,7 +627,77 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest** +```c +// replace the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* CertificatesV1alpha1API_replaceNamespacedPodCertificateRequest(apiClient_t *apiClient, char *name, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the PodCertificateRequest | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus** +```c +// replace status of the specified PodCertificateRequest +// +v1alpha1_pod_certificate_request_t* CertificatesV1alpha1API_replaceNamespacedPodCertificateRequestStatus(apiClient_t *apiClient, char *name, char *_namespace, v1alpha1_pod_certificate_request_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the PodCertificateRequest | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha1_pod_certificate_request_t](v1alpha1_pod_certificate_request.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/CertificatesV1beta1API.md b/kubernetes/docs/CertificatesV1beta1API.md index 7b8c1861..fdd489fb 100644 --- a/kubernetes/docs/CertificatesV1beta1API.md +++ b/kubernetes/docs/CertificatesV1beta1API.md @@ -4,39 +4,36 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CertificatesV1beta1API_createCertificateSigningRequest**](CertificatesV1beta1API.md#CertificatesV1beta1API_createCertificateSigningRequest) | **POST** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests | -[**CertificatesV1beta1API_deleteCertificateSigningRequest**](CertificatesV1beta1API.md#CertificatesV1beta1API_deleteCertificateSigningRequest) | **DELETE** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name} | -[**CertificatesV1beta1API_deleteCollectionCertificateSigningRequest**](CertificatesV1beta1API.md#CertificatesV1beta1API_deleteCollectionCertificateSigningRequest) | **DELETE** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests | +[**CertificatesV1beta1API_createClusterTrustBundle**](CertificatesV1beta1API.md#CertificatesV1beta1API_createClusterTrustBundle) | **POST** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +[**CertificatesV1beta1API_deleteClusterTrustBundle**](CertificatesV1beta1API.md#CertificatesV1beta1API_deleteClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +[**CertificatesV1beta1API_deleteCollectionClusterTrustBundle**](CertificatesV1beta1API.md#CertificatesV1beta1API_deleteCollectionClusterTrustBundle) | **DELETE** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | [**CertificatesV1beta1API_getAPIResources**](CertificatesV1beta1API.md#CertificatesV1beta1API_getAPIResources) | **GET** /apis/certificates.k8s.io/v1beta1/ | -[**CertificatesV1beta1API_listCertificateSigningRequest**](CertificatesV1beta1API.md#CertificatesV1beta1API_listCertificateSigningRequest) | **GET** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests | -[**CertificatesV1beta1API_patchCertificateSigningRequest**](CertificatesV1beta1API.md#CertificatesV1beta1API_patchCertificateSigningRequest) | **PATCH** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name} | -[**CertificatesV1beta1API_patchCertificateSigningRequestStatus**](CertificatesV1beta1API.md#CertificatesV1beta1API_patchCertificateSigningRequestStatus) | **PATCH** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status | -[**CertificatesV1beta1API_readCertificateSigningRequest**](CertificatesV1beta1API.md#CertificatesV1beta1API_readCertificateSigningRequest) | **GET** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name} | -[**CertificatesV1beta1API_readCertificateSigningRequestStatus**](CertificatesV1beta1API.md#CertificatesV1beta1API_readCertificateSigningRequestStatus) | **GET** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status | -[**CertificatesV1beta1API_replaceCertificateSigningRequest**](CertificatesV1beta1API.md#CertificatesV1beta1API_replaceCertificateSigningRequest) | **PUT** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name} | -[**CertificatesV1beta1API_replaceCertificateSigningRequestApproval**](CertificatesV1beta1API.md#CertificatesV1beta1API_replaceCertificateSigningRequestApproval) | **PUT** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval | -[**CertificatesV1beta1API_replaceCertificateSigningRequestStatus**](CertificatesV1beta1API.md#CertificatesV1beta1API_replaceCertificateSigningRequestStatus) | **PUT** /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status | +[**CertificatesV1beta1API_listClusterTrustBundle**](CertificatesV1beta1API.md#CertificatesV1beta1API_listClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +[**CertificatesV1beta1API_patchClusterTrustBundle**](CertificatesV1beta1API.md#CertificatesV1beta1API_patchClusterTrustBundle) | **PATCH** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +[**CertificatesV1beta1API_readClusterTrustBundle**](CertificatesV1beta1API.md#CertificatesV1beta1API_readClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +[**CertificatesV1beta1API_replaceClusterTrustBundle**](CertificatesV1beta1API.md#CertificatesV1beta1API_replaceClusterTrustBundle) | **PUT** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | -# **CertificatesV1beta1API_createCertificateSigningRequest** +# **CertificatesV1beta1API_createClusterTrustBundle** ```c -// create a CertificateSigningRequest +// create a ClusterTrustBundle // -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_createCertificateSigningRequest(apiClient_t *apiClient, v1beta1_certificate_signing_request_t * body, char * pretty, char * dryRun, char * fieldManager); +v1beta1_cluster_trust_bundle_t* CertificatesV1beta1API_createClusterTrustBundle(apiClient_t *apiClient, v1beta1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**body** | **[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**body** | **[v1beta1_cluster_trust_bundle_t](v1beta1_cluster_trust_bundle.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * +[v1beta1_cluster_trust_bundle_t](v1beta1_cluster_trust_bundle.md) * ### Authorization @@ -46,26 +43,27 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CertificatesV1beta1API_deleteCertificateSigningRequest** +# **CertificatesV1beta1API_deleteClusterTrustBundle** ```c -// delete a CertificateSigningRequest +// delete a ClusterTrustBundle // -v1_status_t* CertificatesV1beta1API_deleteCertificateSigningRequest(apiClient_t *apiClient, char * name, char * pretty, char * dryRun, int gracePeriodSeconds, int orphanDependents, char * propagationPolicy, v1_delete_options_t * body); +v1_status_t* CertificatesV1beta1API_deleteClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the ClusterTrustBundle | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] -**gracePeriodSeconds** | **int** | 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] -**orphanDependents** | **int** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -81,32 +79,35 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CertificatesV1beta1API_deleteCollectionCertificateSigningRequest** +# **CertificatesV1beta1API_deleteCollectionClusterTrustBundle** ```c -// delete collection of CertificateSigningRequest +// delete collection of ClusterTrustBundle // -v1_status_t* CertificatesV1beta1API_deleteCollectionCertificateSigningRequest(apiClient_t *apiClient, char * pretty, char * _continue, char * dryRun, char * fieldSelector, int gracePeriodSeconds, char * labelSelector, int limit, int orphanDependents, char * propagationPolicy, char * resourceVersion, int timeoutSeconds, v1_delete_options_t * body); +v1_status_t* CertificatesV1beta1API_deleteCollectionClusterTrustBundle(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **_continue** | **char \*** | 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. | [optional] **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] -**gracePeriodSeconds** | **int** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**orphanDependents** | **int** | 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] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] ### Return type @@ -121,7 +122,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -149,34 +150,36 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CertificatesV1beta1API_listCertificateSigningRequest** +# **CertificatesV1beta1API_listClusterTrustBundle** ```c -// list or watch objects of kind CertificateSigningRequest +// list or watch objects of kind ClusterTrustBundle // -v1beta1_certificate_signing_request_list_t* CertificatesV1beta1API_listCertificateSigningRequest(apiClient_t *apiClient, char * pretty, int allowWatchBookmarks, char * _continue, char * fieldSelector, char * labelSelector, int limit, char * resourceVersion, int timeoutSeconds, int watch); +v1beta1_cluster_trust_bundle_list_t* CertificatesV1beta1API_listClusterTrustBundle(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**allowWatchBookmarks** | **int** | 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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] **_continue** | **char \*** | 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. | [optional] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] -**watch** | **int** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] ### Return type -[v1beta1_certificate_signing_request_list_t](v1beta1_certificate_signing_request_list.md) * +[v1beta1_cluster_trust_bundle_list_t](v1beta1_cluster_trust_bundle_list.md) * ### Authorization @@ -186,31 +189,32 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CertificatesV1beta1API_patchCertificateSigningRequest** +# **CertificatesV1beta1API_patchClusterTrustBundle** ```c -// partially update the specified CertificateSigningRequest +// partially update the specified ClusterTrustBundle // -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_patchCertificateSigningRequest(apiClient_t *apiClient, char * name, object_t * body, char * pretty, char * dryRun, char * fieldManager, int force); +v1beta1_cluster_trust_bundle_t* CertificatesV1beta1API_patchClusterTrustBundle(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | +**name** | **char \*** | name of the ClusterTrustBundle | **body** | **[object_t](object.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**force** | **int** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] ### Return type -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * +[v1beta1_cluster_trust_bundle_t](v1beta1_cluster_trust_bundle.md) * ### Authorization @@ -219,160 +223,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CertificatesV1beta1API_patchCertificateSigningRequestStatus** +# **CertificatesV1beta1API_readClusterTrustBundle** ```c -// partially update status of the specified CertificateSigningRequest +// read the specified ClusterTrustBundle // -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_patchCertificateSigningRequestStatus(apiClient_t *apiClient, char * name, object_t * body, char * pretty, char * dryRun, char * fieldManager, int force); +v1beta1_cluster_trust_bundle_t* CertificatesV1beta1API_readClusterTrustBundle(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | -**body** | **[object_t](object.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**dryRun** | **char \*** | 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] -**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**force** | **int** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] - -### Return type - -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CertificatesV1beta1API_readCertificateSigningRequest** -```c -// read the specified CertificateSigningRequest -// -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_readCertificateSigningRequest(apiClient_t *apiClient, char * name, char * pretty, int exact, int _export); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**exact** | **int** | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18. | [optional] -**_export** | **int** | Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. | [optional] - -### Return type - -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CertificatesV1beta1API_readCertificateSigningRequestStatus** -```c -// read status of the specified CertificateSigningRequest -// -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_readCertificateSigningRequestStatus(apiClient_t *apiClient, char * name, char * pretty); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] - -### Return type - -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CertificatesV1beta1API_replaceCertificateSigningRequest** -```c -// replace the specified CertificateSigningRequest -// -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_replaceCertificateSigningRequest(apiClient_t *apiClient, char * name, v1beta1_certificate_signing_request_t * body, char * pretty, char * dryRun, char * fieldManager); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | -**body** | **[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**dryRun** | **char \*** | 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] -**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] - -### Return type - -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CertificatesV1beta1API_replaceCertificateSigningRequestApproval** -```c -// replace approval of the specified CertificateSigningRequest -// -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_replaceCertificateSigningRequestApproval(apiClient_t *apiClient, char * name, v1beta1_certificate_signing_request_t * body, char * dryRun, char * fieldManager, char * pretty); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | -**body** | **[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) \*** | | -**dryRun** | **char \*** | 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] -**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the ClusterTrustBundle | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] ### Return type -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * +[v1beta1_cluster_trust_bundle_t](v1beta1_cluster_trust_bundle.md) * ### Authorization @@ -382,30 +254,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CertificatesV1beta1API_replaceCertificateSigningRequestStatus** +# **CertificatesV1beta1API_replaceClusterTrustBundle** ```c -// replace status of the specified CertificateSigningRequest +// replace the specified ClusterTrustBundle // -v1beta1_certificate_signing_request_t* CertificatesV1beta1API_replaceCertificateSigningRequestStatus(apiClient_t *apiClient, char * name, v1beta1_certificate_signing_request_t * body, char * pretty, char * dryRun, char * fieldManager); +v1beta1_cluster_trust_bundle_t* CertificatesV1beta1API_replaceClusterTrustBundle(apiClient_t *apiClient, char *name, v1beta1_cluster_trust_bundle_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CertificateSigningRequest | -**body** | **[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the ClusterTrustBundle | +**body** | **[v1beta1_cluster_trust_bundle_t](v1beta1_cluster_trust_bundle.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[v1beta1_certificate_signing_request_t](v1beta1_certificate_signing_request.md) * +[v1beta1_cluster_trust_bundle_t](v1beta1_cluster_trust_bundle.md) * ### Authorization @@ -415,7 +288,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/CoordinationV1API.md b/kubernetes/docs/CoordinationV1API.md index b1d4877f..79bc0146 100644 --- a/kubernetes/docs/CoordinationV1API.md +++ b/kubernetes/docs/CoordinationV1API.md @@ -45,7 +45,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -53,7 +53,7 @@ Name | Type | Description | Notes ```c // delete collection of Lease // -v1_status_t* CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoordinationV1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -66,6 +66,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +97,7 @@ Name | Type | Description | Notes ```c // delete a Lease // -v1_status_t* CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoordinationV1API_deleteNamespacedLease(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -108,6 +109,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -124,7 +126,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -152,7 +154,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -191,7 +193,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -231,7 +233,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,8 +268,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -298,7 +300,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -333,7 +335,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/CoordinationV1alpha1API.md b/kubernetes/docs/CoordinationV1alpha1API.md new file mode 100644 index 00000000..88899649 --- /dev/null +++ b/kubernetes/docs/CoordinationV1alpha1API.md @@ -0,0 +1,339 @@ +# CoordinationV1alpha1API + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CoordinationV1alpha1API_createNamespacedLeaseCandidate**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_createNamespacedLeaseCandidate) | **POST** /apis/coordination.k8s.io/v1alpha1/namespaces/{namespace}/leasecandidates | +[**CoordinationV1alpha1API_deleteCollectionNamespacedLeaseCandidate**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_deleteCollectionNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1alpha1/namespaces/{namespace}/leasecandidates | +[**CoordinationV1alpha1API_deleteNamespacedLeaseCandidate**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_deleteNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1alpha1/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1alpha1API_getAPIResources_16**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_getAPIResources_16) | **GET** /apis/coordination.k8s.io/v1alpha1/ | +[**CoordinationV1alpha1API_listLeaseCandidateForAllNamespaces**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_listLeaseCandidateForAllNamespaces) | **GET** /apis/coordination.k8s.io/v1alpha1/leasecandidates | +[**CoordinationV1alpha1API_listNamespacedLeaseCandidate**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_listNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1alpha1/namespaces/{namespace}/leasecandidates | +[**CoordinationV1alpha1API_patchNamespacedLeaseCandidate**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_patchNamespacedLeaseCandidate) | **PATCH** /apis/coordination.k8s.io/v1alpha1/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1alpha1API_readNamespacedLeaseCandidate**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_readNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1alpha1/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1alpha1API_replaceNamespacedLeaseCandidate**](CoordinationV1alpha1API.md#CoordinationV1alpha1API_replaceNamespacedLeaseCandidate) | **PUT** /apis/coordination.k8s.io/v1alpha1/namespaces/{namespace}/leasecandidates/{name} | + + +# **CoordinationV1alpha1API_createNamespacedLeaseCandidate** +```c +// create a LeaseCandidate +// +v1alpha1_lease_candidate_t* CoordinationV1alpha1API_createNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, v1alpha1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1alpha1_lease_candidate_t](v1alpha1_lease_candidate.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha1_lease_candidate_t](v1alpha1_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_deleteCollectionNamespacedLeaseCandidate** +```c +// delete collection of LeaseCandidate +// +v1_status_t* CoordinationV1alpha1API_deleteCollectionNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_deleteNamespacedLeaseCandidate** +```c +// delete a LeaseCandidate +// +v1_status_t* CoordinationV1alpha1API_deleteNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_getAPIResources_16** +```c +// get available resources +// +v1_api_resource_list_t* CoordinationV1alpha1API_getAPIResources_16(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[v1_api_resource_list_t](v1_api_resource_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_listLeaseCandidateForAllNamespaces** +```c +// list or watch objects of kind LeaseCandidate +// +v1alpha1_lease_candidate_list_t* CoordinationV1alpha1API_listLeaseCandidateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1alpha1_lease_candidate_list_t](v1alpha1_lease_candidate_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_listNamespacedLeaseCandidate** +```c +// list or watch objects of kind LeaseCandidate +// +v1alpha1_lease_candidate_list_t* CoordinationV1alpha1API_listNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1alpha1_lease_candidate_list_t](v1alpha1_lease_candidate_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_patchNamespacedLeaseCandidate** +```c +// partially update the specified LeaseCandidate +// +v1alpha1_lease_candidate_t* CoordinationV1alpha1API_patchNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1alpha1_lease_candidate_t](v1alpha1_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_readNamespacedLeaseCandidate** +```c +// read the specified LeaseCandidate +// +v1alpha1_lease_candidate_t* CoordinationV1alpha1API_readNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1alpha1_lease_candidate_t](v1alpha1_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha1API_replaceNamespacedLeaseCandidate** +```c +// replace the specified LeaseCandidate +// +v1alpha1_lease_candidate_t* CoordinationV1alpha1API_replaceNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, v1alpha1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1alpha1_lease_candidate_t](v1alpha1_lease_candidate.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha1_lease_candidate_t](v1alpha1_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/kubernetes/docs/CoordinationV1alpha2API.md b/kubernetes/docs/CoordinationV1alpha2API.md new file mode 100644 index 00000000..538432d1 --- /dev/null +++ b/kubernetes/docs/CoordinationV1alpha2API.md @@ -0,0 +1,341 @@ +# CoordinationV1alpha2API + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CoordinationV1alpha2API_createNamespacedLeaseCandidate**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_createNamespacedLeaseCandidate) | **POST** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +[**CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +[**CoordinationV1alpha2API_deleteNamespacedLeaseCandidate**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_deleteNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1alpha2API_getAPIResources**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_getAPIResources) | **GET** /apis/coordination.k8s.io/v1alpha2/ | +[**CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces) | **GET** /apis/coordination.k8s.io/v1alpha2/leasecandidates | +[**CoordinationV1alpha2API_listNamespacedLeaseCandidate**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_listNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +[**CoordinationV1alpha2API_patchNamespacedLeaseCandidate**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_patchNamespacedLeaseCandidate) | **PATCH** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1alpha2API_readNamespacedLeaseCandidate**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_readNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1alpha2API_replaceNamespacedLeaseCandidate**](CoordinationV1alpha2API.md#CoordinationV1alpha2API_replaceNamespacedLeaseCandidate) | **PUT** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | + + +# **CoordinationV1alpha2API_createNamespacedLeaseCandidate** +```c +// create a LeaseCandidate +// +v1alpha2_lease_candidate_t* CoordinationV1alpha2API_createNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, v1alpha2_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1alpha2_lease_candidate_t](v1alpha2_lease_candidate.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha2_lease_candidate_t](v1alpha2_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate** +```c +// delete collection of LeaseCandidate +// +v1_status_t* CoordinationV1alpha2API_deleteCollectionNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_deleteNamespacedLeaseCandidate** +```c +// delete a LeaseCandidate +// +v1_status_t* CoordinationV1alpha2API_deleteNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_getAPIResources** +```c +// get available resources +// +v1_api_resource_list_t* CoordinationV1alpha2API_getAPIResources(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[v1_api_resource_list_t](v1_api_resource_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces** +```c +// list or watch objects of kind LeaseCandidate +// +v1alpha2_lease_candidate_list_t* CoordinationV1alpha2API_listLeaseCandidateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1alpha2_lease_candidate_list_t](v1alpha2_lease_candidate_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_listNamespacedLeaseCandidate** +```c +// list or watch objects of kind LeaseCandidate +// +v1alpha2_lease_candidate_list_t* CoordinationV1alpha2API_listNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1alpha2_lease_candidate_list_t](v1alpha2_lease_candidate_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_patchNamespacedLeaseCandidate** +```c +// partially update the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* CoordinationV1alpha2API_patchNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1alpha2_lease_candidate_t](v1alpha2_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_readNamespacedLeaseCandidate** +```c +// read the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* CoordinationV1alpha2API_readNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1alpha2_lease_candidate_t](v1alpha2_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoordinationV1alpha2API_replaceNamespacedLeaseCandidate** +```c +// replace the specified LeaseCandidate +// +v1alpha2_lease_candidate_t* CoordinationV1alpha2API_replaceNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, v1alpha2_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the LeaseCandidate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1alpha2_lease_candidate_t](v1alpha2_lease_candidate.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha2_lease_candidate_t](v1alpha2_lease_candidate.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/kubernetes/docs/CoordinationV1beta1API.md b/kubernetes/docs/CoordinationV1beta1API.md index d0d76aaa..ed5d65a7 100644 --- a/kubernetes/docs/CoordinationV1beta1API.md +++ b/kubernetes/docs/CoordinationV1beta1API.md @@ -4,22 +4,22 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CoordinationV1beta1API_createNamespacedLease**](CoordinationV1beta1API.md#CoordinationV1beta1API_createNamespacedLease) | **POST** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases | -[**CoordinationV1beta1API_deleteCollectionNamespacedLease**](CoordinationV1beta1API.md#CoordinationV1beta1API_deleteCollectionNamespacedLease) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases | -[**CoordinationV1beta1API_deleteNamespacedLease**](CoordinationV1beta1API.md#CoordinationV1beta1API_deleteNamespacedLease) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name} | +[**CoordinationV1beta1API_createNamespacedLeaseCandidate**](CoordinationV1beta1API.md#CoordinationV1beta1API_createNamespacedLeaseCandidate) | **POST** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +[**CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate**](CoordinationV1beta1API.md#CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +[**CoordinationV1beta1API_deleteNamespacedLeaseCandidate**](CoordinationV1beta1API.md#CoordinationV1beta1API_deleteNamespacedLeaseCandidate) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | [**CoordinationV1beta1API_getAPIResources**](CoordinationV1beta1API.md#CoordinationV1beta1API_getAPIResources) | **GET** /apis/coordination.k8s.io/v1beta1/ | -[**CoordinationV1beta1API_listLeaseForAllNamespaces**](CoordinationV1beta1API.md#CoordinationV1beta1API_listLeaseForAllNamespaces) | **GET** /apis/coordination.k8s.io/v1beta1/leases | -[**CoordinationV1beta1API_listNamespacedLease**](CoordinationV1beta1API.md#CoordinationV1beta1API_listNamespacedLease) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases | -[**CoordinationV1beta1API_patchNamespacedLease**](CoordinationV1beta1API.md#CoordinationV1beta1API_patchNamespacedLease) | **PATCH** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name} | -[**CoordinationV1beta1API_readNamespacedLease**](CoordinationV1beta1API.md#CoordinationV1beta1API_readNamespacedLease) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name} | -[**CoordinationV1beta1API_replaceNamespacedLease**](CoordinationV1beta1API.md#CoordinationV1beta1API_replaceNamespacedLease) | **PUT** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name} | +[**CoordinationV1beta1API_listLeaseCandidateForAllNamespaces**](CoordinationV1beta1API.md#CoordinationV1beta1API_listLeaseCandidateForAllNamespaces) | **GET** /apis/coordination.k8s.io/v1beta1/leasecandidates | +[**CoordinationV1beta1API_listNamespacedLeaseCandidate**](CoordinationV1beta1API.md#CoordinationV1beta1API_listNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +[**CoordinationV1beta1API_patchNamespacedLeaseCandidate**](CoordinationV1beta1API.md#CoordinationV1beta1API_patchNamespacedLeaseCandidate) | **PATCH** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1beta1API_readNamespacedLeaseCandidate**](CoordinationV1beta1API.md#CoordinationV1beta1API_readNamespacedLeaseCandidate) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +[**CoordinationV1beta1API_replaceNamespacedLeaseCandidate**](CoordinationV1beta1API.md#CoordinationV1beta1API_replaceNamespacedLeaseCandidate) | **PUT** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | -# **CoordinationV1beta1API_createNamespacedLease** +# **CoordinationV1beta1API_createNamespacedLeaseCandidate** ```c -// create a Lease +// create a LeaseCandidate // -v1beta1_lease_t* CoordinationV1beta1API_createNamespacedLease(apiClient_t *apiClient, char * _namespace, v1beta1_lease_t * body, char * pretty, char * dryRun, char * fieldManager); +v1beta1_lease_candidate_t* CoordinationV1beta1API_createNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, v1beta1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters @@ -27,14 +27,15 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | **_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**body** | **[v1beta1_lease_t](v1beta1_lease.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**body** | **[v1beta1_lease_candidate_t](v1beta1_lease_candidate.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[v1beta1_lease_t](v1beta1_lease.md) * +[v1beta1_lease_candidate_t](v1beta1_lease_candidate.md) * ### Authorization @@ -44,15 +45,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CoordinationV1beta1API_deleteCollectionNamespacedLease** +# **CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate** ```c -// delete collection of Lease +// delete collection of LeaseCandidate // -v1_status_t* CoordinationV1beta1API_deleteCollectionNamespacedLease(apiClient_t *apiClient, char * _namespace, char * pretty, char * _continue, char * dryRun, char * fieldSelector, int gracePeriodSeconds, char * labelSelector, int limit, int orphanDependents, char * propagationPolicy, char * resourceVersion, int timeoutSeconds, v1_delete_options_t * body); +v1_status_t* CoordinationV1beta1API_deleteCollectionNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -60,17 +61,20 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | **_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **_continue** | **char \*** | 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. | [optional] **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] -**gracePeriodSeconds** | **int** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**orphanDependents** | **int** | 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] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] ### Return type @@ -85,27 +89,28 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CoordinationV1beta1API_deleteNamespacedLease** +# **CoordinationV1beta1API_deleteNamespacedLeaseCandidate** ```c -// delete a Lease +// delete a LeaseCandidate // -v1_status_t* CoordinationV1beta1API_deleteNamespacedLease(apiClient_t *apiClient, char * name, char * _namespace, char * pretty, char * dryRun, int gracePeriodSeconds, int orphanDependents, char * propagationPolicy, v1_delete_options_t * body); +v1_status_t* CoordinationV1beta1API_deleteNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Lease | +**name** | **char \*** | name of the LeaseCandidate | **_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] -**gracePeriodSeconds** | **int** | 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] -**orphanDependents** | **int** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -121,7 +126,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -149,34 +154,36 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CoordinationV1beta1API_listLeaseForAllNamespaces** +# **CoordinationV1beta1API_listLeaseCandidateForAllNamespaces** ```c -// list or watch objects of kind Lease +// list or watch objects of kind LeaseCandidate // -v1beta1_lease_list_t* CoordinationV1beta1API_listLeaseForAllNamespaces(apiClient_t *apiClient, int allowWatchBookmarks, char * _continue, char * fieldSelector, char * labelSelector, int limit, char * pretty, char * resourceVersion, int timeoutSeconds, int watch); +v1beta1_lease_candidate_list_t* CoordinationV1beta1API_listLeaseCandidateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**allowWatchBookmarks** | **int** | 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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. | [optional] +**allowWatchBookmarks** | **int \*** | 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] **_continue** | **char \*** | 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. | [optional] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] -**watch** | **int** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] ### Return type -[v1beta1_lease_list_t](v1beta1_lease_list.md) * +[v1beta1_lease_candidate_list_t](v1beta1_lease_candidate_list.md) * ### Authorization @@ -186,15 +193,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CoordinationV1beta1API_listNamespacedLease** +# **CoordinationV1beta1API_listNamespacedLeaseCandidate** ```c -// list or watch objects of kind Lease +// list or watch objects of kind LeaseCandidate // -v1beta1_lease_list_t* CoordinationV1beta1API_listNamespacedLease(apiClient_t *apiClient, char * _namespace, char * pretty, int allowWatchBookmarks, char * _continue, char * fieldSelector, char * labelSelector, int limit, char * resourceVersion, int timeoutSeconds, int watch); +v1beta1_lease_candidate_list_t* CoordinationV1beta1API_listNamespacedLeaseCandidate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters @@ -202,19 +209,21 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | **_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**allowWatchBookmarks** | **int** | 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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] **_continue** | **char \*** | 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. | [optional] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] -**watch** | **int** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] ### Return type -[v1beta1_lease_list_t](v1beta1_lease_list.md) * +[v1beta1_lease_candidate_list_t](v1beta1_lease_candidate_list.md) * ### Authorization @@ -224,32 +233,33 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CoordinationV1beta1API_patchNamespacedLease** +# **CoordinationV1beta1API_patchNamespacedLeaseCandidate** ```c -// partially update the specified Lease +// partially update the specified LeaseCandidate // -v1beta1_lease_t* CoordinationV1beta1API_patchNamespacedLease(apiClient_t *apiClient, char * name, char * _namespace, object_t * body, char * pretty, char * dryRun, char * fieldManager, int force); +v1beta1_lease_candidate_t* CoordinationV1beta1API_patchNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Lease | +**name** | **char \*** | name of the LeaseCandidate | **_namespace** | **char \*** | object name and auth scope, such as for teams and projects | **body** | **[object_t](object.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**force** | **int** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] ### Return type -[v1beta1_lease_t](v1beta1_lease.md) * +[v1beta1_lease_candidate_t](v1beta1_lease_candidate.md) * ### Authorization @@ -258,31 +268,29 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CoordinationV1beta1API_readNamespacedLease** +# **CoordinationV1beta1API_readNamespacedLeaseCandidate** ```c -// read the specified Lease +// read the specified LeaseCandidate // -v1beta1_lease_t* CoordinationV1beta1API_readNamespacedLease(apiClient_t *apiClient, char * name, char * _namespace, char * pretty, int exact, int _export); +v1beta1_lease_candidate_t* CoordinationV1beta1API_readNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Lease | +**name** | **char \*** | name of the LeaseCandidate | **_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**exact** | **int** | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18. | [optional] -**_export** | **int** | Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] ### Return type -[v1beta1_lease_t](v1beta1_lease.md) * +[v1beta1_lease_candidate_t](v1beta1_lease_candidate.md) * ### Authorization @@ -292,31 +300,32 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **CoordinationV1beta1API_replaceNamespacedLease** +# **CoordinationV1beta1API_replaceNamespacedLeaseCandidate** ```c -// replace the specified Lease +// replace the specified LeaseCandidate // -v1beta1_lease_t* CoordinationV1beta1API_replaceNamespacedLease(apiClient_t *apiClient, char * name, char * _namespace, v1beta1_lease_t * body, char * pretty, char * dryRun, char * fieldManager); +v1beta1_lease_candidate_t* CoordinationV1beta1API_replaceNamespacedLeaseCandidate(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_lease_candidate_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Lease | +**name** | **char \*** | name of the LeaseCandidate | **_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**body** | **[v1beta1_lease_t](v1beta1_lease.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**body** | **[v1beta1_lease_candidate_t](v1beta1_lease_candidate.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[v1beta1_lease_t](v1beta1_lease.md) * +[v1beta1_lease_candidate_t](v1beta1_lease_candidate.md) * ### Authorization @@ -326,7 +335,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/CoreV1API.md b/kubernetes/docs/CoreV1API.md index 3c8d8381..a19aa94a 100644 --- a/kubernetes/docs/CoreV1API.md +++ b/kubernetes/docs/CoreV1API.md @@ -139,6 +139,7 @@ Method | HTTP request | Description [**CoreV1API_patchNamespacedPersistentVolumeClaimStatus**](CoreV1API.md#CoreV1API_patchNamespacedPersistentVolumeClaimStatus) | **PATCH** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status | [**CoreV1API_patchNamespacedPod**](CoreV1API.md#CoreV1API_patchNamespacedPod) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name} | [**CoreV1API_patchNamespacedPodEphemeralcontainers**](CoreV1API.md#CoreV1API_patchNamespacedPodEphemeralcontainers) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | +[**CoreV1API_patchNamespacedPodResize**](CoreV1API.md#CoreV1API_patchNamespacedPodResize) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/resize | [**CoreV1API_patchNamespacedPodStatus**](CoreV1API.md#CoreV1API_patchNamespacedPodStatus) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/status | [**CoreV1API_patchNamespacedPodTemplate**](CoreV1API.md#CoreV1API_patchNamespacedPodTemplate) | **PATCH** /api/v1/namespaces/{namespace}/podtemplates/{name} | [**CoreV1API_patchNamespacedReplicationController**](CoreV1API.md#CoreV1API_patchNamespacedReplicationController) | **PATCH** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | @@ -166,6 +167,7 @@ Method | HTTP request | Description [**CoreV1API_readNamespacedPod**](CoreV1API.md#CoreV1API_readNamespacedPod) | **GET** /api/v1/namespaces/{namespace}/pods/{name} | [**CoreV1API_readNamespacedPodEphemeralcontainers**](CoreV1API.md#CoreV1API_readNamespacedPodEphemeralcontainers) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | [**CoreV1API_readNamespacedPodLog**](CoreV1API.md#CoreV1API_readNamespacedPodLog) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/log | +[**CoreV1API_readNamespacedPodResize**](CoreV1API.md#CoreV1API_readNamespacedPodResize) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/resize | [**CoreV1API_readNamespacedPodStatus**](CoreV1API.md#CoreV1API_readNamespacedPodStatus) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/status | [**CoreV1API_readNamespacedPodTemplate**](CoreV1API.md#CoreV1API_readNamespacedPodTemplate) | **GET** /api/v1/namespaces/{namespace}/podtemplates/{name} | [**CoreV1API_readNamespacedReplicationController**](CoreV1API.md#CoreV1API_readNamespacedReplicationController) | **GET** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | @@ -192,6 +194,7 @@ Method | HTTP request | Description [**CoreV1API_replaceNamespacedPersistentVolumeClaimStatus**](CoreV1API.md#CoreV1API_replaceNamespacedPersistentVolumeClaimStatus) | **PUT** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status | [**CoreV1API_replaceNamespacedPod**](CoreV1API.md#CoreV1API_replaceNamespacedPod) | **PUT** /api/v1/namespaces/{namespace}/pods/{name} | [**CoreV1API_replaceNamespacedPodEphemeralcontainers**](CoreV1API.md#CoreV1API_replaceNamespacedPodEphemeralcontainers) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | +[**CoreV1API_replaceNamespacedPodResize**](CoreV1API.md#CoreV1API_replaceNamespacedPodResize) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/resize | [**CoreV1API_replaceNamespacedPodStatus**](CoreV1API.md#CoreV1API_replaceNamespacedPodStatus) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/status | [**CoreV1API_replaceNamespacedPodTemplate**](CoreV1API.md#CoreV1API_replaceNamespacedPodTemplate) | **PUT** /api/v1/namespaces/{namespace}/podtemplates/{name} | [**CoreV1API_replaceNamespacedReplicationController**](CoreV1API.md#CoreV1API_replaceNamespacedReplicationController) | **PUT** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | @@ -1799,7 +1802,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1833,7 +1836,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1867,7 +1870,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1901,7 +1904,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1935,7 +1938,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1969,7 +1972,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2003,7 +2006,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2037,7 +2040,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2072,7 +2075,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2107,7 +2110,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2141,7 +2144,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2175,7 +2178,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2209,7 +2212,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2243,7 +2246,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2277,7 +2280,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2311,7 +2314,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2346,7 +2349,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2379,7 +2382,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2412,7 +2415,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2420,7 +2423,7 @@ Name | Type | Description | Notes ```c // delete collection of ConfigMap // -v1_status_t* CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedConfigMap(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2433,6 +2436,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2455,7 +2459,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2463,7 +2467,7 @@ Name | Type | Description | Notes ```c // delete collection of Endpoints // -v1_status_t* CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedEndpoints(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2476,6 +2480,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2498,7 +2503,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2506,7 +2511,7 @@ Name | Type | Description | Notes ```c // delete collection of Event // -v1_status_t* CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2519,6 +2524,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2541,7 +2547,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2549,7 +2555,7 @@ Name | Type | Description | Notes ```c // delete collection of LimitRange // -v1_status_t* CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedLimitRange(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2562,6 +2568,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2584,7 +2591,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2592,7 +2599,7 @@ Name | Type | Description | Notes ```c // delete collection of PersistentVolumeClaim // -v1_status_t* CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2605,6 +2612,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2627,7 +2635,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2635,7 +2643,7 @@ Name | Type | Description | Notes ```c // delete collection of Pod // -v1_status_t* CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedPod(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2648,6 +2656,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2670,7 +2679,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2678,7 +2687,7 @@ Name | Type | Description | Notes ```c // delete collection of PodTemplate // -v1_status_t* CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedPodTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2691,6 +2700,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2713,7 +2723,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2721,7 +2731,7 @@ Name | Type | Description | Notes ```c // delete collection of ReplicationController // -v1_status_t* CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedReplicationController(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2734,6 +2744,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2756,7 +2767,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2764,7 +2775,7 @@ Name | Type | Description | Notes ```c // delete collection of ResourceQuota // -v1_status_t* CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedResourceQuota(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2777,6 +2788,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2799,7 +2811,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2807,7 +2819,7 @@ Name | Type | Description | Notes ```c // delete collection of Secret // -v1_status_t* CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedSecret(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2820,6 +2832,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2842,7 +2855,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2850,7 +2863,7 @@ Name | Type | Description | Notes ```c // delete collection of Service // -v1_status_t* CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedService(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2863,6 +2876,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2885,7 +2899,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2893,7 +2907,7 @@ Name | Type | Description | Notes ```c // delete collection of ServiceAccount // -v1_status_t* CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNamespacedServiceAccount(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2906,6 +2920,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2928,7 +2943,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2936,7 +2951,7 @@ Name | Type | Description | Notes ```c // delete collection of Node // -v1_status_t* CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionNode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2948,6 +2963,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -2970,7 +2986,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2978,7 +2994,7 @@ Name | Type | Description | Notes ```c // delete collection of PersistentVolume // -v1_status_t* CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteCollectionPersistentVolume(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -2990,6 +3006,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -3012,7 +3029,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3020,7 +3037,7 @@ Name | Type | Description | Notes ```c // delete a Namespace // -v1_status_t* CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNamespace(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3031,6 +3048,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3047,7 +3065,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3055,7 +3073,7 @@ Name | Type | Description | Notes ```c // delete a ConfigMap // -v1_status_t* CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNamespacedConfigMap(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3067,6 +3085,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3083,7 +3102,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3091,7 +3110,7 @@ Name | Type | Description | Notes ```c // delete Endpoints // -v1_status_t* CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNamespacedEndpoints(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3103,6 +3122,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3119,7 +3139,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3127,7 +3147,7 @@ Name | Type | Description | Notes ```c // delete an Event // -v1_status_t* CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3139,6 +3159,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3155,7 +3176,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3163,7 +3184,7 @@ Name | Type | Description | Notes ```c // delete a LimitRange // -v1_status_t* CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNamespacedLimitRange(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3175,6 +3196,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3191,7 +3213,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3199,7 +3221,7 @@ Name | Type | Description | Notes ```c // delete a PersistentVolumeClaim // -v1_persistent_volume_claim_t* CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_persistent_volume_claim_t* CoreV1API_deleteNamespacedPersistentVolumeClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3211,6 +3233,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3227,7 +3250,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3235,7 +3258,7 @@ Name | Type | Description | Notes ```c // delete a Pod // -v1_pod_t* CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_pod_t* CoreV1API_deleteNamespacedPod(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3247,6 +3270,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3263,7 +3287,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3271,7 +3295,7 @@ Name | Type | Description | Notes ```c // delete a PodTemplate // -v1_pod_template_t* CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_pod_template_t* CoreV1API_deleteNamespacedPodTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3283,6 +3307,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3299,7 +3324,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3307,7 +3332,7 @@ Name | Type | Description | Notes ```c // delete a ReplicationController // -v1_status_t* CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNamespacedReplicationController(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3319,6 +3344,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3335,7 +3361,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3343,7 +3369,7 @@ Name | Type | Description | Notes ```c // delete a ResourceQuota // -v1_resource_quota_t* CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_resource_quota_t* CoreV1API_deleteNamespacedResourceQuota(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3355,6 +3381,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3371,7 +3398,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3379,7 +3406,7 @@ Name | Type | Description | Notes ```c // delete a Secret // -v1_status_t* CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNamespacedSecret(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3391,6 +3418,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3407,7 +3435,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3415,7 +3443,7 @@ Name | Type | Description | Notes ```c // delete a Service // -v1_service_t* CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_service_t* CoreV1API_deleteNamespacedService(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3427,6 +3455,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3443,7 +3472,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3451,7 +3480,7 @@ Name | Type | Description | Notes ```c // delete a ServiceAccount // -v1_service_account_t* CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_service_account_t* CoreV1API_deleteNamespacedServiceAccount(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3463,6 +3492,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3479,7 +3509,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3487,7 +3517,7 @@ Name | Type | Description | Notes ```c // delete a Node // -v1_status_t* CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* CoreV1API_deleteNode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3498,6 +3528,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3514,7 +3545,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3522,7 +3553,7 @@ Name | Type | Description | Notes ```c // delete a PersistentVolume // -v1_persistent_volume_t* CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_persistent_volume_t* CoreV1API_deletePersistentVolume(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -3533,6 +3564,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -3549,7 +3581,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3577,7 +3609,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3616,7 +3648,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3655,7 +3687,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3694,7 +3726,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3733,7 +3765,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3772,7 +3804,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3811,7 +3843,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3851,7 +3883,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3891,7 +3923,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3931,7 +3963,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3971,7 +4003,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4011,7 +4043,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4051,7 +4083,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4091,7 +4123,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4131,7 +4163,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4171,7 +4203,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4211,7 +4243,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4251,7 +4283,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4291,7 +4323,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4330,7 +4362,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4369,7 +4401,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4408,7 +4440,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4447,7 +4479,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4486,7 +4518,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4525,7 +4557,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4564,7 +4596,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4603,7 +4635,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4642,7 +4674,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4681,7 +4713,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4715,8 +4747,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4750,8 +4782,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4786,8 +4818,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4822,8 +4854,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4858,8 +4890,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4894,8 +4926,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4930,8 +4962,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -4966,8 +4998,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5002,8 +5034,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5038,8 +5070,44 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoreV1API_patchNamespacedPodResize** +```c +// partially update resize of the specified Pod +// +v1_pod_t* CoreV1API_patchNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the Pod | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_pod_t](v1_pod.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5074,8 +5142,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5110,8 +5178,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5146,8 +5214,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5182,8 +5250,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5218,8 +5286,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5254,8 +5322,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5290,8 +5358,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5326,8 +5394,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5362,8 +5430,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5398,8 +5466,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5434,8 +5502,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5469,8 +5537,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5504,8 +5572,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5539,8 +5607,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5574,8 +5642,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5605,7 +5673,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5635,7 +5703,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5665,7 +5733,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5696,7 +5764,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5727,7 +5795,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5758,7 +5826,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5789,7 +5857,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5820,7 +5888,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5851,7 +5919,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5882,7 +5950,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5913,7 +5981,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5921,7 +5989,7 @@ Name | Type | Description | Notes ```c // read log of the specified Pod // -char* CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namespace, char *container, int *follow, int *insecureSkipTLSVerifyBackend, int *limitBytes, char *pretty, int *previous, int *sinceSeconds, int *tailLines, int *timestamps); +char* CoreV1API_readNamespacedPodLog(apiClient_t *apiClient, char *name, char *_namespace, char *container, int *follow, int *insecureSkipTLSVerifyBackend, int *limitBytes, char *pretty, int *previous, int *sinceSeconds, char *stream, int *tailLines, int *timestamps); ``` ### Parameters @@ -5937,7 +6005,8 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **previous** | **int \*** | Return previous terminated container logs. Defaults to false. | [optional] **sinceSeconds** | **int \*** | 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] -**tailLines** | **int \*** | 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] +**stream** | **char \*** | Specify which container log stream to return to the client. Acceptable values are \"All\", \"Stdout\" and \"Stderr\". If not specified, \"All\" is used, and both stdout and stderr are returned interleaved. Note that when \"TailLines\" is specified, \"Stream\" can only be set to nil or \"All\". | [optional] +**tailLines** | **int \*** | 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. Note that when \"TailLines\" is specified, \"Stream\" can only be set to nil or \"All\". | [optional] **timestamps** | **int \*** | If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. | [optional] ### Return type @@ -5953,7 +6022,38 @@ char* ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: text/plain, application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: text/plain, application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoreV1API_readNamespacedPodResize** +```c +// read resize of the specified Pod +// +v1_pod_t* CoreV1API_readNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the Pod | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_pod_t](v1_pod.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -5984,7 +6084,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6015,7 +6115,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6046,7 +6146,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6077,7 +6177,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6108,7 +6208,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6139,7 +6239,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6170,7 +6270,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6201,7 +6301,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6232,7 +6332,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6263,7 +6363,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6294,7 +6394,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6324,7 +6424,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6354,7 +6454,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6384,7 +6484,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6414,7 +6514,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6448,7 +6548,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6482,7 +6582,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6516,7 +6616,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6551,7 +6651,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6586,7 +6686,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6621,7 +6721,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6656,7 +6756,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6691,7 +6791,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6726,7 +6826,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6761,7 +6861,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6796,7 +6896,42 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CoreV1API_replaceNamespacedPodResize** +```c +// replace resize of the specified Pod +// +v1_pod_t* CoreV1API_replaceNamespacedPodResize(apiClient_t *apiClient, char *name, char *_namespace, v1_pod_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the Pod | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1_pod_t](v1_pod.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_pod_t](v1_pod.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6831,7 +6966,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6866,7 +7001,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6901,7 +7036,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6936,7 +7071,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -6971,7 +7106,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7006,7 +7141,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7041,7 +7176,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7076,7 +7211,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7111,7 +7246,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7146,7 +7281,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7181,7 +7316,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7215,7 +7350,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7249,7 +7384,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7283,7 +7418,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -7317,7 +7452,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/CustomObjectsAPI.md b/kubernetes/docs/CustomObjectsAPI.md index 39a16d52..83956792 100644 --- a/kubernetes/docs/CustomObjectsAPI.md +++ b/kubernetes/docs/CustomObjectsAPI.md @@ -18,6 +18,7 @@ Method | HTTP request | Description [**CustomObjectsAPI_getNamespacedCustomObjectScale**](CustomObjectsAPI.md#CustomObjectsAPI_getNamespacedCustomObjectScale) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale | [**CustomObjectsAPI_getNamespacedCustomObjectStatus**](CustomObjectsAPI.md#CustomObjectsAPI_getNamespacedCustomObjectStatus) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status | [**CustomObjectsAPI_listClusterCustomObject**](CustomObjectsAPI.md#CustomObjectsAPI_listClusterCustomObject) | **GET** /apis/{group}/{version}/{plural} | +[**CustomObjectsAPI_listCustomObjectForAllNamespaces**](CustomObjectsAPI.md#CustomObjectsAPI_listCustomObjectForAllNamespaces) | **GET** /apis/{group}/{version}/{resource_plural} | [**CustomObjectsAPI_listNamespacedCustomObject**](CustomObjectsAPI.md#CustomObjectsAPI_listNamespacedCustomObject) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural} | [**CustomObjectsAPI_patchClusterCustomObject**](CustomObjectsAPI.md#CustomObjectsAPI_patchClusterCustomObject) | **PATCH** /apis/{group}/{version}/{plural}/{name} | [**CustomObjectsAPI_patchClusterCustomObjectScale**](CustomObjectsAPI.md#CustomObjectsAPI_patchClusterCustomObjectScale) | **PATCH** /apis/{group}/{version}/{plural}/{name}/scale | @@ -185,7 +186,7 @@ Name | Type | Description | Notes ```c // Delete collection of namespace scoped custom objects // -object_t* CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, char *group, char *version, char *_namespace, char *plural, char *pretty, char *labelSelector, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, char *dryRun, v1_delete_options_t *body); +object_t* CustomObjectsAPI_deleteCollectionNamespacedCustomObject(apiClient_t *apiClient, char *group, char *version, char *_namespace, char *plural, char *pretty, char *labelSelector, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, char *dryRun, char *fieldSelector, v1_delete_options_t *body); ``` ### Parameters @@ -202,6 +203,7 @@ Name | Type | Description | Notes **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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. | [optional] **dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] ### Return type @@ -513,6 +515,47 @@ Name | Type | Description | Notes [object_t](object.md) * +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/json;stream=watch + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CustomObjectsAPI_listCustomObjectForAllNamespaces** +```c +// list or watch namespace scoped custom objects +// +object_t* CustomObjectsAPI_listCustomObjectForAllNamespaces(apiClient_t *apiClient, char *group, char *version, char *resource_plural, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**group** | **char \*** | The custom resource's group name | +**version** | **char \*** | The custom resource's version | +**resource_plural** | **char \*** | The custom resource's plural name. For TPRs this would be lowercase plural kind. | +**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**allowWatchBookmarks** | **int \*** | 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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. | [optional] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] +**resourceVersionMatch** | **char \*** | 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] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. | [optional] + +### Return type + +[object_t](object.md) * + + ### Authorization [BearerToken](../README.md#BearerToken) diff --git a/kubernetes/docs/DiscoveryV1API.md b/kubernetes/docs/DiscoveryV1API.md index 3c5626b8..87b3f7cd 100644 --- a/kubernetes/docs/DiscoveryV1API.md +++ b/kubernetes/docs/DiscoveryV1API.md @@ -45,7 +45,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -53,7 +53,7 @@ Name | Type | Description | Notes ```c // delete collection of EndpointSlice // -v1_status_t* DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* DiscoveryV1API_deleteCollectionNamespacedEndpointSlice(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -66,6 +66,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +97,7 @@ Name | Type | Description | Notes ```c // delete an EndpointSlice // -v1_status_t* DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* DiscoveryV1API_deleteNamespacedEndpointSlice(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -108,6 +109,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -124,7 +126,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -152,7 +154,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -191,7 +193,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -231,7 +233,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,8 +268,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -298,7 +300,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -333,7 +335,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/EventsV1API.md b/kubernetes/docs/EventsV1API.md index be767a0f..63b032ac 100644 --- a/kubernetes/docs/EventsV1API.md +++ b/kubernetes/docs/EventsV1API.md @@ -45,7 +45,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -53,7 +53,7 @@ Name | Type | Description | Notes ```c // delete collection of Event // -v1_status_t* EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* EventsV1API_deleteCollectionNamespacedEvent(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -66,6 +66,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +97,7 @@ Name | Type | Description | Notes ```c // delete an Event // -v1_status_t* EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* EventsV1API_deleteNamespacedEvent(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -108,6 +109,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -124,7 +126,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -152,7 +154,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -191,7 +193,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -231,7 +233,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,8 +268,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -298,7 +300,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -333,7 +335,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/FlowcontrolApiserverV1API.md b/kubernetes/docs/FlowcontrolApiserverV1API.md index 9acc694b..7048c9ba 100644 --- a/kubernetes/docs/FlowcontrolApiserverV1API.md +++ b/kubernetes/docs/FlowcontrolApiserverV1API.md @@ -56,7 +56,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -89,7 +89,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -97,7 +97,7 @@ Name | Type | Description | Notes ```c // delete collection of FlowSchema // -v1_status_t* FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -109,6 +109,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -131,7 +132,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -139,7 +140,7 @@ Name | Type | Description | Notes ```c // delete collection of PriorityLevelConfiguration // -v1_status_t* FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -151,6 +152,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -173,7 +175,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -181,7 +183,7 @@ Name | Type | Description | Notes ```c // delete a FlowSchema // -v1_status_t* FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -192,6 +194,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -208,7 +211,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -216,7 +219,7 @@ Name | Type | Description | Notes ```c // delete a PriorityLevelConfiguration // -v1_status_t* FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -227,6 +230,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -243,7 +247,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -271,7 +275,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -310,7 +314,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -349,7 +353,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -383,8 +387,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -418,8 +422,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -453,8 +457,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -488,8 +492,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -519,7 +523,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -549,7 +553,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -579,7 +583,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -609,7 +613,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -643,7 +647,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -677,7 +681,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -711,7 +715,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -745,7 +749,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/FlowcontrolApiserverV1beta3API.md b/kubernetes/docs/FlowcontrolApiserverV1beta3API.md index a55daab2..413b069b 100644 --- a/kubernetes/docs/FlowcontrolApiserverV1beta3API.md +++ b/kubernetes/docs/FlowcontrolApiserverV1beta3API.md @@ -4,34 +4,34 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**FlowcontrolApiserverV1beta3API_createFlowSchema**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_createFlowSchema) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | -[**FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | -[**FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | -[**FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | -[**FlowcontrolApiserverV1beta3API_deleteFlowSchema**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteFlowSchema) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -[**FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -[**FlowcontrolApiserverV1beta3API_getAPIResources**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_getAPIResources) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/ | -[**FlowcontrolApiserverV1beta3API_listFlowSchema**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_listFlowSchema) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | -[**FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | -[**FlowcontrolApiserverV1beta3API_patchFlowSchema**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchFlowSchema) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -[**FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | -[**FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -[**FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | -[**FlowcontrolApiserverV1beta3API_readFlowSchema**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readFlowSchema) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -[**FlowcontrolApiserverV1beta3API_readFlowSchemaStatus**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readFlowSchemaStatus) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | -[**FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -[**FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | -[**FlowcontrolApiserverV1beta3API_replaceFlowSchema**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replaceFlowSchema) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | -[**FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | -[**FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | -[**FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | - - -# **FlowcontrolApiserverV1beta3API_createFlowSchema** +[**FlowcontrolApiserverV1beta3API_createFlowSchema_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_createFlowSchema_0) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | +[**FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration_0) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | +[**FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema_0) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | +[**FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration_0) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | +[**FlowcontrolApiserverV1beta3API_deleteFlowSchema_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deleteFlowSchema_0) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | +[**FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration_0) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | +[**FlowcontrolApiserverV1beta3API_getAPIResources_20**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_getAPIResources_20) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/ | +[**FlowcontrolApiserverV1beta3API_listFlowSchema_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_listFlowSchema_0) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas | +[**FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration_0) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations | +[**FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus_0) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | +[**FlowcontrolApiserverV1beta3API_patchFlowSchema_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchFlowSchema_0) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | +[**FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus_0) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | +[**FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration_0) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | +[**FlowcontrolApiserverV1beta3API_readFlowSchemaStatus_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readFlowSchemaStatus_0) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | +[**FlowcontrolApiserverV1beta3API_readFlowSchema_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readFlowSchema_0) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | +[**FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus_0) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | +[**FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration_0) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | +[**FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus_0) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name}/status | +[**FlowcontrolApiserverV1beta3API_replaceFlowSchema_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replaceFlowSchema_0) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/flowschemas/{name} | +[**FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus_0) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name}/status | +[**FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration_0**](FlowcontrolApiserverV1beta3API.md#FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration_0) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1beta3/prioritylevelconfigurations/{name} | + + +# **FlowcontrolApiserverV1beta3API_createFlowSchema_0** ```c // create a FlowSchema // -v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_createFlowSchema(apiClient_t *apiClient, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_createFlowSchema_0(apiClient_t *apiClient, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters @@ -60,11 +60,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration** +# **FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration_0** ```c // create a PriorityLevelConfiguration // -v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration(apiClient_t *apiClient, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_createPriorityLevelConfiguration_0(apiClient_t *apiClient, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters @@ -93,11 +93,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema** +# **FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema_0** ```c // delete collection of FlowSchema // -v1_status_t* FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1beta3API_deleteCollectionFlowSchema_0(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -135,11 +135,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration** +# **FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration_0** ```c // delete collection of PriorityLevelConfiguration // -v1_status_t* FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1beta3API_deleteCollectionPriorityLevelConfiguration_0(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -177,11 +177,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_deleteFlowSchema** +# **FlowcontrolApiserverV1beta3API_deleteFlowSchema_0** ```c // delete a FlowSchema // -v1_status_t* FlowcontrolApiserverV1beta3API_deleteFlowSchema(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1beta3API_deleteFlowSchema_0(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -212,11 +212,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration** +# **FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration_0** ```c // delete a PriorityLevelConfiguration // -v1_status_t* FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* FlowcontrolApiserverV1beta3API_deletePriorityLevelConfiguration_0(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -247,11 +247,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_getAPIResources** +# **FlowcontrolApiserverV1beta3API_getAPIResources_20** ```c // get available resources // -v1_api_resource_list_t* FlowcontrolApiserverV1beta3API_getAPIResources(apiClient_t *apiClient); +v1_api_resource_list_t* FlowcontrolApiserverV1beta3API_getAPIResources_20(apiClient_t *apiClient); ``` ### Parameters @@ -275,11 +275,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_listFlowSchema** +# **FlowcontrolApiserverV1beta3API_listFlowSchema_0** ```c // list or watch objects of kind FlowSchema // -v1beta3_flow_schema_list_t* FlowcontrolApiserverV1beta3API_listFlowSchema(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1beta3_flow_schema_list_t* FlowcontrolApiserverV1beta3API_listFlowSchema_0(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters @@ -314,11 +314,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration** +# **FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration_0** ```c // list or watch objects of kind PriorityLevelConfiguration // -v1beta3_priority_level_configuration_list_t* FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +v1beta3_priority_level_configuration_list_t* FlowcontrolApiserverV1beta3API_listPriorityLevelConfiguration_0(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters @@ -353,11 +353,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_patchFlowSchema** +# **FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus_0** ```c -// partially update the specified FlowSchema +// partially update status of the specified FlowSchema // -v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_patchFlowSchema(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus_0(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters @@ -388,11 +388,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus** +# **FlowcontrolApiserverV1beta3API_patchFlowSchema_0** ```c -// partially update status of the specified FlowSchema +// partially update the specified FlowSchema // -v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_patchFlowSchemaStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_patchFlowSchema_0(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters @@ -423,11 +423,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration** +# **FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus_0** ```c -// partially update the specified PriorityLevelConfiguration +// partially update status of the specified PriorityLevelConfiguration // -v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus_0(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters @@ -458,11 +458,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus** +# **FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration_0** ```c -// partially update status of the specified PriorityLevelConfiguration +// partially update the specified PriorityLevelConfiguration // -v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_patchPriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_patchPriorityLevelConfiguration_0(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters @@ -493,11 +493,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_readFlowSchema** +# **FlowcontrolApiserverV1beta3API_readFlowSchemaStatus_0** ```c -// read the specified FlowSchema +// read status of the specified FlowSchema // -v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_readFlowSchema(apiClient_t *apiClient, char *name, char *pretty); +v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_readFlowSchemaStatus_0(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters @@ -523,11 +523,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_readFlowSchemaStatus** +# **FlowcontrolApiserverV1beta3API_readFlowSchema_0** ```c -// read status of the specified FlowSchema +// read the specified FlowSchema // -v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_readFlowSchemaStatus(apiClient_t *apiClient, char *name, char *pretty); +v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_readFlowSchema_0(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters @@ -553,11 +553,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration** +# **FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus_0** ```c -// read the specified PriorityLevelConfiguration +// read status of the specified PriorityLevelConfiguration // -v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration(apiClient_t *apiClient, char *name, char *pretty); +v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus_0(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters @@ -583,11 +583,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus** +# **FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration_0** ```c -// read status of the specified PriorityLevelConfiguration +// read the specified PriorityLevelConfiguration // -v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_readPriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, char *pretty); +v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_readPriorityLevelConfiguration_0(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters @@ -613,11 +613,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_replaceFlowSchema** +# **FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus_0** ```c -// replace the specified FlowSchema +// replace status of the specified FlowSchema // -v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_replaceFlowSchema(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus_0(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters @@ -647,11 +647,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus** +# **FlowcontrolApiserverV1beta3API_replaceFlowSchema_0** ```c -// replace status of the specified FlowSchema +// replace the specified FlowSchema // -v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_replaceFlowSchemaStatus(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta3_flow_schema_t* FlowcontrolApiserverV1beta3API_replaceFlowSchema_0(apiClient_t *apiClient, char *name, v1beta3_flow_schema_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters @@ -681,11 +681,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration** +# **FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus_0** ```c -// replace the specified PriorityLevelConfiguration +// replace status of the specified PriorityLevelConfiguration // -v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus_0(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters @@ -715,11 +715,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus** +# **FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration_0** ```c -// replace status of the specified PriorityLevelConfiguration +// replace the specified PriorityLevelConfiguration // -v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_replacePriorityLevelConfigurationStatus(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +v1beta3_priority_level_configuration_t* FlowcontrolApiserverV1beta3API_replacePriorityLevelConfiguration_0(apiClient_t *apiClient, char *name, v1beta3_priority_level_configuration_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters diff --git a/kubernetes/docs/InternalApiserverV1alpha1API.md b/kubernetes/docs/InternalApiserverV1alpha1API.md index d50e03d6..09579653 100644 --- a/kubernetes/docs/InternalApiserverV1alpha1API.md +++ b/kubernetes/docs/InternalApiserverV1alpha1API.md @@ -46,7 +46,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -54,7 +54,7 @@ Name | Type | Description | Notes ```c // delete collection of StorageVersion // -v1_status_t* InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* InternalApiserverV1alpha1API_deleteCollectionStorageVersion(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -66,6 +66,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +97,7 @@ Name | Type | Description | Notes ```c // delete a StorageVersion // -v1_status_t* InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* InternalApiserverV1alpha1API_deleteStorageVersion(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -107,6 +108,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -123,7 +125,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,7 +153,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -190,7 +192,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -224,8 +226,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -259,8 +261,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -290,7 +292,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -320,7 +322,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -354,7 +356,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -388,7 +390,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/NetworkingV1API.md b/kubernetes/docs/NetworkingV1API.md index f487da08..ea6dbd4b 100644 --- a/kubernetes/docs/NetworkingV1API.md +++ b/kubernetes/docs/NetworkingV1API.md @@ -4,35 +4,85 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**NetworkingV1API_createIPAddress**](NetworkingV1API.md#NetworkingV1API_createIPAddress) | **POST** /apis/networking.k8s.io/v1/ipaddresses | [**NetworkingV1API_createIngressClass**](NetworkingV1API.md#NetworkingV1API_createIngressClass) | **POST** /apis/networking.k8s.io/v1/ingressclasses | [**NetworkingV1API_createNamespacedIngress**](NetworkingV1API.md#NetworkingV1API_createNamespacedIngress) | **POST** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | [**NetworkingV1API_createNamespacedNetworkPolicy**](NetworkingV1API.md#NetworkingV1API_createNamespacedNetworkPolicy) | **POST** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | +[**NetworkingV1API_createServiceCIDR**](NetworkingV1API.md#NetworkingV1API_createServiceCIDR) | **POST** /apis/networking.k8s.io/v1/servicecidrs | +[**NetworkingV1API_deleteCollectionIPAddress**](NetworkingV1API.md#NetworkingV1API_deleteCollectionIPAddress) | **DELETE** /apis/networking.k8s.io/v1/ipaddresses | [**NetworkingV1API_deleteCollectionIngressClass**](NetworkingV1API.md#NetworkingV1API_deleteCollectionIngressClass) | **DELETE** /apis/networking.k8s.io/v1/ingressclasses | [**NetworkingV1API_deleteCollectionNamespacedIngress**](NetworkingV1API.md#NetworkingV1API_deleteCollectionNamespacedIngress) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | [**NetworkingV1API_deleteCollectionNamespacedNetworkPolicy**](NetworkingV1API.md#NetworkingV1API_deleteCollectionNamespacedNetworkPolicy) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | +[**NetworkingV1API_deleteCollectionServiceCIDR**](NetworkingV1API.md#NetworkingV1API_deleteCollectionServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1/servicecidrs | +[**NetworkingV1API_deleteIPAddress**](NetworkingV1API.md#NetworkingV1API_deleteIPAddress) | **DELETE** /apis/networking.k8s.io/v1/ipaddresses/{name} | [**NetworkingV1API_deleteIngressClass**](NetworkingV1API.md#NetworkingV1API_deleteIngressClass) | **DELETE** /apis/networking.k8s.io/v1/ingressclasses/{name} | [**NetworkingV1API_deleteNamespacedIngress**](NetworkingV1API.md#NetworkingV1API_deleteNamespacedIngress) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | [**NetworkingV1API_deleteNamespacedNetworkPolicy**](NetworkingV1API.md#NetworkingV1API_deleteNamespacedNetworkPolicy) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +[**NetworkingV1API_deleteServiceCIDR**](NetworkingV1API.md#NetworkingV1API_deleteServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1/servicecidrs/{name} | [**NetworkingV1API_getAPIResources**](NetworkingV1API.md#NetworkingV1API_getAPIResources) | **GET** /apis/networking.k8s.io/v1/ | +[**NetworkingV1API_listIPAddress**](NetworkingV1API.md#NetworkingV1API_listIPAddress) | **GET** /apis/networking.k8s.io/v1/ipaddresses | [**NetworkingV1API_listIngressClass**](NetworkingV1API.md#NetworkingV1API_listIngressClass) | **GET** /apis/networking.k8s.io/v1/ingressclasses | [**NetworkingV1API_listIngressForAllNamespaces**](NetworkingV1API.md#NetworkingV1API_listIngressForAllNamespaces) | **GET** /apis/networking.k8s.io/v1/ingresses | [**NetworkingV1API_listNamespacedIngress**](NetworkingV1API.md#NetworkingV1API_listNamespacedIngress) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | [**NetworkingV1API_listNamespacedNetworkPolicy**](NetworkingV1API.md#NetworkingV1API_listNamespacedNetworkPolicy) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | [**NetworkingV1API_listNetworkPolicyForAllNamespaces**](NetworkingV1API.md#NetworkingV1API_listNetworkPolicyForAllNamespaces) | **GET** /apis/networking.k8s.io/v1/networkpolicies | +[**NetworkingV1API_listServiceCIDR**](NetworkingV1API.md#NetworkingV1API_listServiceCIDR) | **GET** /apis/networking.k8s.io/v1/servicecidrs | +[**NetworkingV1API_patchIPAddress**](NetworkingV1API.md#NetworkingV1API_patchIPAddress) | **PATCH** /apis/networking.k8s.io/v1/ipaddresses/{name} | [**NetworkingV1API_patchIngressClass**](NetworkingV1API.md#NetworkingV1API_patchIngressClass) | **PATCH** /apis/networking.k8s.io/v1/ingressclasses/{name} | [**NetworkingV1API_patchNamespacedIngress**](NetworkingV1API.md#NetworkingV1API_patchNamespacedIngress) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | [**NetworkingV1API_patchNamespacedIngressStatus**](NetworkingV1API.md#NetworkingV1API_patchNamespacedIngressStatus) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | [**NetworkingV1API_patchNamespacedNetworkPolicy**](NetworkingV1API.md#NetworkingV1API_patchNamespacedNetworkPolicy) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +[**NetworkingV1API_patchServiceCIDR**](NetworkingV1API.md#NetworkingV1API_patchServiceCIDR) | **PATCH** /apis/networking.k8s.io/v1/servicecidrs/{name} | +[**NetworkingV1API_patchServiceCIDRStatus**](NetworkingV1API.md#NetworkingV1API_patchServiceCIDRStatus) | **PATCH** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +[**NetworkingV1API_readIPAddress**](NetworkingV1API.md#NetworkingV1API_readIPAddress) | **GET** /apis/networking.k8s.io/v1/ipaddresses/{name} | [**NetworkingV1API_readIngressClass**](NetworkingV1API.md#NetworkingV1API_readIngressClass) | **GET** /apis/networking.k8s.io/v1/ingressclasses/{name} | [**NetworkingV1API_readNamespacedIngress**](NetworkingV1API.md#NetworkingV1API_readNamespacedIngress) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | [**NetworkingV1API_readNamespacedIngressStatus**](NetworkingV1API.md#NetworkingV1API_readNamespacedIngressStatus) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | [**NetworkingV1API_readNamespacedNetworkPolicy**](NetworkingV1API.md#NetworkingV1API_readNamespacedNetworkPolicy) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +[**NetworkingV1API_readServiceCIDR**](NetworkingV1API.md#NetworkingV1API_readServiceCIDR) | **GET** /apis/networking.k8s.io/v1/servicecidrs/{name} | +[**NetworkingV1API_readServiceCIDRStatus**](NetworkingV1API.md#NetworkingV1API_readServiceCIDRStatus) | **GET** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +[**NetworkingV1API_replaceIPAddress**](NetworkingV1API.md#NetworkingV1API_replaceIPAddress) | **PUT** /apis/networking.k8s.io/v1/ipaddresses/{name} | [**NetworkingV1API_replaceIngressClass**](NetworkingV1API.md#NetworkingV1API_replaceIngressClass) | **PUT** /apis/networking.k8s.io/v1/ingressclasses/{name} | [**NetworkingV1API_replaceNamespacedIngress**](NetworkingV1API.md#NetworkingV1API_replaceNamespacedIngress) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | [**NetworkingV1API_replaceNamespacedIngressStatus**](NetworkingV1API.md#NetworkingV1API_replaceNamespacedIngressStatus) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | [**NetworkingV1API_replaceNamespacedNetworkPolicy**](NetworkingV1API.md#NetworkingV1API_replaceNamespacedNetworkPolicy) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +[**NetworkingV1API_replaceServiceCIDR**](NetworkingV1API.md#NetworkingV1API_replaceServiceCIDR) | **PUT** /apis/networking.k8s.io/v1/servicecidrs/{name} | +[**NetworkingV1API_replaceServiceCIDRStatus**](NetworkingV1API.md#NetworkingV1API_replaceServiceCIDRStatus) | **PUT** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +# **NetworkingV1API_createIPAddress** +```c +// create an IPAddress +// +v1_ip_address_t* NetworkingV1API_createIPAddress(apiClient_t *apiClient, v1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1_ip_address_t](v1_ip_address.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_ip_address_t](v1_ip_address.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **NetworkingV1API_createIngressClass** ```c // create an IngressClass @@ -62,7 +112,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +146,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -130,7 +180,83 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_createServiceCIDR** +```c +// create a ServiceCIDR +// +v1_service_cidr_t* NetworkingV1API_createServiceCIDR(apiClient_t *apiClient, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1_service_cidr_t](v1_service_cidr.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_service_cidr_t](v1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_deleteCollectionIPAddress** +```c +// delete collection of IPAddress +// +v1_status_t* NetworkingV1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -138,7 +264,7 @@ Name | Type | Description | Notes ```c // delete collection of IngressClass // -v1_status_t* NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -150,6 +276,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -172,7 +299,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -180,7 +307,7 @@ Name | Type | Description | Notes ```c // delete collection of Ingress // -v1_status_t* NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -193,6 +320,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -215,7 +343,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -223,7 +351,7 @@ Name | Type | Description | Notes ```c // delete collection of NetworkPolicy // -v1_status_t* NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -236,6 +364,50 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_deleteCollectionServiceCIDR** +```c +// delete collection of ServiceCIDR +// +v1_status_t* NetworkingV1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -258,7 +430,43 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_deleteIPAddress** +```c +// delete an IPAddress +// +v1_status_t* NetworkingV1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IPAddress | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,7 +474,7 @@ Name | Type | Description | Notes ```c // delete an IngressClass // -v1_status_t* NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -277,6 +485,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -293,7 +502,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -301,7 +510,7 @@ Name | Type | Description | Notes ```c // delete an Ingress // -v1_status_t* NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -313,6 +522,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -329,7 +539,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -337,7 +547,7 @@ Name | Type | Description | Notes ```c // delete a NetworkPolicy // -v1_status_t* NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -349,6 +559,43 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_deleteServiceCIDR** +```c +// delete a ServiceCIDR +// +v1_status_t* NetworkingV1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -365,7 +612,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -393,7 +640,46 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_listIPAddress** +```c +// list or watch objects of kind IPAddress +// +v1_ip_address_list_t* NetworkingV1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_ip_address_list_t](v1_ip_address_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -432,7 +718,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -471,7 +757,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -511,7 +797,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -551,7 +837,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -590,7 +876,81 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_listServiceCIDR** +```c +// list or watch objects of kind ServiceCIDR +// +v1_service_cidr_list_t* NetworkingV1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_service_cidr_list_t](v1_service_cidr_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_patchIPAddress** +```c +// partially update the specified IPAddress +// +v1_ip_address_t* NetworkingV1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IPAddress | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_ip_address_t](v1_ip_address.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -624,8 +984,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -660,8 +1020,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -696,8 +1056,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -732,8 +1092,108 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_patchServiceCIDR** +```c +// partially update the specified ServiceCIDR +// +v1_service_cidr_t* NetworkingV1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_service_cidr_t](v1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_patchServiceCIDRStatus** +```c +// partially update status of the specified ServiceCIDR +// +v1_service_cidr_t* NetworkingV1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_service_cidr_t](v1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_readIPAddress** +```c +// read the specified IPAddress +// +v1_ip_address_t* NetworkingV1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IPAddress | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_ip_address_t](v1_ip_address.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -763,7 +1223,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -794,7 +1254,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -825,7 +1285,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -856,7 +1316,101 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_readServiceCIDR** +```c +// read the specified ServiceCIDR +// +v1_service_cidr_t* NetworkingV1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_service_cidr_t](v1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_readServiceCIDRStatus** +```c +// read status of the specified ServiceCIDR +// +v1_service_cidr_t* NetworkingV1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_service_cidr_t](v1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_replaceIPAddress** +```c +// replace the specified IPAddress +// +v1_ip_address_t* NetworkingV1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IPAddress | +**body** | **[v1_ip_address_t](v1_ip_address.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_ip_address_t](v1_ip_address.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -890,7 +1444,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -925,7 +1479,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -960,7 +1514,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -995,7 +1549,75 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_replaceServiceCIDR** +```c +// replace the specified ServiceCIDR +// +v1_service_cidr_t* NetworkingV1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**body** | **[v1_service_cidr_t](v1_service_cidr.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_service_cidr_t](v1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1API_replaceServiceCIDRStatus** +```c +// replace status of the specified ServiceCIDR +// +v1_service_cidr_t* NetworkingV1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**body** | **[v1_service_cidr_t](v1_service_cidr.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_service_cidr_t](v1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/NetworkingV1beta1API.md b/kubernetes/docs/NetworkingV1beta1API.md index e9f7da05..68d5ac64 100644 --- a/kubernetes/docs/NetworkingV1beta1API.md +++ b/kubernetes/docs/NetworkingV1beta1API.md @@ -4,40 +4,79 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**NetworkingV1beta1API_createNamespacedIngress**](NetworkingV1beta1API.md#NetworkingV1beta1API_createNamespacedIngress) | **POST** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses | -[**NetworkingV1beta1API_deleteCollectionNamespacedIngress**](NetworkingV1beta1API.md#NetworkingV1beta1API_deleteCollectionNamespacedIngress) | **DELETE** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses | -[**NetworkingV1beta1API_deleteNamespacedIngress**](NetworkingV1beta1API.md#NetworkingV1beta1API_deleteNamespacedIngress) | **DELETE** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name} | +[**NetworkingV1beta1API_createIPAddress**](NetworkingV1beta1API.md#NetworkingV1beta1API_createIPAddress) | **POST** /apis/networking.k8s.io/v1beta1/ipaddresses | +[**NetworkingV1beta1API_createServiceCIDR**](NetworkingV1beta1API.md#NetworkingV1beta1API_createServiceCIDR) | **POST** /apis/networking.k8s.io/v1beta1/servicecidrs | +[**NetworkingV1beta1API_deleteCollectionIPAddress**](NetworkingV1beta1API.md#NetworkingV1beta1API_deleteCollectionIPAddress) | **DELETE** /apis/networking.k8s.io/v1beta1/ipaddresses | +[**NetworkingV1beta1API_deleteCollectionServiceCIDR**](NetworkingV1beta1API.md#NetworkingV1beta1API_deleteCollectionServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1beta1/servicecidrs | +[**NetworkingV1beta1API_deleteIPAddress**](NetworkingV1beta1API.md#NetworkingV1beta1API_deleteIPAddress) | **DELETE** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +[**NetworkingV1beta1API_deleteServiceCIDR**](NetworkingV1beta1API.md#NetworkingV1beta1API_deleteServiceCIDR) | **DELETE** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | [**NetworkingV1beta1API_getAPIResources**](NetworkingV1beta1API.md#NetworkingV1beta1API_getAPIResources) | **GET** /apis/networking.k8s.io/v1beta1/ | -[**NetworkingV1beta1API_listIngressForAllNamespaces**](NetworkingV1beta1API.md#NetworkingV1beta1API_listIngressForAllNamespaces) | **GET** /apis/networking.k8s.io/v1beta1/ingresses | -[**NetworkingV1beta1API_listNamespacedIngress**](NetworkingV1beta1API.md#NetworkingV1beta1API_listNamespacedIngress) | **GET** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses | -[**NetworkingV1beta1API_patchNamespacedIngress**](NetworkingV1beta1API.md#NetworkingV1beta1API_patchNamespacedIngress) | **PATCH** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name} | -[**NetworkingV1beta1API_patchNamespacedIngressStatus**](NetworkingV1beta1API.md#NetworkingV1beta1API_patchNamespacedIngressStatus) | **PATCH** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}/status | -[**NetworkingV1beta1API_readNamespacedIngress**](NetworkingV1beta1API.md#NetworkingV1beta1API_readNamespacedIngress) | **GET** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name} | -[**NetworkingV1beta1API_readNamespacedIngressStatus**](NetworkingV1beta1API.md#NetworkingV1beta1API_readNamespacedIngressStatus) | **GET** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}/status | -[**NetworkingV1beta1API_replaceNamespacedIngress**](NetworkingV1beta1API.md#NetworkingV1beta1API_replaceNamespacedIngress) | **PUT** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name} | -[**NetworkingV1beta1API_replaceNamespacedIngressStatus**](NetworkingV1beta1API.md#NetworkingV1beta1API_replaceNamespacedIngressStatus) | **PUT** /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}/status | +[**NetworkingV1beta1API_listIPAddress**](NetworkingV1beta1API.md#NetworkingV1beta1API_listIPAddress) | **GET** /apis/networking.k8s.io/v1beta1/ipaddresses | +[**NetworkingV1beta1API_listServiceCIDR**](NetworkingV1beta1API.md#NetworkingV1beta1API_listServiceCIDR) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs | +[**NetworkingV1beta1API_patchIPAddress**](NetworkingV1beta1API.md#NetworkingV1beta1API_patchIPAddress) | **PATCH** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +[**NetworkingV1beta1API_patchServiceCIDR**](NetworkingV1beta1API.md#NetworkingV1beta1API_patchServiceCIDR) | **PATCH** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +[**NetworkingV1beta1API_patchServiceCIDRStatus**](NetworkingV1beta1API.md#NetworkingV1beta1API_patchServiceCIDRStatus) | **PATCH** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | +[**NetworkingV1beta1API_readIPAddress**](NetworkingV1beta1API.md#NetworkingV1beta1API_readIPAddress) | **GET** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +[**NetworkingV1beta1API_readServiceCIDR**](NetworkingV1beta1API.md#NetworkingV1beta1API_readServiceCIDR) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +[**NetworkingV1beta1API_readServiceCIDRStatus**](NetworkingV1beta1API.md#NetworkingV1beta1API_readServiceCIDRStatus) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | +[**NetworkingV1beta1API_replaceIPAddress**](NetworkingV1beta1API.md#NetworkingV1beta1API_replaceIPAddress) | **PUT** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +[**NetworkingV1beta1API_replaceServiceCIDR**](NetworkingV1beta1API.md#NetworkingV1beta1API_replaceServiceCIDR) | **PUT** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +[**NetworkingV1beta1API_replaceServiceCIDRStatus**](NetworkingV1beta1API.md#NetworkingV1beta1API_replaceServiceCIDRStatus) | **PUT** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | + + +# **NetworkingV1beta1API_createIPAddress** +```c +// create an IPAddress +// +v1beta1_ip_address_t* NetworkingV1beta1API_createIPAddress(apiClient_t *apiClient, v1beta1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1beta1_ip_address_t](v1beta1_ip_address.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +### Return type + +[v1beta1_ip_address_t](v1beta1_ip_address.md) * + + +### Authorization -# **NetworkingV1beta1API_createNamespacedIngress** +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1beta1API_createServiceCIDR** ```c -// create an Ingress +// create a ServiceCIDR // -networking_v1beta1_ingress_t* NetworkingV1beta1API_createNamespacedIngress(apiClient_t *apiClient, char * _namespace, networking_v1beta1_ingress_t * body, char * pretty, char * dryRun, char * fieldManager); +v1beta1_service_cidr_t* NetworkingV1beta1API_createServiceCIDR(apiClient_t *apiClient, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**body** | **[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**body** | **[v1beta1_service_cidr_t](v1beta1_service_cidr.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) * +[v1beta1_service_cidr_t](v1beta1_service_cidr.md) * ### Authorization @@ -47,33 +86,35 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_deleteCollectionNamespacedIngress** +# **NetworkingV1beta1API_deleteCollectionIPAddress** ```c -// delete collection of Ingress +// delete collection of IPAddress // -v1_status_t* NetworkingV1beta1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * _namespace, char * pretty, char * _continue, char * dryRun, char * fieldSelector, int gracePeriodSeconds, char * labelSelector, int limit, int orphanDependents, char * propagationPolicy, char * resourceVersion, int timeoutSeconds, v1_delete_options_t * body); +v1_status_t* NetworkingV1beta1API_deleteCollectionIPAddress(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **_continue** | **char \*** | 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. | [optional] **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] -**gracePeriodSeconds** | **int** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**orphanDependents** | **int** | 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] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] ### Return type @@ -88,28 +129,35 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_deleteNamespacedIngress** +# **NetworkingV1beta1API_deleteCollectionServiceCIDR** ```c -// delete an Ingress +// delete collection of ServiceCIDR // -v1_status_t* NetworkingV1beta1API_deleteNamespacedIngress(apiClient_t *apiClient, char * name, char * _namespace, char * pretty, char * dryRun, int gracePeriodSeconds, int orphanDependents, char * propagationPolicy, v1_delete_options_t * body); +v1_status_t* NetworkingV1beta1API_deleteCollectionServiceCIDR(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Ingress | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] **dryRun** | **char \*** | 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] -**gracePeriodSeconds** | **int** | 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] -**orphanDependents** | **int** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] ### Return type @@ -124,7 +172,79 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1beta1API_deleteIPAddress** +```c +// delete an IPAddress +// +v1_status_t* NetworkingV1beta1API_deleteIPAddress(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IPAddress | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1beta1API_deleteServiceCIDR** +```c +// delete a ServiceCIDR +// +v1_status_t* NetworkingV1beta1API_deleteServiceCIDR(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -152,34 +272,36 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_listIngressForAllNamespaces** +# **NetworkingV1beta1API_listIPAddress** ```c -// list or watch objects of kind Ingress +// list or watch objects of kind IPAddress // -networking_v1beta1_ingress_list_t* NetworkingV1beta1API_listIngressForAllNamespaces(apiClient_t *apiClient, int allowWatchBookmarks, char * _continue, char * fieldSelector, char * labelSelector, int limit, char * pretty, char * resourceVersion, int timeoutSeconds, int watch); +v1beta1_ip_address_list_t* NetworkingV1beta1API_listIPAddress(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**allowWatchBookmarks** | **int** | 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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] **_continue** | **char \*** | 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. | [optional] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] -**watch** | **int** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] ### Return type -[networking_v1beta1_ingress_list_t](networking_v1beta1_ingress_list.md) * +[v1beta1_ip_address_list_t](v1beta1_ip_address_list.md) * ### Authorization @@ -189,35 +311,36 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_listNamespacedIngress** +# **NetworkingV1beta1API_listServiceCIDR** ```c -// list or watch objects of kind Ingress +// list or watch objects of kind ServiceCIDR // -networking_v1beta1_ingress_list_t* NetworkingV1beta1API_listNamespacedIngress(apiClient_t *apiClient, char * _namespace, char * pretty, int allowWatchBookmarks, char * _continue, char * fieldSelector, char * labelSelector, int limit, char * resourceVersion, int timeoutSeconds, int watch); +v1beta1_service_cidr_list_t* NetworkingV1beta1API_listServiceCIDR(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**allowWatchBookmarks** | **int** | 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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] **_continue** | **char \*** | 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. | [optional] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**resourceVersion** | **char \*** | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | [optional] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] -**watch** | **int** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] ### Return type -[networking_v1beta1_ingress_list_t](networking_v1beta1_ingress_list.md) * +[v1beta1_service_cidr_list_t](v1beta1_service_cidr_list.md) * ### Authorization @@ -227,32 +350,67 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1beta1API_patchIPAddress** +```c +// partially update the specified IPAddress +// +v1beta1_ip_address_t* NetworkingV1beta1API_patchIPAddress(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IPAddress | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta1_ip_address_t](v1beta1_ip_address.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_patchNamespacedIngress** +# **NetworkingV1beta1API_patchServiceCIDR** ```c -// partially update the specified Ingress +// partially update the specified ServiceCIDR // -networking_v1beta1_ingress_t* NetworkingV1beta1API_patchNamespacedIngress(apiClient_t *apiClient, char * name, char * _namespace, object_t * body, char * pretty, char * dryRun, char * fieldManager, int force); +v1beta1_service_cidr_t* NetworkingV1beta1API_patchServiceCIDR(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Ingress | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**name** | **char \*** | name of the ServiceCIDR | **body** | **[object_t](object.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**force** | **int** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] ### Return type -[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) * +[v1beta1_service_cidr_t](v1beta1_service_cidr.md) * ### Authorization @@ -261,33 +419,93 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_patchNamespacedIngressStatus** +# **NetworkingV1beta1API_patchServiceCIDRStatus** ```c -// partially update status of the specified Ingress +// partially update status of the specified ServiceCIDR // -networking_v1beta1_ingress_t* NetworkingV1beta1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char * name, char * _namespace, object_t * body, char * pretty, char * dryRun, char * fieldManager, int force); +v1beta1_service_cidr_t* NetworkingV1beta1API_patchServiceCIDRStatus(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Ingress | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**name** | **char \*** | name of the ServiceCIDR | **body** | **[object_t](object.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**force** | **int** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta1_service_cidr_t](v1beta1_service_cidr.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1beta1API_readIPAddress** +```c +// read the specified IPAddress +// +v1beta1_ip_address_t* NetworkingV1beta1API_readIPAddress(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IPAddress | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta1_ip_address_t](v1beta1_ip_address.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **NetworkingV1beta1API_readServiceCIDR** +```c +// read the specified ServiceCIDR +// +v1beta1_service_cidr_t* NetworkingV1beta1API_readServiceCIDR(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ServiceCIDR | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] ### Return type -[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) * +[v1beta1_service_cidr_t](v1beta1_service_cidr.md) * ### Authorization @@ -296,31 +514,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_readNamespacedIngress** +# **NetworkingV1beta1API_readServiceCIDRStatus** ```c -// read the specified Ingress +// read status of the specified ServiceCIDR // -networking_v1beta1_ingress_t* NetworkingV1beta1API_readNamespacedIngress(apiClient_t *apiClient, char * name, char * _namespace, char * pretty, int exact, int _export); +v1beta1_service_cidr_t* NetworkingV1beta1API_readServiceCIDRStatus(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Ingress | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**exact** | **int** | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18. | [optional] -**_export** | **int** | Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. | [optional] +**name** | **char \*** | name of the ServiceCIDR | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] ### Return type -[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) * +[v1beta1_service_cidr_t](v1beta1_service_cidr.md) * ### Authorization @@ -330,28 +545,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_readNamespacedIngressStatus** +# **NetworkingV1beta1API_replaceIPAddress** ```c -// read status of the specified Ingress +// replace the specified IPAddress // -networking_v1beta1_ingress_t* NetworkingV1beta1API_readNamespacedIngressStatus(apiClient_t *apiClient, char * name, char * _namespace, char * pretty); +v1beta1_ip_address_t* NetworkingV1beta1API_replaceIPAddress(apiClient_t *apiClient, char *name, v1beta1_ip_address_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Ingress | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the IPAddress | +**body** | **[v1beta1_ip_address_t](v1beta1_ip_address.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) * +[v1beta1_ip_address_t](v1beta1_ip_address.md) * ### Authorization @@ -361,31 +579,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_replaceNamespacedIngress** +# **NetworkingV1beta1API_replaceServiceCIDR** ```c -// replace the specified Ingress +// replace the specified ServiceCIDR // -networking_v1beta1_ingress_t* NetworkingV1beta1API_replaceNamespacedIngress(apiClient_t *apiClient, char * name, char * _namespace, networking_v1beta1_ingress_t * body, char * pretty, char * dryRun, char * fieldManager); +v1beta1_service_cidr_t* NetworkingV1beta1API_replaceServiceCIDR(apiClient_t *apiClient, char *name, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Ingress | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**body** | **[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the ServiceCIDR | +**body** | **[v1beta1_service_cidr_t](v1beta1_service_cidr.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) * +[v1beta1_service_cidr_t](v1beta1_service_cidr.md) * ### Authorization @@ -395,31 +613,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **NetworkingV1beta1API_replaceNamespacedIngressStatus** +# **NetworkingV1beta1API_replaceServiceCIDRStatus** ```c -// replace status of the specified Ingress +// replace status of the specified ServiceCIDR // -networking_v1beta1_ingress_t* NetworkingV1beta1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char * name, char * _namespace, networking_v1beta1_ingress_t * body, char * pretty, char * dryRun, char * fieldManager); +v1beta1_service_cidr_t* NetworkingV1beta1API_replaceServiceCIDRStatus(apiClient_t *apiClient, char *name, v1beta1_service_cidr_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the Ingress | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**body** | **[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the ServiceCIDR | +**body** | **[v1beta1_service_cidr_t](v1beta1_service_cidr.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[networking_v1beta1_ingress_t](networking_v1beta1_ingress.md) * +[v1beta1_service_cidr_t](v1beta1_service_cidr.md) * ### Authorization @@ -429,7 +647,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/NodeV1API.md b/kubernetes/docs/NodeV1API.md index ed74b3c9..2cd240bf 100644 --- a/kubernetes/docs/NodeV1API.md +++ b/kubernetes/docs/NodeV1API.md @@ -43,7 +43,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -51,7 +51,7 @@ Name | Type | Description | Notes ```c // delete collection of RuntimeClass // -v1_status_t* NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* NodeV1API_deleteCollectionRuntimeClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -63,6 +63,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -85,7 +86,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -93,7 +94,7 @@ Name | Type | Description | Notes ```c // delete a RuntimeClass // -v1_status_t* NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* NodeV1API_deleteRuntimeClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -104,6 +105,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -120,7 +122,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -148,7 +150,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -187,7 +189,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -221,8 +223,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -252,7 +254,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -286,7 +288,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/PolicyV1API.md b/kubernetes/docs/PolicyV1API.md index 16baa94c..8b32e3c1 100644 --- a/kubernetes/docs/PolicyV1API.md +++ b/kubernetes/docs/PolicyV1API.md @@ -48,7 +48,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -56,7 +56,7 @@ Name | Type | Description | Notes ```c // delete collection of PodDisruptionBudget // -v1_status_t* PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* PolicyV1API_deleteCollectionNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -69,6 +69,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -91,7 +92,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -99,7 +100,7 @@ Name | Type | Description | Notes ```c // delete a PodDisruptionBudget // -v1_status_t* PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* PolicyV1API_deleteNamespacedPodDisruptionBudget(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -111,6 +112,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -127,7 +129,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -155,7 +157,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -195,7 +197,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -234,7 +236,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -269,8 +271,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -305,8 +307,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -337,7 +339,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -368,7 +370,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -403,7 +405,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -438,7 +440,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/RbacAuthorizationV1API.md b/kubernetes/docs/RbacAuthorizationV1API.md index 6cb2a577..e59a8025 100644 --- a/kubernetes/docs/RbacAuthorizationV1API.md +++ b/kubernetes/docs/RbacAuthorizationV1API.md @@ -66,7 +66,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -99,7 +99,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -133,7 +133,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -167,7 +167,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -175,7 +175,7 @@ Name | Type | Description | Notes ```c // delete a ClusterRole // -v1_status_t* RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteClusterRole(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -186,6 +186,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -202,7 +203,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -210,7 +211,7 @@ Name | Type | Description | Notes ```c // delete a ClusterRoleBinding // -v1_status_t* RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteClusterRoleBinding(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -221,6 +222,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -237,7 +239,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -245,7 +247,7 @@ Name | Type | Description | Notes ```c // delete collection of ClusterRole // -v1_status_t* RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteCollectionClusterRole(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -257,6 +259,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -279,7 +282,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -287,7 +290,7 @@ Name | Type | Description | Notes ```c // delete collection of ClusterRoleBinding // -v1_status_t* RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteCollectionClusterRoleBinding(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -299,6 +302,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -321,7 +325,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -329,7 +333,7 @@ Name | Type | Description | Notes ```c // delete collection of Role // -v1_status_t* RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteCollectionNamespacedRole(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -342,6 +346,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -364,7 +369,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -372,7 +377,7 @@ Name | Type | Description | Notes ```c // delete collection of RoleBinding // -v1_status_t* RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteCollectionNamespacedRoleBinding(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -385,6 +390,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -407,7 +413,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -415,7 +421,7 @@ Name | Type | Description | Notes ```c // delete a Role // -v1_status_t* RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteNamespacedRole(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -427,6 +433,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -443,7 +450,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -451,7 +458,7 @@ Name | Type | Description | Notes ```c // delete a RoleBinding // -v1_status_t* RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* RbacAuthorizationV1API_deleteNamespacedRoleBinding(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -463,6 +470,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -479,7 +487,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -507,7 +515,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -546,7 +554,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -585,7 +593,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -625,7 +633,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -665,7 +673,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -704,7 +712,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -743,7 +751,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -777,8 +785,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -812,8 +820,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -848,8 +856,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -884,8 +892,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -915,7 +923,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -945,7 +953,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -976,7 +984,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1007,7 +1015,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1041,7 +1049,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1075,7 +1083,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1110,7 +1118,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1145,7 +1153,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/ResourceV1API.md b/kubernetes/docs/ResourceV1API.md new file mode 100644 index 00000000..b9013bca --- /dev/null +++ b/kubernetes/docs/ResourceV1API.md @@ -0,0 +1,1264 @@ +# ResourceV1API + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResourceV1API_createDeviceClass**](ResourceV1API.md#ResourceV1API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1/deviceclasses | +[**ResourceV1API_createNamespacedResourceClaim**](ResourceV1API.md#ResourceV1API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +[**ResourceV1API_createNamespacedResourceClaimTemplate**](ResourceV1API.md#ResourceV1API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1API_createResourceSlice**](ResourceV1API.md#ResourceV1API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1/resourceslices | +[**ResourceV1API_deleteCollectionDeviceClass**](ResourceV1API.md#ResourceV1API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1/deviceclasses | +[**ResourceV1API_deleteCollectionNamespacedResourceClaim**](ResourceV1API.md#ResourceV1API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +[**ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate**](ResourceV1API.md#ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1API_deleteCollectionResourceSlice**](ResourceV1API.md#ResourceV1API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1/resourceslices | +[**ResourceV1API_deleteDeviceClass**](ResourceV1API.md#ResourceV1API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1/deviceclasses/{name} | +[**ResourceV1API_deleteNamespacedResourceClaim**](ResourceV1API.md#ResourceV1API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1API_deleteNamespacedResourceClaimTemplate**](ResourceV1API.md#ResourceV1API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1API_deleteResourceSlice**](ResourceV1API.md#ResourceV1API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1/resourceslices/{name} | +[**ResourceV1API_getAPIResources**](ResourceV1API.md#ResourceV1API_getAPIResources) | **GET** /apis/resource.k8s.io/v1/ | +[**ResourceV1API_listDeviceClass**](ResourceV1API.md#ResourceV1API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1/deviceclasses | +[**ResourceV1API_listNamespacedResourceClaim**](ResourceV1API.md#ResourceV1API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +[**ResourceV1API_listNamespacedResourceClaimTemplate**](ResourceV1API.md#ResourceV1API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1API_listResourceClaimForAllNamespaces**](ResourceV1API.md#ResourceV1API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1/resourceclaims | +[**ResourceV1API_listResourceClaimTemplateForAllNamespaces**](ResourceV1API.md#ResourceV1API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1/resourceclaimtemplates | +[**ResourceV1API_listResourceSlice**](ResourceV1API.md#ResourceV1API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1/resourceslices | +[**ResourceV1API_patchDeviceClass**](ResourceV1API.md#ResourceV1API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1/deviceclasses/{name} | +[**ResourceV1API_patchNamespacedResourceClaim**](ResourceV1API.md#ResourceV1API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1API_patchNamespacedResourceClaimStatus**](ResourceV1API.md#ResourceV1API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1API_patchNamespacedResourceClaimTemplate**](ResourceV1API.md#ResourceV1API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1API_patchResourceSlice**](ResourceV1API.md#ResourceV1API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1/resourceslices/{name} | +[**ResourceV1API_readDeviceClass**](ResourceV1API.md#ResourceV1API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1/deviceclasses/{name} | +[**ResourceV1API_readNamespacedResourceClaim**](ResourceV1API.md#ResourceV1API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1API_readNamespacedResourceClaimStatus**](ResourceV1API.md#ResourceV1API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1API_readNamespacedResourceClaimTemplate**](ResourceV1API.md#ResourceV1API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1API_readResourceSlice**](ResourceV1API.md#ResourceV1API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1/resourceslices/{name} | +[**ResourceV1API_replaceDeviceClass**](ResourceV1API.md#ResourceV1API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1/deviceclasses/{name} | +[**ResourceV1API_replaceNamespacedResourceClaim**](ResourceV1API.md#ResourceV1API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1API_replaceNamespacedResourceClaimStatus**](ResourceV1API.md#ResourceV1API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1API_replaceNamespacedResourceClaimTemplate**](ResourceV1API.md#ResourceV1API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1API_replaceResourceSlice**](ResourceV1API.md#ResourceV1API_replaceResourceSlice) | **PUT** /apis/resource.k8s.io/v1/resourceslices/{name} | + + +# **ResourceV1API_createDeviceClass** +```c +// create a DeviceClass +// +v1_device_class_t* ResourceV1API_createDeviceClass(apiClient_t *apiClient, v1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1_device_class_t](v1_device_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_device_class_t](v1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_createNamespacedResourceClaim** +```c +// create a ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[resource_v1_resource_claim_t](resource_v1_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_createNamespacedResourceClaimTemplate** +```c +// create a ResourceClaimTemplate +// +v1_resource_claim_template_t* ResourceV1API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1_resource_claim_template_t](v1_resource_claim_template.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_resource_claim_template_t](v1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_createResourceSlice** +```c +// create a ResourceSlice +// +v1_resource_slice_t* ResourceV1API_createResourceSlice(apiClient_t *apiClient, v1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1_resource_slice_t](v1_resource_slice.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_resource_slice_t](v1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteCollectionDeviceClass** +```c +// delete collection of DeviceClass +// +v1_status_t* ResourceV1API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteCollectionNamespacedResourceClaim** +```c +// delete collection of ResourceClaim +// +v1_status_t* ResourceV1API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate** +```c +// delete collection of ResourceClaimTemplate +// +v1_status_t* ResourceV1API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteCollectionResourceSlice** +```c +// delete collection of ResourceSlice +// +v1_status_t* ResourceV1API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteDeviceClass** +```c +// delete a DeviceClass +// +v1_device_class_t* ResourceV1API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_device_class_t](v1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteNamespacedResourceClaim** +```c +// delete a ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteNamespacedResourceClaimTemplate** +```c +// delete a ResourceClaimTemplate +// +v1_resource_claim_template_t* ResourceV1API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_resource_claim_template_t](v1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_deleteResourceSlice** +```c +// delete a ResourceSlice +// +v1_resource_slice_t* ResourceV1API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_resource_slice_t](v1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_getAPIResources** +```c +// get available resources +// +v1_api_resource_list_t* ResourceV1API_getAPIResources(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[v1_api_resource_list_t](v1_api_resource_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_listDeviceClass** +```c +// list or watch objects of kind DeviceClass +// +v1_device_class_list_t* ResourceV1API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_device_class_list_t](v1_device_class_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_listNamespacedResourceClaim** +```c +// list or watch objects of kind ResourceClaim +// +v1_resource_claim_list_t* ResourceV1API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_resource_claim_list_t](v1_resource_claim_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_listNamespacedResourceClaimTemplate** +```c +// list or watch objects of kind ResourceClaimTemplate +// +v1_resource_claim_template_list_t* ResourceV1API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_resource_claim_template_list_t](v1_resource_claim_template_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_listResourceClaimForAllNamespaces** +```c +// list or watch objects of kind ResourceClaim +// +v1_resource_claim_list_t* ResourceV1API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_resource_claim_list_t](v1_resource_claim_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_listResourceClaimTemplateForAllNamespaces** +```c +// list or watch objects of kind ResourceClaimTemplate +// +v1_resource_claim_template_list_t* ResourceV1API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_resource_claim_template_list_t](v1_resource_claim_template_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_listResourceSlice** +```c +// list or watch objects of kind ResourceSlice +// +v1_resource_slice_list_t* ResourceV1API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_resource_slice_list_t](v1_resource_slice_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_patchDeviceClass** +```c +// partially update the specified DeviceClass +// +v1_device_class_t* ResourceV1API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_device_class_t](v1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_patchNamespacedResourceClaim** +```c +// partially update the specified ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_patchNamespacedResourceClaimStatus** +```c +// partially update status of the specified ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_patchNamespacedResourceClaimTemplate** +```c +// partially update the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* ResourceV1API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_resource_claim_template_t](v1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_patchResourceSlice** +```c +// partially update the specified ResourceSlice +// +v1_resource_slice_t* ResourceV1API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_resource_slice_t](v1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_readDeviceClass** +```c +// read the specified DeviceClass +// +v1_device_class_t* ResourceV1API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_device_class_t](v1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_readNamespacedResourceClaim** +```c +// read the specified ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_readNamespacedResourceClaimStatus** +```c +// read status of the specified ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_readNamespacedResourceClaimTemplate** +```c +// read the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* ResourceV1API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_resource_claim_template_t](v1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_readResourceSlice** +```c +// read the specified ResourceSlice +// +v1_resource_slice_t* ResourceV1API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_resource_slice_t](v1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_replaceDeviceClass** +```c +// replace the specified DeviceClass +// +v1_device_class_t* ResourceV1API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**body** | **[v1_device_class_t](v1_device_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_device_class_t](v1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_replaceNamespacedResourceClaim** +```c +// replace the specified ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[resource_v1_resource_claim_t](resource_v1_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_replaceNamespacedResourceClaimStatus** +```c +// replace status of the specified ResourceClaim +// +resource_v1_resource_claim_t* ResourceV1API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, resource_v1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[resource_v1_resource_claim_t](resource_v1_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[resource_v1_resource_claim_t](resource_v1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_replaceNamespacedResourceClaimTemplate** +```c +// replace the specified ResourceClaimTemplate +// +v1_resource_claim_template_t* ResourceV1API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1_resource_claim_template_t](v1_resource_claim_template.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_resource_claim_template_t](v1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1API_replaceResourceSlice** +```c +// replace the specified ResourceSlice +// +v1_resource_slice_t* ResourceV1API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**body** | **[v1_resource_slice_t](v1_resource_slice.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_resource_slice_t](v1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/kubernetes/docs/ResourceV1alpha3API.md b/kubernetes/docs/ResourceV1alpha3API.md new file mode 100644 index 00000000..88ec1f47 --- /dev/null +++ b/kubernetes/docs/ResourceV1alpha3API.md @@ -0,0 +1,294 @@ +# ResourceV1alpha3API + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResourceV1alpha3API_createDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_createDeviceTaintRule) | **POST** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +[**ResourceV1alpha3API_deleteCollectionDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +[**ResourceV1alpha3API_deleteDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +[**ResourceV1alpha3API_getAPIResources**](ResourceV1alpha3API.md#ResourceV1alpha3API_getAPIResources) | **GET** /apis/resource.k8s.io/v1alpha3/ | +[**ResourceV1alpha3API_listDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_listDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +[**ResourceV1alpha3API_patchDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_patchDeviceTaintRule) | **PATCH** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +[**ResourceV1alpha3API_readDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_readDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +[**ResourceV1alpha3API_replaceDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_replaceDeviceTaintRule) | **PUT** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | + + +# **ResourceV1alpha3API_createDeviceTaintRule** +```c +// create a DeviceTaintRule +// +v1alpha3_device_taint_rule_t* ResourceV1alpha3API_createDeviceTaintRule(apiClient_t *apiClient, v1alpha3_device_taint_rule_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1alpha3_device_taint_rule_t](v1alpha3_device_taint_rule.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha3_device_taint_rule_t](v1alpha3_device_taint_rule.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1alpha3API_deleteCollectionDeviceTaintRule** +```c +// delete collection of DeviceTaintRule +// +v1_status_t* ResourceV1alpha3API_deleteCollectionDeviceTaintRule(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1alpha3API_deleteDeviceTaintRule** +```c +// delete a DeviceTaintRule +// +v1alpha3_device_taint_rule_t* ResourceV1alpha3API_deleteDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceTaintRule | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1alpha3_device_taint_rule_t](v1alpha3_device_taint_rule.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1alpha3API_getAPIResources** +```c +// get available resources +// +v1_api_resource_list_t* ResourceV1alpha3API_getAPIResources(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[v1_api_resource_list_t](v1_api_resource_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1alpha3API_listDeviceTaintRule** +```c +// list or watch objects of kind DeviceTaintRule +// +v1alpha3_device_taint_rule_list_t* ResourceV1alpha3API_listDeviceTaintRule(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1alpha3_device_taint_rule_list_t](v1alpha3_device_taint_rule_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1alpha3API_patchDeviceTaintRule** +```c +// partially update the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* ResourceV1alpha3API_patchDeviceTaintRule(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceTaintRule | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1alpha3_device_taint_rule_t](v1alpha3_device_taint_rule.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1alpha3API_readDeviceTaintRule** +```c +// read the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* ResourceV1alpha3API_readDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceTaintRule | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1alpha3_device_taint_rule_t](v1alpha3_device_taint_rule.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1alpha3API_replaceDeviceTaintRule** +```c +// replace the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* ResourceV1alpha3API_replaceDeviceTaintRule(apiClient_t *apiClient, char *name, v1alpha3_device_taint_rule_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceTaintRule | +**body** | **[v1alpha3_device_taint_rule_t](v1alpha3_device_taint_rule.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1alpha3_device_taint_rule_t](v1alpha3_device_taint_rule.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/kubernetes/docs/ResourceV1beta1API.md b/kubernetes/docs/ResourceV1beta1API.md new file mode 100644 index 00000000..6624d31e --- /dev/null +++ b/kubernetes/docs/ResourceV1beta1API.md @@ -0,0 +1,1264 @@ +# ResourceV1beta1API + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResourceV1beta1API_createDeviceClass**](ResourceV1beta1API.md#ResourceV1beta1API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1beta1/deviceclasses | +[**ResourceV1beta1API_createNamespacedResourceClaim**](ResourceV1beta1API.md#ResourceV1beta1API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +[**ResourceV1beta1API_createNamespacedResourceClaimTemplate**](ResourceV1beta1API.md#ResourceV1beta1API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1beta1API_createResourceSlice**](ResourceV1beta1API.md#ResourceV1beta1API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1beta1/resourceslices | +[**ResourceV1beta1API_deleteCollectionDeviceClass**](ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta1/deviceclasses | +[**ResourceV1beta1API_deleteCollectionNamespacedResourceClaim**](ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +[**ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate**](ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1beta1API_deleteCollectionResourceSlice**](ResourceV1beta1API.md#ResourceV1beta1API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta1/resourceslices | +[**ResourceV1beta1API_deleteDeviceClass**](ResourceV1beta1API.md#ResourceV1beta1API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +[**ResourceV1beta1API_deleteNamespacedResourceClaim**](ResourceV1beta1API.md#ResourceV1beta1API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta1API_deleteNamespacedResourceClaimTemplate**](ResourceV1beta1API.md#ResourceV1beta1API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta1API_deleteResourceSlice**](ResourceV1beta1API.md#ResourceV1beta1API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +[**ResourceV1beta1API_getAPIResources**](ResourceV1beta1API.md#ResourceV1beta1API_getAPIResources) | **GET** /apis/resource.k8s.io/v1beta1/ | +[**ResourceV1beta1API_listDeviceClass**](ResourceV1beta1API.md#ResourceV1beta1API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1beta1/deviceclasses | +[**ResourceV1beta1API_listNamespacedResourceClaim**](ResourceV1beta1API.md#ResourceV1beta1API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +[**ResourceV1beta1API_listNamespacedResourceClaimTemplate**](ResourceV1beta1API.md#ResourceV1beta1API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1beta1API_listResourceClaimForAllNamespaces**](ResourceV1beta1API.md#ResourceV1beta1API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta1/resourceclaims | +[**ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces**](ResourceV1beta1API.md#ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta1/resourceclaimtemplates | +[**ResourceV1beta1API_listResourceSlice**](ResourceV1beta1API.md#ResourceV1beta1API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1beta1/resourceslices | +[**ResourceV1beta1API_patchDeviceClass**](ResourceV1beta1API.md#ResourceV1beta1API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +[**ResourceV1beta1API_patchNamespacedResourceClaim**](ResourceV1beta1API.md#ResourceV1beta1API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta1API_patchNamespacedResourceClaimStatus**](ResourceV1beta1API.md#ResourceV1beta1API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1beta1API_patchNamespacedResourceClaimTemplate**](ResourceV1beta1API.md#ResourceV1beta1API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta1API_patchResourceSlice**](ResourceV1beta1API.md#ResourceV1beta1API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +[**ResourceV1beta1API_readDeviceClass**](ResourceV1beta1API.md#ResourceV1beta1API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +[**ResourceV1beta1API_readNamespacedResourceClaim**](ResourceV1beta1API.md#ResourceV1beta1API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta1API_readNamespacedResourceClaimStatus**](ResourceV1beta1API.md#ResourceV1beta1API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1beta1API_readNamespacedResourceClaimTemplate**](ResourceV1beta1API.md#ResourceV1beta1API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta1API_readResourceSlice**](ResourceV1beta1API.md#ResourceV1beta1API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +[**ResourceV1beta1API_replaceDeviceClass**](ResourceV1beta1API.md#ResourceV1beta1API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +[**ResourceV1beta1API_replaceNamespacedResourceClaim**](ResourceV1beta1API.md#ResourceV1beta1API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta1API_replaceNamespacedResourceClaimStatus**](ResourceV1beta1API.md#ResourceV1beta1API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1beta1API_replaceNamespacedResourceClaimTemplate**](ResourceV1beta1API.md#ResourceV1beta1API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta1API_replaceResourceSlice**](ResourceV1beta1API.md#ResourceV1beta1API_replaceResourceSlice) | **PUT** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | + + +# **ResourceV1beta1API_createDeviceClass** +```c +// create a DeviceClass +// +v1beta1_device_class_t* ResourceV1beta1API_createDeviceClass(apiClient_t *apiClient, v1beta1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1beta1_device_class_t](v1beta1_device_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_device_class_t](v1beta1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_createNamespacedResourceClaim** +```c +// create a ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta1_resource_claim_t](v1beta1_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_createNamespacedResourceClaimTemplate** +```c +// create a ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* ResourceV1beta1API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1beta1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta1_resource_claim_template_t](v1beta1_resource_claim_template.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_resource_claim_template_t](v1beta1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_createResourceSlice** +```c +// create a ResourceSlice +// +v1beta1_resource_slice_t* ResourceV1beta1API_createResourceSlice(apiClient_t *apiClient, v1beta1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1beta1_resource_slice_t](v1beta1_resource_slice.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_resource_slice_t](v1beta1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteCollectionDeviceClass** +```c +// delete collection of DeviceClass +// +v1_status_t* ResourceV1beta1API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteCollectionNamespacedResourceClaim** +```c +// delete collection of ResourceClaim +// +v1_status_t* ResourceV1beta1API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate** +```c +// delete collection of ResourceClaimTemplate +// +v1_status_t* ResourceV1beta1API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteCollectionResourceSlice** +```c +// delete collection of ResourceSlice +// +v1_status_t* ResourceV1beta1API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteDeviceClass** +```c +// delete a DeviceClass +// +v1beta1_device_class_t* ResourceV1beta1API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta1_device_class_t](v1beta1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteNamespacedResourceClaim** +```c +// delete a ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteNamespacedResourceClaimTemplate** +```c +// delete a ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* ResourceV1beta1API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta1_resource_claim_template_t](v1beta1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_deleteResourceSlice** +```c +// delete a ResourceSlice +// +v1beta1_resource_slice_t* ResourceV1beta1API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta1_resource_slice_t](v1beta1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_getAPIResources** +```c +// get available resources +// +v1_api_resource_list_t* ResourceV1beta1API_getAPIResources(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[v1_api_resource_list_t](v1_api_resource_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_listDeviceClass** +```c +// list or watch objects of kind DeviceClass +// +v1beta1_device_class_list_t* ResourceV1beta1API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta1_device_class_list_t](v1beta1_device_class_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_listNamespacedResourceClaim** +```c +// list or watch objects of kind ResourceClaim +// +v1beta1_resource_claim_list_t* ResourceV1beta1API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta1_resource_claim_list_t](v1beta1_resource_claim_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_listNamespacedResourceClaimTemplate** +```c +// list or watch objects of kind ResourceClaimTemplate +// +v1beta1_resource_claim_template_list_t* ResourceV1beta1API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta1_resource_claim_template_list_t](v1beta1_resource_claim_template_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_listResourceClaimForAllNamespaces** +```c +// list or watch objects of kind ResourceClaim +// +v1beta1_resource_claim_list_t* ResourceV1beta1API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta1_resource_claim_list_t](v1beta1_resource_claim_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces** +```c +// list or watch objects of kind ResourceClaimTemplate +// +v1beta1_resource_claim_template_list_t* ResourceV1beta1API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta1_resource_claim_template_list_t](v1beta1_resource_claim_template_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_listResourceSlice** +```c +// list or watch objects of kind ResourceSlice +// +v1beta1_resource_slice_list_t* ResourceV1beta1API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta1_resource_slice_list_t](v1beta1_resource_slice_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_patchDeviceClass** +```c +// partially update the specified DeviceClass +// +v1beta1_device_class_t* ResourceV1beta1API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta1_device_class_t](v1beta1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_patchNamespacedResourceClaim** +```c +// partially update the specified ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_patchNamespacedResourceClaimStatus** +```c +// partially update status of the specified ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_patchNamespacedResourceClaimTemplate** +```c +// partially update the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* ResourceV1beta1API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta1_resource_claim_template_t](v1beta1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_patchResourceSlice** +```c +// partially update the specified ResourceSlice +// +v1beta1_resource_slice_t* ResourceV1beta1API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta1_resource_slice_t](v1beta1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_readDeviceClass** +```c +// read the specified DeviceClass +// +v1beta1_device_class_t* ResourceV1beta1API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta1_device_class_t](v1beta1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_readNamespacedResourceClaim** +```c +// read the specified ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_readNamespacedResourceClaimStatus** +```c +// read status of the specified ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_readNamespacedResourceClaimTemplate** +```c +// read the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* ResourceV1beta1API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta1_resource_claim_template_t](v1beta1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_readResourceSlice** +```c +// read the specified ResourceSlice +// +v1beta1_resource_slice_t* ResourceV1beta1API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta1_resource_slice_t](v1beta1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_replaceDeviceClass** +```c +// replace the specified DeviceClass +// +v1beta1_device_class_t* ResourceV1beta1API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1beta1_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**body** | **[v1beta1_device_class_t](v1beta1_device_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_device_class_t](v1beta1_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_replaceNamespacedResourceClaim** +```c +// replace the specified ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta1_resource_claim_t](v1beta1_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_replaceNamespacedResourceClaimStatus** +```c +// replace status of the specified ResourceClaim +// +v1beta1_resource_claim_t* ResourceV1beta1API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta1_resource_claim_t](v1beta1_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_resource_claim_t](v1beta1_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_replaceNamespacedResourceClaimTemplate** +```c +// replace the specified ResourceClaimTemplate +// +v1beta1_resource_claim_template_t* ResourceV1beta1API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1beta1_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta1_resource_claim_template_t](v1beta1_resource_claim_template.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_resource_claim_template_t](v1beta1_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta1API_replaceResourceSlice** +```c +// replace the specified ResourceSlice +// +v1beta1_resource_slice_t* ResourceV1beta1API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1beta1_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**body** | **[v1beta1_resource_slice_t](v1beta1_resource_slice.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta1_resource_slice_t](v1beta1_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/kubernetes/docs/ResourceV1beta2API.md b/kubernetes/docs/ResourceV1beta2API.md new file mode 100644 index 00000000..41557c2c --- /dev/null +++ b/kubernetes/docs/ResourceV1beta2API.md @@ -0,0 +1,1264 @@ +# ResourceV1beta2API + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResourceV1beta2API_createDeviceClass**](ResourceV1beta2API.md#ResourceV1beta2API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1beta2/deviceclasses | +[**ResourceV1beta2API_createNamespacedResourceClaim**](ResourceV1beta2API.md#ResourceV1beta2API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +[**ResourceV1beta2API_createNamespacedResourceClaimTemplate**](ResourceV1beta2API.md#ResourceV1beta2API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1beta2API_createResourceSlice**](ResourceV1beta2API.md#ResourceV1beta2API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1beta2/resourceslices | +[**ResourceV1beta2API_deleteCollectionDeviceClass**](ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta2/deviceclasses | +[**ResourceV1beta2API_deleteCollectionNamespacedResourceClaim**](ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +[**ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate**](ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1beta2API_deleteCollectionResourceSlice**](ResourceV1beta2API.md#ResourceV1beta2API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta2/resourceslices | +[**ResourceV1beta2API_deleteDeviceClass**](ResourceV1beta2API.md#ResourceV1beta2API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +[**ResourceV1beta2API_deleteNamespacedResourceClaim**](ResourceV1beta2API.md#ResourceV1beta2API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta2API_deleteNamespacedResourceClaimTemplate**](ResourceV1beta2API.md#ResourceV1beta2API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta2API_deleteResourceSlice**](ResourceV1beta2API.md#ResourceV1beta2API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +[**ResourceV1beta2API_getAPIResources**](ResourceV1beta2API.md#ResourceV1beta2API_getAPIResources) | **GET** /apis/resource.k8s.io/v1beta2/ | +[**ResourceV1beta2API_listDeviceClass**](ResourceV1beta2API.md#ResourceV1beta2API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1beta2/deviceclasses | +[**ResourceV1beta2API_listNamespacedResourceClaim**](ResourceV1beta2API.md#ResourceV1beta2API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +[**ResourceV1beta2API_listNamespacedResourceClaimTemplate**](ResourceV1beta2API.md#ResourceV1beta2API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +[**ResourceV1beta2API_listResourceClaimForAllNamespaces**](ResourceV1beta2API.md#ResourceV1beta2API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta2/resourceclaims | +[**ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces**](ResourceV1beta2API.md#ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1beta2/resourceclaimtemplates | +[**ResourceV1beta2API_listResourceSlice**](ResourceV1beta2API.md#ResourceV1beta2API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1beta2/resourceslices | +[**ResourceV1beta2API_patchDeviceClass**](ResourceV1beta2API.md#ResourceV1beta2API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +[**ResourceV1beta2API_patchNamespacedResourceClaim**](ResourceV1beta2API.md#ResourceV1beta2API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta2API_patchNamespacedResourceClaimStatus**](ResourceV1beta2API.md#ResourceV1beta2API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1beta2API_patchNamespacedResourceClaimTemplate**](ResourceV1beta2API.md#ResourceV1beta2API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta2API_patchResourceSlice**](ResourceV1beta2API.md#ResourceV1beta2API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +[**ResourceV1beta2API_readDeviceClass**](ResourceV1beta2API.md#ResourceV1beta2API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +[**ResourceV1beta2API_readNamespacedResourceClaim**](ResourceV1beta2API.md#ResourceV1beta2API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta2API_readNamespacedResourceClaimStatus**](ResourceV1beta2API.md#ResourceV1beta2API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1beta2API_readNamespacedResourceClaimTemplate**](ResourceV1beta2API.md#ResourceV1beta2API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta2API_readResourceSlice**](ResourceV1beta2API.md#ResourceV1beta2API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +[**ResourceV1beta2API_replaceDeviceClass**](ResourceV1beta2API.md#ResourceV1beta2API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +[**ResourceV1beta2API_replaceNamespacedResourceClaim**](ResourceV1beta2API.md#ResourceV1beta2API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +[**ResourceV1beta2API_replaceNamespacedResourceClaimStatus**](ResourceV1beta2API.md#ResourceV1beta2API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +[**ResourceV1beta2API_replaceNamespacedResourceClaimTemplate**](ResourceV1beta2API.md#ResourceV1beta2API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +[**ResourceV1beta2API_replaceResourceSlice**](ResourceV1beta2API.md#ResourceV1beta2API_replaceResourceSlice) | **PUT** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | + + +# **ResourceV1beta2API_createDeviceClass** +```c +// create a DeviceClass +// +v1beta2_device_class_t* ResourceV1beta2API_createDeviceClass(apiClient_t *apiClient, v1beta2_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1beta2_device_class_t](v1beta2_device_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_device_class_t](v1beta2_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_createNamespacedResourceClaim** +```c +// create a ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_createNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta2_resource_claim_t](v1beta2_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_createNamespacedResourceClaimTemplate** +```c +// create a ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* ResourceV1beta2API_createNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, v1beta2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta2_resource_claim_template_t](v1beta2_resource_claim_template.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_resource_claim_template_t](v1beta2_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_createResourceSlice** +```c +// create a ResourceSlice +// +v1beta2_resource_slice_t* ResourceV1beta2API_createResourceSlice(apiClient_t *apiClient, v1beta2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1beta2_resource_slice_t](v1beta2_resource_slice.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_resource_slice_t](v1beta2_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteCollectionDeviceClass** +```c +// delete collection of DeviceClass +// +v1_status_t* ResourceV1beta2API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteCollectionNamespacedResourceClaim** +```c +// delete collection of ResourceClaim +// +v1_status_t* ResourceV1beta2API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate** +```c +// delete collection of ResourceClaimTemplate +// +v1_status_t* ResourceV1beta2API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteCollectionResourceSlice** +```c +// delete collection of ResourceSlice +// +v1_status_t* ResourceV1beta2API_deleteCollectionResourceSlice(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteDeviceClass** +```c +// delete a DeviceClass +// +v1beta2_device_class_t* ResourceV1beta2API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta2_device_class_t](v1beta2_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteNamespacedResourceClaim** +```c +// delete a ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteNamespacedResourceClaimTemplate** +```c +// delete a ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* ResourceV1beta2API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta2_resource_claim_template_t](v1beta2_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_deleteResourceSlice** +```c +// delete a ResourceSlice +// +v1beta2_resource_slice_t* ResourceV1beta2API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1beta2_resource_slice_t](v1beta2_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_getAPIResources** +```c +// get available resources +// +v1_api_resource_list_t* ResourceV1beta2API_getAPIResources(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[v1_api_resource_list_t](v1_api_resource_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_listDeviceClass** +```c +// list or watch objects of kind DeviceClass +// +v1beta2_device_class_list_t* ResourceV1beta2API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta2_device_class_list_t](v1beta2_device_class_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_listNamespacedResourceClaim** +```c +// list or watch objects of kind ResourceClaim +// +v1beta2_resource_claim_list_t* ResourceV1beta2API_listNamespacedResourceClaim(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta2_resource_claim_list_t](v1beta2_resource_claim_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_listNamespacedResourceClaimTemplate** +```c +// list or watch objects of kind ResourceClaimTemplate +// +v1beta2_resource_claim_template_list_t* ResourceV1beta2API_listNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *_namespace, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta2_resource_claim_template_list_t](v1beta2_resource_claim_template_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_listResourceClaimForAllNamespaces** +```c +// list or watch objects of kind ResourceClaim +// +v1beta2_resource_claim_list_t* ResourceV1beta2API_listResourceClaimForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta2_resource_claim_list_t](v1beta2_resource_claim_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces** +```c +// list or watch objects of kind ResourceClaimTemplate +// +v1beta2_resource_claim_template_list_t* ResourceV1beta2API_listResourceClaimTemplateForAllNamespaces(apiClient_t *apiClient, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *pretty, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta2_resource_claim_template_list_t](v1beta2_resource_claim_template_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_listResourceSlice** +```c +// list or watch objects of kind ResourceSlice +// +v1beta2_resource_slice_list_t* ResourceV1beta2API_listResourceSlice(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1beta2_resource_slice_list_t](v1beta2_resource_slice_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_patchDeviceClass** +```c +// partially update the specified DeviceClass +// +v1beta2_device_class_t* ResourceV1beta2API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta2_device_class_t](v1beta2_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_patchNamespacedResourceClaim** +```c +// partially update the specified ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_patchNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_patchNamespacedResourceClaimStatus** +```c +// partially update status of the specified ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_patchNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_patchNamespacedResourceClaimTemplate** +```c +// partially update the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* ResourceV1beta2API_patchNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta2_resource_claim_template_t](v1beta2_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_patchResourceSlice** +```c +// partially update the specified ResourceSlice +// +v1beta2_resource_slice_t* ResourceV1beta2API_patchResourceSlice(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1beta2_resource_slice_t](v1beta2_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_readDeviceClass** +```c +// read the specified DeviceClass +// +v1beta2_device_class_t* ResourceV1beta2API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta2_device_class_t](v1beta2_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_readNamespacedResourceClaim** +```c +// read the specified ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_readNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_readNamespacedResourceClaimStatus** +```c +// read status of the specified ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_readNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_readNamespacedResourceClaimTemplate** +```c +// read the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* ResourceV1beta2API_readNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta2_resource_claim_template_t](v1beta2_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_readResourceSlice** +```c +// read the specified ResourceSlice +// +v1beta2_resource_slice_t* ResourceV1beta2API_readResourceSlice(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1beta2_resource_slice_t](v1beta2_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_replaceDeviceClass** +```c +// replace the specified DeviceClass +// +v1beta2_device_class_t* ResourceV1beta2API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1beta2_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the DeviceClass | +**body** | **[v1beta2_device_class_t](v1beta2_device_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_device_class_t](v1beta2_device_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_replaceNamespacedResourceClaim** +```c +// replace the specified ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_replaceNamespacedResourceClaim(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta2_resource_claim_t](v1beta2_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_replaceNamespacedResourceClaimStatus** +```c +// replace status of the specified ResourceClaim +// +v1beta2_resource_claim_t* ResourceV1beta2API_replaceNamespacedResourceClaimStatus(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaim | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta2_resource_claim_t](v1beta2_resource_claim.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_resource_claim_t](v1beta2_resource_claim.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_replaceNamespacedResourceClaimTemplate** +```c +// replace the specified ResourceClaimTemplate +// +v1beta2_resource_claim_template_t* ResourceV1beta2API_replaceNamespacedResourceClaimTemplate(apiClient_t *apiClient, char *name, char *_namespace, v1beta2_resource_claim_template_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceClaimTemplate | +**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**body** | **[v1beta2_resource_claim_template_t](v1beta2_resource_claim_template.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_resource_claim_template_t](v1beta2_resource_claim_template.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ResourceV1beta2API_replaceResourceSlice** +```c +// replace the specified ResourceSlice +// +v1beta2_resource_slice_t* ResourceV1beta2API_replaceResourceSlice(apiClient_t *apiClient, char *name, v1beta2_resource_slice_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the ResourceSlice | +**body** | **[v1beta2_resource_slice_t](v1beta2_resource_slice.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1beta2_resource_slice_t](v1beta2_resource_slice.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/kubernetes/docs/SchedulingV1API.md b/kubernetes/docs/SchedulingV1API.md index bd9c65f8..e920adf2 100644 --- a/kubernetes/docs/SchedulingV1API.md +++ b/kubernetes/docs/SchedulingV1API.md @@ -43,7 +43,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -51,7 +51,7 @@ Name | Type | Description | Notes ```c // delete collection of PriorityClass // -v1_status_t* SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* SchedulingV1API_deleteCollectionPriorityClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -63,6 +63,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -85,7 +86,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -93,7 +94,7 @@ Name | Type | Description | Notes ```c // delete a PriorityClass // -v1_status_t* SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* SchedulingV1API_deletePriorityClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -104,6 +105,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -120,7 +122,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -148,7 +150,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -187,7 +189,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -221,8 +223,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -252,7 +254,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -286,7 +288,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/StorageV1API.md b/kubernetes/docs/StorageV1API.md index ec0bbec0..4b93d634 100644 --- a/kubernetes/docs/StorageV1API.md +++ b/kubernetes/docs/StorageV1API.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**StorageV1API_createNamespacedCSIStorageCapacity**](StorageV1API.md#StorageV1API_createNamespacedCSIStorageCapacity) | **POST** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | [**StorageV1API_createStorageClass**](StorageV1API.md#StorageV1API_createStorageClass) | **POST** /apis/storage.k8s.io/v1/storageclasses | [**StorageV1API_createVolumeAttachment**](StorageV1API.md#StorageV1API_createVolumeAttachment) | **POST** /apis/storage.k8s.io/v1/volumeattachments | +[**StorageV1API_createVolumeAttributesClass**](StorageV1API.md#StorageV1API_createVolumeAttributesClass) | **POST** /apis/storage.k8s.io/v1/volumeattributesclasses | [**StorageV1API_deleteCSIDriver**](StorageV1API.md#StorageV1API_deleteCSIDriver) | **DELETE** /apis/storage.k8s.io/v1/csidrivers/{name} | [**StorageV1API_deleteCSINode**](StorageV1API.md#StorageV1API_deleteCSINode) | **DELETE** /apis/storage.k8s.io/v1/csinodes/{name} | [**StorageV1API_deleteCollectionCSIDriver**](StorageV1API.md#StorageV1API_deleteCollectionCSIDriver) | **DELETE** /apis/storage.k8s.io/v1/csidrivers | @@ -16,9 +17,11 @@ Method | HTTP request | Description [**StorageV1API_deleteCollectionNamespacedCSIStorageCapacity**](StorageV1API.md#StorageV1API_deleteCollectionNamespacedCSIStorageCapacity) | **DELETE** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | [**StorageV1API_deleteCollectionStorageClass**](StorageV1API.md#StorageV1API_deleteCollectionStorageClass) | **DELETE** /apis/storage.k8s.io/v1/storageclasses | [**StorageV1API_deleteCollectionVolumeAttachment**](StorageV1API.md#StorageV1API_deleteCollectionVolumeAttachment) | **DELETE** /apis/storage.k8s.io/v1/volumeattachments | +[**StorageV1API_deleteCollectionVolumeAttributesClass**](StorageV1API.md#StorageV1API_deleteCollectionVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1/volumeattributesclasses | [**StorageV1API_deleteNamespacedCSIStorageCapacity**](StorageV1API.md#StorageV1API_deleteNamespacedCSIStorageCapacity) | **DELETE** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | [**StorageV1API_deleteStorageClass**](StorageV1API.md#StorageV1API_deleteStorageClass) | **DELETE** /apis/storage.k8s.io/v1/storageclasses/{name} | [**StorageV1API_deleteVolumeAttachment**](StorageV1API.md#StorageV1API_deleteVolumeAttachment) | **DELETE** /apis/storage.k8s.io/v1/volumeattachments/{name} | +[**StorageV1API_deleteVolumeAttributesClass**](StorageV1API.md#StorageV1API_deleteVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | [**StorageV1API_getAPIResources**](StorageV1API.md#StorageV1API_getAPIResources) | **GET** /apis/storage.k8s.io/v1/ | [**StorageV1API_listCSIDriver**](StorageV1API.md#StorageV1API_listCSIDriver) | **GET** /apis/storage.k8s.io/v1/csidrivers | [**StorageV1API_listCSINode**](StorageV1API.md#StorageV1API_listCSINode) | **GET** /apis/storage.k8s.io/v1/csinodes | @@ -26,24 +29,28 @@ Method | HTTP request | Description [**StorageV1API_listNamespacedCSIStorageCapacity**](StorageV1API.md#StorageV1API_listNamespacedCSIStorageCapacity) | **GET** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | [**StorageV1API_listStorageClass**](StorageV1API.md#StorageV1API_listStorageClass) | **GET** /apis/storage.k8s.io/v1/storageclasses | [**StorageV1API_listVolumeAttachment**](StorageV1API.md#StorageV1API_listVolumeAttachment) | **GET** /apis/storage.k8s.io/v1/volumeattachments | +[**StorageV1API_listVolumeAttributesClass**](StorageV1API.md#StorageV1API_listVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1/volumeattributesclasses | [**StorageV1API_patchCSIDriver**](StorageV1API.md#StorageV1API_patchCSIDriver) | **PATCH** /apis/storage.k8s.io/v1/csidrivers/{name} | [**StorageV1API_patchCSINode**](StorageV1API.md#StorageV1API_patchCSINode) | **PATCH** /apis/storage.k8s.io/v1/csinodes/{name} | [**StorageV1API_patchNamespacedCSIStorageCapacity**](StorageV1API.md#StorageV1API_patchNamespacedCSIStorageCapacity) | **PATCH** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | [**StorageV1API_patchStorageClass**](StorageV1API.md#StorageV1API_patchStorageClass) | **PATCH** /apis/storage.k8s.io/v1/storageclasses/{name} | [**StorageV1API_patchVolumeAttachment**](StorageV1API.md#StorageV1API_patchVolumeAttachment) | **PATCH** /apis/storage.k8s.io/v1/volumeattachments/{name} | [**StorageV1API_patchVolumeAttachmentStatus**](StorageV1API.md#StorageV1API_patchVolumeAttachmentStatus) | **PATCH** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +[**StorageV1API_patchVolumeAttributesClass**](StorageV1API.md#StorageV1API_patchVolumeAttributesClass) | **PATCH** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | [**StorageV1API_readCSIDriver**](StorageV1API.md#StorageV1API_readCSIDriver) | **GET** /apis/storage.k8s.io/v1/csidrivers/{name} | [**StorageV1API_readCSINode**](StorageV1API.md#StorageV1API_readCSINode) | **GET** /apis/storage.k8s.io/v1/csinodes/{name} | [**StorageV1API_readNamespacedCSIStorageCapacity**](StorageV1API.md#StorageV1API_readNamespacedCSIStorageCapacity) | **GET** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | [**StorageV1API_readStorageClass**](StorageV1API.md#StorageV1API_readStorageClass) | **GET** /apis/storage.k8s.io/v1/storageclasses/{name} | [**StorageV1API_readVolumeAttachment**](StorageV1API.md#StorageV1API_readVolumeAttachment) | **GET** /apis/storage.k8s.io/v1/volumeattachments/{name} | [**StorageV1API_readVolumeAttachmentStatus**](StorageV1API.md#StorageV1API_readVolumeAttachmentStatus) | **GET** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +[**StorageV1API_readVolumeAttributesClass**](StorageV1API.md#StorageV1API_readVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | [**StorageV1API_replaceCSIDriver**](StorageV1API.md#StorageV1API_replaceCSIDriver) | **PUT** /apis/storage.k8s.io/v1/csidrivers/{name} | [**StorageV1API_replaceCSINode**](StorageV1API.md#StorageV1API_replaceCSINode) | **PUT** /apis/storage.k8s.io/v1/csinodes/{name} | [**StorageV1API_replaceNamespacedCSIStorageCapacity**](StorageV1API.md#StorageV1API_replaceNamespacedCSIStorageCapacity) | **PUT** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | [**StorageV1API_replaceStorageClass**](StorageV1API.md#StorageV1API_replaceStorageClass) | **PUT** /apis/storage.k8s.io/v1/storageclasses/{name} | [**StorageV1API_replaceVolumeAttachment**](StorageV1API.md#StorageV1API_replaceVolumeAttachment) | **PUT** /apis/storage.k8s.io/v1/volumeattachments/{name} | [**StorageV1API_replaceVolumeAttachmentStatus**](StorageV1API.md#StorageV1API_replaceVolumeAttachmentStatus) | **PUT** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +[**StorageV1API_replaceVolumeAttributesClass**](StorageV1API.md#StorageV1API_replaceVolumeAttributesClass) | **PUT** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | # **StorageV1API_createCSIDriver** @@ -75,7 +82,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -108,7 +115,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -142,7 +149,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -175,7 +182,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -208,7 +215,40 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StorageV1API_createVolumeAttributesClass** +```c +// create a VolumeAttributesClass +// +v1_volume_attributes_class_t* StorageV1API_createVolumeAttributesClass(apiClient_t *apiClient, v1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**body** | **[v1_volume_attributes_class_t](v1_volume_attributes_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_volume_attributes_class_t](v1_volume_attributes_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -216,7 +256,7 @@ Name | Type | Description | Notes ```c // delete a CSIDriver // -v1_csi_driver_t* StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_csi_driver_t* StorageV1API_deleteCSIDriver(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -227,6 +267,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -243,7 +284,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -251,7 +292,7 @@ Name | Type | Description | Notes ```c // delete a CSINode // -v1_csi_node_t* StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_csi_node_t* StorageV1API_deleteCSINode(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -262,6 +303,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -278,7 +320,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -286,7 +328,7 @@ Name | Type | Description | Notes ```c // delete collection of CSIDriver // -v1_status_t* StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* StorageV1API_deleteCollectionCSIDriver(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -298,6 +340,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -320,7 +363,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -328,7 +371,7 @@ Name | Type | Description | Notes ```c // delete collection of CSINode // -v1_status_t* StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* StorageV1API_deleteCollectionCSINode(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -340,6 +383,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -362,7 +406,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -370,7 +414,7 @@ Name | Type | Description | Notes ```c // delete collection of CSIStorageCapacity // -v1_status_t* StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* StorageV1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *_namespace, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -383,6 +427,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -405,7 +450,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -413,7 +458,7 @@ Name | Type | Description | Notes ```c // delete collection of StorageClass // -v1_status_t* StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* StorageV1API_deleteCollectionStorageClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -425,6 +470,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -447,7 +493,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -455,7 +501,50 @@ Name | Type | Description | Notes ```c // delete collection of VolumeAttachment // -v1_status_t* StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* StorageV1API_deleteCollectionVolumeAttachment(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**_continue** | **char \*** | 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. | [optional] +**dryRun** | **char \*** | 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] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_status_t](v1_status.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StorageV1API_deleteCollectionVolumeAttributesClass** +```c +// delete collection of VolumeAttributesClass +// +v1_status_t* StorageV1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -467,6 +556,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -489,7 +579,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -497,7 +587,7 @@ Name | Type | Description | Notes ```c // delete a CSIStorageCapacity // -v1_status_t* StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* StorageV1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char *name, char *_namespace, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -509,6 +599,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -525,7 +616,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -533,7 +624,7 @@ Name | Type | Description | Notes ```c // delete a StorageClass // -v1_storage_class_t* StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_storage_class_t* StorageV1API_deleteStorageClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -544,6 +635,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -560,7 +652,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -568,7 +660,7 @@ Name | Type | Description | Notes ```c // delete a VolumeAttachment // -v1_volume_attachment_t* StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_volume_attachment_t* StorageV1API_deleteVolumeAttachment(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -579,6 +671,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -595,7 +688,43 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StorageV1API_deleteVolumeAttributesClass** +```c +// delete a VolumeAttributesClass +// +v1_volume_attributes_class_t* StorageV1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the VolumeAttributesClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] +**propagationPolicy** | **char \*** | 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] +**body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] + +### Return type + +[v1_volume_attributes_class_t](v1_volume_attributes_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -623,7 +752,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -662,7 +791,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -701,7 +830,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -740,7 +869,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -780,7 +909,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -819,7 +948,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -858,7 +987,46 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StorageV1API_listVolumeAttributesClass** +```c +// list or watch objects of kind VolumeAttributesClass +// +v1_volume_attributes_class_list_t* StorageV1API_listVolumeAttributesClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] +**_continue** | **char \*** | 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. | [optional] +**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] +**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] +**limit** | **int \*** | 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. | [optional] +**resourceVersion** | **char \*** | 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] +**resourceVersionMatch** | **char \*** | 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] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[v1_volume_attributes_class_list_t](v1_volume_attributes_class_list.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -892,8 +1060,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -927,8 +1095,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -963,8 +1131,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -998,8 +1166,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1033,8 +1201,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1068,8 +1236,43 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StorageV1API_patchVolumeAttributesClass** +```c +// partially update the specified VolumeAttributesClass +// +v1_volume_attributes_class_t* StorageV1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the VolumeAttributesClass | +**body** | **[object_t](object.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[v1_volume_attributes_class_t](v1_volume_attributes_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1099,7 +1302,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1129,7 +1332,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1160,7 +1363,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1190,7 +1393,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1220,7 +1423,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1250,7 +1453,37 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StorageV1API_readVolumeAttributesClass** +```c +// read the specified VolumeAttributesClass +// +v1_volume_attributes_class_t* StorageV1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the VolumeAttributesClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[v1_volume_attributes_class_t](v1_volume_attributes_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1284,7 +1517,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1318,7 +1551,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1353,7 +1586,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1387,7 +1620,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1421,7 +1654,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1455,7 +1688,41 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StorageV1API_replaceVolumeAttributesClass** +```c +// replace the specified VolumeAttributesClass +// +v1_volume_attributes_class_t* StorageV1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *name, v1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the VolumeAttributesClass | +**body** | **[v1_volume_attributes_class_t](v1_volume_attributes_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**dryRun** | **char \*** | 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] +**fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[v1_volume_attributes_class_t](v1_volume_attributes_class.md) * + + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/StorageV1alpha1API.md b/kubernetes/docs/StorageV1alpha1API.md index b1e7fe27..63070c66 100644 --- a/kubernetes/docs/StorageV1alpha1API.md +++ b/kubernetes/docs/StorageV1alpha1API.md @@ -43,7 +43,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -51,7 +51,7 @@ Name | Type | Description | Notes ```c // delete collection of VolumeAttributesClass // -v1_status_t* StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* StorageV1alpha1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -63,6 +63,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -85,7 +86,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -93,7 +94,7 @@ Name | Type | Description | Notes ```c // delete a VolumeAttributesClass // -v1alpha1_volume_attributes_class_t* StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1alpha1_volume_attributes_class_t* StorageV1alpha1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -104,6 +105,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -120,7 +122,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -148,7 +150,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -187,7 +189,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -221,8 +223,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -252,7 +254,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -286,7 +288,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/StorageV1beta1API.md b/kubernetes/docs/StorageV1beta1API.md index f0f8ea13..310eba1b 100644 --- a/kubernetes/docs/StorageV1beta1API.md +++ b/kubernetes/docs/StorageV1beta1API.md @@ -4,38 +4,36 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**StorageV1beta1API_createNamespacedCSIStorageCapacity**](StorageV1beta1API.md#StorageV1beta1API_createNamespacedCSIStorageCapacity) | **POST** /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities | -[**StorageV1beta1API_deleteCollectionNamespacedCSIStorageCapacity**](StorageV1beta1API.md#StorageV1beta1API_deleteCollectionNamespacedCSIStorageCapacity) | **DELETE** /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities | -[**StorageV1beta1API_deleteNamespacedCSIStorageCapacity**](StorageV1beta1API.md#StorageV1beta1API_deleteNamespacedCSIStorageCapacity) | **DELETE** /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name} | +[**StorageV1beta1API_createVolumeAttributesClass**](StorageV1beta1API.md#StorageV1beta1API_createVolumeAttributesClass) | **POST** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +[**StorageV1beta1API_deleteCollectionVolumeAttributesClass**](StorageV1beta1API.md#StorageV1beta1API_deleteCollectionVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +[**StorageV1beta1API_deleteVolumeAttributesClass**](StorageV1beta1API.md#StorageV1beta1API_deleteVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | [**StorageV1beta1API_getAPIResources**](StorageV1beta1API.md#StorageV1beta1API_getAPIResources) | **GET** /apis/storage.k8s.io/v1beta1/ | -[**StorageV1beta1API_listCSIStorageCapacityForAllNamespaces**](StorageV1beta1API.md#StorageV1beta1API_listCSIStorageCapacityForAllNamespaces) | **GET** /apis/storage.k8s.io/v1beta1/csistoragecapacities | -[**StorageV1beta1API_listNamespacedCSIStorageCapacity**](StorageV1beta1API.md#StorageV1beta1API_listNamespacedCSIStorageCapacity) | **GET** /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities | -[**StorageV1beta1API_patchNamespacedCSIStorageCapacity**](StorageV1beta1API.md#StorageV1beta1API_patchNamespacedCSIStorageCapacity) | **PATCH** /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name} | -[**StorageV1beta1API_readNamespacedCSIStorageCapacity**](StorageV1beta1API.md#StorageV1beta1API_readNamespacedCSIStorageCapacity) | **GET** /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name} | -[**StorageV1beta1API_replaceNamespacedCSIStorageCapacity**](StorageV1beta1API.md#StorageV1beta1API_replaceNamespacedCSIStorageCapacity) | **PUT** /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name} | +[**StorageV1beta1API_listVolumeAttributesClass**](StorageV1beta1API.md#StorageV1beta1API_listVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +[**StorageV1beta1API_patchVolumeAttributesClass**](StorageV1beta1API.md#StorageV1beta1API_patchVolumeAttributesClass) | **PATCH** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +[**StorageV1beta1API_readVolumeAttributesClass**](StorageV1beta1API.md#StorageV1beta1API_readVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +[**StorageV1beta1API_replaceVolumeAttributesClass**](StorageV1beta1API.md#StorageV1beta1API_replaceVolumeAttributesClass) | **PUT** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | -# **StorageV1beta1API_createNamespacedCSIStorageCapacity** +# **StorageV1beta1API_createVolumeAttributesClass** ```c -// create a CSIStorageCapacity +// create a VolumeAttributesClass // -v1beta1_csi_storage_capacity_t* StorageV1beta1API_createNamespacedCSIStorageCapacity(apiClient_t *apiClient, char * _namespace, v1beta1_csi_storage_capacity_t * body, char * pretty, char * dryRun, char * fieldManager, char * fieldValidation); +v1beta1_volume_attributes_class_t* StorageV1beta1API_createVolumeAttributesClass(apiClient_t *apiClient, v1beta1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**body** | **[v1beta1_csi_storage_capacity_t](v1beta1_csi_storage_capacity.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**body** | **[v1beta1_volume_attributes_class_t](v1beta1_volume_attributes_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] -**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[v1beta1_csi_storage_capacity_t](v1beta1_csi_storage_capacity.md) * +[v1beta1_volume_attributes_class_t](v1beta1_volume_attributes_class.md) * ### Authorization @@ -45,34 +43,35 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **StorageV1beta1API_deleteCollectionNamespacedCSIStorageCapacity** +# **StorageV1beta1API_deleteCollectionVolumeAttributesClass** ```c -// delete collection of CSIStorageCapacity +// delete collection of VolumeAttributesClass // -v1_status_t* StorageV1beta1API_deleteCollectionNamespacedCSIStorageCapacity(apiClient_t *apiClient, char * _namespace, char * pretty, char * _continue, char * dryRun, char * fieldSelector, int gracePeriodSeconds, char * labelSelector, int limit, int orphanDependents, char * propagationPolicy, char * resourceVersion, char * resourceVersionMatch, int timeoutSeconds, v1_delete_options_t * body); +v1_status_t* StorageV1beta1API_deleteCollectionVolumeAttributesClass(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **_continue** | **char \*** | 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. | [optional] **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] -**gracePeriodSeconds** | **int** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**orphanDependents** | **int** | 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] +**limit** | **int \*** | 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. | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **resourceVersion** | **char \*** | 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] **resourceVersionMatch** | **char \*** | 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] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] ### Return type @@ -87,33 +86,33 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **StorageV1beta1API_deleteNamespacedCSIStorageCapacity** +# **StorageV1beta1API_deleteVolumeAttributesClass** ```c -// delete a CSIStorageCapacity +// delete a VolumeAttributesClass // -v1_status_t* StorageV1beta1API_deleteNamespacedCSIStorageCapacity(apiClient_t *apiClient, char * name, char * _namespace, char * pretty, char * dryRun, int gracePeriodSeconds, int orphanDependents, char * propagationPolicy, v1_delete_options_t * body); +v1beta1_volume_attributes_class_t* StorageV1beta1API_deleteVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CSIStorageCapacity | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the VolumeAttributesClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] -**gracePeriodSeconds** | **int** | 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] -**orphanDependents** | **int** | 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] +**gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] +**orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] ### Return type -[v1_status_t](v1_status.md) * +[v1beta1_volume_attributes_class_t](v1beta1_volume_attributes_class.md) * ### Authorization @@ -123,7 +122,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,74 +150,36 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **StorageV1beta1API_listCSIStorageCapacityForAllNamespaces** -```c -// list or watch objects of kind CSIStorageCapacity -// -v1beta1_csi_storage_capacity_list_t* StorageV1beta1API_listCSIStorageCapacityForAllNamespaces(apiClient_t *apiClient, int allowWatchBookmarks, char * _continue, char * fieldSelector, char * labelSelector, int limit, char * pretty, char * resourceVersion, char * resourceVersionMatch, int timeoutSeconds, int watch); -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | -**allowWatchBookmarks** | **int** | 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] -**_continue** | **char \*** | 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. | [optional] -**fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] -**labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**resourceVersion** | **char \*** | 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] -**resourceVersionMatch** | **char \*** | 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] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] -**watch** | **int** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] - -### Return type - -[v1beta1_csi_storage_capacity_list_t](v1beta1_csi_storage_capacity_list.md) * - - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **StorageV1beta1API_listNamespacedCSIStorageCapacity** +# **StorageV1beta1API_listVolumeAttributesClass** ```c -// list or watch objects of kind CSIStorageCapacity +// list or watch objects of kind VolumeAttributesClass // -v1beta1_csi_storage_capacity_list_t* StorageV1beta1API_listNamespacedCSIStorageCapacity(apiClient_t *apiClient, char * _namespace, char * pretty, int allowWatchBookmarks, char * _continue, char * fieldSelector, char * labelSelector, int limit, char * resourceVersion, char * resourceVersionMatch, int timeoutSeconds, int watch); +v1beta1_volume_attributes_class_list_t* StorageV1beta1API_listVolumeAttributesClass(apiClient_t *apiClient, char *pretty, int *allowWatchBookmarks, char *_continue, char *fieldSelector, char *labelSelector, int *limit, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, int *watch); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] -**allowWatchBookmarks** | **int** | 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] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] +**allowWatchBookmarks** | **int \*** | 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] **_continue** | **char \*** | 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. | [optional] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] -**limit** | **int** | 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. | [optional] +**limit** | **int \*** | 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. | [optional] **resourceVersion** | **char \*** | 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] **resourceVersionMatch** | **char \*** | 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] -**timeoutSeconds** | **int** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] -**watch** | **int** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] +**sendInitialEvents** | **int \*** | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] +**timeoutSeconds** | **int \*** | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] +**watch** | **int \*** | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] ### Return type -[v1beta1_csi_storage_capacity_list_t](v1beta1_csi_storage_capacity_list.md) * +[v1beta1_volume_attributes_class_list_t](v1beta1_volume_attributes_class_list.md) * ### Authorization @@ -228,33 +189,32 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **StorageV1beta1API_patchNamespacedCSIStorageCapacity** +# **StorageV1beta1API_patchVolumeAttributesClass** ```c -// partially update the specified CSIStorageCapacity +// partially update the specified VolumeAttributesClass // -v1beta1_csi_storage_capacity_t* StorageV1beta1API_patchNamespacedCSIStorageCapacity(apiClient_t *apiClient, char * name, char * _namespace, object_t * body, char * pretty, char * dryRun, char * fieldManager, char * fieldValidation, int force); +v1beta1_volume_attributes_class_t* StorageV1beta1API_patchVolumeAttributesClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CSIStorageCapacity | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | +**name** | **char \*** | name of the VolumeAttributesClass | **body** | **[object_t](object.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] -**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] -**force** | **int** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**force** | **int \*** | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] ### Return type -[v1beta1_csi_storage_capacity_t](v1beta1_csi_storage_capacity.md) * +[v1beta1_volume_attributes_class_t](v1beta1_volume_attributes_class.md) * ### Authorization @@ -263,29 +223,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **StorageV1beta1API_readNamespacedCSIStorageCapacity** +# **StorageV1beta1API_readVolumeAttributesClass** ```c -// read the specified CSIStorageCapacity +// read the specified VolumeAttributesClass // -v1beta1_csi_storage_capacity_t* StorageV1beta1API_readNamespacedCSIStorageCapacity(apiClient_t *apiClient, char * name, char * _namespace, char * pretty); +v1beta1_volume_attributes_class_t* StorageV1beta1API_readVolumeAttributesClass(apiClient_t *apiClient, char *name, char *pretty); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CSIStorageCapacity | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the VolumeAttributesClass | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] ### Return type -[v1beta1_csi_storage_capacity_t](v1beta1_csi_storage_capacity.md) * +[v1beta1_volume_attributes_class_t](v1beta1_volume_attributes_class.md) * ### Authorization @@ -295,32 +254,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **StorageV1beta1API_replaceNamespacedCSIStorageCapacity** +# **StorageV1beta1API_replaceVolumeAttributesClass** ```c -// replace the specified CSIStorageCapacity +// replace the specified VolumeAttributesClass // -v1beta1_csi_storage_capacity_t* StorageV1beta1API_replaceNamespacedCSIStorageCapacity(apiClient_t *apiClient, char * name, char * _namespace, v1beta1_csi_storage_capacity_t * body, char * pretty, char * dryRun, char * fieldManager, char * fieldValidation); +v1beta1_volume_attributes_class_t* StorageV1beta1API_replaceVolumeAttributesClass(apiClient_t *apiClient, char *name, v1beta1_volume_attributes_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiClient** | **apiClient_t \*** | context containing the client configuration | -**name** | **char \*** | name of the CSIStorageCapacity | -**_namespace** | **char \*** | object name and auth scope, such as for teams and projects | -**body** | **[v1beta1_csi_storage_capacity_t](v1beta1_csi_storage_capacity.md) \*** | | -**pretty** | **char \*** | If 'true', then the output is pretty printed. | [optional] +**name** | **char \*** | name of the VolumeAttributesClass | +**body** | **[v1beta1_volume_attributes_class_t](v1beta1_volume_attributes_class.md) \*** | | +**pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **fieldManager** | **char \*** | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] -**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] +**fieldValidation** | **char \*** | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] ### Return type -[v1beta1_csi_storage_capacity_t](v1beta1_csi_storage_capacity.md) * +[v1beta1_volume_attributes_class_t](v1beta1_volume_attributes_class.md) * ### Authorization @@ -330,7 +288,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/StoragemigrationV1alpha1API.md b/kubernetes/docs/StoragemigrationV1alpha1API.md index d48b5809..03a3dee8 100644 --- a/kubernetes/docs/StoragemigrationV1alpha1API.md +++ b/kubernetes/docs/StoragemigrationV1alpha1API.md @@ -46,7 +46,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -54,7 +54,7 @@ Name | Type | Description | Notes ```c // delete collection of StorageVersionMigration // -v1_status_t* StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); +v1_status_t* StoragemigrationV1alpha1API_deleteCollectionStorageVersionMigration(apiClient_t *apiClient, char *pretty, char *_continue, char *dryRun, char *fieldSelector, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, char *labelSelector, int *limit, int *orphanDependents, char *propagationPolicy, char *resourceVersion, char *resourceVersionMatch, int *sendInitialEvents, int *timeoutSeconds, v1_delete_options_t *body); ``` ### Parameters @@ -66,6 +66,7 @@ Name | Type | Description | Notes **dryRun** | **char \*** | 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] **fieldSelector** | **char \*** | A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **labelSelector** | **char \*** | A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] **limit** | **int \*** | 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. | [optional] **orphanDependents** | **int \*** | 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] @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +97,7 @@ Name | Type | Description | Notes ```c // delete a StorageVersionMigration // -v1_status_t* StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); +v1_status_t* StoragemigrationV1alpha1API_deleteStorageVersionMigration(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body); ``` ### Parameters @@ -107,6 +108,7 @@ Name | Type | Description | Notes **pretty** | **char \*** | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] **dryRun** | **char \*** | 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] **gracePeriodSeconds** | **int \*** | 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] +**ignoreStoreReadErrorWithClusterBreakingPotential** | **int \*** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **orphanDependents** | **int \*** | 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] **propagationPolicy** | **char \*** | 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] **body** | **[v1_delete_options_t](v1_delete_options.md) \*** | | [optional] @@ -123,7 +125,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,7 +153,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -190,7 +192,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -224,8 +226,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -259,8 +261,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Content-Type**: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml, application/apply-patch+cbor + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -290,7 +292,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -320,7 +322,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -354,7 +356,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -388,7 +390,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/kubernetes/docs/VersionAPI.md b/kubernetes/docs/VersionAPI.md index 5ae3428a..12ca76cf 100644 --- a/kubernetes/docs/VersionAPI.md +++ b/kubernetes/docs/VersionAPI.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **VersionAPI_getCode** ```c -// get the code version +// get the version information for this server // version_info_t* VersionAPI_getCode(apiClient_t *apiClient); ``` diff --git a/kubernetes/docs/core_v1_resource_claim.md b/kubernetes/docs/core_v1_resource_claim.md new file mode 100644 index 00000000..7e0348b1 --- /dev/null +++ b/kubernetes/docs/core_v1_resource_claim.md @@ -0,0 +1,11 @@ +# core_v1_resource_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **char \*** | Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. | +**request** | **char \*** | Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/discovery_v1_endpoint_port.md b/kubernetes/docs/discovery_v1_endpoint_port.md index 8497f813..6e3a0fe7 100644 --- a/kubernetes/docs/discovery_v1_endpoint_port.md +++ b/kubernetes/docs/discovery_v1_endpoint_port.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **app_protocol** | **char \*** | The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol. | [optional] **name** | **char \*** | name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. | [optional] -**port** | **int** | port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer. | [optional] +**port** | **int** | port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port. | [optional] **protocol** | **char \*** | protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/resource_v1_resource_claim.md b/kubernetes/docs/resource_v1_resource_claim.md new file mode 100644 index 00000000..b1a88c42 --- /dev/null +++ b/kubernetes/docs/resource_v1_resource_claim.md @@ -0,0 +1,14 @@ +# resource_v1_resource_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1_resource_claim_spec_t**](v1_resource_claim_spec.md) \* | | +**status** | [**v1_resource_claim_status_t**](v1_resource_claim_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_allocated_device_status.md b/kubernetes/docs/v1_allocated_device_status.md new file mode 100644 index 00000000..a508dd08 --- /dev/null +++ b/kubernetes/docs/v1_allocated_device_status.md @@ -0,0 +1,16 @@ +# v1_allocated_device_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**list_t**](v1_condition.md) \* | Conditions contains the latest observation of the device's state. If the device has been configured according to the class and claim config references, the `Ready` condition should be True. Must not contain more than 8 entries. | [optional] +**data** | [**object_t**](.md) \* | Data contains arbitrary driver-specific data. The length of the raw data must be smaller or equal to 10 Ki. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**network_data** | [**v1_network_device_data_t**](v1_network_device_data.md) \* | | [optional] +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | +**share_id** | **char \*** | ShareID uniquely identifies an individual allocation share of the device. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_allocation_result.md b/kubernetes/docs/v1_allocation_result.md new file mode 100644 index 00000000..9a17e925 --- /dev/null +++ b/kubernetes/docs/v1_allocation_result.md @@ -0,0 +1,12 @@ +# v1_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation_timestamp** | **char \*** | AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate. | [optional] +**devices** | [**v1_device_allocation_result_t**](v1_device_allocation_result.md) \* | | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_capacity_request_policy.md b/kubernetes/docs/v1_capacity_request_policy.md new file mode 100644 index 00000000..bde898a3 --- /dev/null +++ b/kubernetes/docs/v1_capacity_request_policy.md @@ -0,0 +1,12 @@ +# v1_capacity_request_policy_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_default** | **char \*** | Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity. | [optional] +**valid_range** | [**v1_capacity_request_policy_range_t**](v1_capacity_request_policy_range.md) \* | | [optional] +**valid_values** | **list_t \*** | ValidValues defines a set of acceptable quantity values in consuming requests. Must not contain more than 10 entries. Must be sorted in ascending order. If this field is set, Default must be defined and it must be included in ValidValues list. If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues). If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_capacity_request_policy_range.md b/kubernetes/docs/v1_capacity_request_policy_range.md new file mode 100644 index 00000000..75468fb7 --- /dev/null +++ b/kubernetes/docs/v1_capacity_request_policy_range.md @@ -0,0 +1,12 @@ +# v1_capacity_request_policy_range_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max** | **char \*** | Max defines the upper limit for capacity that can be requested. Max must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum. | [optional] +**min** | **char \*** | Min specifies the minimum capacity allowed for a consumption request. Min must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum. | +**step** | **char \*** | Step defines the step size between valid capacity amounts within the range. Max (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_capacity_requirements.md b/kubernetes/docs/v1_capacity_requirements.md new file mode 100644 index 00000000..234197c0 --- /dev/null +++ b/kubernetes/docs/v1_capacity_requirements.md @@ -0,0 +1,10 @@ +# v1_capacity_requirements_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | **list_t*** | Requests represent individual device resource requests for distinct resources, all of which must be provided by the device. This value is used as an additional filtering condition against the available capacity on the device. This is semantically equivalent to a CEL selector with `device.capacity[<domain>].<name>.compareTo(quantity(<request quantity>)) >= 0`. For example, device.capacity['test-driver.cdi.k8s.io'].counters.compareTo(quantity('2')) >= 0. When a requestPolicy is defined, the requested amount is adjusted upward to the nearest valid value based on the policy. If the requested amount cannot be adjusted to a valid value—because it exceeds what the requestPolicy allows— the device is considered ineligible for allocation. For any capacity that is not explicitly requested: - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity (i.e., the whole device is claimed). - If a requestPolicy is set, the default consumed capacity is determined according to that policy. If the device allows multiple allocation, the aggregated amount across all requests must not exceed the capacity value. The consumed capacity, which may be adjusted based on the requestPolicy if defined, is recorded in the resource claim’s status.devices[*].consumedCapacity field. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_cel_device_selector.md b/kubernetes/docs/v1_cel_device_selector.md new file mode 100644 index 00000000..555f6420 --- /dev/null +++ b/kubernetes/docs/v1_cel_device_selector.md @@ -0,0 +1,10 @@ +# v1_cel_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device (v1.34+ with the DRAConsumableCapacity feature enabled). Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_container.md b/kubernetes/docs/v1_container.md index de539d18..64209330 100644 --- a/kubernetes/docs/v1_container.md +++ b/kubernetes/docs/v1_container.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **args** | **list_t \*** | Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell | [optional] **command** | **list_t \*** | Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell | [optional] **env** | [**list_t**](v1_env_var.md) \* | List of environment variables to set in the container. Cannot be updated. | [optional] -**env_from** | [**list_t**](v1_env_from_source.md) \* | List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. | [optional] +**env_from** | [**list_t**](v1_env_from_source.md) \* | List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. | [optional] **image** | **char \*** | Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets. | [optional] **image_pull_policy** | **char \*** | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images | [optional] **lifecycle** | [**v1_lifecycle_t**](v1_lifecycle.md) \* | | [optional] @@ -16,7 +16,8 @@ Name | Type | Description | Notes **readiness_probe** | [**v1_probe_t**](v1_probe.md) \* | | [optional] **resize_policy** | [**list_t**](v1_container_resize_policy.md) \* | Resources resize policy for the container. | [optional] **resources** | [**v1_resource_requirements_t**](v1_resource_requirements.md) \* | | [optional] -**restart_policy** | **char \*** | RestartPolicy defines the restart behavior of individual containers in a pod. This field may only be set for init containers, and the only allowed value is \"Always\". For non-init containers or when this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed. | [optional] +**restart_policy** | **char \*** | RestartPolicy defines the restart behavior of individual containers in a pod. This overrides the pod-level restart policy. When this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Additionally, setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed. | [optional] +**restart_policy_rules** | [**list_t**](v1_container_restart_rule.md) \* | Represents a list of rules to be checked to determine if the container should be restarted on exit. The rules are evaluated in order. Once a rule matches a container exit condition, the remaining rules are ignored. If no rule matches the container exit condition, the Container-level restart policy determines the whether the container is restarted or not. Constraints on the rules: - At most 20 rules are allowed. - Rules can have the same action. - Identical rules are not forbidden in validations. When rules are specified, container MUST set RestartPolicy explicitly even it if matches the Pod's RestartPolicy. | [optional] **security_context** | [**v1_security_context_t**](v1_security_context.md) \* | | [optional] **startup_probe** | [**v1_probe_t**](v1_probe.md) \* | | [optional] **_stdin** | **int** | Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. | [optional] diff --git a/kubernetes/docs/v1_container_extended_resource_request.md b/kubernetes/docs/v1_container_extended_resource_request.md new file mode 100644 index 00000000..374e3c80 --- /dev/null +++ b/kubernetes/docs/v1_container_extended_resource_request.md @@ -0,0 +1,12 @@ +# v1_container_extended_resource_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**container_name** | **char \*** | The name of the container requesting resources. | +**request_name** | **char \*** | The name of the request in the special ResourceClaim which corresponds to the extended resource. | +**resource_name** | **char \*** | The name of the extended resource in that container which gets backed by DRA. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_container_restart_rule.md b/kubernetes/docs/v1_container_restart_rule.md new file mode 100644 index 00000000..09140a33 --- /dev/null +++ b/kubernetes/docs/v1_container_restart_rule.md @@ -0,0 +1,11 @@ +# v1_container_restart_rule_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **char \*** | Specifies the action taken on a container exit if the requirements are satisfied. The only possible value is \"Restart\" to restart the container. | +**exit_codes** | [**v1_container_restart_rule_on_exit_codes_t**](v1_container_restart_rule_on_exit_codes.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_container_restart_rule_on_exit_codes.md b/kubernetes/docs/v1_container_restart_rule_on_exit_codes.md new file mode 100644 index 00000000..c423d28d --- /dev/null +++ b/kubernetes/docs/v1_container_restart_rule_on_exit_codes.md @@ -0,0 +1,11 @@ +# v1_container_restart_rule_on_exit_codes_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_operator** | **char \*** | Represents the relationship between the container exit code(s) and the specified values. Possible values are: - In: the requirement is satisfied if the container exit code is in the set of specified values. - NotIn: the requirement is satisfied if the container exit code is not in the set of specified values. | +**values** | **list_t \*** | Specifies the set of values to check for container exit codes. At most 255 elements are allowed. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_container_status.md b/kubernetes/docs/v1_container_status.md index 9a84cc64..4e174b4e 100644 --- a/kubernetes/docs/v1_container_status.md +++ b/kubernetes/docs/v1_container_status.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **allocated_resources** | **list_t*** | AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize. | [optional] +**allocated_resources_status** | [**list_t**](v1_resource_status.md) \* | AllocatedResourcesStatus represents the status of various resources allocated for this Pod. | [optional] **container_id** | **char \*** | ContainerID is the ID of the container in the format '<type>://<container_id>'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\"). | [optional] **image** | **char \*** | Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images. | **image_id** | **char \*** | ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime. | @@ -14,6 +15,8 @@ Name | Type | Description | Notes **restart_count** | **int** | RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative. | **started** | **int** | Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false. | [optional] **state** | [**v1_container_state_t**](v1_container_state.md) \* | | [optional] +**stop_signal** | **char \*** | StopSignal reports the effective stop signal for this container | [optional] +**user** | [**v1_container_user_t**](v1_container_user.md) \* | | [optional] **volume_mounts** | [**list_t**](v1_volume_mount_status.md) \* | Status of volume mounts. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_container_user.md b/kubernetes/docs/v1_container_user.md new file mode 100644 index 00000000..45dd3746 --- /dev/null +++ b/kubernetes/docs/v1_container_user.md @@ -0,0 +1,10 @@ +# v1_container_user_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_linux** | [**v1_linux_container_user_t**](v1_linux_container_user.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_counter.md b/kubernetes/docs/v1_counter.md new file mode 100644 index 00000000..8e84f641 --- /dev/null +++ b/kubernetes/docs/v1_counter.md @@ -0,0 +1,10 @@ +# v1_counter_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **char \*** | Value defines how much of a certain device counter is available. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_counter_set.md b/kubernetes/docs/v1_counter_set.md new file mode 100644 index 00000000..2e90c07f --- /dev/null +++ b/kubernetes/docs/v1_counter_set.md @@ -0,0 +1,11 @@ +# v1_counter_set_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counters** | **list_t*** | Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label. The maximum number of counters in all sets is 32. | +**name** | **char \*** | Name defines the name of the counter set. It must be a DNS label. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_csi_driver_spec.md b/kubernetes/docs/v1_csi_driver_spec.md index 8fd88070..aa274f47 100644 --- a/kubernetes/docs/v1_csi_driver_spec.md +++ b/kubernetes/docs/v1_csi_driver_spec.md @@ -3,8 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**attach_required** | **int** | attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called. This field is immutable. | [optional] +**attach_required** | **int** | attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called. This field is immutable. | [optional] **fs_group_policy** | **char \*** | fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field was immutable in Kubernetes < 1.29 and now is mutable. Defaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce. | [optional] +**node_allocatable_update_period_seconds** | **long** | nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of the CSINode allocatable capacity for this driver. When set, both periodic updates and updates triggered by capacity-related failures are enabled. If not set, no updates occur (neither periodic nor upon detecting capacity-related failures), and the allocatable.count remains static. The minimum allowed value for this field is 10 seconds. This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled. This field is mutable. | [optional] **pod_info_on_mount** | **int** | podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume defined by a CSIVolumeSource, otherwise \"false\" \"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver. This field was immutable in Kubernetes < 1.29 and now is mutable. | [optional] **requires_republish** | **int** | requiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false. Note: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container. | [optional] **se_linux_mount** | **int** | seLinuxMount specifies if the CSI driver supports \"-o context\" mount option. When \"true\", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with \"-o context=xyz\" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context. When \"false\", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem. Default is \"false\". | [optional] diff --git a/kubernetes/docs/v1_delete_options.md b/kubernetes/docs/v1_delete_options.md index 20078eab..bb4b4b8a 100644 --- a/kubernetes/docs/v1_delete_options.md +++ b/kubernetes/docs/v1_delete_options.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] **dry_run** | **list_t \*** | 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] **grace_period_seconds** | **long** | 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] +**ignore_store_read_error_with_cluster_breaking_potential** | **int** | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **orphan_dependents** | **int** | 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] **preconditions** | [**v1_preconditions_t**](v1_preconditions.md) \* | | [optional] diff --git a/kubernetes/docs/v1_deployment_status.md b/kubernetes/docs/v1_deployment_status.md index ff96f8c8..b5fcb6a3 100644 --- a/kubernetes/docs/v1_deployment_status.md +++ b/kubernetes/docs/v1_deployment_status.md @@ -3,14 +3,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**available_replicas** | **int** | Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. | [optional] +**available_replicas** | **int** | Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. | [optional] **collision_count** | **int** | Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet. | [optional] **conditions** | [**list_t**](v1_deployment_condition.md) \* | Represents the latest available observations of a deployment's current state. | [optional] **observed_generation** | **long** | The generation observed by the deployment controller. | [optional] -**ready_replicas** | **int** | readyReplicas is the number of pods targeted by this Deployment with a Ready Condition. | [optional] -**replicas** | **int** | Total number of non-terminated pods targeted by this deployment (their labels match the selector). | [optional] +**ready_replicas** | **int** | Total number of non-terminating pods targeted by this Deployment with a Ready Condition. | [optional] +**replicas** | **int** | Total number of non-terminating pods targeted by this deployment (their labels match the selector). | [optional] +**terminating_replicas** | **int** | Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. | [optional] **unavailable_replicas** | **int** | Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created. | [optional] -**updated_replicas** | **int** | Total number of non-terminated pods targeted by this deployment that have the desired template spec. | [optional] +**updated_replicas** | **int** | Total number of non-terminating pods targeted by this deployment that have the desired template spec. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_device.md b/kubernetes/docs/v1_device.md new file mode 100644 index 00000000..d072959a --- /dev/null +++ b/kubernetes/docs/v1_device.md @@ -0,0 +1,21 @@ +# v1_device_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**allow_multiple_allocations** | **int** | AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. If AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. | [optional] +**attributes** | **list_t*** | Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**binding_conditions** | **list_t \*** | BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod. The maximum number of binding conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binding_failure_conditions** | **list_t \*** | BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred. The maximum number of binding failure conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binds_to_node** | **int** | BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**capacity** | **list_t*** | Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**consumes_counters** | [**list_t**](v1_device_counter_consumption.md) \* | ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The total number of device counter consumption entries must be <= 32. In addition, the total number in the entire ResourceSlice must be <= 1024 (for example, 64 devices with 16 counters each). | [optional] +**name** | **char \*** | Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label. | +**node_name** | **char \*** | NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**taints** | [**list_t**](v1_device_taint.md) \* | If specified, these are the driver-defined taints. The maximum number of taints is 4. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_allocation_configuration.md b/kubernetes/docs/v1_device_allocation_configuration.md new file mode 100644 index 00000000..57489874 --- /dev/null +++ b/kubernetes/docs/v1_device_allocation_configuration.md @@ -0,0 +1,12 @@ +# v1_device_allocation_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1_opaque_device_configuration_t**](v1_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, its applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] +**source** | **char \*** | Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_allocation_result.md b/kubernetes/docs/v1_device_allocation_result.md new file mode 100644 index 00000000..47f8778c --- /dev/null +++ b/kubernetes/docs/v1_device_allocation_result.md @@ -0,0 +1,11 @@ +# v1_device_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1_device_allocation_configuration.md) \* | This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag. This includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters. | [optional] +**results** | [**list_t**](v1_device_request_allocation_result.md) \* | Results lists all allocated devices. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_attribute.md b/kubernetes/docs/v1_device_attribute.md new file mode 100644 index 00000000..14feaa54 --- /dev/null +++ b/kubernetes/docs/v1_device_attribute.md @@ -0,0 +1,13 @@ +# v1_device_attribute_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_bool** | **int** | BoolValue is a true/false value. | [optional] +**_int** | **long** | IntValue is a number. | [optional] +**string** | **char \*** | StringValue is a string. Must not be longer than 64 characters. | [optional] +**version** | **char \*** | VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_capacity.md b/kubernetes/docs/v1_device_capacity.md new file mode 100644 index 00000000..bd41cdfb --- /dev/null +++ b/kubernetes/docs/v1_device_capacity.md @@ -0,0 +1,11 @@ +# v1_device_capacity_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_policy** | [**v1_capacity_request_policy_t**](v1_capacity_request_policy.md) \* | | [optional] +**value** | **char \*** | Value defines how much of a certain capacity that device has. This field reflects the fixed total capacity and does not change. The consumed amount is tracked separately by scheduler and does not affect this value. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_claim.md b/kubernetes/docs/v1_device_claim.md new file mode 100644 index 00000000..8b5e3206 --- /dev/null +++ b/kubernetes/docs/v1_device_claim.md @@ -0,0 +1,12 @@ +# v1_device_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1_device_claim_configuration.md) \* | This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim. | [optional] +**constraints** | [**list_t**](v1_device_constraint.md) \* | These constraints must be satisfied by the set of devices that get allocated for the claim. | [optional] +**requests** | [**list_t**](v1_device_request.md) \* | Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_claim_configuration.md b/kubernetes/docs/v1_device_claim_configuration.md new file mode 100644 index 00000000..3d8580ac --- /dev/null +++ b/kubernetes/docs/v1_device_claim_configuration.md @@ -0,0 +1,11 @@ +# v1_device_claim_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1_opaque_device_configuration_t**](v1_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, it applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_class.md b/kubernetes/docs/v1_device_class.md new file mode 100644 index 00000000..184ca852 --- /dev/null +++ b/kubernetes/docs/v1_device_class.md @@ -0,0 +1,13 @@ +# v1_device_class_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1_device_class_spec_t**](v1_device_class_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_class_configuration.md b/kubernetes/docs/v1_device_class_configuration.md new file mode 100644 index 00000000..d60378de --- /dev/null +++ b/kubernetes/docs/v1_device_class_configuration.md @@ -0,0 +1,10 @@ +# v1_device_class_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1_opaque_device_configuration_t**](v1_opaque_device_configuration.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_class_list.md b/kubernetes/docs/v1_device_class_list.md new file mode 100644 index 00000000..4524da71 --- /dev/null +++ b/kubernetes/docs/v1_device_class_list.md @@ -0,0 +1,13 @@ +# v1_device_class_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1_device_class.md) \* | Items is the list of resource classes. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_class_spec.md b/kubernetes/docs/v1_device_class_spec.md new file mode 100644 index 00000000..afd2939a --- /dev/null +++ b/kubernetes/docs/v1_device_class_spec.md @@ -0,0 +1,12 @@ +# v1_device_class_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1_device_class_configuration.md) \* | Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver. They are passed to the driver, but are not considered while allocating the claim. | [optional] +**extended_resource_name** | **char \*** | ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked. This is an alpha field. | [optional] +**selectors** | [**list_t**](v1_device_selector.md) \* | Each selector must be satisfied by a device which is claimed via this class. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_constraint.md b/kubernetes/docs/v1_device_constraint.md new file mode 100644 index 00000000..46baec08 --- /dev/null +++ b/kubernetes/docs/v1_device_constraint.md @@ -0,0 +1,12 @@ +# v1_device_constraint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distinct_attribute** | **char \*** | DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices. This acts as the inverse of MatchAttribute. This constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation. This is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs. | [optional] +**match_attribute** | **char \*** | MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices. For example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen. Must include the domain qualifier. | [optional] +**requests** | **list_t \*** | Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the constraint applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_counter_consumption.md b/kubernetes/docs/v1_device_counter_consumption.md new file mode 100644 index 00000000..1646af0a --- /dev/null +++ b/kubernetes/docs/v1_device_counter_consumption.md @@ -0,0 +1,11 @@ +# v1_device_counter_consumption_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counter_set** | **char \*** | CounterSet is the name of the set from which the counters defined will be consumed. | +**counters** | **list_t*** | Counters defines the counters that will be consumed by the device. The maximum number counters in a device is 32. In addition, the maximum number of all counters in all devices is 1024 (for example, 64 devices with 16 counters each). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_request.md b/kubernetes/docs/v1_device_request.md new file mode 100644 index 00000000..4c9d597d --- /dev/null +++ b/kubernetes/docs/v1_device_request.md @@ -0,0 +1,12 @@ +# v1_device_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exactly** | [**v1_exact_device_request_t**](v1_exact_device_request.md) \* | | [optional] +**first_available** | [**list_t**](v1_device_sub_request.md) \* | FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used. DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later. | [optional] +**name** | **char \*** | Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. References using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler. Must be a DNS label. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_request_allocation_result.md b/kubernetes/docs/v1_device_request_allocation_result.md new file mode 100644 index 00000000..8a88640b --- /dev/null +++ b/kubernetes/docs/v1_device_request_allocation_result.md @@ -0,0 +1,19 @@ +# v1_device_request_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**binding_conditions** | **list_t \*** | BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binding_failure_conditions** | **list_t \*** | BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**consumed_capacity** | **list_t*** | ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount). The total consumed capacity for each device must not exceed the DeviceCapacity's Value. This field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | +**request** | **char \*** | Request is the name of the request in the claim which caused this device to be allocated. If it references a subrequest in the firstAvailable list on a DeviceRequest, this field must include both the name of the main request and the subrequest using the format <main request>/<subrequest>. Multiple devices may have been allocated per request. | +**share_id** | **char \*** | ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device. | [optional] +**tolerations** | [**list_t**](v1_device_toleration.md) \* | A copy of all tolerations specified in the request at the time when the device got allocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_selector.md b/kubernetes/docs/v1_device_selector.md new file mode 100644 index 00000000..c0e57523 --- /dev/null +++ b/kubernetes/docs/v1_device_selector.md @@ -0,0 +1,10 @@ +# v1_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cel** | [**v1_cel_device_selector_t**](v1_cel_device_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_sub_request.md b/kubernetes/docs/v1_device_sub_request.md new file mode 100644 index 00000000..b3ad4983 --- /dev/null +++ b/kubernetes/docs/v1_device_sub_request.md @@ -0,0 +1,16 @@ +# v1_device_sub_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This subrequest is for all of the matching devices in a pool. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**capacity** | [**v1_capacity_requirements_t**](v1_capacity_requirements.md) \* | | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest. A class is required. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | +**name** | **char \*** | Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format <main request>/<subrequest>. Must be a DNS label. | +**selectors** | [**list_t**](v1_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered. | [optional] +**tolerations** | [**list_t**](v1_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_taint.md b/kubernetes/docs/v1_device_taint.md new file mode 100644 index 00000000..7d150c06 --- /dev/null +++ b/kubernetes/docs/v1_device_taint.md @@ -0,0 +1,13 @@ +# v1_device_taint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. | +**key** | **char \*** | The taint key to be applied to a device. Must be a label name. | +**time_added** | **char \*** | TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set. | [optional] +**value** | **char \*** | The taint value corresponding to the taint key. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_device_toleration.md b/kubernetes/docs/v1_device_toleration.md new file mode 100644 index 00000000..646c2ed1 --- /dev/null +++ b/kubernetes/docs/v1_device_toleration.md @@ -0,0 +1,14 @@ +# v1_device_toleration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule and NoExecute. | [optional] +**key** | **char \*** | Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name. | [optional] +**_operator** | **char \*** | Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a ResourceClaim can tolerate all taints of a particular category. | [optional] +**toleration_seconds** | **long** | TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. If larger than zero, the time when the pod needs to be evicted is calculated as <time when taint was adedd> + <toleration seconds>. | [optional] +**value** | **char \*** | Value is the taint value the toleration matches to. If the operator is Exists, the value must be empty, otherwise just a regular string. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_endpoint.md b/kubernetes/docs/v1_endpoint.md index 33aea3df..87c4df8b 100644 --- a/kubernetes/docs/v1_endpoint.md +++ b/kubernetes/docs/v1_endpoint.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**addresses** | **list_t \*** | addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267 | +**addresses** | **list_t \*** | addresses of this endpoint. For EndpointSlices of addressType \"IPv4\" or \"IPv6\", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them. | **conditions** | [**v1_endpoint_conditions_t**](v1_endpoint_conditions.md) \* | | [optional] **deprecated_topology** | **list_t*** | deprecatedTopology contains topology information part of the v1beta1 API. This field is deprecated, and will be removed when the v1beta1 API is removed (no sooner than kubernetes v1.24). While this field can hold values, it is not writable through the v1 API, and any attempts to write to it will be silently ignored. Topology information can be found in the zone and nodeName fields instead. | [optional] **hints** | [**v1_endpoint_hints_t**](v1_endpoint_hints.md) \* | | [optional] diff --git a/kubernetes/docs/v1_endpoint_conditions.md b/kubernetes/docs/v1_endpoint_conditions.md index f96c3ae4..7d781fc5 100644 --- a/kubernetes/docs/v1_endpoint_conditions.md +++ b/kubernetes/docs/v1_endpoint_conditions.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ready** | **int** | ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag. | [optional] -**serving** | **int** | serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition. | [optional] -**terminating** | **int** | terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating. | [optional] +**ready** | **int** | ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as \"true\". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag. | [optional] +**serving** | **int** | serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as \"true\". | [optional] +**terminating** | **int** | terminating indicates that this endpoint is terminating. A nil value should be interpreted as \"false\". | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_endpoint_hints.md b/kubernetes/docs/v1_endpoint_hints.md index 6a4b66b5..66ad494f 100644 --- a/kubernetes/docs/v1_endpoint_hints.md +++ b/kubernetes/docs/v1_endpoint_hints.md @@ -3,7 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**for_zones** | [**list_t**](v1_for_zone.md) \* | forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing. | [optional] +**for_nodes** | [**list_t**](v1_for_node.md) \* | forNodes indicates the node(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries. This is an Alpha feature and is only used when the PreferSameTrafficDistribution feature gate is enabled. | [optional] +**for_zones** | [**list_t**](v1_for_zone.md) \* | forZones indicates the zone(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_endpoint_slice.md b/kubernetes/docs/v1_endpoint_slice.md index a8d9571a..f69e5a33 100644 --- a/kubernetes/docs/v1_endpoint_slice.md +++ b/kubernetes/docs/v1_endpoint_slice.md @@ -3,12 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**address_type** | **char \*** | addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. | +**address_type** | **char \*** | addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type. | **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] **endpoints** | [**list_t**](v1_endpoint.md) \* | endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints. | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] -**ports** | [**list_t**](discovery_v1_endpoint_port.md) \* | ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports. | [optional] +**ports** | [**list_t**](discovery_v1_endpoint_port.md) \* | ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_env_from_source.md b/kubernetes/docs/v1_env_from_source.md index a67420be..db217c91 100644 --- a/kubernetes/docs/v1_env_from_source.md +++ b/kubernetes/docs/v1_env_from_source.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **config_map_ref** | [**v1_config_map_env_source_t**](v1_config_map_env_source.md) \* | | [optional] -**prefix** | **char \*** | An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. | [optional] +**prefix** | **char \*** | Optional text to prepend to the name of each environment variable. May consist of any printable ASCII characters except '='. | [optional] **secret_ref** | [**v1_secret_env_source_t**](v1_secret_env_source.md) \* | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_env_var.md b/kubernetes/docs/v1_env_var.md index 049d7ad4..7b715021 100644 --- a/kubernetes/docs/v1_env_var.md +++ b/kubernetes/docs/v1_env_var.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **char \*** | Name of the environment variable. Must be a C_IDENTIFIER. | +**name** | **char \*** | Name of the environment variable. May consist of any printable ASCII characters except '='. | **value** | **char \*** | Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\". | [optional] **value_from** | [**v1_env_var_source_t**](v1_env_var_source.md) \* | | [optional] diff --git a/kubernetes/docs/v1_env_var_source.md b/kubernetes/docs/v1_env_var_source.md index b5310864..83e6f185 100644 --- a/kubernetes/docs/v1_env_var_source.md +++ b/kubernetes/docs/v1_env_var_source.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **config_map_key_ref** | [**v1_config_map_key_selector_t**](v1_config_map_key_selector.md) \* | | [optional] **field_ref** | [**v1_object_field_selector_t**](v1_object_field_selector.md) \* | | [optional] +**file_key_ref** | [**v1_file_key_selector_t**](v1_file_key_selector.md) \* | | [optional] **resource_field_ref** | [**v1_resource_field_selector_t**](v1_resource_field_selector.md) \* | | [optional] **secret_key_ref** | [**v1_secret_key_selector_t**](v1_secret_key_selector.md) \* | | [optional] diff --git a/kubernetes/docs/v1_ephemeral_container.md b/kubernetes/docs/v1_ephemeral_container.md index 8e4a4807..b5bfd279 100644 --- a/kubernetes/docs/v1_ephemeral_container.md +++ b/kubernetes/docs/v1_ephemeral_container.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **args** | **list_t \*** | Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell | [optional] **command** | **list_t \*** | Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell | [optional] **env** | [**list_t**](v1_env_var.md) \* | List of environment variables to set in the container. Cannot be updated. | [optional] -**env_from** | [**list_t**](v1_env_from_source.md) \* | List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. | [optional] +**env_from** | [**list_t**](v1_env_from_source.md) \* | List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. | [optional] **image** | **char \*** | Container image name. More info: https://kubernetes.io/docs/concepts/containers/images | [optional] **image_pull_policy** | **char \*** | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images | [optional] **lifecycle** | [**v1_lifecycle_t**](v1_lifecycle.md) \* | | [optional] @@ -16,7 +16,8 @@ Name | Type | Description | Notes **readiness_probe** | [**v1_probe_t**](v1_probe.md) \* | | [optional] **resize_policy** | [**list_t**](v1_container_resize_policy.md) \* | Resources resize policy for the container. | [optional] **resources** | [**v1_resource_requirements_t**](v1_resource_requirements.md) \* | | [optional] -**restart_policy** | **char \*** | Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers. | [optional] +**restart_policy** | **char \*** | Restart policy for the container to manage the restart behavior of each container within a pod. You cannot set this field on ephemeral containers. | [optional] +**restart_policy_rules** | [**list_t**](v1_container_restart_rule.md) \* | Represents a list of rules to be checked to determine if the container should be restarted on exit. You cannot set this field on ephemeral containers. | [optional] **security_context** | [**v1_security_context_t**](v1_security_context.md) \* | | [optional] **startup_probe** | [**v1_probe_t**](v1_probe.md) \* | | [optional] **_stdin** | **int** | Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. | [optional] diff --git a/kubernetes/docs/v1_exact_device_request.md b/kubernetes/docs/v1_exact_device_request.md new file mode 100644 index 00000000..38b8872e --- /dev/null +++ b/kubernetes/docs/v1_exact_device_request.md @@ -0,0 +1,16 @@ +# v1_exact_device_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This request is for all of the matching devices in a pool. At least one device must exist on the node for the allocation to succeed. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**capacity** | [**v1_capacity_requirements_t**](v1_capacity_requirements.md) \* | | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request. A DeviceClassName is required. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | +**selectors** | [**list_t**](v1_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered. | [optional] +**tolerations** | [**list_t**](v1_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_field_selector_attributes.md b/kubernetes/docs/v1_field_selector_attributes.md new file mode 100644 index 00000000..05553556 --- /dev/null +++ b/kubernetes/docs/v1_field_selector_attributes.md @@ -0,0 +1,11 @@ +# v1_field_selector_attributes_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**raw_selector** | **char \*** | rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present. | [optional] +**requirements** | [**list_t**](v1_field_selector_requirement.md) \* | requirements is the parsed interpretation of a field selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_field_selector_requirement.md b/kubernetes/docs/v1_field_selector_requirement.md new file mode 100644 index 00000000..b33edc4e --- /dev/null +++ b/kubernetes/docs/v1_field_selector_requirement.md @@ -0,0 +1,12 @@ +# v1_field_selector_requirement_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **char \*** | key is the field selector key that the requirement applies to. | +**_operator** | **char \*** | operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future. | +**values** | **list_t \*** | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_file_key_selector.md b/kubernetes/docs/v1_file_key_selector.md new file mode 100644 index 00000000..8aaba15a --- /dev/null +++ b/kubernetes/docs/v1_file_key_selector.md @@ -0,0 +1,13 @@ +# v1_file_key_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **char \*** | The key within the env file. An invalid key will prevent the pod from starting. The keys defined within a source may consist of any printable ASCII characters except '='. During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters. | +**optional** | **int** | Specify whether the file or its key must be defined. If the file or key does not exist, then the env var is not published. If optional is set to true and the specified key does not exist, the environment variable will not be set in the Pod's containers. If optional is set to false and the specified key does not exist, an error will be returned during Pod creation. | [optional] +**path** | **char \*** | The path within the volume from which to select the file. Must be relative and may not contain the '..' path or start with '..'. | +**volume_name** | **char \*** | The name of the volume mount containing the env file. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_for_node.md b/kubernetes/docs/v1_for_node.md new file mode 100644 index 00000000..22623cad --- /dev/null +++ b/kubernetes/docs/v1_for_node.md @@ -0,0 +1,10 @@ +# v1_for_node_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **char \*** | name represents the name of the node. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_glusterfs_volume_source.md b/kubernetes/docs/v1_glusterfs_volume_source.md index d29d705e..cc552a63 100644 --- a/kubernetes/docs/v1_glusterfs_volume_source.md +++ b/kubernetes/docs/v1_glusterfs_volume_source.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**endpoints** | **char \*** | endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod | +**endpoints** | **char \*** | endpoints is the endpoint name that details Glusterfs topology. | **path** | **char \*** | path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod | **read_only** | **int** | readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod | [optional] diff --git a/kubernetes/docs/v1_host_ip.md b/kubernetes/docs/v1_host_ip.md index 6e588e2b..3b14dbc8 100644 --- a/kubernetes/docs/v1_host_ip.md +++ b/kubernetes/docs/v1_host_ip.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ip** | **char \*** | IP is the IP address assigned to the host | [optional] +**ip** | **char \*** | IP is the IP address assigned to the host | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_image_volume_source.md b/kubernetes/docs/v1_image_volume_source.md new file mode 100644 index 00000000..38bc55f9 --- /dev/null +++ b/kubernetes/docs/v1_image_volume_source.md @@ -0,0 +1,11 @@ +# v1_image_volume_source_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pull_policy** | **char \*** | Policy for pulling OCI objects. Possible values are: Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. | [optional] +**reference** | **char \*** | Required: Image or artifact reference to be used. Behaves in the same way as pod.spec.containers[*].image. Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_ip_address.md b/kubernetes/docs/v1_ip_address.md new file mode 100644 index 00000000..843d2cd3 --- /dev/null +++ b/kubernetes/docs/v1_ip_address.md @@ -0,0 +1,13 @@ +# v1_ip_address_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1_ip_address_spec_t**](v1_ip_address_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_ip_address_list.md b/kubernetes/docs/v1_ip_address_list.md new file mode 100644 index 00000000..7eb963e4 --- /dev/null +++ b/kubernetes/docs/v1_ip_address_list.md @@ -0,0 +1,13 @@ +# v1_ip_address_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1_ip_address.md) \* | items is the list of IPAddresses. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_ip_address_spec.md b/kubernetes/docs/v1_ip_address_spec.md new file mode 100644 index 00000000..0eb3904e --- /dev/null +++ b/kubernetes/docs/v1_ip_address_spec.md @@ -0,0 +1,10 @@ +# v1_ip_address_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_ref** | [**v1_parent_reference_t**](v1_parent_reference.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_job_spec.md b/kubernetes/docs/v1_job_spec.md index d4171444..373ceaf5 100644 --- a/kubernetes/docs/v1_job_spec.md +++ b/kubernetes/docs/v1_job_spec.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **active_deadline_seconds** | **long** | Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again. | [optional] -**backoff_limit** | **int** | Specifies the number of retries before marking this job failed. Defaults to 6 | [optional] -**backoff_limit_per_index** | **int** | Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). | [optional] +**backoff_limit** | **int** | Specifies the number of retries before marking this job failed. Defaults to 6, unless backoffLimitPerIndex (only Indexed Job) is specified. When backoffLimitPerIndex is specified, backoffLimit defaults to 2147483647. | [optional] +**backoff_limit_per_index** | **int** | Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. | [optional] **completion_mode** | **char \*** | completionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. `NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other. `Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, which is possible during upgrades due to version skew, the controller skips updates for the Job. | [optional] **completions** | **int** | Specifies the desired number of successfully finished pods the job should be run with. Setting to null means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ | [optional] -**managed_by** | **char \*** | ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 64 characters. This field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default). | [optional] +**managed_by** | **char \*** | ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable. This field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default). | [optional] **manual_selector** | **int** | manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector | [optional] -**max_failed_indexes** | **int** | Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). | [optional] +**max_failed_indexes** | **int** | Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. | [optional] **parallelism** | **int** | Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ | [optional] **pod_failure_policy** | [**v1_pod_failure_policy_t**](v1_pod_failure_policy.md) \* | | [optional] -**pod_replacement_policy** | **char \*** | podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods when they are terminating (has a metadata.deletionTimestamp) or failed. - Failed means to wait until a previously created Pod is fully terminated (has phase Failed or Succeeded) before creating a replacement Pod. When using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle. This is on by default. | [optional] +**pod_replacement_policy** | **char \*** | podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods when they are terminating (has a metadata.deletionTimestamp) or failed. - Failed means to wait until a previously created Pod is fully terminated (has phase Failed or Succeeded) before creating a replacement Pod. When using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. | [optional] **selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] **success_policy** | [**v1_success_policy_t**](v1_success_policy.md) \* | | [optional] **suspend** | **int** | suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false. | [optional] diff --git a/kubernetes/docs/v1_job_status.md b/kubernetes/docs/v1_job_status.md index 341291b1..9945ce7a 100644 --- a/kubernetes/docs/v1_job_status.md +++ b/kubernetes/docs/v1_job_status.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes **completion_time** | **char \*** | Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is set when the job finishes successfully, and only then. The value cannot be updated or removed. The value indicates the same or later point in time as the startTime field. | [optional] **conditions** | [**list_t**](v1_job_condition.md) \* | The latest available observations of an object's current state. When a Job fails, one of the conditions will have type \"Failed\" and status true. When a Job is suspended, one of the conditions will have type \"Suspended\" and status true; when the Job is resumed, the status of this condition will become false. When a Job is completed, one of the conditions will have type \"Complete\" and status true. A job is considered finished when it is in a terminal condition, either \"Complete\" or \"Failed\". A Job cannot have both the \"Complete\" and \"Failed\" conditions. Additionally, it cannot be in the \"Complete\" and \"FailureTarget\" conditions. The \"Complete\", \"Failed\" and \"FailureTarget\" conditions cannot be disabled. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ | [optional] **failed** | **int** | The number of pods which reached phase Failed. The value increases monotonically. | [optional] -**failed_indexes** | **char \*** | FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). | [optional] -**ready** | **int** | The number of pods which have a Ready condition. | [optional] +**failed_indexes** | **char \*** | FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes. | [optional] +**ready** | **int** | The number of active pods which have a Ready condition and are not terminating (without a deletionTimestamp). | [optional] **start_time** | **char \*** | Represents time when the job controller started processing a job. When a Job is created in the suspended state, this field is not set until the first time it is resumed. This field is reset every time a Job is resumed from suspension. It is represented in RFC3339 form and is in UTC. Once set, the field can only be removed when the job is suspended. The field cannot be modified while the job is unsuspended or finished. | [optional] **succeeded** | **int** | The number of pods which reached phase Succeeded. The value increases monotonically for a given spec. However, it may decrease in reaction to scale down of elastic indexed jobs. | [optional] **terminating** | **int** | The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp). This field is beta-level. The job controller populates the field when the feature gate JobPodReplacementPolicy is enabled (enabled by default). | [optional] diff --git a/kubernetes/docs/v1_json_schema_props.md b/kubernetes/docs/v1_json_schema_props.md index a80e5225..d4ac548c 100644 --- a/kubernetes/docs/v1_json_schema_props.md +++ b/kubernetes/docs/v1_json_schema_props.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **exclusive_maximum** | **int** | | [optional] **exclusive_minimum** | **int** | | [optional] **external_docs** | [**v1_external_documentation_t**](v1_external_documentation.md) \* | | [optional] -**format** | **char \*** | format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated: - bsonobjectid: a bson object ID, i.e. a 24 characters hex string - uri: an URI as parsed by Golang net/url.ParseRequestURI - email: an email address as parsed by Golang net/mail.ParseAddress - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - cidr: a CIDR as parsed by Golang net.ParseCIDR - mac: a MAC address as parsed by Golang net.ParseMAC - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - isbn: an ISBN10 or ISBN13 number string like \"0321751043\" or \"978-0321751041\" - isbn10: an ISBN10 number string like \"0321751043\" - isbn13: an ISBN13 number string like \"978-0321751041\" - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$ with any non digit characters mixed in - ssn: a U.S. social security number following the regex ^\\d{3}[- ]?\\d{2}[- ]?\\d{4}$ - hexcolor: an hexadecimal color code like \"#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ - rgbcolor: an RGB color code like rgb like \"rgb(255,255,2559\" - byte: base64 encoded binary data - password: any kind of string - date: a date string like \"2006-01-02\" as defined by full-date in RFC3339 - duration: a duration string like \"22 ns\" as parsed by Golang time.ParseDuration or compatible with Scala duration format - datetime: a date time string like \"2014-12-15T19:30:20.000Z\" as defined by date-time in RFC3339. | [optional] +**format** | **char \*** | format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated: - bsonobjectid: a bson object ID, i.e. a 24 characters hex string - uri: an URI as parsed by Golang net/url.ParseRequestURI - email: an email address as parsed by Golang net/mail.ParseAddress - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - cidr: a CIDR as parsed by Golang net.ParseCIDR - mac: a MAC address as parsed by Golang net.ParseMAC - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - isbn: an ISBN10 or ISBN13 number string like \"0321751043\" or \"978-0321751041\" - isbn10: an ISBN10 number string like \"0321751043\" - isbn13: an ISBN13 number string like \"978-0321751041\" - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\\\d{3})\\\\d{11})$ with any non digit characters mixed in - ssn: a U.S. social security number following the regex ^\\\\d{3}[- ]?\\\\d{2}[- ]?\\\\d{4}$ - hexcolor: an hexadecimal color code like \"#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ - rgbcolor: an RGB color code like rgb like \"rgb(255,255,2559\" - byte: base64 encoded binary data - password: any kind of string - date: a date string like \"2006-01-02\" as defined by full-date in RFC3339 - duration: a duration string like \"22 ns\" as parsed by Golang time.ParseDuration or compatible with Scala duration format - datetime: a date time string like \"2014-12-15T19:30:20.000Z\" as defined by date-time in RFC3339. | [optional] **id** | **char \*** | | [optional] **items** | [**object_t**](.md) \* | JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps or an array of JSONSchemaProps. Mainly here for serialization purposes. | [optional] **max_items** | **long** | | [optional] @@ -46,7 +46,7 @@ Name | Type | Description | Notes **x_kubernetes_list_type** | **char \*** | x-kubernetes-list-type annotates an array to further describe its topology. This extension must only be used on lists and may have 3 possible values: 1) `atomic`: the list is treated as a single entity, like a scalar. Atomic lists will be entirely replaced when updated. This extension may be used on any type of list (struct, scalar, ...). 2) `set`: Sets are lists that must not have multiple items with the same value. Each value must be a scalar, an object with x-kubernetes-map-type `atomic` or an array with x-kubernetes-list-type `atomic`. 3) `map`: These lists are like maps in that their elements have a non-index key used to identify them. Order is preserved upon merge. The map tag must only be used on a list with elements of type object. Defaults to atomic for arrays. | [optional] **x_kubernetes_map_type** | **char \*** | x-kubernetes-map-type annotates an object to further describe its topology. This extension must only be used when type is object and may have 2 possible values: 1) `granular`: These maps are actual maps (key-value pairs) and each fields are independent from each other (they can each be manipulated by separate actors). This is the default behaviour for all maps. 2) `atomic`: the list is treated as a single entity, like a scalar. Atomic maps will be entirely replaced when updated. | [optional] **x_kubernetes_preserve_unknown_fields** | **int** | x-kubernetes-preserve-unknown-fields stops the API server decoding step from pruning fields which are not specified in the validation schema. This affects fields recursively, but switches back to normal pruning behaviour if nested properties or additionalProperties are specified in the schema. This can either be true or undefined. False is forbidden. | [optional] -**x_kubernetes_validations** | [**list_t**](v1_validation_rule.md) \* | x-kubernetes-validations describes a list of validation rules written in the CEL expression language. This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled. | [optional] +**x_kubernetes_validations** | [**list_t**](v1_validation_rule.md) \* | x-kubernetes-validations describes a list of validation rules written in the CEL expression language. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_label_selector_attributes.md b/kubernetes/docs/v1_label_selector_attributes.md new file mode 100644 index 00000000..0c8e8b0d --- /dev/null +++ b/kubernetes/docs/v1_label_selector_attributes.md @@ -0,0 +1,11 @@ +# v1_label_selector_attributes_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**raw_selector** | **char \*** | rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present. | [optional] +**requirements** | [**list_t**](v1_label_selector_requirement.md) \* | requirements is the parsed interpretation of a label selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_lease_spec.md b/kubernetes/docs/v1_lease_spec.md index 1148bc3f..b98a2d8a 100644 --- a/kubernetes/docs/v1_lease_spec.md +++ b/kubernetes/docs/v1_lease_spec.md @@ -4,10 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **acquire_time** | **char \*** | acquireTime is a time when the current lease was acquired. | [optional] -**holder_identity** | **char \*** | holderIdentity contains the identity of the holder of a current lease. | [optional] -**lease_duration_seconds** | **int** | leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed renewTime. | [optional] +**holder_identity** | **char \*** | holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field. | [optional] +**lease_duration_seconds** | **int** | leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime. | [optional] **lease_transitions** | **int** | leaseTransitions is the number of transitions of a lease between holders. | [optional] +**preferred_holder** | **char \*** | PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set. | [optional] **renew_time** | **char \*** | renewTime is a time when the current holder of a lease has last updated the lease. | [optional] +**strategy** | **char \*** | Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_lifecycle.md b/kubernetes/docs/v1_lifecycle.md index 63dae14a..d700c2f6 100644 --- a/kubernetes/docs/v1_lifecycle.md +++ b/kubernetes/docs/v1_lifecycle.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **post_start** | [**v1_lifecycle_handler_t**](v1_lifecycle_handler.md) \* | | [optional] **pre_stop** | [**v1_lifecycle_handler_t**](v1_lifecycle_handler.md) \* | | [optional] +**stop_signal** | **char \*** | StopSignal defines which signal will be sent to a container when it is being stopped. If not specified, the default is defined by the container runtime in use. StopSignal can only be set for Pods with a non-empty .spec.os.name | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_linux_container_user.md b/kubernetes/docs/v1_linux_container_user.md new file mode 100644 index 00000000..3e89ba9e --- /dev/null +++ b/kubernetes/docs/v1_linux_container_user.md @@ -0,0 +1,12 @@ +# v1_linux_container_user_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**gid** | **long** | GID is the primary gid initially attached to the first process in the container | +**supplemental_groups** | **list_t \*** | SupplementalGroups are the supplemental groups initially attached to the first process in the container | [optional] +**uid** | **long** | UID is the primary uid initially attached to the first process in the container | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_namespace_condition.md b/kubernetes/docs/v1_namespace_condition.md index f03e9d3b..2f92e369 100644 --- a/kubernetes/docs/v1_namespace_condition.md +++ b/kubernetes/docs/v1_namespace_condition.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**last_transition_time** | **char \*** | 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. | [optional] -**message** | **char \*** | | [optional] -**reason** | **char \*** | | [optional] +**last_transition_time** | **char \*** | Last time the condition transitioned from one status to another. | [optional] +**message** | **char \*** | Human-readable message indicating details about last transition. | [optional] +**reason** | **char \*** | Unique, one-word, CamelCase reason for the condition's last transition. | [optional] **status** | **char \*** | Status of the condition, one of True, False, Unknown. | **type** | **char \*** | Type of namespace controller condition. | diff --git a/kubernetes/docs/v1_network_device_data.md b/kubernetes/docs/v1_network_device_data.md new file mode 100644 index 00000000..6ca214d4 --- /dev/null +++ b/kubernetes/docs/v1_network_device_data.md @@ -0,0 +1,12 @@ +# v1_network_device_data_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hardware_address** | **char \*** | HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. Must not be longer than 128 characters. | [optional] +**interface_name** | **char \*** | InterfaceName specifies the name of the network interface associated with the allocated device. This might be the name of a physical or virtual network interface being configured in the pod. Must not be longer than 256 characters. | [optional] +**ips** | **list_t \*** | IPs lists the network addresses assigned to the device's network interface. This can include both IPv4 and IPv6 addresses. The IPs are in the CIDR notation, which includes both the address and the associated subnet mask. e.g.: \"192.0.2.5/24\" for IPv4 and \"2001:db8::5/64\" for IPv6. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_network_policy_spec.md b/kubernetes/docs/v1_network_policy_spec.md index 83db9d1f..69faa557 100644 --- a/kubernetes/docs/v1_network_policy_spec.md +++ b/kubernetes/docs/v1_network_policy_spec.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **egress** | [**list_t**](v1_network_policy_egress_rule.md) \* | egress is a list of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8 | [optional] **ingress** | [**list_t**](v1_network_policy_ingress_rule.md) \* | ingress is a list of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default) | [optional] -**pod_selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | +**pod_selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] **policy_types** | **list_t \*** | policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are [\"Ingress\"], [\"Egress\"], or [\"Ingress\", \"Egress\"]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ \"Egress\" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include \"Egress\" (since such a policy would not include an egress section and would otherwise default to just [ \"Ingress\" ]). This field is beta-level in 1.8 | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_node_features.md b/kubernetes/docs/v1_node_features.md new file mode 100644 index 00000000..0413018c --- /dev/null +++ b/kubernetes/docs/v1_node_features.md @@ -0,0 +1,10 @@ +# v1_node_features_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**supplemental_groups_policy** | **int** | SupplementalGroupsPolicy is set to true if the runtime supports SupplementalGroupsPolicy and ContainerUser. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_node_runtime_handler_features.md b/kubernetes/docs/v1_node_runtime_handler_features.md index bd57fca2..0de4a9da 100644 --- a/kubernetes/docs/v1_node_runtime_handler_features.md +++ b/kubernetes/docs/v1_node_runtime_handler_features.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **recursive_read_only_mounts** | **int** | RecursiveReadOnlyMounts is set to true if the runtime handler supports RecursiveReadOnlyMounts. | [optional] +**user_namespaces** | **int** | UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_node_status.md b/kubernetes/docs/v1_node_status.md index d0b95e28..8b5aea33 100644 --- a/kubernetes/docs/v1_node_status.md +++ b/kubernetes/docs/v1_node_status.md @@ -3,12 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**addresses** | [**list_t**](v1_node_address.md) \* | List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP). | [optional] +**addresses** | [**list_t**](v1_node_address.md) \* | List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/reference/node/node-status/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP). | [optional] **allocatable** | **list_t*** | Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity. | [optional] -**capacity** | **list_t*** | Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity | [optional] -**conditions** | [**list_t**](v1_node_condition.md) \* | Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition | [optional] +**capacity** | **list_t*** | Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/reference/node/node-status/#capacity | [optional] +**conditions** | [**list_t**](v1_node_condition.md) \* | Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/reference/node/node-status/#condition | [optional] **config** | [**v1_node_config_status_t**](v1_node_config_status.md) \* | | [optional] **daemon_endpoints** | [**v1_node_daemon_endpoints_t**](v1_node_daemon_endpoints.md) \* | | [optional] +**features** | [**v1_node_features_t**](v1_node_features.md) \* | | [optional] **images** | [**list_t**](v1_container_image.md) \* | List of container images on this node | [optional] **node_info** | [**v1_node_system_info_t**](v1_node_system_info.md) \* | | [optional] **phase** | **char \*** | NodePhase is the recently observed lifecycle phase of the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#phase The field is never populated, and now is deprecated. | [optional] diff --git a/kubernetes/docs/v1_node_swap_status.md b/kubernetes/docs/v1_node_swap_status.md new file mode 100644 index 00000000..93ff0565 --- /dev/null +++ b/kubernetes/docs/v1_node_swap_status.md @@ -0,0 +1,10 @@ +# v1_node_swap_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capacity** | **long** | Total amount of swap memory in bytes. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_node_system_info.md b/kubernetes/docs/v1_node_system_info.md index d7bbf408..5052109d 100644 --- a/kubernetes/docs/v1_node_system_info.md +++ b/kubernetes/docs/v1_node_system_info.md @@ -7,11 +7,12 @@ Name | Type | Description | Notes **boot_id** | **char \*** | Boot ID reported by the node. | **container_runtime_version** | **char \*** | ContainerRuntime Version reported by the node through runtime remote API (e.g. containerd://1.4.2). | **kernel_version** | **char \*** | Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64). | -**kube_proxy_version** | **char \*** | KubeProxy Version reported by the node. | +**kube_proxy_version** | **char \*** | Deprecated: KubeProxy Version reported by the node. | **kubelet_version** | **char \*** | Kubelet Version reported by the node. | **machine_id** | **char \*** | MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html | **operating_system** | **char \*** | The Operating System reported by the node | **os_image** | **char \*** | OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)). | +**swap** | [**v1_node_swap_status_t**](v1_node_swap_status.md) \* | | [optional] **system_uuid** | **char \*** | SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_opaque_device_configuration.md b/kubernetes/docs/v1_opaque_device_configuration.md new file mode 100644 index 00000000..169e38e9 --- /dev/null +++ b/kubernetes/docs/v1_opaque_device_configuration.md @@ -0,0 +1,11 @@ +# v1_opaque_device_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**driver** | **char \*** | Driver is used to determine which kubelet plugin needs to be passed these configuration parameters. An admission policy provided by the driver developer could use this to decide whether it needs to validate them. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**parameters** | [**object_t**](.md) \* | Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions. The length of the raw data must be smaller or equal to 10 Ki. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_parent_reference.md b/kubernetes/docs/v1_parent_reference.md new file mode 100644 index 00000000..168c315c --- /dev/null +++ b/kubernetes/docs/v1_parent_reference.md @@ -0,0 +1,13 @@ +# v1_parent_reference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | **char \*** | Group is the group of the object being referenced. | [optional] +**name** | **char \*** | Name is the name of the object being referenced. | +**_namespace** | **char \*** | Namespace is the namespace of the object being referenced. | [optional] +**resource** | **char \*** | Resource is the resource of the object being referenced. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_persistent_volume_claim_condition.md b/kubernetes/docs/v1_persistent_volume_claim_condition.md index 96228b9f..30a8044b 100644 --- a/kubernetes/docs/v1_persistent_volume_claim_condition.md +++ b/kubernetes/docs/v1_persistent_volume_claim_condition.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes **last_transition_time** | **char \*** | lastTransitionTime is the time the condition transitioned from one status to another. | [optional] **message** | **char \*** | message is the human-readable message indicating details about last transition. | [optional] **reason** | **char \*** | reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"Resizing\" that means the underlying persistent volume is being resized. | [optional] -**status** | **char \*** | | -**type** | **char \*** | | +**status** | **char \*** | Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=state%20of%20pvc-,conditions.status,-(string)%2C%20required | +**type** | **char \*** | Type is the type of the condition. More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=set%20to%20%27ResizeStarted%27.-,PersistentVolumeClaimCondition,-contains%20details%20about | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_persistent_volume_claim_spec.md b/kubernetes/docs/v1_persistent_volume_claim_spec.md index 585b773e..5f4a306b 100644 --- a/kubernetes/docs/v1_persistent_volume_claim_spec.md +++ b/kubernetes/docs/v1_persistent_volume_claim_spec.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **resources** | [**v1_volume_resource_requirements_t**](v1_volume_resource_requirements.md) \* | | [optional] **selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] **storage_class_name** | **char \*** | storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 | [optional] -**volume_attributes_class_name** | **char \*** | volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled. | [optional] +**volume_attributes_class_name** | **char \*** | volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string or nil value indicates that no VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, this field can be reset to its previous value (including nil) to cancel the modification. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ | [optional] **volume_mode** | **char \*** | volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. | [optional] **volume_name** | **char \*** | volumeName is the binding reference to the PersistentVolume backing this claim. | [optional] diff --git a/kubernetes/docs/v1_persistent_volume_claim_status.md b/kubernetes/docs/v1_persistent_volume_claim_status.md index 4118fbd9..ee547622 100644 --- a/kubernetes/docs/v1_persistent_volume_claim_status.md +++ b/kubernetes/docs/v1_persistent_volume_claim_status.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **allocated_resources** | **list_t*** | allocatedResources tracks the resources allocated to a PVC including its capacity. Key names follow standard Kubernetes label syntax. Valid values are either: * Un-prefixed keys: - storage - the capacity of the volume. * Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\" Apart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used. Capacity reported here may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. A controller that receives PVC update with previously unknown resourceName should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature. | [optional] **capacity** | **list_t*** | capacity represents the actual resources of the underlying volume. | [optional] **conditions** | [**list_t**](v1_persistent_volume_claim_condition.md) \* | conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'Resizing'. | [optional] -**current_volume_attributes_class_name** | **char \*** | currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is an alpha field and requires enabling VolumeAttributesClass feature. | [optional] +**current_volume_attributes_class_name** | **char \*** | currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim | [optional] **modify_volume_status** | [**v1_modify_volume_status_t**](v1_modify_volume_status.md) \* | | [optional] **phase** | **char \*** | phase represents the current phase of PersistentVolumeClaim. | [optional] diff --git a/kubernetes/docs/v1_persistent_volume_spec.md b/kubernetes/docs/v1_persistent_volume_spec.md index 288b2855..8c2b0bed 100644 --- a/kubernetes/docs/v1_persistent_volume_spec.md +++ b/kubernetes/docs/v1_persistent_volume_spec.md @@ -31,7 +31,7 @@ Name | Type | Description | Notes **scale_io** | [**v1_scale_io_persistent_volume_source_t**](v1_scale_io_persistent_volume_source.md) \* | | [optional] **storage_class_name** | **char \*** | storageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass. | [optional] **storageos** | [**v1_storage_os_persistent_volume_source_t**](v1_storage_os_persistent_volume_source.md) \* | | [optional] -**volume_attributes_class_name** | **char \*** | Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is an alpha field and requires enabling VolumeAttributesClass feature. | [optional] +**volume_attributes_class_name** | **char \*** | Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. | [optional] **volume_mode** | **char \*** | volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. | [optional] **vsphere_volume** | [**v1_vsphere_virtual_disk_volume_source_t**](v1_vsphere_virtual_disk_volume_source.md) \* | | [optional] diff --git a/kubernetes/docs/v1_persistent_volume_status.md b/kubernetes/docs/v1_persistent_volume_status.md index 4e1fef6f..1e4b7f66 100644 --- a/kubernetes/docs/v1_persistent_volume_status.md +++ b/kubernetes/docs/v1_persistent_volume_status.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**last_phase_transition_time** | **char \*** | lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default). | [optional] +**last_phase_transition_time** | **char \*** | lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. | [optional] **message** | **char \*** | message is a human-readable message indicating details about why the volume is in this state. | [optional] **phase** | **char \*** | phase indicates if a volume is available, bound to a claim, or released by a claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase | [optional] **reason** | **char \*** | reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI. | [optional] diff --git a/kubernetes/docs/v1_pod_affinity_term.md b/kubernetes/docs/v1_pod_affinity_term.md index 62b933c3..f1c8dee7 100644 --- a/kubernetes/docs/v1_pod_affinity_term.md +++ b/kubernetes/docs/v1_pod_affinity_term.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label_selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] -**match_label_keys** | **list_t \*** | MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. | [optional] -**mismatch_label_keys** | **list_t \*** | MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. | [optional] +**match_label_keys** | **list_t \*** | MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. | [optional] +**mismatch_label_keys** | **list_t \*** | MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. | [optional] **namespace_selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] **namespaces** | **list_t \*** | namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\". | [optional] **topology_key** | **char \*** | This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. | diff --git a/kubernetes/docs/v1_pod_anti_affinity.md b/kubernetes/docs/v1_pod_anti_affinity.md index 6958a9f4..16d4833d 100644 --- a/kubernetes/docs/v1_pod_anti_affinity.md +++ b/kubernetes/docs/v1_pod_anti_affinity.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**preferred_during_scheduling_ignored_during_execution** | [**list_t**](v1_weighted_pod_affinity_term.md) \* | The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. | [optional] +**preferred_during_scheduling_ignored_during_execution** | [**list_t**](v1_weighted_pod_affinity_term.md) \* | The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and subtracting \"weight\" from the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. | [optional] **required_during_scheduling_ignored_during_execution** | [**list_t**](v1_pod_affinity_term.md) \* | If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_pod_certificate_projection.md b/kubernetes/docs/v1_pod_certificate_projection.md new file mode 100644 index 00000000..050b0e38 --- /dev/null +++ b/kubernetes/docs/v1_pod_certificate_projection.md @@ -0,0 +1,15 @@ +# v1_pod_certificate_projection_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**certificate_chain_path** | **char \*** | Write the certificate chain at this path in the projected volume. Most applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation. | [optional] +**credential_bundle_path** | **char \*** | Write the credential bundle at this path in the projected volume. The credential bundle is a single file that contains multiple PEM blocks. The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private key. The remaining blocks are CERTIFICATE blocks, containing the issued certificate chain from the signer (leaf and any intermediates). Using credentialBundlePath lets your Pod's application code make a single atomic read that retrieves a consistent key and certificate chain. If you project them to separate files, your application code will need to additionally check that the leaf certificate was issued to the key. | [optional] +**key_path** | **char \*** | Write the key at this path in the projected volume. Most applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation. | [optional] +**key_type** | **char \*** | The type of keypair Kubelet will generate for the pod. Valid values are \"RSA3072\", \"RSA4096\", \"ECDSAP256\", \"ECDSAP384\", \"ECDSAP521\", and \"ED25519\". | +**max_expiration_seconds** | **int** | maxExpirationSeconds is the maximum lifetime permitted for the certificate. Kubelet copies this value verbatim into the PodCertificateRequests it generates for this projection. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours. | [optional] +**signer_name** | **char \*** | Kubelet's generated CSRs will be addressed to this signer. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_pod_condition.md b/kubernetes/docs/v1_pod_condition.md index 069f0365..5eac33c6 100644 --- a/kubernetes/docs/v1_pod_condition.md +++ b/kubernetes/docs/v1_pod_condition.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **last_probe_time** | **char \*** | Last time we probed the condition. | [optional] **last_transition_time** | **char \*** | Last time the condition transitioned from one status to another. | [optional] **message** | **char \*** | Human-readable message indicating details about last transition. | [optional] +**observed_generation** | **long** | If set, this represents the .metadata.generation that the pod condition was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field. | [optional] **reason** | **char \*** | Unique, one-word, CamelCase reason for the condition's last transition. | [optional] **status** | **char \*** | Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions | **type** | **char \*** | Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions | diff --git a/kubernetes/docs/v1_pod_disruption_budget_spec.md b/kubernetes/docs/v1_pod_disruption_budget_spec.md index a752ac3e..6085ae53 100644 --- a/kubernetes/docs/v1_pod_disruption_budget_spec.md +++ b/kubernetes/docs/v1_pod_disruption_budget_spec.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **max_unavailable** | **int_or_string_t \*** | IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number. | [optional] **min_available** | **int_or_string_t \*** | IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number. | [optional] **selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] -**unhealthy_pod_eviction_policy** | **char \*** | UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\". Valid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy. IfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction. AlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction. Additional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field. This field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default). | [optional] +**unhealthy_pod_eviction_policy** | **char \*** | UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\". Valid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy. IfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction. AlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction. Additional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_pod_dns_config_option.md b/kubernetes/docs/v1_pod_dns_config_option.md index bf404db0..257e0207 100644 --- a/kubernetes/docs/v1_pod_dns_config_option.md +++ b/kubernetes/docs/v1_pod_dns_config_option.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **char \*** | Required. | [optional] -**value** | **char \*** | | [optional] +**name** | **char \*** | Name is this DNS resolver option's name. Required. | [optional] +**value** | **char \*** | Value is this DNS resolver option's value. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_pod_extended_resource_claim_status.md b/kubernetes/docs/v1_pod_extended_resource_claim_status.md new file mode 100644 index 00000000..388fed06 --- /dev/null +++ b/kubernetes/docs/v1_pod_extended_resource_claim_status.md @@ -0,0 +1,11 @@ +# v1_pod_extended_resource_claim_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_mappings** | [**list_t**](v1_container_extended_resource_request.md) \* | RequestMappings identifies the mapping of <container, extended resource backed by DRA> to device request in the generated ResourceClaim. | +**resource_claim_name** | **char \*** | ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_pod_failure_policy_rule.md b/kubernetes/docs/v1_pod_failure_policy_rule.md index 7f44fa06..e1c8d363 100644 --- a/kubernetes/docs/v1_pod_failure_policy_rule.md +++ b/kubernetes/docs/v1_pod_failure_policy_rule.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | **char \*** | Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. This value is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). - Ignore: indicates that the counter towards the .backoffLimit is not incremented and a replacement pod is created. - Count: indicates that the pod is handled in the default way - the counter towards the .backoffLimit is incremented. Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule. | +**action** | **char \*** | Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. - Ignore: indicates that the counter towards the .backoffLimit is not incremented and a replacement pod is created. - Count: indicates that the pod is handled in the default way - the counter towards the .backoffLimit is incremented. Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule. | **on_exit_codes** | [**v1_pod_failure_policy_on_exit_codes_requirement_t**](v1_pod_failure_policy_on_exit_codes_requirement.md) \* | | [optional] **on_pod_conditions** | [**list_t**](v1_pod_failure_policy_on_pod_conditions_pattern.md) \* | Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed. | [optional] diff --git a/kubernetes/docs/v1_pod_ip.md b/kubernetes/docs/v1_pod_ip.md index 4d3e31bc..53abeb01 100644 --- a/kubernetes/docs/v1_pod_ip.md +++ b/kubernetes/docs/v1_pod_ip.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ip** | **char \*** | IP is the IP address assigned to the pod | [optional] +**ip** | **char \*** | IP is the IP address assigned to the pod | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_pod_resource_claim.md b/kubernetes/docs/v1_pod_resource_claim.md index 39d389f3..aeae01e3 100644 --- a/kubernetes/docs/v1_pod_resource_claim.md +++ b/kubernetes/docs/v1_pod_resource_claim.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **char \*** | Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. | -**source** | [**v1_claim_source_t**](v1_claim_source.md) \* | | [optional] +**resource_claim_name** | **char \*** | ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod. Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set. | [optional] +**resource_claim_template_name** | **char \*** | ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod. The template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim. Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_pod_resource_claim_status.md b/kubernetes/docs/v1_pod_resource_claim_status.md index f6fada2d..0008302c 100644 --- a/kubernetes/docs/v1_pod_resource_claim_status.md +++ b/kubernetes/docs/v1_pod_resource_claim_status.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **char \*** | Name uniquely identifies this resource claim inside the pod. This must match the name of an entry in pod.spec.resourceClaims, which implies that the string must be a DNS_LABEL. | -**resource_claim_name** | **char \*** | ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. It this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case. | [optional] +**resource_claim_name** | **char \*** | ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_pod_security_context.md b/kubernetes/docs/v1_pod_security_context.md index b3f2097a..dc8e849f 100644 --- a/kubernetes/docs/v1_pod_security_context.md +++ b/kubernetes/docs/v1_pod_security_context.md @@ -9,9 +9,11 @@ Name | Type | Description | Notes **run_as_group** | **long** | The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. | [optional] **run_as_non_root** | **int** | Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. | [optional] **run_as_user** | **long** | The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. | [optional] +**se_linux_change_policy** | **char \*** | seLinuxChangePolicy defines how the container's SELinux label is applied to all volumes used by the Pod. It has no effect on nodes that do not support SELinux or to volumes does not support SELinux. Valid values are \"MountOption\" and \"Recursive\". \"Recursive\" means relabeling of all files on all Pod volumes by the container runtime. This may be slow for large volumes, but allows mixing privileged and unprivileged Pods sharing the same volume on the same node. \"MountOption\" mounts all eligible Pod volumes with `-o context` mount option. This requires all Pods that share the same volume to use the same SELinux label. It is not possible to share the same volume among privileged and unprivileged Pods. Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. \"MountOption\" value is allowed only when SELinuxMount feature gate is enabled. If not specified and SELinuxMount feature gate is enabled, \"MountOption\" is used. If not specified and SELinuxMount feature gate is disabled, \"MountOption\" is used for ReadWriteOncePod volumes and \"Recursive\" for all other volumes. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. All Pods that use the same volume should use the same seLinuxChangePolicy, otherwise some pods can get stuck in ContainerCreating state. Note that this field cannot be set when spec.os.name is windows. | [optional] **se_linux_options** | [**v1_se_linux_options_t**](v1_se_linux_options.md) \* | | [optional] **seccomp_profile** | [**v1_seccomp_profile_t**](v1_seccomp_profile.md) \* | | [optional] -**supplemental_groups** | **list_t \*** | A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows. | [optional] +**supplemental_groups** | **list_t \*** | A list of groups applied to the first process run in each container, in addition to the container's primary GID and fsGroup (if specified). If the SupplementalGroupsPolicy feature is enabled, the supplementalGroupsPolicy field determines whether these are in addition to or instead of any group memberships defined in the container image. If unspecified, no additional groups are added, though group memberships defined in the container image may still be used, depending on the supplementalGroupsPolicy field. Note that this field cannot be set when spec.os.name is windows. | [optional] +**supplemental_groups_policy** | **char \*** | Defines how supplemental groups of the first container processes are calculated. Valid values are \"Merge\" and \"Strict\". If not specified, \"Merge\" is used. (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled and the container runtime must implement support for this feature. Note that this field cannot be set when spec.os.name is windows. | [optional] **sysctls** | [**list_t**](v1_sysctl.md) \* | Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows. | [optional] **windows_options** | [**v1_windows_security_context_options_t**](v1_windows_security_context_options.md) \* | | [optional] diff --git a/kubernetes/docs/v1_pod_spec.md b/kubernetes/docs/v1_pod_spec.md index 15724c04..4df950ec 100644 --- a/kubernetes/docs/v1_pod_spec.md +++ b/kubernetes/docs/v1_pod_spec.md @@ -13,13 +13,14 @@ Name | Type | Description | Notes **ephemeral_containers** | [**list_t**](v1_ephemeral_container.md) \* | List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. | [optional] **host_aliases** | [**list_t**](v1_host_alias.md) \* | HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. | [optional] **host_ipc** | **int** | Use the host's ipc namespace. Optional: Default to false. | [optional] -**host_network** | **int** | Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false. | [optional] +**host_network** | **int** | Host networking requested for this pod. Use the host's network namespace. When using HostNetwork you should specify ports so the scheduler is aware. When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`, and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`. Default to false. | [optional] **host_pid** | **int** | Use the host's pid namespace. Optional: Default to false. | [optional] **host_users** | **int** | Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature. | [optional] **hostname** | **char \*** | Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. | [optional] +**hostname_override** | **char \*** | HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false. This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled. | [optional] **image_pull_secrets** | [**list_t**](v1_local_object_reference.md) \* | ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod | [optional] -**init_containers** | [**list_t**](v1_container.md) \* | List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ | [optional] -**node_name** | **char \*** | NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements. | [optional] +**init_containers** | [**list_t**](v1_container.md) \* | List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ | [optional] +**node_name** | **char \*** | NodeName indicates in which node this pod is scheduled. If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. This field should not be used to express a desire for the pod to be scheduled on a specific node. https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename | [optional] **node_selector** | **list_t*** | NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ | [optional] **os** | [**v1_pod_os_t**](v1_pod_os.md) \* | | [optional] **overhead** | **list_t*** | Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md | [optional] @@ -28,6 +29,7 @@ Name | Type | Description | Notes **priority_class_name** | **char \*** | If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. | [optional] **readiness_gates** | [**list_t**](v1_pod_readiness_gate.md) \* | If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates | [optional] **resource_claims** | [**list_t**](v1_pod_resource_claim.md) \* | ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. | [optional] +**resources** | [**v1_resource_requirements_t**](v1_resource_requirements.md) \* | | [optional] **restart_policy** | **char \*** | Restart policy for all containers within the pod. One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy | [optional] **runtime_class_name** | **char \*** | RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class | [optional] **scheduler_name** | **char \*** | If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. | [optional] @@ -35,7 +37,7 @@ Name | Type | Description | Notes **security_context** | [**v1_pod_security_context_t**](v1_pod_security_context.md) \* | | [optional] **service_account** | **char \*** | DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead. | [optional] **service_account_name** | **char \*** | ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ | [optional] -**set_hostname_as_fqdn** | **int** | If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false. | [optional] +**set_hostname_as_fqdn** | **int** | If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false. | [optional] **share_process_namespace** | **int** | Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. | [optional] **subdomain** | **char \*** | If specified, the fully qualified Pod hostname will be \"<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>\". If not specified, the pod will not have a domainname at all. | [optional] **termination_grace_period_seconds** | **long** | Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds. | [optional] diff --git a/kubernetes/docs/v1_pod_status.md b/kubernetes/docs/v1_pod_status.md index f76374ce..cd7bf157 100644 --- a/kubernetes/docs/v1_pod_status.md +++ b/kubernetes/docs/v1_pod_status.md @@ -4,19 +4,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**list_t**](v1_pod_condition.md) \* | Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions | [optional] -**container_statuses** | [**list_t**](v1_container_status.md) \* | The list has one entry per container in the manifest. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status | [optional] -**ephemeral_container_statuses** | [**list_t**](v1_container_status.md) \* | Status for any ephemeral containers that have run in this pod. | [optional] +**container_statuses** | [**list_t**](v1_container_status.md) \* | Statuses of containers in this pod. Each container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status | [optional] +**ephemeral_container_statuses** | [**list_t**](v1_container_status.md) \* | Statuses for any ephemeral containers that have run in this pod. Each ephemeral container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status | [optional] +**extended_resource_claim_status** | [**v1_pod_extended_resource_claim_status_t**](v1_pod_extended_resource_claim_status.md) \* | | [optional] **host_ip** | **char \*** | hostIP holds the IP address of the host to which the pod is assigned. Empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns mean that HostIP will not be updated even if there is a node is assigned to pod | [optional] **host_ips** | [**list_t**](v1_host_ip.md) \* | hostIPs holds the IP addresses allocated to the host. If this field is specified, the first entry must match the hostIP field. This list is empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns means that HostIPs will not be updated even if there is a node is assigned to this pod. | [optional] -**init_container_statuses** | [**list_t**](v1_container_status.md) \* | The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status | [optional] +**init_container_statuses** | [**list_t**](v1_container_status.md) \* | Statuses of init containers in this pod. The most recent successful non-restartable init container will have ready = true, the most recently started container will have startTime set. Each init container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-and-container-status | [optional] **message** | **char \*** | A human readable message indicating details about why the pod is in this condition. | [optional] **nominated_node_name** | **char \*** | nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled. | [optional] +**observed_generation** | **long** | If set, this represents the .metadata.generation that the pod status was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field. | [optional] **phase** | **char \*** | The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values: Pending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase | [optional] **pod_ip** | **char \*** | podIP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated. | [optional] **pod_ips** | [**list_t**](v1_pod_ip.md) \* | podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list is empty if no IPs have been allocated yet. | [optional] **qos_class** | **char \*** | The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#quality-of-service-classes | [optional] **reason** | **char \*** | A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted' | [optional] -**resize** | **char \*** | Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" | [optional] +**resize** | **char \*** | Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources. | [optional] **resource_claim_statuses** | [**list_t**](v1_pod_resource_claim_status.md) \* | Status of resource claims. | [optional] **start_time** | **char \*** | RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod. | [optional] diff --git a/kubernetes/docs/v1_projected_volume_source.md b/kubernetes/docs/v1_projected_volume_source.md index fe494410..95e2b819 100644 --- a/kubernetes/docs/v1_projected_volume_source.md +++ b/kubernetes/docs/v1_projected_volume_source.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **default_mode** | **int** | defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. | [optional] -**sources** | [**list_t**](v1_volume_projection.md) \* | sources is the list of volume projections | [optional] +**sources** | [**list_t**](v1_volume_projection.md) \* | sources is the list of volume projections. Each entry in this list handles one source. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_replica_set_list.md b/kubernetes/docs/v1_replica_set_list.md index 812c7c9d..9c99d410 100644 --- a/kubernetes/docs/v1_replica_set_list.md +++ b/kubernetes/docs/v1_replica_set_list.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**list_t**](v1_replica_set.md) \* | List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller | +**items** | [**list_t**](v1_replica_set.md) \* | List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] diff --git a/kubernetes/docs/v1_replica_set_spec.md b/kubernetes/docs/v1_replica_set_spec.md index 27a7220c..eadd67ab 100644 --- a/kubernetes/docs/v1_replica_set_spec.md +++ b/kubernetes/docs/v1_replica_set_spec.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **min_ready_seconds** | **int** | Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) | [optional] -**replicas** | **int** | Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller | [optional] +**replicas** | **int** | Replicas is the number of desired pods. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset | [optional] **selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | **_template** | [**v1_pod_template_spec_t**](v1_pod_template_spec.md) \* | | [optional] diff --git a/kubernetes/docs/v1_replica_set_status.md b/kubernetes/docs/v1_replica_set_status.md index 4b56f1d1..bb0c71a2 100644 --- a/kubernetes/docs/v1_replica_set_status.md +++ b/kubernetes/docs/v1_replica_set_status.md @@ -3,12 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**available_replicas** | **int** | The number of available replicas (ready for at least minReadySeconds) for this replica set. | [optional] +**available_replicas** | **int** | The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. | [optional] **conditions** | [**list_t**](v1_replica_set_condition.md) \* | Represents the latest available observations of a replica set's current state. | [optional] -**fully_labeled_replicas** | **int** | The number of pods that have labels matching the labels of the pod template of the replicaset. | [optional] +**fully_labeled_replicas** | **int** | The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. | [optional] **observed_generation** | **long** | ObservedGeneration reflects the generation of the most recently observed ReplicaSet. | [optional] -**ready_replicas** | **int** | readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition. | [optional] -**replicas** | **int** | Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller | +**ready_replicas** | **int** | The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. | [optional] +**replicas** | **int** | Replicas is the most recently observed number of non-terminating pods. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset | +**terminating_replicas** | **int** | The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_resource_attributes.md b/kubernetes/docs/v1_resource_attributes.md index 3a25f72f..2cdb706d 100644 --- a/kubernetes/docs/v1_resource_attributes.md +++ b/kubernetes/docs/v1_resource_attributes.md @@ -3,7 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**field_selector** | [**v1_field_selector_attributes_t**](v1_field_selector_attributes.md) \* | | [optional] **group** | **char \*** | Group is the API Group of the Resource. \"*\" means all. | [optional] +**label_selector** | [**v1_label_selector_attributes_t**](v1_label_selector_attributes.md) \* | | [optional] **name** | **char \*** | Name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all. | [optional] **_namespace** | **char \*** | Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces \"\" (empty) is defaulted for LocalSubjectAccessReviews \"\" (empty) is empty for cluster-scoped resources \"\" (empty) means \"all\" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview | [optional] **resource** | **char \*** | Resource is one of the existing resource types. \"*\" means all. | [optional] diff --git a/kubernetes/docs/v1_resource_claim.md b/kubernetes/docs/v1_resource_claim.md index 26284bc8..891841f6 100644 --- a/kubernetes/docs/v1_resource_claim.md +++ b/kubernetes/docs/v1_resource_claim.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **char \*** | Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. | +**request** | **char \*** | Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_resource_claim_consumer_reference.md b/kubernetes/docs/v1_resource_claim_consumer_reference.md new file mode 100644 index 00000000..39380a19 --- /dev/null +++ b/kubernetes/docs/v1_resource_claim_consumer_reference.md @@ -0,0 +1,13 @@ +# v1_resource_claim_consumer_reference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_group** | **char \*** | APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources. | [optional] +**name** | **char \*** | Name is the name of resource being referenced. | +**resource** | **char \*** | Resource is the type of resource being referenced, for example \"pods\". | +**uid** | **char \*** | UID identifies exactly one incarnation of the resource. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_claim_list.md b/kubernetes/docs/v1_resource_claim_list.md new file mode 100644 index 00000000..9da7526c --- /dev/null +++ b/kubernetes/docs/v1_resource_claim_list.md @@ -0,0 +1,13 @@ +# v1_resource_claim_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](resource_v1_resource_claim.md) \* | Items is the list of resource claims. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_claim_spec.md b/kubernetes/docs/v1_resource_claim_spec.md new file mode 100644 index 00000000..64521662 --- /dev/null +++ b/kubernetes/docs/v1_resource_claim_spec.md @@ -0,0 +1,10 @@ +# v1_resource_claim_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**v1_device_claim_t**](v1_device_claim.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_claim_status.md b/kubernetes/docs/v1_resource_claim_status.md new file mode 100644 index 00000000..ad7629b9 --- /dev/null +++ b/kubernetes/docs/v1_resource_claim_status.md @@ -0,0 +1,12 @@ +# v1_resource_claim_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation** | [**v1_allocation_result_t**](v1_allocation_result.md) \* | | [optional] +**devices** | [**list_t**](v1_allocated_device_status.md) \* | Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers. | [optional] +**reserved_for** | [**list_t**](v1_resource_claim_consumer_reference.md) \* | ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated. In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled. Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again. There can be at most 256 such reservations. This may get increased in the future, but not reduced. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_claim_template.md b/kubernetes/docs/v1_resource_claim_template.md new file mode 100644 index 00000000..f4328407 --- /dev/null +++ b/kubernetes/docs/v1_resource_claim_template.md @@ -0,0 +1,13 @@ +# v1_resource_claim_template_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1_resource_claim_template_spec_t**](v1_resource_claim_template_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_claim_template_list.md b/kubernetes/docs/v1_resource_claim_template_list.md new file mode 100644 index 00000000..9d3637f0 --- /dev/null +++ b/kubernetes/docs/v1_resource_claim_template_list.md @@ -0,0 +1,13 @@ +# v1_resource_claim_template_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1_resource_claim_template.md) \* | Items is the list of resource claim templates. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_claim_template_spec.md b/kubernetes/docs/v1_resource_claim_template_spec.md new file mode 100644 index 00000000..ee4620dc --- /dev/null +++ b/kubernetes/docs/v1_resource_claim_template_spec.md @@ -0,0 +1,11 @@ +# v1_resource_claim_template_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1_resource_claim_spec_t**](v1_resource_claim_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_health.md b/kubernetes/docs/v1_resource_health.md new file mode 100644 index 00000000..1fb2ebd6 --- /dev/null +++ b/kubernetes/docs/v1_resource_health.md @@ -0,0 +1,11 @@ +# v1_resource_health_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**health** | **char \*** | Health of the resource. can be one of: - Healthy: operates as normal - Unhealthy: reported unhealthy. We consider this a temporary health issue since we do not have a mechanism today to distinguish temporary and permanent issues. - Unknown: The status cannot be determined. For example, Device Plugin got unregistered and hasn't been re-registered since. In future we may want to introduce the PermanentlyUnhealthy Status. | [optional] +**resource_id** | **char \*** | ResourceID is the unique identifier of the resource. See the ResourceID type for more information. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_pool.md b/kubernetes/docs/v1_resource_pool.md new file mode 100644 index 00000000..d0e262b4 --- /dev/null +++ b/kubernetes/docs/v1_resource_pool.md @@ -0,0 +1,12 @@ +# v1_resource_pool_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**generation** | **long** | Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted. Combined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state. | +**name** | **char \*** | Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. It must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable. | +**resource_slice_count** | **long** | ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero. Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_requirements.md b/kubernetes/docs/v1_resource_requirements.md index e9a2f87c..bcad8040 100644 --- a/kubernetes/docs/v1_resource_requirements.md +++ b/kubernetes/docs/v1_resource_requirements.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**claims** | [**list_t**](v1_resource_claim.md) \* | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. | [optional] +**claims** | [**list_t**](core_v1_resource_claim.md) \* | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This field depends on the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. | [optional] **limits** | **list_t*** | Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | [optional] **requests** | **list_t*** | Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | [optional] diff --git a/kubernetes/docs/v1_resource_slice.md b/kubernetes/docs/v1_resource_slice.md new file mode 100644 index 00000000..b6fc540a --- /dev/null +++ b/kubernetes/docs/v1_resource_slice.md @@ -0,0 +1,13 @@ +# v1_resource_slice_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1_resource_slice_spec_t**](v1_resource_slice_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_slice_list.md b/kubernetes/docs/v1_resource_slice_list.md new file mode 100644 index 00000000..0ad354bf --- /dev/null +++ b/kubernetes/docs/v1_resource_slice_list.md @@ -0,0 +1,13 @@ +# v1_resource_slice_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1_resource_slice.md) \* | Items is the list of resource ResourceSlices. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_slice_spec.md b/kubernetes/docs/v1_resource_slice_spec.md new file mode 100644 index 00000000..8a3d8f6b --- /dev/null +++ b/kubernetes/docs/v1_resource_slice_spec.md @@ -0,0 +1,17 @@ +# v1_resource_slice_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the resources in the pool. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**devices** | [**list_t**](v1_device.md) \* | Devices lists some or all of the devices in this pool. Must not have more than 128 entries. | [optional] +**driver** | **char \*** | Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable. | +**node_name** | **char \*** | NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node. This field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**per_device_node_selection** | **int** | PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**pool** | [**v1_resource_pool_t**](v1_resource_pool.md) \* | | +**shared_counters** | [**list_t**](v1_counter_set.md) \* | SharedCounters defines a list of counter sets, each of which has a name and a list of counters available. The names of the SharedCounters must be unique in the ResourceSlice. The maximum number of counters in all sets is 32. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_resource_status.md b/kubernetes/docs/v1_resource_status.md new file mode 100644 index 00000000..04b9e29c --- /dev/null +++ b/kubernetes/docs/v1_resource_status.md @@ -0,0 +1,11 @@ +# v1_resource_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **char \*** | Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:<claim_name>/<request>\". When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container. | +**resources** | [**list_t**](v1_resource_health.md) \* | List of unique resources health. Each element in the list contains an unique resource ID and its health. At a minimum, for the lifetime of a Pod, resource ID must uniquely identify the resource allocated to the Pod on the Node. If other Pod on the same Node reports the status with the same resource ID, it must be the same resource they share. See ResourceID type definition for a specific format it has in various use cases. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_security_context.md b/kubernetes/docs/v1_security_context.md index 35a9b5b9..854d1bad 100644 --- a/kubernetes/docs/v1_security_context.md +++ b/kubernetes/docs/v1_security_context.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **app_armor_profile** | [**v1_app_armor_profile_t**](v1_app_armor_profile.md) \* | | [optional] **capabilities** | [**v1_capabilities_t**](v1_capabilities.md) \* | | [optional] **privileged** | **int** | Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. | [optional] -**proc_mount** | **char \*** | procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. | [optional] +**proc_mount** | **char \*** | procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. | [optional] **read_only_root_filesystem** | **int** | Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. | [optional] **run_as_group** | **long** | The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. | [optional] **run_as_non_root** | **int** | Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. | [optional] diff --git a/kubernetes/docs/v1_service_account.md b/kubernetes/docs/v1_service_account.md index 4e60b89b..21da939d 100644 --- a/kubernetes/docs/v1_service_account.md +++ b/kubernetes/docs/v1_service_account.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **image_pull_secrets** | [**list_t**](v1_local_object_reference.md) \* | ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod | [optional] **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] -**secrets** | [**list_t**](v1_object_reference.md) \* | Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a \"kubernetes.io/enforce-mountable-secrets\" annotation set to \"true\". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret | [optional] +**secrets** | [**list_t**](v1_object_reference.md) \* | Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a \"kubernetes.io/enforce-mountable-secrets\" annotation set to \"true\". The \"kubernetes.io/enforce-mountable-secrets\" annotation is deprecated since v1.32. Prefer separate namespaces to isolate access to mounted secrets. This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_service_cidr.md b/kubernetes/docs/v1_service_cidr.md new file mode 100644 index 00000000..dd4b90a3 --- /dev/null +++ b/kubernetes/docs/v1_service_cidr.md @@ -0,0 +1,14 @@ +# v1_service_cidr_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1_service_cidr_spec_t**](v1_service_cidr_spec.md) \* | | [optional] +**status** | [**v1_service_cidr_status_t**](v1_service_cidr_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_service_cidr_list.md b/kubernetes/docs/v1_service_cidr_list.md new file mode 100644 index 00000000..49f1ecf4 --- /dev/null +++ b/kubernetes/docs/v1_service_cidr_list.md @@ -0,0 +1,13 @@ +# v1_service_cidr_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1_service_cidr.md) \* | items is the list of ServiceCIDRs. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_service_cidr_spec.md b/kubernetes/docs/v1_service_cidr_spec.md new file mode 100644 index 00000000..132459df --- /dev/null +++ b/kubernetes/docs/v1_service_cidr_spec.md @@ -0,0 +1,10 @@ +# v1_service_cidr_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cidrs** | **list_t \*** | CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_service_cidr_status.md b/kubernetes/docs/v1_service_cidr_status.md new file mode 100644 index 00000000..9ea5512c --- /dev/null +++ b/kubernetes/docs/v1_service_cidr_status.md @@ -0,0 +1,10 @@ +# v1_service_cidr_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**list_t**](v1_condition.md) \* | conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. Current service state | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_service_spec.md b/kubernetes/docs/v1_service_spec.md index 5e26bc85..666b85aa 100644 --- a/kubernetes/docs/v1_service_spec.md +++ b/kubernetes/docs/v1_service_spec.md @@ -21,7 +21,7 @@ Name | Type | Description | Notes **selector** | **list_t*** | Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/ | [optional] **session_affinity** | **char \*** | Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies | [optional] **session_affinity_config** | [**v1_session_affinity_config_t**](v1_session_affinity_config.md) \* | | [optional] -**traffic_distribution** | **char \*** | TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are topologically close (e.g., same zone). This is an alpha field and requires enabling ServiceTrafficDistribution feature. | [optional] +**traffic_distribution** | **char \*** | TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are in the same zone. | [optional] **type** | **char \*** | type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object or EndpointSlice objects. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP. \"ExternalName\" aliases this service to the specified externalName. Several other fields do not apply to ExternalName services. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_stateful_set_spec.md b/kubernetes/docs/v1_stateful_set_spec.md index 906c8158..e64dc090 100644 --- a/kubernetes/docs/v1_stateful_set_spec.md +++ b/kubernetes/docs/v1_stateful_set_spec.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **replicas** | **int** | replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. | [optional] **revision_history_limit** | **int** | revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. | [optional] **selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | -**service_name** | **char \*** | serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller. | +**service_name** | **char \*** | serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller. | [optional] **_template** | [**v1_pod_template_spec_t**](v1_pod_template_spec.md) \* | | **update_strategy** | [**v1_stateful_set_update_strategy_t**](v1_stateful_set_update_strategy.md) \* | | [optional] **volume_claim_templates** | [**list_t**](v1_persistent_volume_claim.md) \* | volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. | [optional] diff --git a/kubernetes/docs/v1_success_policy.md b/kubernetes/docs/v1_success_policy.md index 73633525..c98667d6 100644 --- a/kubernetes/docs/v1_success_policy.md +++ b/kubernetes/docs/v1_success_policy.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**rules** | [**list_t**](v1_success_policy_rule.md) \* | rules represents the list of alternative rules for the declaring the Jobs as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met, the \"SucceededCriteriaMet\" condition is added, and the lingering pods are removed. The terminal state for such a Job has the \"Complete\" condition. Additionally, these rules are evaluated in order; Once the Job meets one of the rules, other rules are ignored. At most 20 elements are allowed. | +**rules** | [**list_t**](v1_success_policy_rule.md) \* | rules represents the list of alternative rules for the declaring the Jobs as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met, the \"SuccessCriteriaMet\" condition is added, and the lingering pods are removed. The terminal state for such a Job has the \"Complete\" condition. Additionally, these rules are evaluated in order; Once the Job meets one of the rules, other rules are ignored. At most 20 elements are allowed. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_taint.md b/kubernetes/docs/v1_taint.md index cd382b04..95df5a2c 100644 --- a/kubernetes/docs/v1_taint.md +++ b/kubernetes/docs/v1_taint.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **effect** | **char \*** | Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. | **key** | **char \*** | Required. The taint key to be applied to a node. | -**time_added** | **char \*** | TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. | [optional] +**time_added** | **char \*** | TimeAdded represents the time at which the taint was added. | [optional] **value** | **char \*** | The taint value corresponding to the taint key. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_topology_spread_constraint.md b/kubernetes/docs/v1_topology_spread_constraint.md index a7b266dc..43c48619 100644 --- a/kubernetes/docs/v1_topology_spread_constraint.md +++ b/kubernetes/docs/v1_topology_spread_constraint.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes **match_label_keys** | **list_t \*** | MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when LabelSelector isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector. This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default). | [optional] **max_skew** | **int** | MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed. | **min_domains** | **int** | MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule. For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew. | [optional] -**node_affinity_policy** | **char \*** | NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. If this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. | [optional] -**node_taints_policy** | **char \*** | NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. If this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. | [optional] +**node_affinity_policy** | **char \*** | NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. If this value is nil, the behavior is equivalent to the Honor policy. | [optional] +**node_taints_policy** | **char \*** | NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. If this value is nil, the behavior is equivalent to the Ignore policy. | [optional] **topology_key** | **char \*** | TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each <key, value> as a \"bucket\", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes meet the requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey is \"kubernetes.io/hostname\", each Node is a domain of that topology. And, if TopologyKey is \"topology.kubernetes.io/zone\", each zone is a domain of that topology. It's a required field. | **when_unsatisfiable** | **char \*** | WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field. | diff --git a/kubernetes/docs/v1_validating_admission_policy_binding_list.md b/kubernetes/docs/v1_validating_admission_policy_binding_list.md index af856c90..175b761b 100644 --- a/kubernetes/docs/v1_validating_admission_policy_binding_list.md +++ b/kubernetes/docs/v1_validating_admission_policy_binding_list.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**list_t**](v1_validating_admission_policy_binding.md) \* | List of PolicyBinding. | [optional] +**items** | [**list_t**](v1_validating_admission_policy_binding.md) \* | List of PolicyBinding. | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] diff --git a/kubernetes/docs/v1_validating_admission_policy_binding_spec.md b/kubernetes/docs/v1_validating_admission_policy_binding_spec.md index 4b4851c0..7f614263 100644 --- a/kubernetes/docs/v1_validating_admission_policy_binding_spec.md +++ b/kubernetes/docs/v1_validating_admission_policy_binding_spec.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **match_resources** | [**v1_match_resources_t**](v1_match_resources.md) \* | | [optional] **param_ref** | [**v1_param_ref_t**](v1_param_ref.md) \* | | [optional] **policy_name** | **char \*** | PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required. | [optional] -**validation_actions** | **list_t \*** | validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions. Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy. validationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action. The supported actions values are: \"Deny\" specifies that a validation failure results in a denied request. \"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses. \"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]\"` Clients should expect to handle additional values by ignoring any values not recognized. \"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers. Required. | [optional] +**validation_actions** | **list_t \*** | validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions. Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy. validationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action. The supported actions values are: \"Deny\" specifies that a validation failure results in a denied request. \"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses. \"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\\\"message\\\": \\\"Invalid value\\\", {\\\"policy\\\": \\\"policy.example.com\\\", {\\\"binding\\\": \\\"policybinding.example.com\\\", {\\\"expressionIndex\\\": \\\"1\\\", {\\\"validationActions\\\": [\\\"Audit\\\"]}]\"` Clients should expect to handle additional values by ignoring any values not recognized. \"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers. Required. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1_validating_admission_policy_list.md b/kubernetes/docs/v1_validating_admission_policy_list.md index 6c062420..5c515d34 100644 --- a/kubernetes/docs/v1_validating_admission_policy_list.md +++ b/kubernetes/docs/v1_validating_admission_policy_list.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**list_t**](v1_validating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | [optional] +**items** | [**list_t**](v1_validating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] diff --git a/kubernetes/docs/v1_volume.md b/kubernetes/docs/v1_volume.md index 9aa87023..29de6a60 100644 --- a/kubernetes/docs/v1_volume.md +++ b/kubernetes/docs/v1_volume.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **git_repo** | [**v1_git_repo_volume_source_t**](v1_git_repo_volume_source.md) \* | | [optional] **glusterfs** | [**v1_glusterfs_volume_source_t**](v1_glusterfs_volume_source.md) \* | | [optional] **host_path** | [**v1_host_path_volume_source_t**](v1_host_path_volume_source.md) \* | | [optional] +**image** | [**v1_image_volume_source_t**](v1_image_volume_source.md) \* | | [optional] **iscsi** | [**v1_iscsi_volume_source_t**](v1_iscsi_volume_source.md) \* | | [optional] **name** | **char \*** | name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | **nfs** | [**v1_nfs_volume_source_t**](v1_nfs_volume_source.md) \* | | [optional] diff --git a/kubernetes/docs/v1_volume_attributes_class.md b/kubernetes/docs/v1_volume_attributes_class.md new file mode 100644 index 00000000..197e13b8 --- /dev/null +++ b/kubernetes/docs/v1_volume_attributes_class.md @@ -0,0 +1,14 @@ +# v1_volume_attributes_class_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**driver_name** | **char \*** | Name of the CSI driver This field is immutable. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**parameters** | **list_t*** | parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_volume_attributes_class_list.md b/kubernetes/docs/v1_volume_attributes_class_list.md new file mode 100644 index 00000000..44627cdf --- /dev/null +++ b/kubernetes/docs/v1_volume_attributes_class_list.md @@ -0,0 +1,13 @@ +# v1_volume_attributes_class_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1_volume_attributes_class.md) \* | items is the list of VolumeAttributesClass objects. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1_volume_error.md b/kubernetes/docs/v1_volume_error.md index 5ffd8a5a..40575ef6 100644 --- a/kubernetes/docs/v1_volume_error.md +++ b/kubernetes/docs/v1_volume_error.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**error_code** | **int** | errorCode is a numeric gRPC code representing the error encountered during Attach or Detach operations. This is an optional, beta field that requires the MutableCSINodeAllocatableCount feature gate being enabled to be set. | [optional] **message** | **char \*** | message represents the error encountered during Attach or Detach operation. This string may be logged, so it should not contain sensitive information. | [optional] **time** | **char \*** | time represents the time the error was encountered. | [optional] diff --git a/kubernetes/docs/v1_volume_projection.md b/kubernetes/docs/v1_volume_projection.md index 7abc5769..b6c6ae72 100644 --- a/kubernetes/docs/v1_volume_projection.md +++ b/kubernetes/docs/v1_volume_projection.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **cluster_trust_bundle** | [**v1_cluster_trust_bundle_projection_t**](v1_cluster_trust_bundle_projection.md) \* | | [optional] **config_map** | [**v1_config_map_projection_t**](v1_config_map_projection.md) \* | | [optional] **downward_api** | [**v1_downward_api_projection_t**](v1_downward_api_projection.md) \* | | [optional] +**pod_certificate** | [**v1_pod_certificate_projection_t**](v1_pod_certificate_projection.md) \* | | [optional] **secret** | [**v1_secret_projection_t**](v1_secret_projection.md) \* | | [optional] **service_account_token** | [**v1_service_account_token_projection_t**](v1_service_account_token_projection.md) \* | | [optional] diff --git a/kubernetes/docs/v1alpha1_apply_configuration.md b/kubernetes/docs/v1alpha1_apply_configuration.md new file mode 100644 index 00000000..349907b4 --- /dev/null +++ b/kubernetes/docs/v1alpha1_apply_configuration.md @@ -0,0 +1,10 @@ +# v1alpha1_apply_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field: Object{ spec: Object.spec{ serviceAccountName: \"example\" } } Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration. CEL expressions have access to the object types needed to create apply configurations: - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers') CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables: - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value. For example, a variable named 'foo' can be accessed as 'variables.foo'. - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request. See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the request resource. The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible. Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_json_patch.md b/kubernetes/docs/v1alpha1_json_patch.md new file mode 100644 index 00000000..b23eb4c6 --- /dev/null +++ b/kubernetes/docs/v1alpha1_json_patch.md @@ -0,0 +1,10 @@ +# v1alpha1_json_patch_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec expression must return an array of JSONPatch values. For example, this CEL expression returns a JSON patch to conditionally modify a value: [ JSONPatch{op: \"test\", path: \"/spec/example\", value: \"Red\"}, JSONPatch{op: \"replace\", path: \"/spec/example\", value: \"Green\"} ] To define an object for the patch value, use Object types. For example: [ JSONPatch{ op: \"add\", path: \"/spec/selector\", value: Object.spec.selector{matchLabels: {\"environment\": \"test\"}} } ] To use strings containing '/' and '~' as JSONPatch path keys, use \"jsonpatch.escapeKey\". For example: [ JSONPatch{ op: \"add\", path: \"/metadata/labels/\" + jsonpatch.escapeKey(\"example.com/environment\"), value: \"test\" }, ] CEL expressions have access to the types needed to create JSON patches and objects: - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'. See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string, integer, array, map or object. If set, the 'path' and 'from' fields must be set to a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL function may be used to escape path keys containing '/' and '~'. - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers') CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables: - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value. For example, a variable named 'foo' can be accessed as 'variables.foo'. - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request. See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the request resource. CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as: - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively). Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_lease_candidate.md b/kubernetes/docs/v1alpha1_lease_candidate.md new file mode 100644 index 00000000..25dcc285 --- /dev/null +++ b/kubernetes/docs/v1alpha1_lease_candidate.md @@ -0,0 +1,13 @@ +# v1alpha1_lease_candidate_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha1_lease_candidate_spec_t**](v1alpha1_lease_candidate_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_lease_candidate_list.md b/kubernetes/docs/v1alpha1_lease_candidate_list.md new file mode 100644 index 00000000..4c281d35 --- /dev/null +++ b/kubernetes/docs/v1alpha1_lease_candidate_list.md @@ -0,0 +1,13 @@ +# v1alpha1_lease_candidate_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha1_lease_candidate.md) \* | items is a list of schema objects. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_lease_candidate_spec.md b/kubernetes/docs/v1alpha1_lease_candidate_spec.md new file mode 100644 index 00000000..f1e3fd23 --- /dev/null +++ b/kubernetes/docs/v1alpha1_lease_candidate_spec.md @@ -0,0 +1,15 @@ +# v1alpha1_lease_candidate_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_version** | **char \*** | BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is \"OldestEmulationVersion\" | [optional] +**emulation_version** | **char \*** | EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\" | [optional] +**lease_name** | **char \*** | LeaseName is the name of the lease for which this candidate is contending. This field is immutable. | +**ping_time** | **char \*** | PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime. | [optional] +**preferred_strategies** | **list_t \*** | PreferredStrategies indicates the list of strategies for picking the leader for coordinated leader election. The list is ordered, and the first strategy supersedes all other strategies. The list is used by coordinated leader election to make a decision about the final election strategy. This follows as - If all clients have strategy X as the first element in this list, strategy X will be used. - If a candidate has strategy [X] and another candidate has strategy [Y, X], Y supersedes X and strategy Y will be used. - If a candidate has strategy [X, Y] and another candidate has strategy [Y, X], this is a user error and leader election will not operate the Lease until resolved. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. | +**renew_time** | **char \*** | RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_match_resources.md b/kubernetes/docs/v1alpha1_match_resources.md index 2f7f30e1..867d07ef 100644 --- a/kubernetes/docs/v1alpha1_match_resources.md +++ b/kubernetes/docs/v1alpha1_match_resources.md @@ -3,11 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**exclude_resource_rules** | [**list_t**](v1alpha1_named_rule_with_operations.md) \* | ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded) | [optional] -**match_policy** | **char \*** | matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\". - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy. - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy. Defaults to \"Equivalent\" | [optional] +**exclude_resource_rules** | [**list_t**](v1alpha1_named_rule_with_operations.md) \* | ExcludeResourceRules describes what operations on what resources/subresources the policy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded) | [optional] +**match_policy** | **char \*** | matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\". - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, the admission policy does not consider requests to apps/v1beta1 or extensions/v1beta1 API groups. - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, the admission policy **does** consider requests made to apps/v1beta1 or extensions/v1beta1 API groups. The API server translates the request to a matched resource API if necessary. Defaults to \"Equivalent\" | [optional] **namespace_selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] **object_selector** | [**v1_label_selector_t**](v1_label_selector.md) \* | | [optional] -**resource_rules** | [**list_t**](v1alpha1_named_rule_with_operations.md) \* | ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule. | [optional] +**resource_rules** | [**list_t**](v1alpha1_named_rule_with_operations.md) \* | ResourceRules describes what operations on what resources/subresources the admission policy matches. The policy cares about an operation if it matches _any_ Rule. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1alpha1_mutating_admission_policy.md b/kubernetes/docs/v1alpha1_mutating_admission_policy.md new file mode 100644 index 00000000..543dea29 --- /dev/null +++ b/kubernetes/docs/v1alpha1_mutating_admission_policy.md @@ -0,0 +1,13 @@ +# v1alpha1_mutating_admission_policy_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha1_mutating_admission_policy_spec_t**](v1alpha1_mutating_admission_policy_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_mutating_admission_policy_binding.md b/kubernetes/docs/v1alpha1_mutating_admission_policy_binding.md new file mode 100644 index 00000000..0f18c0b8 --- /dev/null +++ b/kubernetes/docs/v1alpha1_mutating_admission_policy_binding.md @@ -0,0 +1,13 @@ +# v1alpha1_mutating_admission_policy_binding_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha1_mutating_admission_policy_binding_spec_t**](v1alpha1_mutating_admission_policy_binding_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_mutating_admission_policy_binding_list.md b/kubernetes/docs/v1alpha1_mutating_admission_policy_binding_list.md new file mode 100644 index 00000000..01f795df --- /dev/null +++ b/kubernetes/docs/v1alpha1_mutating_admission_policy_binding_list.md @@ -0,0 +1,13 @@ +# v1alpha1_mutating_admission_policy_binding_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha1_mutating_admission_policy_binding.md) \* | List of PolicyBinding. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_mutating_admission_policy_binding_spec.md b/kubernetes/docs/v1alpha1_mutating_admission_policy_binding_spec.md new file mode 100644 index 00000000..2589a912 --- /dev/null +++ b/kubernetes/docs/v1alpha1_mutating_admission_policy_binding_spec.md @@ -0,0 +1,12 @@ +# v1alpha1_mutating_admission_policy_binding_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**match_resources** | [**v1alpha1_match_resources_t**](v1alpha1_match_resources.md) \* | | [optional] +**param_ref** | [**v1alpha1_param_ref_t**](v1alpha1_param_ref.md) \* | | [optional] +**policy_name** | **char \*** | policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_mutating_admission_policy_list.md b/kubernetes/docs/v1alpha1_mutating_admission_policy_list.md new file mode 100644 index 00000000..b514b384 --- /dev/null +++ b/kubernetes/docs/v1alpha1_mutating_admission_policy_list.md @@ -0,0 +1,13 @@ +# v1alpha1_mutating_admission_policy_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha1_mutating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_mutating_admission_policy_spec.md b/kubernetes/docs/v1alpha1_mutating_admission_policy_spec.md new file mode 100644 index 00000000..c23fce63 --- /dev/null +++ b/kubernetes/docs/v1alpha1_mutating_admission_policy_spec.md @@ -0,0 +1,16 @@ +# v1alpha1_mutating_admission_policy_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**failure_policy** | **char \*** | failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings. A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource. failurePolicy does not define how validations that evaluate to false are handled. Allowed values are Ignore or Fail. Defaults to Fail. | [optional] +**match_conditions** | [**list_t**](v1alpha1_match_condition.md) \* | matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions. The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the policy is skipped. 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the policy is skipped | [optional] +**match_constraints** | [**v1alpha1_match_resources_t**](v1alpha1_match_resources.md) \* | | [optional] +**mutations** | [**list_t**](v1alpha1_mutation.md) \* | mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis. | [optional] +**param_kind** | [**v1alpha1_param_kind_t**](v1alpha1_param_kind.md) \* | | [optional] +**reinvocation_policy** | **char \*** | reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are \"Never\" and \"IfNeeded\". Never: These mutations will not be called more than once per binding in a single admission evaluation. IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required. | [optional] +**variables** | [**list_t**](v1alpha1_variable.md) \* | variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy. The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_mutation.md b/kubernetes/docs/v1alpha1_mutation.md new file mode 100644 index 00000000..562ee09b --- /dev/null +++ b/kubernetes/docs/v1alpha1_mutation.md @@ -0,0 +1,12 @@ +# v1alpha1_mutation_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apply_configuration** | [**v1alpha1_apply_configuration_t**](v1alpha1_apply_configuration.md) \* | | [optional] +**json_patch** | [**v1alpha1_json_patch_t**](v1alpha1_json_patch.md) \* | | [optional] +**patch_type** | **char \*** | patchType indicates the patch strategy used. Allowed values are \"ApplyConfiguration\" and \"JSONPatch\". Required. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_pod_certificate_request.md b/kubernetes/docs/v1alpha1_pod_certificate_request.md new file mode 100644 index 00000000..71ad6473 --- /dev/null +++ b/kubernetes/docs/v1alpha1_pod_certificate_request.md @@ -0,0 +1,14 @@ +# v1alpha1_pod_certificate_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha1_pod_certificate_request_spec_t**](v1alpha1_pod_certificate_request_spec.md) \* | | +**status** | [**v1alpha1_pod_certificate_request_status_t**](v1alpha1_pod_certificate_request_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_pod_certificate_request_list.md b/kubernetes/docs/v1alpha1_pod_certificate_request_list.md new file mode 100644 index 00000000..a5fb242c --- /dev/null +++ b/kubernetes/docs/v1alpha1_pod_certificate_request_list.md @@ -0,0 +1,13 @@ +# v1alpha1_pod_certificate_request_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha1_pod_certificate_request.md) \* | items is a collection of PodCertificateRequest objects | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_pod_certificate_request_spec.md b/kubernetes/docs/v1alpha1_pod_certificate_request_spec.md new file mode 100644 index 00000000..a6299a40 --- /dev/null +++ b/kubernetes/docs/v1alpha1_pod_certificate_request_spec.md @@ -0,0 +1,19 @@ +# v1alpha1_pod_certificate_request_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max_expiration_seconds** | **int** | maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours. | [optional] +**node_name** | **char \*** | nodeName is the name of the node the pod is assigned to. | +**node_uid** | **char \*** | nodeUID is the UID of the node the pod is assigned to. | +**pkix_public_key** | **char \*** | pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field. | +**pod_name** | **char \*** | podName is the name of the pod into which the certificate will be mounted. | +**pod_uid** | **char \*** | podUID is the UID of the pod into which the certificate will be mounted. | +**proof_of_possession** | **char \*** | proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign). | +**service_account_name** | **char \*** | serviceAccountName is the name of the service account the pod is running as. | +**service_account_uid** | **char \*** | serviceAccountUID is the UID of the service account the pod is running as. | +**signer_name** | **char \*** | signerName indicates the requested signer. All signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_pod_certificate_request_status.md b/kubernetes/docs/v1alpha1_pod_certificate_request_status.md new file mode 100644 index 00000000..6b032ee8 --- /dev/null +++ b/kubernetes/docs/v1alpha1_pod_certificate_request_status.md @@ -0,0 +1,14 @@ +# v1alpha1_pod_certificate_request_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**begin_refresh_at** | **char \*** | beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable. This field is only a hint. Kubelet may start refreshing before or after this time if necessary. | [optional] +**certificate_chain** | **char \*** | certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificateChain must consist of one or more PEM-formatted certificates. 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as described in section 4 of RFC5280. If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers. | [optional] +**conditions** | [**list_t**](v1_condition.md) \* | conditions applied to the request. The types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\". If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field. | [optional] +**not_after** | **char \*** | notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. | [optional] +**not_before** | **char \*** | notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha1_validating_admission_policy_binding_list.md b/kubernetes/docs/v1alpha1_validating_admission_policy_binding_list.md index d35cdee5..2f9542cd 100644 --- a/kubernetes/docs/v1alpha1_validating_admission_policy_binding_list.md +++ b/kubernetes/docs/v1alpha1_validating_admission_policy_binding_list.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**list_t**](v1alpha1_validating_admission_policy_binding.md) \* | List of PolicyBinding. | [optional] +**items** | [**list_t**](v1alpha1_validating_admission_policy_binding.md) \* | List of PolicyBinding. | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] diff --git a/kubernetes/docs/v1alpha1_validating_admission_policy_list.md b/kubernetes/docs/v1alpha1_validating_admission_policy_list.md index c6dbe448..5cd42f16 100644 --- a/kubernetes/docs/v1alpha1_validating_admission_policy_list.md +++ b/kubernetes/docs/v1alpha1_validating_admission_policy_list.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**list_t**](v1alpha1_validating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | [optional] +**items** | [**list_t**](v1alpha1_validating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] diff --git a/kubernetes/docs/v1alpha2_lease_candidate.md b/kubernetes/docs/v1alpha2_lease_candidate.md new file mode 100644 index 00000000..05fab96d --- /dev/null +++ b/kubernetes/docs/v1alpha2_lease_candidate.md @@ -0,0 +1,13 @@ +# v1alpha2_lease_candidate_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha2_lease_candidate_spec_t**](v1alpha2_lease_candidate_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha2_lease_candidate_list.md b/kubernetes/docs/v1alpha2_lease_candidate_list.md new file mode 100644 index 00000000..e7624479 --- /dev/null +++ b/kubernetes/docs/v1alpha2_lease_candidate_list.md @@ -0,0 +1,13 @@ +# v1alpha2_lease_candidate_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha2_lease_candidate.md) \* | items is a list of schema objects. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha2_lease_candidate_spec.md b/kubernetes/docs/v1alpha2_lease_candidate_spec.md new file mode 100644 index 00000000..0ee1759a --- /dev/null +++ b/kubernetes/docs/v1alpha2_lease_candidate_spec.md @@ -0,0 +1,15 @@ +# v1alpha2_lease_candidate_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_version** | **char \*** | BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required. | +**emulation_version** | **char \*** | EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\" | [optional] +**lease_name** | **char \*** | LeaseName is the name of the lease for which this candidate is contending. This field is immutable. | +**ping_time** | **char \*** | PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime. | [optional] +**renew_time** | **char \*** | RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates. | [optional] +**strategy** | **char \*** | Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_allocated_device_status.md b/kubernetes/docs/v1alpha3_allocated_device_status.md new file mode 100644 index 00000000..b7f79001 --- /dev/null +++ b/kubernetes/docs/v1alpha3_allocated_device_status.md @@ -0,0 +1,15 @@ +# v1alpha3_allocated_device_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**list_t**](v1_condition.md) \* | Conditions contains the latest observation of the device's state. If the device has been configured according to the class and claim config references, the `Ready` condition should be True. Must not contain more than 8 entries. | [optional] +**data** | [**object_t**](.md) \* | Data contains arbitrary driver-specific data. The length of the raw data must be smaller or equal to 10 Ki. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**network_data** | [**v1alpha3_network_device_data_t**](v1alpha3_network_device_data.md) \* | | [optional] +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_allocation_result.md b/kubernetes/docs/v1alpha3_allocation_result.md new file mode 100644 index 00000000..3423f33f --- /dev/null +++ b/kubernetes/docs/v1alpha3_allocation_result.md @@ -0,0 +1,11 @@ +# v1alpha3_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**v1alpha3_device_allocation_result_t**](v1alpha3_device_allocation_result.md) \* | | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_basic_device.md b/kubernetes/docs/v1alpha3_basic_device.md new file mode 100644 index 00000000..bf46a12d --- /dev/null +++ b/kubernetes/docs/v1alpha3_basic_device.md @@ -0,0 +1,16 @@ +# v1alpha3_basic_device_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**attributes** | **list_t*** | Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**capacity** | **list_t*** | Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**consumes_counters** | [**list_t**](v1alpha3_device_counter_consumption.md) \* | ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The total number of device counter consumption entries must be <= 32. In addition, the total number in the entire ResourceSlice must be <= 1024 (for example, 64 devices with 16 counters each). | [optional] +**node_name** | **char \*** | NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**taints** | [**list_t**](v1alpha3_device_taint.md) \* | If specified, these are the driver-defined taints. The maximum number of taints is 4. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_cel_device_selector.md b/kubernetes/docs/v1alpha3_cel_device_selector.md new file mode 100644 index 00000000..dd881b08 --- /dev/null +++ b/kubernetes/docs/v1alpha3_cel_device_selector.md @@ -0,0 +1,10 @@ +# v1alpha3_cel_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_counter.md b/kubernetes/docs/v1alpha3_counter.md new file mode 100644 index 00000000..15b813a6 --- /dev/null +++ b/kubernetes/docs/v1alpha3_counter.md @@ -0,0 +1,10 @@ +# v1alpha3_counter_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **char \*** | Value defines how much of a certain device counter is available. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_counter_set.md b/kubernetes/docs/v1alpha3_counter_set.md new file mode 100644 index 00000000..042c40d4 --- /dev/null +++ b/kubernetes/docs/v1alpha3_counter_set.md @@ -0,0 +1,11 @@ +# v1alpha3_counter_set_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counters** | **list_t*** | Counters defines the counters that will be consumed by the device. The name of each counter must be unique in that set and must be a DNS label. To ensure this uniqueness, capacities defined by the vendor must be listed without the driver name as domain prefix in their name. All others must be listed with their domain prefix. The maximum number of counters is 32. | +**name** | **char \*** | CounterSet is the name of the set from which the counters defined will be consumed. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device.md b/kubernetes/docs/v1alpha3_device.md new file mode 100644 index 00000000..99c980fb --- /dev/null +++ b/kubernetes/docs/v1alpha3_device.md @@ -0,0 +1,11 @@ +# v1alpha3_device_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basic** | [**v1alpha3_basic_device_t**](v1alpha3_basic_device.md) \* | | [optional] +**name** | **char \*** | Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_allocation_configuration.md b/kubernetes/docs/v1alpha3_device_allocation_configuration.md new file mode 100644 index 00000000..446a0b92 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_allocation_configuration.md @@ -0,0 +1,12 @@ +# v1alpha3_device_allocation_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1alpha3_opaque_device_configuration_t**](v1alpha3_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, its applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] +**source** | **char \*** | Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_allocation_result.md b/kubernetes/docs/v1alpha3_device_allocation_result.md new file mode 100644 index 00000000..edbd1bc6 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_allocation_result.md @@ -0,0 +1,11 @@ +# v1alpha3_device_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1alpha3_device_allocation_configuration.md) \* | This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag. This includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters. | [optional] +**results** | [**list_t**](v1alpha3_device_request_allocation_result.md) \* | Results lists all allocated devices. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_attribute.md b/kubernetes/docs/v1alpha3_device_attribute.md new file mode 100644 index 00000000..2d4d84d5 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_attribute.md @@ -0,0 +1,13 @@ +# v1alpha3_device_attribute_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_bool** | **int** | BoolValue is a true/false value. | [optional] +**_int** | **long** | IntValue is a number. | [optional] +**string** | **char \*** | StringValue is a string. Must not be longer than 64 characters. | [optional] +**version** | **char \*** | VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_claim.md b/kubernetes/docs/v1alpha3_device_claim.md new file mode 100644 index 00000000..d2c9edf3 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_claim.md @@ -0,0 +1,12 @@ +# v1alpha3_device_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1alpha3_device_claim_configuration.md) \* | This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim. | [optional] +**constraints** | [**list_t**](v1alpha3_device_constraint.md) \* | These constraints must be satisfied by the set of devices that get allocated for the claim. | [optional] +**requests** | [**list_t**](v1alpha3_device_request.md) \* | Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_claim_configuration.md b/kubernetes/docs/v1alpha3_device_claim_configuration.md new file mode 100644 index 00000000..c99eb19f --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_claim_configuration.md @@ -0,0 +1,11 @@ +# v1alpha3_device_claim_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1alpha3_opaque_device_configuration_t**](v1alpha3_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, it applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_class.md b/kubernetes/docs/v1alpha3_device_class.md new file mode 100644 index 00000000..70687fca --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_class.md @@ -0,0 +1,13 @@ +# v1alpha3_device_class_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha3_device_class_spec_t**](v1alpha3_device_class_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_class_configuration.md b/kubernetes/docs/v1alpha3_device_class_configuration.md new file mode 100644 index 00000000..a73cfaf2 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_class_configuration.md @@ -0,0 +1,10 @@ +# v1alpha3_device_class_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1alpha3_opaque_device_configuration_t**](v1alpha3_opaque_device_configuration.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_class_list.md b/kubernetes/docs/v1alpha3_device_class_list.md new file mode 100644 index 00000000..be9ee98f --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_class_list.md @@ -0,0 +1,13 @@ +# v1alpha3_device_class_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha3_device_class.md) \* | Items is the list of resource classes. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_class_spec.md b/kubernetes/docs/v1alpha3_device_class_spec.md new file mode 100644 index 00000000..0b8d7fc7 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_class_spec.md @@ -0,0 +1,11 @@ +# v1alpha3_device_class_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1alpha3_device_class_configuration.md) \* | Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver. They are passed to the driver, but are not considered while allocating the claim. | [optional] +**selectors** | [**list_t**](v1alpha3_device_selector.md) \* | Each selector must be satisfied by a device which is claimed via this class. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_constraint.md b/kubernetes/docs/v1alpha3_device_constraint.md new file mode 100644 index 00000000..0ec4c917 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_constraint.md @@ -0,0 +1,11 @@ +# v1alpha3_device_constraint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**match_attribute** | **char \*** | MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices. For example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen. Must include the domain qualifier. | [optional] +**requests** | **list_t \*** | Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the constraint applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_counter_consumption.md b/kubernetes/docs/v1alpha3_device_counter_consumption.md new file mode 100644 index 00000000..2911fbc6 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_counter_consumption.md @@ -0,0 +1,11 @@ +# v1alpha3_device_counter_consumption_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counter_set** | **char \*** | CounterSet defines the set from which the counters defined will be consumed. | +**counters** | **list_t*** | Counters defines the Counter that will be consumed by the device. The maximum number counters in a device is 32. In addition, the maximum number of all counters in all devices is 1024 (for example, 64 devices with 16 counters each). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_request.md b/kubernetes/docs/v1alpha3_device_request.md new file mode 100644 index 00000000..152d4d4e --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_request.md @@ -0,0 +1,17 @@ +# v1alpha3_device_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This request is for all of the matching devices in a pool. At least one device must exist on the node for the allocation to succeed. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request. A class is required if no subrequests are specified in the firstAvailable list and no class can be set if subrequests are specified in the firstAvailable list. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | [optional] +**first_available** | [**list_t**](v1alpha3_device_sub_request.md) \* | FirstAvailable contains subrequests, of which exactly one will be satisfied by the scheduler to satisfy this request. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one cannot be used. This field may only be set in the entries of DeviceClaim.Requests. DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later. | [optional] +**name** | **char \*** | Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. Must be a DNS label. | +**selectors** | [**list_t**](v1alpha3_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. | [optional] +**tolerations** | [**list_t**](v1alpha3_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_request_allocation_result.md b/kubernetes/docs/v1alpha3_device_request_allocation_result.md new file mode 100644 index 00000000..9db195c8 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_request_allocation_result.md @@ -0,0 +1,15 @@ +# v1alpha3_device_request_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | +**request** | **char \*** | Request is the name of the request in the claim which caused this device to be allocated. If it references a subrequest in the firstAvailable list on a DeviceRequest, this field must include both the name of the main request and the subrequest using the format <main request>/<subrequest>. Multiple devices may have been allocated per request. | +**tolerations** | [**list_t**](v1alpha3_device_toleration.md) \* | A copy of all tolerations specified in the request at the time when the device got allocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_selector.md b/kubernetes/docs/v1alpha3_device_selector.md new file mode 100644 index 00000000..e9e4e87f --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_selector.md @@ -0,0 +1,10 @@ +# v1alpha3_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cel** | [**v1alpha3_cel_device_selector_t**](v1alpha3_cel_device_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_sub_request.md b/kubernetes/docs/v1alpha3_device_sub_request.md new file mode 100644 index 00000000..e40377f0 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_sub_request.md @@ -0,0 +1,15 @@ +# v1alpha3_device_sub_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This request is for all of the matching devices in a pool. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest. A class is required. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | +**name** | **char \*** | Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format <main request>/<subrequest>. Must be a DNS label. | +**selectors** | [**list_t**](v1alpha3_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered. | [optional] +**tolerations** | [**list_t**](v1alpha3_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_taint.md b/kubernetes/docs/v1alpha3_device_taint.md new file mode 100644 index 00000000..d5466af9 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_taint.md @@ -0,0 +1,13 @@ +# v1alpha3_device_taint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. | +**key** | **char \*** | The taint key to be applied to a device. Must be a label name. | +**time_added** | **char \*** | TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set. | [optional] +**value** | **char \*** | The taint value corresponding to the taint key. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_taint_rule.md b/kubernetes/docs/v1alpha3_device_taint_rule.md new file mode 100644 index 00000000..a3d8ac43 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_taint_rule.md @@ -0,0 +1,13 @@ +# v1alpha3_device_taint_rule_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha3_device_taint_rule_spec_t**](v1alpha3_device_taint_rule_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_taint_rule_list.md b/kubernetes/docs/v1alpha3_device_taint_rule_list.md new file mode 100644 index 00000000..059bd7d3 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_taint_rule_list.md @@ -0,0 +1,13 @@ +# v1alpha3_device_taint_rule_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha3_device_taint_rule.md) \* | Items is the list of DeviceTaintRules. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_taint_rule_spec.md b/kubernetes/docs/v1alpha3_device_taint_rule_spec.md new file mode 100644 index 00000000..97b5c9fa --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_taint_rule_spec.md @@ -0,0 +1,11 @@ +# v1alpha3_device_taint_rule_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device_selector** | [**v1alpha3_device_taint_selector_t**](v1alpha3_device_taint_selector.md) \* | | [optional] +**taint** | [**v1alpha3_device_taint_t**](v1alpha3_device_taint.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_taint_selector.md b/kubernetes/docs/v1alpha3_device_taint_selector.md new file mode 100644 index 00000000..bf748778 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_taint_selector.md @@ -0,0 +1,14 @@ +# v1alpha3_device_taint_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device** | **char \*** | If device is set, only devices with that name are selected. This field corresponds to slice.spec.devices[].name. Setting also driver and pool may be required to avoid ambiguity, but is not required. | [optional] +**device_class_name** | **char \*** | If DeviceClassName is set, the selectors defined there must be satisfied by a device to be selected. This field corresponds to class.metadata.name. | [optional] +**driver** | **char \*** | If driver is set, only devices from that driver are selected. This fields corresponds to slice.spec.driver. | [optional] +**pool** | **char \*** | If pool is set, only devices in that pool are selected. Also setting the driver name may be useful to avoid ambiguity when different drivers use the same pool name, but this is not required because selecting pools from different drivers may also be useful, for example when drivers with node-local devices use the node name as their pool name. | [optional] +**selectors** | [**list_t**](v1alpha3_device_selector.md) \* | Selectors contains the same selection criteria as a ResourceClaim. Currently, CEL expressions are supported. All of these selectors must be satisfied. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_device_toleration.md b/kubernetes/docs/v1alpha3_device_toleration.md new file mode 100644 index 00000000..648597b9 --- /dev/null +++ b/kubernetes/docs/v1alpha3_device_toleration.md @@ -0,0 +1,14 @@ +# v1alpha3_device_toleration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule and NoExecute. | [optional] +**key** | **char \*** | Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name. | [optional] +**_operator** | **char \*** | Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a ResourceClaim can tolerate all taints of a particular category. | [optional] +**toleration_seconds** | **long** | TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. If larger than zero, the time when the pod needs to be evicted is calculated as <time when taint was adedd> + <toleration seconds>. | [optional] +**value** | **char \*** | Value is the taint value the toleration matches to. If the operator is Exists, the value must be empty, otherwise just a regular string. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_network_device_data.md b/kubernetes/docs/v1alpha3_network_device_data.md new file mode 100644 index 00000000..efd68d48 --- /dev/null +++ b/kubernetes/docs/v1alpha3_network_device_data.md @@ -0,0 +1,12 @@ +# v1alpha3_network_device_data_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hardware_address** | **char \*** | HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. Must not be longer than 128 characters. | [optional] +**interface_name** | **char \*** | InterfaceName specifies the name of the network interface associated with the allocated device. This might be the name of a physical or virtual network interface being configured in the pod. Must not be longer than 256 characters. | [optional] +**ips** | **list_t \*** | IPs lists the network addresses assigned to the device's network interface. This can include both IPv4 and IPv6 addresses. The IPs are in the CIDR notation, which includes both the address and the associated subnet mask. e.g.: \"192.0.2.5/24\" for IPv4 and \"2001:db8::5/64\" for IPv6. Must not contain more than 16 entries. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_opaque_device_configuration.md b/kubernetes/docs/v1alpha3_opaque_device_configuration.md new file mode 100644 index 00000000..d3333c2a --- /dev/null +++ b/kubernetes/docs/v1alpha3_opaque_device_configuration.md @@ -0,0 +1,11 @@ +# v1alpha3_opaque_device_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**driver** | **char \*** | Driver is used to determine which kubelet plugin needs to be passed these configuration parameters. An admission policy provided by the driver developer could use this to decide whether it needs to validate them. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**parameters** | [**object_t**](.md) \* | Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions. The length of the raw data must be smaller or equal to 10 Ki. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_pod_scheduling_context.md b/kubernetes/docs/v1alpha3_pod_scheduling_context.md new file mode 100644 index 00000000..0447fe25 --- /dev/null +++ b/kubernetes/docs/v1alpha3_pod_scheduling_context.md @@ -0,0 +1,14 @@ +# v1alpha3_pod_scheduling_context_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha3_pod_scheduling_context_spec_t**](v1alpha3_pod_scheduling_context_spec.md) \* | | +**status** | [**v1alpha3_pod_scheduling_context_status_t**](v1alpha3_pod_scheduling_context_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_pod_scheduling_context_list.md b/kubernetes/docs/v1alpha3_pod_scheduling_context_list.md new file mode 100644 index 00000000..ed02452c --- /dev/null +++ b/kubernetes/docs/v1alpha3_pod_scheduling_context_list.md @@ -0,0 +1,13 @@ +# v1alpha3_pod_scheduling_context_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha3_pod_scheduling_context.md) \* | Items is the list of PodSchedulingContext objects. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_pod_scheduling_context_spec.md b/kubernetes/docs/v1alpha3_pod_scheduling_context_spec.md new file mode 100644 index 00000000..d1e0c52d --- /dev/null +++ b/kubernetes/docs/v1alpha3_pod_scheduling_context_spec.md @@ -0,0 +1,11 @@ +# v1alpha3_pod_scheduling_context_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**potential_nodes** | **list_t \*** | PotentialNodes lists nodes where the Pod might be able to run. The size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced. | [optional] +**selected_node** | **char \*** | SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_pod_scheduling_context_status.md b/kubernetes/docs/v1alpha3_pod_scheduling_context_status.md new file mode 100644 index 00000000..637a1aa3 --- /dev/null +++ b/kubernetes/docs/v1alpha3_pod_scheduling_context_status.md @@ -0,0 +1,10 @@ +# v1alpha3_pod_scheduling_context_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_claims** | [**list_t**](v1alpha3_resource_claim_scheduling_status.md) \* | ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim.md b/kubernetes/docs/v1alpha3_resource_claim.md new file mode 100644 index 00000000..4d6a8218 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim.md @@ -0,0 +1,14 @@ +# v1alpha3_resource_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha3_resource_claim_spec_t**](v1alpha3_resource_claim_spec.md) \* | | +**status** | [**v1alpha3_resource_claim_status_t**](v1alpha3_resource_claim_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_consumer_reference.md b/kubernetes/docs/v1alpha3_resource_claim_consumer_reference.md new file mode 100644 index 00000000..210b98f8 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_consumer_reference.md @@ -0,0 +1,13 @@ +# v1alpha3_resource_claim_consumer_reference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_group** | **char \*** | APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources. | [optional] +**name** | **char \*** | Name is the name of resource being referenced. | +**resource** | **char \*** | Resource is the type of resource being referenced, for example \"pods\". | +**uid** | **char \*** | UID identifies exactly one incarnation of the resource. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_list.md b/kubernetes/docs/v1alpha3_resource_claim_list.md new file mode 100644 index 00000000..b13a6ec6 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_list.md @@ -0,0 +1,13 @@ +# v1alpha3_resource_claim_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha3_resource_claim.md) \* | Items is the list of resource claims. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_scheduling_status.md b/kubernetes/docs/v1alpha3_resource_claim_scheduling_status.md new file mode 100644 index 00000000..d56de715 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_scheduling_status.md @@ -0,0 +1,11 @@ +# v1alpha3_resource_claim_scheduling_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **char \*** | Name matches the pod.spec.resourceClaims[*].Name field. | +**unsuitable_nodes** | **list_t \*** | UnsuitableNodes lists nodes that the ResourceClaim cannot be allocated for. The size of this field is limited to 128, the same as for PodSchedulingSpec.PotentialNodes. This may get increased in the future, but not reduced. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_spec.md b/kubernetes/docs/v1alpha3_resource_claim_spec.md new file mode 100644 index 00000000..ca556677 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_spec.md @@ -0,0 +1,10 @@ +# v1alpha3_resource_claim_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**v1alpha3_device_claim_t**](v1alpha3_device_claim.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_status.md b/kubernetes/docs/v1alpha3_resource_claim_status.md new file mode 100644 index 00000000..3d020eda --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_status.md @@ -0,0 +1,12 @@ +# v1alpha3_resource_claim_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation** | [**v1alpha3_allocation_result_t**](v1alpha3_allocation_result.md) \* | | [optional] +**devices** | [**list_t**](v1alpha3_allocated_device_status.md) \* | Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers. | [optional] +**reserved_for** | [**list_t**](v1alpha3_resource_claim_consumer_reference.md) \* | ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated. In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled. Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again. There can be at most 256 such reservations. This may get increased in the future, but not reduced. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_template.md b/kubernetes/docs/v1alpha3_resource_claim_template.md new file mode 100644 index 00000000..52686c7c --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_template.md @@ -0,0 +1,13 @@ +# v1alpha3_resource_claim_template_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha3_resource_claim_template_spec_t**](v1alpha3_resource_claim_template_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_template_list.md b/kubernetes/docs/v1alpha3_resource_claim_template_list.md new file mode 100644 index 00000000..affb3114 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_template_list.md @@ -0,0 +1,13 @@ +# v1alpha3_resource_claim_template_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha3_resource_claim_template.md) \* | Items is the list of resource claim templates. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_claim_template_spec.md b/kubernetes/docs/v1alpha3_resource_claim_template_spec.md new file mode 100644 index 00000000..fc3e3bf3 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_claim_template_spec.md @@ -0,0 +1,11 @@ +# v1alpha3_resource_claim_template_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha3_resource_claim_spec_t**](v1alpha3_resource_claim_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_pool.md b/kubernetes/docs/v1alpha3_resource_pool.md new file mode 100644 index 00000000..0acd457d --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_pool.md @@ -0,0 +1,12 @@ +# v1alpha3_resource_pool_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**generation** | **long** | Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted. Combined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state. | +**name** | **char \*** | Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. It must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable. | +**resource_slice_count** | **long** | ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero. Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_slice.md b/kubernetes/docs/v1alpha3_resource_slice.md new file mode 100644 index 00000000..37bef8cf --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_slice.md @@ -0,0 +1,13 @@ +# v1alpha3_resource_slice_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1alpha3_resource_slice_spec_t**](v1alpha3_resource_slice_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_slice_list.md b/kubernetes/docs/v1alpha3_resource_slice_list.md new file mode 100644 index 00000000..642d37cf --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_slice_list.md @@ -0,0 +1,13 @@ +# v1alpha3_resource_slice_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1alpha3_resource_slice.md) \* | Items is the list of resource ResourceSlices. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1alpha3_resource_slice_spec.md b/kubernetes/docs/v1alpha3_resource_slice_spec.md new file mode 100644 index 00000000..b9c14b63 --- /dev/null +++ b/kubernetes/docs/v1alpha3_resource_slice_spec.md @@ -0,0 +1,17 @@ +# v1alpha3_resource_slice_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the resources in the pool. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**devices** | [**list_t**](v1alpha3_device.md) \* | Devices lists some or all of the devices in this pool. Must not have more than 128 entries. | [optional] +**driver** | **char \*** | Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable. | +**node_name** | **char \*** | NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node. This field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**per_device_node_selection** | **int** | PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**pool** | [**v1alpha3_resource_pool_t**](v1alpha3_resource_pool.md) \* | | +**shared_counters** | [**list_t**](v1alpha3_counter_set.md) \* | SharedCounters defines a list of counter sets, each of which has a name and a list of counters available. The names of the SharedCounters must be unique in the ResourceSlice. The maximum number of SharedCounters is 32. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_allocated_device_status.md b/kubernetes/docs/v1beta1_allocated_device_status.md new file mode 100644 index 00000000..e44841cc --- /dev/null +++ b/kubernetes/docs/v1beta1_allocated_device_status.md @@ -0,0 +1,16 @@ +# v1beta1_allocated_device_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**list_t**](v1_condition.md) \* | Conditions contains the latest observation of the device's state. If the device has been configured according to the class and claim config references, the `Ready` condition should be True. Must not contain more than 8 entries. | [optional] +**data** | [**object_t**](.md) \* | Data contains arbitrary driver-specific data. The length of the raw data must be smaller or equal to 10 Ki. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**network_data** | [**v1beta1_network_device_data_t**](v1beta1_network_device_data.md) \* | | [optional] +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | +**share_id** | **char \*** | ShareID uniquely identifies an individual allocation share of the device. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_allocation_result.md b/kubernetes/docs/v1beta1_allocation_result.md new file mode 100644 index 00000000..16de5ba8 --- /dev/null +++ b/kubernetes/docs/v1beta1_allocation_result.md @@ -0,0 +1,12 @@ +# v1beta1_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation_timestamp** | **char \*** | AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate. | [optional] +**devices** | [**v1beta1_device_allocation_result_t**](v1beta1_device_allocation_result.md) \* | | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_apply_configuration.md b/kubernetes/docs/v1beta1_apply_configuration.md new file mode 100644 index 00000000..02e598ce --- /dev/null +++ b/kubernetes/docs/v1beta1_apply_configuration.md @@ -0,0 +1,10 @@ +# v1beta1_apply_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field: Object{ spec: Object.spec{ serviceAccountName: \"example\" } } Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration. CEL expressions have access to the object types needed to create apply configurations: - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers') CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables: - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value. For example, a variable named 'foo' can be accessed as 'variables.foo'. - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request. See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the request resource. The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible. Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_basic_device.md b/kubernetes/docs/v1beta1_basic_device.md new file mode 100644 index 00000000..7e420845 --- /dev/null +++ b/kubernetes/docs/v1beta1_basic_device.md @@ -0,0 +1,20 @@ +# v1beta1_basic_device_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**allow_multiple_allocations** | **int** | AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. If AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. | [optional] +**attributes** | **list_t*** | Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**binding_conditions** | **list_t \*** | BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod. The maximum number of binding conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binding_failure_conditions** | **list_t \*** | BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is true, a binding failure occurred. The maximum number of binding failure conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binds_to_node** | **int** | BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**capacity** | **list_t*** | Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**consumes_counters** | [**list_t**](v1beta1_device_counter_consumption.md) \* | ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The total number of device counter consumption entries must be <= 32. In addition, the total number in the entire ResourceSlice must be <= 1024 (for example, 64 devices with 16 counters each). | [optional] +**node_name** | **char \*** | NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**taints** | [**list_t**](v1beta1_device_taint.md) \* | If specified, these are the driver-defined taints. The maximum number of taints is 4. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_capacity_request_policy.md b/kubernetes/docs/v1beta1_capacity_request_policy.md new file mode 100644 index 00000000..d2a1a7a7 --- /dev/null +++ b/kubernetes/docs/v1beta1_capacity_request_policy.md @@ -0,0 +1,12 @@ +# v1beta1_capacity_request_policy_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_default** | **char \*** | Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity. | [optional] +**valid_range** | [**v1beta1_capacity_request_policy_range_t**](v1beta1_capacity_request_policy_range.md) \* | | [optional] +**valid_values** | **list_t \*** | ValidValues defines a set of acceptable quantity values in consuming requests. Must not contain more than 10 entries. Must be sorted in ascending order. If this field is set, Default must be defined and it must be included in ValidValues list. If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues). If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_capacity_request_policy_range.md b/kubernetes/docs/v1beta1_capacity_request_policy_range.md new file mode 100644 index 00000000..91f7e269 --- /dev/null +++ b/kubernetes/docs/v1beta1_capacity_request_policy_range.md @@ -0,0 +1,12 @@ +# v1beta1_capacity_request_policy_range_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max** | **char \*** | Max defines the upper limit for capacity that can be requested. Max must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum. | [optional] +**min** | **char \*** | Min specifies the minimum capacity allowed for a consumption request. Min must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum. | +**step** | **char \*** | Step defines the step size between valid capacity amounts within the range. Max (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_capacity_requirements.md b/kubernetes/docs/v1beta1_capacity_requirements.md new file mode 100644 index 00000000..bc5269ac --- /dev/null +++ b/kubernetes/docs/v1beta1_capacity_requirements.md @@ -0,0 +1,10 @@ +# v1beta1_capacity_requirements_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | **list_t*** | Requests represent individual device resource requests for distinct resources, all of which must be provided by the device. This value is used as an additional filtering condition against the available capacity on the device. This is semantically equivalent to a CEL selector with `device.capacity[<domain>].<name>.compareTo(quantity(<request quantity>)) >= 0`. For example, device.capacity['test-driver.cdi.k8s.io'].counters.compareTo(quantity('2')) >= 0. When a requestPolicy is defined, the requested amount is adjusted upward to the nearest valid value based on the policy. If the requested amount cannot be adjusted to a valid value—because it exceeds what the requestPolicy allows— the device is considered ineligible for allocation. For any capacity that is not explicitly requested: - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity (i.e., the whole device is claimed). - If a requestPolicy is set, the default consumed capacity is determined according to that policy. If the device allows multiple allocation, the aggregated amount across all requests must not exceed the capacity value. The consumed capacity, which may be adjusted based on the requestPolicy if defined, is recorded in the resource claim’s status.devices[*].consumedCapacity field. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_cel_device_selector.md b/kubernetes/docs/v1beta1_cel_device_selector.md new file mode 100644 index 00000000..d4f69dd0 --- /dev/null +++ b/kubernetes/docs/v1beta1_cel_device_selector.md @@ -0,0 +1,10 @@ +# v1beta1_cel_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device (v1.34+ with the DRAConsumableCapacity feature enabled). Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_cluster_trust_bundle.md b/kubernetes/docs/v1beta1_cluster_trust_bundle.md new file mode 100644 index 00000000..e24b9edb --- /dev/null +++ b/kubernetes/docs/v1beta1_cluster_trust_bundle.md @@ -0,0 +1,13 @@ +# v1beta1_cluster_trust_bundle_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_cluster_trust_bundle_spec_t**](v1beta1_cluster_trust_bundle_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_cluster_trust_bundle_list.md b/kubernetes/docs/v1beta1_cluster_trust_bundle_list.md new file mode 100644 index 00000000..01aa079d --- /dev/null +++ b/kubernetes/docs/v1beta1_cluster_trust_bundle_list.md @@ -0,0 +1,13 @@ +# v1beta1_cluster_trust_bundle_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_cluster_trust_bundle.md) \* | items is a collection of ClusterTrustBundle objects | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_cluster_trust_bundle_spec.md b/kubernetes/docs/v1beta1_cluster_trust_bundle_spec.md new file mode 100644 index 00000000..05988d0d --- /dev/null +++ b/kubernetes/docs/v1beta1_cluster_trust_bundle_spec.md @@ -0,0 +1,11 @@ +# v1beta1_cluster_trust_bundle_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**signer_name** | **char \*** | signerName indicates the associated signer, if any. In order to create or update a ClusterTrustBundle that sets signerName, you must have the following cluster-scoped permission: group=certificates.k8s.io resource=signers resourceName=<the signer name> verb=attest. If signerName is not empty, then the ClusterTrustBundle object must be named with the signer name as a prefix (translating slashes to colons). For example, for the signer name `example.com/foo`, valid ClusterTrustBundle object names include `example.com:foo:abc` and `example.com:foo:v1`. If signerName is empty, then the ClusterTrustBundle object's name must not have such a prefix. List/watch requests for ClusterTrustBundles can filter on this field using a `spec.signerName=NAME` field selector. | [optional] +**trust_bundle** | **char \*** | trustBundle contains the individual X.509 trust anchors for this bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. The data must consist only of PEM certificate blocks that parse as valid X.509 certificates. Each certificate must include a basic constraints extension with the CA bit set. The API server will reject objects that contain duplicate certificates, or that use PEM block headers. Users of ClusterTrustBundles, including Kubelet, are free to reorder and deduplicate certificate blocks in this file according to their own logic, as well as to drop PEM block headers and inter-block data. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_counter.md b/kubernetes/docs/v1beta1_counter.md new file mode 100644 index 00000000..d02398da --- /dev/null +++ b/kubernetes/docs/v1beta1_counter.md @@ -0,0 +1,10 @@ +# v1beta1_counter_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **char \*** | Value defines how much of a certain device counter is available. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_counter_set.md b/kubernetes/docs/v1beta1_counter_set.md new file mode 100644 index 00000000..0ef7ac63 --- /dev/null +++ b/kubernetes/docs/v1beta1_counter_set.md @@ -0,0 +1,11 @@ +# v1beta1_counter_set_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counters** | **list_t*** | Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label. The maximum number of counters is 32. | +**name** | **char \*** | Name defines the name of the counter set. It must be a DNS label. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device.md b/kubernetes/docs/v1beta1_device.md new file mode 100644 index 00000000..c57f5d25 --- /dev/null +++ b/kubernetes/docs/v1beta1_device.md @@ -0,0 +1,11 @@ +# v1beta1_device_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basic** | [**v1beta1_basic_device_t**](v1beta1_basic_device.md) \* | | [optional] +**name** | **char \*** | Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_allocation_configuration.md b/kubernetes/docs/v1beta1_device_allocation_configuration.md new file mode 100644 index 00000000..96eee1cf --- /dev/null +++ b/kubernetes/docs/v1beta1_device_allocation_configuration.md @@ -0,0 +1,12 @@ +# v1beta1_device_allocation_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1beta1_opaque_device_configuration_t**](v1beta1_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, its applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] +**source** | **char \*** | Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_allocation_result.md b/kubernetes/docs/v1beta1_device_allocation_result.md new file mode 100644 index 00000000..5276ec89 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_allocation_result.md @@ -0,0 +1,11 @@ +# v1beta1_device_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1beta1_device_allocation_configuration.md) \* | This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag. This includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters. | [optional] +**results** | [**list_t**](v1beta1_device_request_allocation_result.md) \* | Results lists all allocated devices. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_attribute.md b/kubernetes/docs/v1beta1_device_attribute.md new file mode 100644 index 00000000..73731505 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_attribute.md @@ -0,0 +1,13 @@ +# v1beta1_device_attribute_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_bool** | **int** | BoolValue is a true/false value. | [optional] +**_int** | **long** | IntValue is a number. | [optional] +**string** | **char \*** | StringValue is a string. Must not be longer than 64 characters. | [optional] +**version** | **char \*** | VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_capacity.md b/kubernetes/docs/v1beta1_device_capacity.md new file mode 100644 index 00000000..8abdcef1 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_capacity.md @@ -0,0 +1,11 @@ +# v1beta1_device_capacity_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_policy** | [**v1beta1_capacity_request_policy_t**](v1beta1_capacity_request_policy.md) \* | | [optional] +**value** | **char \*** | Value defines how much of a certain capacity that device has. This field reflects the fixed total capacity and does not change. The consumed amount is tracked separately by scheduler and does not affect this value. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_claim.md b/kubernetes/docs/v1beta1_device_claim.md new file mode 100644 index 00000000..afe84300 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_claim.md @@ -0,0 +1,12 @@ +# v1beta1_device_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1beta1_device_claim_configuration.md) \* | This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim. | [optional] +**constraints** | [**list_t**](v1beta1_device_constraint.md) \* | These constraints must be satisfied by the set of devices that get allocated for the claim. | [optional] +**requests** | [**list_t**](v1beta1_device_request.md) \* | Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_claim_configuration.md b/kubernetes/docs/v1beta1_device_claim_configuration.md new file mode 100644 index 00000000..ec5680cc --- /dev/null +++ b/kubernetes/docs/v1beta1_device_claim_configuration.md @@ -0,0 +1,11 @@ +# v1beta1_device_claim_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1beta1_opaque_device_configuration_t**](v1beta1_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, it applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_class.md b/kubernetes/docs/v1beta1_device_class.md new file mode 100644 index 00000000..053f23ec --- /dev/null +++ b/kubernetes/docs/v1beta1_device_class.md @@ -0,0 +1,13 @@ +# v1beta1_device_class_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_device_class_spec_t**](v1beta1_device_class_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_class_configuration.md b/kubernetes/docs/v1beta1_device_class_configuration.md new file mode 100644 index 00000000..81e3d5b9 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_class_configuration.md @@ -0,0 +1,10 @@ +# v1beta1_device_class_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1beta1_opaque_device_configuration_t**](v1beta1_opaque_device_configuration.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_class_list.md b/kubernetes/docs/v1beta1_device_class_list.md new file mode 100644 index 00000000..75e4a786 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_class_list.md @@ -0,0 +1,13 @@ +# v1beta1_device_class_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_device_class.md) \* | Items is the list of resource classes. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_class_spec.md b/kubernetes/docs/v1beta1_device_class_spec.md new file mode 100644 index 00000000..37b17f66 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_class_spec.md @@ -0,0 +1,12 @@ +# v1beta1_device_class_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1beta1_device_class_configuration.md) \* | Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver. They are passed to the driver, but are not considered while allocating the claim. | [optional] +**extended_resource_name** | **char \*** | ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked. This is an alpha field. | [optional] +**selectors** | [**list_t**](v1beta1_device_selector.md) \* | Each selector must be satisfied by a device which is claimed via this class. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_constraint.md b/kubernetes/docs/v1beta1_device_constraint.md new file mode 100644 index 00000000..18889d71 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_constraint.md @@ -0,0 +1,12 @@ +# v1beta1_device_constraint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distinct_attribute** | **char \*** | DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices. This acts as the inverse of MatchAttribute. This constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation. This is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs. | [optional] +**match_attribute** | **char \*** | MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices. For example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen. Must include the domain qualifier. | [optional] +**requests** | **list_t \*** | Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the constraint applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_counter_consumption.md b/kubernetes/docs/v1beta1_device_counter_consumption.md new file mode 100644 index 00000000..368b08c8 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_counter_consumption.md @@ -0,0 +1,11 @@ +# v1beta1_device_counter_consumption_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counter_set** | **char \*** | CounterSet is the name of the set from which the counters defined will be consumed. | +**counters** | **list_t*** | Counters defines the counters that will be consumed by the device. The maximum number counters in a device is 32. In addition, the maximum number of all counters in all devices is 1024 (for example, 64 devices with 16 counters each). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_request.md b/kubernetes/docs/v1beta1_device_request.md new file mode 100644 index 00000000..c9c54d9e --- /dev/null +++ b/kubernetes/docs/v1beta1_device_request.md @@ -0,0 +1,18 @@ +# v1beta1_device_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This request is for all of the matching devices in a pool. At least one device must exist on the node for the allocation to succeed. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**capacity** | [**v1beta1_capacity_requirements_t**](v1beta1_capacity_requirements.md) \* | | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request. A class is required if no subrequests are specified in the firstAvailable list and no class can be set if subrequests are specified in the firstAvailable list. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | [optional] +**first_available** | [**list_t**](v1beta1_device_sub_request.md) \* | FirstAvailable contains subrequests, of which exactly one will be satisfied by the scheduler to satisfy this request. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one cannot be used. This field may only be set in the entries of DeviceClaim.Requests. DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later. | [optional] +**name** | **char \*** | Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. Must be a DNS label and unique among all DeviceRequests in a ResourceClaim. | +**selectors** | [**list_t**](v1beta1_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. | [optional] +**tolerations** | [**list_t**](v1beta1_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_request_allocation_result.md b/kubernetes/docs/v1beta1_device_request_allocation_result.md new file mode 100644 index 00000000..7eda9e9a --- /dev/null +++ b/kubernetes/docs/v1beta1_device_request_allocation_result.md @@ -0,0 +1,19 @@ +# v1beta1_device_request_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**binding_conditions** | **list_t \*** | BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binding_failure_conditions** | **list_t \*** | BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**consumed_capacity** | **list_t*** | ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount). The total consumed capacity for each device must not exceed the DeviceCapacity's Value. This field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | +**request** | **char \*** | Request is the name of the request in the claim which caused this device to be allocated. If it references a subrequest in the firstAvailable list on a DeviceRequest, this field must include both the name of the main request and the subrequest using the format <main request>/<subrequest>. Multiple devices may have been allocated per request. | +**share_id** | **char \*** | ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device. | [optional] +**tolerations** | [**list_t**](v1beta1_device_toleration.md) \* | A copy of all tolerations specified in the request at the time when the device got allocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_selector.md b/kubernetes/docs/v1beta1_device_selector.md new file mode 100644 index 00000000..9aed7f56 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_selector.md @@ -0,0 +1,10 @@ +# v1beta1_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cel** | [**v1beta1_cel_device_selector_t**](v1beta1_cel_device_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_sub_request.md b/kubernetes/docs/v1beta1_device_sub_request.md new file mode 100644 index 00000000..49df6897 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_sub_request.md @@ -0,0 +1,16 @@ +# v1beta1_device_sub_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This subrequest is for all of the matching devices in a pool. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**capacity** | [**v1beta1_capacity_requirements_t**](v1beta1_capacity_requirements.md) \* | | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest. A class is required. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | +**name** | **char \*** | Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format <main request>/<subrequest>. Must be a DNS label. | +**selectors** | [**list_t**](v1beta1_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered. | [optional] +**tolerations** | [**list_t**](v1beta1_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_taint.md b/kubernetes/docs/v1beta1_device_taint.md new file mode 100644 index 00000000..f326ed0b --- /dev/null +++ b/kubernetes/docs/v1beta1_device_taint.md @@ -0,0 +1,13 @@ +# v1beta1_device_taint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. | +**key** | **char \*** | The taint key to be applied to a device. Must be a label name. | +**time_added** | **char \*** | TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set. | [optional] +**value** | **char \*** | The taint value corresponding to the taint key. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_device_toleration.md b/kubernetes/docs/v1beta1_device_toleration.md new file mode 100644 index 00000000..b8ee914d --- /dev/null +++ b/kubernetes/docs/v1beta1_device_toleration.md @@ -0,0 +1,14 @@ +# v1beta1_device_toleration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule and NoExecute. | [optional] +**key** | **char \*** | Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name. | [optional] +**_operator** | **char \*** | Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a ResourceClaim can tolerate all taints of a particular category. | [optional] +**toleration_seconds** | **long** | TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. If larger than zero, the time when the pod needs to be evicted is calculated as <time when taint was adedd> + <toleration seconds>. | [optional] +**value** | **char \*** | Value is the taint value the toleration matches to. If the operator is Exists, the value must be empty, otherwise just a regular string. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_ip_address.md b/kubernetes/docs/v1beta1_ip_address.md new file mode 100644 index 00000000..f070c626 --- /dev/null +++ b/kubernetes/docs/v1beta1_ip_address.md @@ -0,0 +1,13 @@ +# v1beta1_ip_address_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_ip_address_spec_t**](v1beta1_ip_address_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_ip_address_list.md b/kubernetes/docs/v1beta1_ip_address_list.md new file mode 100644 index 00000000..da15e56c --- /dev/null +++ b/kubernetes/docs/v1beta1_ip_address_list.md @@ -0,0 +1,13 @@ +# v1beta1_ip_address_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_ip_address.md) \* | items is the list of IPAddresses. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_ip_address_spec.md b/kubernetes/docs/v1beta1_ip_address_spec.md new file mode 100644 index 00000000..9de346b2 --- /dev/null +++ b/kubernetes/docs/v1beta1_ip_address_spec.md @@ -0,0 +1,10 @@ +# v1beta1_ip_address_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_ref** | [**v1beta1_parent_reference_t**](v1beta1_parent_reference.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_json_patch.md b/kubernetes/docs/v1beta1_json_patch.md new file mode 100644 index 00000000..035d1ce9 --- /dev/null +++ b/kubernetes/docs/v1beta1_json_patch.md @@ -0,0 +1,10 @@ +# v1beta1_json_patch_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec expression must return an array of JSONPatch values. For example, this CEL expression returns a JSON patch to conditionally modify a value: [ JSONPatch{op: \"test\", path: \"/spec/example\", value: \"Red\"}, JSONPatch{op: \"replace\", path: \"/spec/example\", value: \"Green\"} ] To define an object for the patch value, use Object types. For example: [ JSONPatch{ op: \"add\", path: \"/spec/selector\", value: Object.spec.selector{matchLabels: {\"environment\": \"test\"}} } ] To use strings containing '/' and '~' as JSONPatch path keys, use \"jsonpatch.escapeKey\". For example: [ JSONPatch{ op: \"add\", path: \"/metadata/labels/\" + jsonpatch.escapeKey(\"example.com/environment\"), value: \"test\" }, ] CEL expressions have access to the types needed to create JSON patches and objects: - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'. See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string, integer, array, map or object. If set, the 'path' and 'from' fields must be set to a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL function may be used to escape path keys containing '/' and '~'. - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers') CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables: - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value. For example, a variable named 'foo' can be accessed as 'variables.foo'. - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request. See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the request resource. CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as: - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively). Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_lease_candidate.md b/kubernetes/docs/v1beta1_lease_candidate.md new file mode 100644 index 00000000..0902af98 --- /dev/null +++ b/kubernetes/docs/v1beta1_lease_candidate.md @@ -0,0 +1,13 @@ +# v1beta1_lease_candidate_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_lease_candidate_spec_t**](v1beta1_lease_candidate_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_lease_candidate_list.md b/kubernetes/docs/v1beta1_lease_candidate_list.md new file mode 100644 index 00000000..d818aaab --- /dev/null +++ b/kubernetes/docs/v1beta1_lease_candidate_list.md @@ -0,0 +1,13 @@ +# v1beta1_lease_candidate_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_lease_candidate.md) \* | items is a list of schema objects. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_lease_candidate_spec.md b/kubernetes/docs/v1beta1_lease_candidate_spec.md new file mode 100644 index 00000000..7aae48ca --- /dev/null +++ b/kubernetes/docs/v1beta1_lease_candidate_spec.md @@ -0,0 +1,15 @@ +# v1beta1_lease_candidate_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_version** | **char \*** | BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required. | +**emulation_version** | **char \*** | EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\" | [optional] +**lease_name** | **char \*** | LeaseName is the name of the lease for which this candidate is contending. The limits on this field are the same as on Lease.name. Multiple lease candidates may reference the same Lease.name. This field is immutable. | +**ping_time** | **char \*** | PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime. | [optional] +**renew_time** | **char \*** | RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates. | [optional] +**strategy** | **char \*** | Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_mutating_admission_policy.md b/kubernetes/docs/v1beta1_mutating_admission_policy.md new file mode 100644 index 00000000..a0f60b6c --- /dev/null +++ b/kubernetes/docs/v1beta1_mutating_admission_policy.md @@ -0,0 +1,13 @@ +# v1beta1_mutating_admission_policy_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_mutating_admission_policy_spec_t**](v1beta1_mutating_admission_policy_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_mutating_admission_policy_binding.md b/kubernetes/docs/v1beta1_mutating_admission_policy_binding.md new file mode 100644 index 00000000..c47b4178 --- /dev/null +++ b/kubernetes/docs/v1beta1_mutating_admission_policy_binding.md @@ -0,0 +1,13 @@ +# v1beta1_mutating_admission_policy_binding_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_mutating_admission_policy_binding_spec_t**](v1beta1_mutating_admission_policy_binding_spec.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_mutating_admission_policy_binding_list.md b/kubernetes/docs/v1beta1_mutating_admission_policy_binding_list.md new file mode 100644 index 00000000..94e0f01b --- /dev/null +++ b/kubernetes/docs/v1beta1_mutating_admission_policy_binding_list.md @@ -0,0 +1,13 @@ +# v1beta1_mutating_admission_policy_binding_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_mutating_admission_policy_binding.md) \* | List of PolicyBinding. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_mutating_admission_policy_binding_spec.md b/kubernetes/docs/v1beta1_mutating_admission_policy_binding_spec.md new file mode 100644 index 00000000..4c8b34e6 --- /dev/null +++ b/kubernetes/docs/v1beta1_mutating_admission_policy_binding_spec.md @@ -0,0 +1,12 @@ +# v1beta1_mutating_admission_policy_binding_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**match_resources** | [**v1beta1_match_resources_t**](v1beta1_match_resources.md) \* | | [optional] +**param_ref** | [**v1beta1_param_ref_t**](v1beta1_param_ref.md) \* | | [optional] +**policy_name** | **char \*** | policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_mutating_admission_policy_list.md b/kubernetes/docs/v1beta1_mutating_admission_policy_list.md new file mode 100644 index 00000000..abccae58 --- /dev/null +++ b/kubernetes/docs/v1beta1_mutating_admission_policy_list.md @@ -0,0 +1,13 @@ +# v1beta1_mutating_admission_policy_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_mutating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_mutating_admission_policy_spec.md b/kubernetes/docs/v1beta1_mutating_admission_policy_spec.md new file mode 100644 index 00000000..57256a9a --- /dev/null +++ b/kubernetes/docs/v1beta1_mutating_admission_policy_spec.md @@ -0,0 +1,16 @@ +# v1beta1_mutating_admission_policy_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**failure_policy** | **char \*** | failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings. A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource. failurePolicy does not define how validations that evaluate to false are handled. Allowed values are Ignore or Fail. Defaults to Fail. | [optional] +**match_conditions** | [**list_t**](v1beta1_match_condition.md) \* | matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions. The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the policy is skipped. 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the policy is skipped | [optional] +**match_constraints** | [**v1beta1_match_resources_t**](v1beta1_match_resources.md) \* | | [optional] +**mutations** | [**list_t**](v1beta1_mutation.md) \* | mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis. | [optional] +**param_kind** | [**v1beta1_param_kind_t**](v1beta1_param_kind.md) \* | | [optional] +**reinvocation_policy** | **char \*** | reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are \"Never\" and \"IfNeeded\". Never: These mutations will not be called more than once per binding in a single admission evaluation. IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required. | [optional] +**variables** | [**list_t**](v1beta1_variable.md) \* | variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy. The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_mutation.md b/kubernetes/docs/v1beta1_mutation.md new file mode 100644 index 00000000..822a77e5 --- /dev/null +++ b/kubernetes/docs/v1beta1_mutation.md @@ -0,0 +1,12 @@ +# v1beta1_mutation_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apply_configuration** | [**v1beta1_apply_configuration_t**](v1beta1_apply_configuration.md) \* | | [optional] +**json_patch** | [**v1beta1_json_patch_t**](v1beta1_json_patch.md) \* | | [optional] +**patch_type** | **char \*** | patchType indicates the patch strategy used. Allowed values are \"ApplyConfiguration\" and \"JSONPatch\". Required. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_network_device_data.md b/kubernetes/docs/v1beta1_network_device_data.md new file mode 100644 index 00000000..7968e1f1 --- /dev/null +++ b/kubernetes/docs/v1beta1_network_device_data.md @@ -0,0 +1,12 @@ +# v1beta1_network_device_data_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hardware_address** | **char \*** | HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. Must not be longer than 128 characters. | [optional] +**interface_name** | **char \*** | InterfaceName specifies the name of the network interface associated with the allocated device. This might be the name of a physical or virtual network interface being configured in the pod. Must not be longer than 256 characters. | [optional] +**ips** | **list_t \*** | IPs lists the network addresses assigned to the device's network interface. This can include both IPv4 and IPv6 addresses. The IPs are in the CIDR notation, which includes both the address and the associated subnet mask. e.g.: \"192.0.2.5/24\" for IPv4 and \"2001:db8::5/64\" for IPv6. Must not contain more than 16 entries. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_opaque_device_configuration.md b/kubernetes/docs/v1beta1_opaque_device_configuration.md new file mode 100644 index 00000000..4e9b8c6d --- /dev/null +++ b/kubernetes/docs/v1beta1_opaque_device_configuration.md @@ -0,0 +1,11 @@ +# v1beta1_opaque_device_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**driver** | **char \*** | Driver is used to determine which kubelet plugin needs to be passed these configuration parameters. An admission policy provided by the driver developer could use this to decide whether it needs to validate them. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**parameters** | [**object_t**](.md) \* | Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions. The length of the raw data must be smaller or equal to 10 Ki. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_parent_reference.md b/kubernetes/docs/v1beta1_parent_reference.md new file mode 100644 index 00000000..1fa68a3e --- /dev/null +++ b/kubernetes/docs/v1beta1_parent_reference.md @@ -0,0 +1,13 @@ +# v1beta1_parent_reference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | **char \*** | Group is the group of the object being referenced. | [optional] +**name** | **char \*** | Name is the name of the object being referenced. | +**_namespace** | **char \*** | Namespace is the namespace of the object being referenced. | [optional] +**resource** | **char \*** | Resource is the resource of the object being referenced. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim.md b/kubernetes/docs/v1beta1_resource_claim.md new file mode 100644 index 00000000..9979900a --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim.md @@ -0,0 +1,14 @@ +# v1beta1_resource_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_resource_claim_spec_t**](v1beta1_resource_claim_spec.md) \* | | +**status** | [**v1beta1_resource_claim_status_t**](v1beta1_resource_claim_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim_consumer_reference.md b/kubernetes/docs/v1beta1_resource_claim_consumer_reference.md new file mode 100644 index 00000000..4dd8f37b --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim_consumer_reference.md @@ -0,0 +1,13 @@ +# v1beta1_resource_claim_consumer_reference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_group** | **char \*** | APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources. | [optional] +**name** | **char \*** | Name is the name of resource being referenced. | +**resource** | **char \*** | Resource is the type of resource being referenced, for example \"pods\". | +**uid** | **char \*** | UID identifies exactly one incarnation of the resource. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim_list.md b/kubernetes/docs/v1beta1_resource_claim_list.md new file mode 100644 index 00000000..19273419 --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim_list.md @@ -0,0 +1,13 @@ +# v1beta1_resource_claim_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_resource_claim.md) \* | Items is the list of resource claims. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim_spec.md b/kubernetes/docs/v1beta1_resource_claim_spec.md new file mode 100644 index 00000000..3f5b70db --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim_spec.md @@ -0,0 +1,10 @@ +# v1beta1_resource_claim_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**v1beta1_device_claim_t**](v1beta1_device_claim.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim_status.md b/kubernetes/docs/v1beta1_resource_claim_status.md new file mode 100644 index 00000000..4e2467c2 --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim_status.md @@ -0,0 +1,12 @@ +# v1beta1_resource_claim_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation** | [**v1beta1_allocation_result_t**](v1beta1_allocation_result.md) \* | | [optional] +**devices** | [**list_t**](v1beta1_allocated_device_status.md) \* | Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers. | [optional] +**reserved_for** | [**list_t**](v1beta1_resource_claim_consumer_reference.md) \* | ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated. In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled. Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again. There can be at most 256 such reservations. This may get increased in the future, but not reduced. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim_template.md b/kubernetes/docs/v1beta1_resource_claim_template.md new file mode 100644 index 00000000..eccd7238 --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim_template.md @@ -0,0 +1,13 @@ +# v1beta1_resource_claim_template_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_resource_claim_template_spec_t**](v1beta1_resource_claim_template_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim_template_list.md b/kubernetes/docs/v1beta1_resource_claim_template_list.md new file mode 100644 index 00000000..badf15ce --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim_template_list.md @@ -0,0 +1,13 @@ +# v1beta1_resource_claim_template_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_resource_claim_template.md) \* | Items is the list of resource claim templates. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_claim_template_spec.md b/kubernetes/docs/v1beta1_resource_claim_template_spec.md new file mode 100644 index 00000000..f7b1cb3d --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_claim_template_spec.md @@ -0,0 +1,11 @@ +# v1beta1_resource_claim_template_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_resource_claim_spec_t**](v1beta1_resource_claim_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_pool.md b/kubernetes/docs/v1beta1_resource_pool.md new file mode 100644 index 00000000..4fdbe15f --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_pool.md @@ -0,0 +1,12 @@ +# v1beta1_resource_pool_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**generation** | **long** | Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted. Combined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state. | +**name** | **char \*** | Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. It must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable. | +**resource_slice_count** | **long** | ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero. Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_slice.md b/kubernetes/docs/v1beta1_resource_slice.md new file mode 100644 index 00000000..36bf4c7d --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_slice.md @@ -0,0 +1,13 @@ +# v1beta1_resource_slice_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_resource_slice_spec_t**](v1beta1_resource_slice_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_slice_list.md b/kubernetes/docs/v1beta1_resource_slice_list.md new file mode 100644 index 00000000..7bd59616 --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_slice_list.md @@ -0,0 +1,13 @@ +# v1beta1_resource_slice_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_resource_slice.md) \* | Items is the list of resource ResourceSlices. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_resource_slice_spec.md b/kubernetes/docs/v1beta1_resource_slice_spec.md new file mode 100644 index 00000000..a16410c7 --- /dev/null +++ b/kubernetes/docs/v1beta1_resource_slice_spec.md @@ -0,0 +1,17 @@ +# v1beta1_resource_slice_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the resources in the pool. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**devices** | [**list_t**](v1beta1_device.md) \* | Devices lists some or all of the devices in this pool. Must not have more than 128 entries. | [optional] +**driver** | **char \*** | Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable. | +**node_name** | **char \*** | NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node. This field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**per_device_node_selection** | **int** | PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**pool** | [**v1beta1_resource_pool_t**](v1beta1_resource_pool.md) \* | | +**shared_counters** | [**list_t**](v1beta1_counter_set.md) \* | SharedCounters defines a list of counter sets, each of which has a name and a list of counters available. The names of the SharedCounters must be unique in the ResourceSlice. The maximum number of SharedCounters is 32. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_service_cidr.md b/kubernetes/docs/v1beta1_service_cidr.md new file mode 100644 index 00000000..0040cd85 --- /dev/null +++ b/kubernetes/docs/v1beta1_service_cidr.md @@ -0,0 +1,14 @@ +# v1beta1_service_cidr_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta1_service_cidr_spec_t**](v1beta1_service_cidr_spec.md) \* | | [optional] +**status** | [**v1beta1_service_cidr_status_t**](v1beta1_service_cidr_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_service_cidr_list.md b/kubernetes/docs/v1beta1_service_cidr_list.md new file mode 100644 index 00000000..f6ec5901 --- /dev/null +++ b/kubernetes/docs/v1beta1_service_cidr_list.md @@ -0,0 +1,13 @@ +# v1beta1_service_cidr_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_service_cidr.md) \* | items is the list of ServiceCIDRs. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_service_cidr_spec.md b/kubernetes/docs/v1beta1_service_cidr_spec.md new file mode 100644 index 00000000..77f4d431 --- /dev/null +++ b/kubernetes/docs/v1beta1_service_cidr_spec.md @@ -0,0 +1,10 @@ +# v1beta1_service_cidr_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cidrs** | **list_t \*** | CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_service_cidr_status.md b/kubernetes/docs/v1beta1_service_cidr_status.md new file mode 100644 index 00000000..bca3a509 --- /dev/null +++ b/kubernetes/docs/v1beta1_service_cidr_status.md @@ -0,0 +1,10 @@ +# v1beta1_service_cidr_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**list_t**](v1_condition.md) \* | conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. Current service state | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_validating_admission_policy_binding_list.md b/kubernetes/docs/v1beta1_validating_admission_policy_binding_list.md index 956a1cba..1bd6ef88 100644 --- a/kubernetes/docs/v1beta1_validating_admission_policy_binding_list.md +++ b/kubernetes/docs/v1beta1_validating_admission_policy_binding_list.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**list_t**](v1beta1_validating_admission_policy_binding.md) \* | List of PolicyBinding. | [optional] +**items** | [**list_t**](v1beta1_validating_admission_policy_binding.md) \* | List of PolicyBinding. | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] diff --git a/kubernetes/docs/v1beta1_validating_admission_policy_binding_spec.md b/kubernetes/docs/v1beta1_validating_admission_policy_binding_spec.md index a8ff1bf9..b6ab4a13 100644 --- a/kubernetes/docs/v1beta1_validating_admission_policy_binding_spec.md +++ b/kubernetes/docs/v1beta1_validating_admission_policy_binding_spec.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **match_resources** | [**v1beta1_match_resources_t**](v1beta1_match_resources.md) \* | | [optional] **param_ref** | [**v1beta1_param_ref_t**](v1beta1_param_ref.md) \* | | [optional] **policy_name** | **char \*** | PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required. | [optional] -**validation_actions** | **list_t \*** | validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions. Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy. validationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action. The supported actions values are: \"Deny\" specifies that a validation failure results in a denied request. \"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses. \"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]\"` Clients should expect to handle additional values by ignoring any values not recognized. \"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers. Required. | [optional] +**validation_actions** | **list_t \*** | validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions. Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy. validationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action. The supported actions values are: \"Deny\" specifies that a validation failure results in a denied request. \"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses. \"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\\\"message\\\": \\\"Invalid value\\\", {\\\"policy\\\": \\\"policy.example.com\\\", {\\\"binding\\\": \\\"policybinding.example.com\\\", {\\\"expressionIndex\\\": \\\"1\\\", {\\\"validationActions\\\": [\\\"Audit\\\"]}]\"` Clients should expect to handle additional values by ignoring any values not recognized. \"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers. Required. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v1beta1_validating_admission_policy_list.md b/kubernetes/docs/v1beta1_validating_admission_policy_list.md index 5a3a95c1..605b70af 100644 --- a/kubernetes/docs/v1beta1_validating_admission_policy_list.md +++ b/kubernetes/docs/v1beta1_validating_admission_policy_list.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**list_t**](v1beta1_validating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | [optional] +**items** | [**list_t**](v1beta1_validating_admission_policy.md) \* | List of ValidatingAdmissionPolicy. | **kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] **metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] diff --git a/kubernetes/docs/v1beta1_volume_attributes_class.md b/kubernetes/docs/v1beta1_volume_attributes_class.md new file mode 100644 index 00000000..5b9d624e --- /dev/null +++ b/kubernetes/docs/v1beta1_volume_attributes_class.md @@ -0,0 +1,14 @@ +# v1beta1_volume_attributes_class_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**driver_name** | **char \*** | Name of the CSI driver This field is immutable. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**parameters** | **list_t*** | parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta1_volume_attributes_class_list.md b/kubernetes/docs/v1beta1_volume_attributes_class_list.md new file mode 100644 index 00000000..e106068c --- /dev/null +++ b/kubernetes/docs/v1beta1_volume_attributes_class_list.md @@ -0,0 +1,13 @@ +# v1beta1_volume_attributes_class_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta1_volume_attributes_class.md) \* | items is the list of VolumeAttributesClass objects. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_allocated_device_status.md b/kubernetes/docs/v1beta2_allocated_device_status.md new file mode 100644 index 00000000..6ff1ff81 --- /dev/null +++ b/kubernetes/docs/v1beta2_allocated_device_status.md @@ -0,0 +1,16 @@ +# v1beta2_allocated_device_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**list_t**](v1_condition.md) \* | Conditions contains the latest observation of the device's state. If the device has been configured according to the class and claim config references, the `Ready` condition should be True. Must not contain more than 8 entries. | [optional] +**data** | [**object_t**](.md) \* | Data contains arbitrary driver-specific data. The length of the raw data must be smaller or equal to 10 Ki. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**network_data** | [**v1beta2_network_device_data_t**](v1beta2_network_device_data.md) \* | | [optional] +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | +**share_id** | **char \*** | ShareID uniquely identifies an individual allocation share of the device. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_allocation_result.md b/kubernetes/docs/v1beta2_allocation_result.md new file mode 100644 index 00000000..5e7d17c5 --- /dev/null +++ b/kubernetes/docs/v1beta2_allocation_result.md @@ -0,0 +1,12 @@ +# v1beta2_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation_timestamp** | **char \*** | AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate. | [optional] +**devices** | [**v1beta2_device_allocation_result_t**](v1beta2_device_allocation_result.md) \* | | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_capacity_request_policy.md b/kubernetes/docs/v1beta2_capacity_request_policy.md new file mode 100644 index 00000000..5d3995cc --- /dev/null +++ b/kubernetes/docs/v1beta2_capacity_request_policy.md @@ -0,0 +1,12 @@ +# v1beta2_capacity_request_policy_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_default** | **char \*** | Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity. | [optional] +**valid_range** | [**v1beta2_capacity_request_policy_range_t**](v1beta2_capacity_request_policy_range.md) \* | | [optional] +**valid_values** | **list_t \*** | ValidValues defines a set of acceptable quantity values in consuming requests. Must not contain more than 10 entries. Must be sorted in ascending order. If this field is set, Default must be defined and it must be included in ValidValues list. If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues). If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_capacity_request_policy_range.md b/kubernetes/docs/v1beta2_capacity_request_policy_range.md new file mode 100644 index 00000000..9266fc72 --- /dev/null +++ b/kubernetes/docs/v1beta2_capacity_request_policy_range.md @@ -0,0 +1,12 @@ +# v1beta2_capacity_request_policy_range_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max** | **char \*** | Max defines the upper limit for capacity that can be requested. Max must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum. | [optional] +**min** | **char \*** | Min specifies the minimum capacity allowed for a consumption request. Min must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum. | +**step** | **char \*** | Step defines the step size between valid capacity amounts within the range. Max (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_capacity_requirements.md b/kubernetes/docs/v1beta2_capacity_requirements.md new file mode 100644 index 00000000..d6e39ac1 --- /dev/null +++ b/kubernetes/docs/v1beta2_capacity_requirements.md @@ -0,0 +1,10 @@ +# v1beta2_capacity_requirements_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | **list_t*** | Requests represent individual device resource requests for distinct resources, all of which must be provided by the device. This value is used as an additional filtering condition against the available capacity on the device. This is semantically equivalent to a CEL selector with `device.capacity[<domain>].<name>.compareTo(quantity(<request quantity>)) >= 0`. For example, device.capacity['test-driver.cdi.k8s.io'].counters.compareTo(quantity('2')) >= 0. When a requestPolicy is defined, the requested amount is adjusted upward to the nearest valid value based on the policy. If the requested amount cannot be adjusted to a valid value—because it exceeds what the requestPolicy allows— the device is considered ineligible for allocation. For any capacity that is not explicitly requested: - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity (i.e., the whole device is claimed). - If a requestPolicy is set, the default consumed capacity is determined according to that policy. If the device allows multiple allocation, the aggregated amount across all requests must not exceed the capacity value. The consumed capacity, which may be adjusted based on the requestPolicy if defined, is recorded in the resource claim’s status.devices[*].consumedCapacity field. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_cel_device_selector.md b/kubernetes/docs/v1beta2_cel_device_selector.md new file mode 100644 index 00000000..3d90b1a8 --- /dev/null +++ b/kubernetes/docs/v1beta2_cel_device_selector.md @@ -0,0 +1,10 @@ +# v1beta2_cel_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **char \*** | Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device (v1.34+ with the DRAConsumableCapacity feature enabled). Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_counter.md b/kubernetes/docs/v1beta2_counter.md new file mode 100644 index 00000000..cccb5f39 --- /dev/null +++ b/kubernetes/docs/v1beta2_counter.md @@ -0,0 +1,10 @@ +# v1beta2_counter_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **char \*** | Value defines how much of a certain device counter is available. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_counter_set.md b/kubernetes/docs/v1beta2_counter_set.md new file mode 100644 index 00000000..e3ab427d --- /dev/null +++ b/kubernetes/docs/v1beta2_counter_set.md @@ -0,0 +1,11 @@ +# v1beta2_counter_set_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counters** | **list_t*** | Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label. The maximum number of counters in all sets is 32. | +**name** | **char \*** | Name defines the name of the counter set. It must be a DNS label. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device.md b/kubernetes/docs/v1beta2_device.md new file mode 100644 index 00000000..f9951629 --- /dev/null +++ b/kubernetes/docs/v1beta2_device.md @@ -0,0 +1,21 @@ +# v1beta2_device_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**allow_multiple_allocations** | **int** | AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. If AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. | [optional] +**attributes** | **list_t*** | Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**binding_conditions** | **list_t \*** | BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod. The maximum number of binding conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binding_failure_conditions** | **list_t \*** | BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred. The maximum number of binding failure conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binds_to_node** | **int** | BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**capacity** | **list_t*** | Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. | [optional] +**consumes_counters** | [**list_t**](v1beta2_device_counter_consumption.md) \* | ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The total number of device counter consumption entries must be <= 32. In addition, the total number in the entire ResourceSlice must be <= 1024 (for example, 64 devices with 16 counters each). | [optional] +**name** | **char \*** | Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label. | +**node_name** | **char \*** | NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**taints** | [**list_t**](v1beta2_device_taint.md) \* | If specified, these are the driver-defined taints. The maximum number of taints is 4. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_allocation_configuration.md b/kubernetes/docs/v1beta2_device_allocation_configuration.md new file mode 100644 index 00000000..813e72b4 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_allocation_configuration.md @@ -0,0 +1,12 @@ +# v1beta2_device_allocation_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1beta2_opaque_device_configuration_t**](v1beta2_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, its applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] +**source** | **char \*** | Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_allocation_result.md b/kubernetes/docs/v1beta2_device_allocation_result.md new file mode 100644 index 00000000..0cadf3fd --- /dev/null +++ b/kubernetes/docs/v1beta2_device_allocation_result.md @@ -0,0 +1,11 @@ +# v1beta2_device_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1beta2_device_allocation_configuration.md) \* | This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag. This includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters. | [optional] +**results** | [**list_t**](v1beta2_device_request_allocation_result.md) \* | Results lists all allocated devices. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_attribute.md b/kubernetes/docs/v1beta2_device_attribute.md new file mode 100644 index 00000000..78790ba9 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_attribute.md @@ -0,0 +1,13 @@ +# v1beta2_device_attribute_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_bool** | **int** | BoolValue is a true/false value. | [optional] +**_int** | **long** | IntValue is a number. | [optional] +**string** | **char \*** | StringValue is a string. Must not be longer than 64 characters. | [optional] +**version** | **char \*** | VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_capacity.md b/kubernetes/docs/v1beta2_device_capacity.md new file mode 100644 index 00000000..a91a8384 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_capacity.md @@ -0,0 +1,11 @@ +# v1beta2_device_capacity_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_policy** | [**v1beta2_capacity_request_policy_t**](v1beta2_capacity_request_policy.md) \* | | [optional] +**value** | **char \*** | Value defines how much of a certain capacity that device has. This field reflects the fixed total capacity and does not change. The consumed amount is tracked separately by scheduler and does not affect this value. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_claim.md b/kubernetes/docs/v1beta2_device_claim.md new file mode 100644 index 00000000..8b966073 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_claim.md @@ -0,0 +1,12 @@ +# v1beta2_device_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1beta2_device_claim_configuration.md) \* | This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim. | [optional] +**constraints** | [**list_t**](v1beta2_device_constraint.md) \* | These constraints must be satisfied by the set of devices that get allocated for the claim. | [optional] +**requests** | [**list_t**](v1beta2_device_request.md) \* | Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_claim_configuration.md b/kubernetes/docs/v1beta2_device_claim_configuration.md new file mode 100644 index 00000000..3656472d --- /dev/null +++ b/kubernetes/docs/v1beta2_device_claim_configuration.md @@ -0,0 +1,11 @@ +# v1beta2_device_claim_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1beta2_opaque_device_configuration_t**](v1beta2_opaque_device_configuration.md) \* | | [optional] +**requests** | **list_t \*** | Requests lists the names of requests where the configuration applies. If empty, it applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the configuration applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_class.md b/kubernetes/docs/v1beta2_device_class.md new file mode 100644 index 00000000..a34418a8 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_class.md @@ -0,0 +1,13 @@ +# v1beta2_device_class_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta2_device_class_spec_t**](v1beta2_device_class_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_class_configuration.md b/kubernetes/docs/v1beta2_device_class_configuration.md new file mode 100644 index 00000000..b6384dfb --- /dev/null +++ b/kubernetes/docs/v1beta2_device_class_configuration.md @@ -0,0 +1,10 @@ +# v1beta2_device_class_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opaque** | [**v1beta2_opaque_device_configuration_t**](v1beta2_opaque_device_configuration.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_class_list.md b/kubernetes/docs/v1beta2_device_class_list.md new file mode 100644 index 00000000..3349b266 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_class_list.md @@ -0,0 +1,13 @@ +# v1beta2_device_class_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta2_device_class.md) \* | Items is the list of resource classes. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_class_spec.md b/kubernetes/docs/v1beta2_device_class_spec.md new file mode 100644 index 00000000..3478e827 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_class_spec.md @@ -0,0 +1,12 @@ +# v1beta2_device_class_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**list_t**](v1beta2_device_class_configuration.md) \* | Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver. They are passed to the driver, but are not considered while allocating the claim. | [optional] +**extended_resource_name** | **char \*** | ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked. This is an alpha field. | [optional] +**selectors** | [**list_t**](v1beta2_device_selector.md) \* | Each selector must be satisfied by a device which is claimed via this class. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_constraint.md b/kubernetes/docs/v1beta2_device_constraint.md new file mode 100644 index 00000000..f9cf4f43 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_constraint.md @@ -0,0 +1,12 @@ +# v1beta2_device_constraint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distinct_attribute** | **char \*** | DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices. This acts as the inverse of MatchAttribute. This constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation. This is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs. | [optional] +**match_attribute** | **char \*** | MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices. For example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen. Must include the domain qualifier. | [optional] +**requests** | **list_t \*** | Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim. References to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the constraint applies to all subrequests. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_counter_consumption.md b/kubernetes/docs/v1beta2_device_counter_consumption.md new file mode 100644 index 00000000..df85d2ae --- /dev/null +++ b/kubernetes/docs/v1beta2_device_counter_consumption.md @@ -0,0 +1,11 @@ +# v1beta2_device_counter_consumption_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**counter_set** | **char \*** | CounterSet is the name of the set from which the counters defined will be consumed. | +**counters** | **list_t*** | Counters defines the counters that will be consumed by the device. The maximum number counters in a device is 32. In addition, the maximum number of all counters in all devices is 1024 (for example, 64 devices with 16 counters each). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_request.md b/kubernetes/docs/v1beta2_device_request.md new file mode 100644 index 00000000..ef14f6fc --- /dev/null +++ b/kubernetes/docs/v1beta2_device_request.md @@ -0,0 +1,12 @@ +# v1beta2_device_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exactly** | [**v1beta2_exact_device_request_t**](v1beta2_exact_device_request.md) \* | | [optional] +**first_available** | [**list_t**](v1beta2_device_sub_request.md) \* | FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used. DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later. | [optional] +**name** | **char \*** | Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. References using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler. Must be a DNS label. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_request_allocation_result.md b/kubernetes/docs/v1beta2_device_request_allocation_result.md new file mode 100644 index 00000000..1a370c81 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_request_allocation_result.md @@ -0,0 +1,19 @@ +# v1beta2_device_request_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**binding_conditions** | **list_t \*** | BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**binding_failure_conditions** | **list_t \*** | BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. | [optional] +**consumed_capacity** | **list_t*** | ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount). The total consumed capacity for each device must not exceed the DeviceCapacity's Value. This field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero. | [optional] +**device** | **char \*** | Device references one device instance via its name in the driver's resource pool. It must be a DNS label. | +**driver** | **char \*** | Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**pool** | **char \*** | This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. | +**request** | **char \*** | Request is the name of the request in the claim which caused this device to be allocated. If it references a subrequest in the firstAvailable list on a DeviceRequest, this field must include both the name of the main request and the subrequest using the format <main request>/<subrequest>. Multiple devices may have been allocated per request. | +**share_id** | **char \*** | ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device. | [optional] +**tolerations** | [**list_t**](v1beta2_device_toleration.md) \* | A copy of all tolerations specified in the request at the time when the device got allocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_selector.md b/kubernetes/docs/v1beta2_device_selector.md new file mode 100644 index 00000000..3dd16426 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_selector.md @@ -0,0 +1,10 @@ +# v1beta2_device_selector_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cel** | [**v1beta2_cel_device_selector_t**](v1beta2_cel_device_selector.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_sub_request.md b/kubernetes/docs/v1beta2_device_sub_request.md new file mode 100644 index 00000000..2113265c --- /dev/null +++ b/kubernetes/docs/v1beta2_device_sub_request.md @@ -0,0 +1,16 @@ +# v1beta2_device_sub_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This subrequest is for all of the matching devices in a pool. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**capacity** | [**v1beta2_capacity_requirements_t**](v1beta2_capacity_requirements.md) \* | | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest. A class is required. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | +**name** | **char \*** | Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format <main request>/<subrequest>. Must be a DNS label. | +**selectors** | [**list_t**](v1beta2_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered. | [optional] +**tolerations** | [**list_t**](v1beta2_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_taint.md b/kubernetes/docs/v1beta2_device_taint.md new file mode 100644 index 00000000..d98d254e --- /dev/null +++ b/kubernetes/docs/v1beta2_device_taint.md @@ -0,0 +1,13 @@ +# v1beta2_device_taint_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. | +**key** | **char \*** | The taint key to be applied to a device. Must be a label name. | +**time_added** | **char \*** | TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set. | [optional] +**value** | **char \*** | The taint value corresponding to the taint key. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_device_toleration.md b/kubernetes/docs/v1beta2_device_toleration.md new file mode 100644 index 00000000..035d1005 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_toleration.md @@ -0,0 +1,14 @@ +# v1beta2_device_toleration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | **char \*** | Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule and NoExecute. | [optional] +**key** | **char \*** | Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name. | [optional] +**_operator** | **char \*** | Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a ResourceClaim can tolerate all taints of a particular category. | [optional] +**toleration_seconds** | **long** | TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. If larger than zero, the time when the pod needs to be evicted is calculated as <time when taint was adedd> + <toleration seconds>. | [optional] +**value** | **char \*** | Value is the taint value the toleration matches to. If the operator is Exists, the value must be empty, otherwise just a regular string. Must be a label value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_exact_device_request.md b/kubernetes/docs/v1beta2_exact_device_request.md new file mode 100644 index 00000000..237c2996 --- /dev/null +++ b/kubernetes/docs/v1beta2_exact_device_request.md @@ -0,0 +1,16 @@ +# v1beta2_exact_device_request_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_access** | **int** | AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. | [optional] +**allocation_mode** | **char \*** | AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This request is for all of the matching devices in a pool. At least one device must exist on the node for the allocation to succeed. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. | [optional] +**capacity** | [**v1beta2_capacity_requirements_t**](v1beta2_capacity_requirements.md) \* | | [optional] +**count** | **long** | Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. | [optional] +**device_class_name** | **char \*** | DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request. A DeviceClassName is required. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. | +**selectors** | [**list_t**](v1beta2_device_selector.md) \* | Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered. | [optional] +**tolerations** | [**list_t**](v1beta2_device_toleration.md) \* | If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_network_device_data.md b/kubernetes/docs/v1beta2_network_device_data.md new file mode 100644 index 00000000..9bcee770 --- /dev/null +++ b/kubernetes/docs/v1beta2_network_device_data.md @@ -0,0 +1,12 @@ +# v1beta2_network_device_data_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hardware_address** | **char \*** | HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. Must not be longer than 128 characters. | [optional] +**interface_name** | **char \*** | InterfaceName specifies the name of the network interface associated with the allocated device. This might be the name of a physical or virtual network interface being configured in the pod. Must not be longer than 256 characters. | [optional] +**ips** | **list_t \*** | IPs lists the network addresses assigned to the device's network interface. This can include both IPv4 and IPv6 addresses. The IPs are in the CIDR notation, which includes both the address and the associated subnet mask. e.g.: \"192.0.2.5/24\" for IPv4 and \"2001:db8::5/64\" for IPv6. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_opaque_device_configuration.md b/kubernetes/docs/v1beta2_opaque_device_configuration.md new file mode 100644 index 00000000..611ebc38 --- /dev/null +++ b/kubernetes/docs/v1beta2_opaque_device_configuration.md @@ -0,0 +1,11 @@ +# v1beta2_opaque_device_configuration_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**driver** | **char \*** | Driver is used to determine which kubelet plugin needs to be passed these configuration parameters. An admission policy provided by the driver developer could use this to decide whether it needs to validate them. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. | +**parameters** | [**object_t**](.md) \* | Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions. The length of the raw data must be smaller or equal to 10 Ki. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim.md b/kubernetes/docs/v1beta2_resource_claim.md new file mode 100644 index 00000000..78e5bf7d --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim.md @@ -0,0 +1,14 @@ +# v1beta2_resource_claim_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta2_resource_claim_spec_t**](v1beta2_resource_claim_spec.md) \* | | +**status** | [**v1beta2_resource_claim_status_t**](v1beta2_resource_claim_status.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim_consumer_reference.md b/kubernetes/docs/v1beta2_resource_claim_consumer_reference.md new file mode 100644 index 00000000..37ebd597 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim_consumer_reference.md @@ -0,0 +1,13 @@ +# v1beta2_resource_claim_consumer_reference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_group** | **char \*** | APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources. | [optional] +**name** | **char \*** | Name is the name of resource being referenced. | +**resource** | **char \*** | Resource is the type of resource being referenced, for example \"pods\". | +**uid** | **char \*** | UID identifies exactly one incarnation of the resource. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim_list.md b/kubernetes/docs/v1beta2_resource_claim_list.md new file mode 100644 index 00000000..390fe1f8 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim_list.md @@ -0,0 +1,13 @@ +# v1beta2_resource_claim_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta2_resource_claim.md) \* | Items is the list of resource claims. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim_spec.md b/kubernetes/docs/v1beta2_resource_claim_spec.md new file mode 100644 index 00000000..4e8e512d --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim_spec.md @@ -0,0 +1,10 @@ +# v1beta2_resource_claim_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**v1beta2_device_claim_t**](v1beta2_device_claim.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim_status.md b/kubernetes/docs/v1beta2_resource_claim_status.md new file mode 100644 index 00000000..c49e0451 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim_status.md @@ -0,0 +1,12 @@ +# v1beta2_resource_claim_status_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocation** | [**v1beta2_allocation_result_t**](v1beta2_allocation_result.md) \* | | [optional] +**devices** | [**list_t**](v1beta2_allocated_device_status.md) \* | Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers. | [optional] +**reserved_for** | [**list_t**](v1beta2_resource_claim_consumer_reference.md) \* | ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated. In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled. Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again. There can be at most 256 such reservations. This may get increased in the future, but not reduced. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim_template.md b/kubernetes/docs/v1beta2_resource_claim_template.md new file mode 100644 index 00000000..e4367def --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim_template.md @@ -0,0 +1,13 @@ +# v1beta2_resource_claim_template_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta2_resource_claim_template_spec_t**](v1beta2_resource_claim_template_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim_template_list.md b/kubernetes/docs/v1beta2_resource_claim_template_list.md new file mode 100644 index 00000000..5a5ee492 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim_template_list.md @@ -0,0 +1,13 @@ +# v1beta2_resource_claim_template_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta2_resource_claim_template.md) \* | Items is the list of resource claim templates. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_claim_template_spec.md b/kubernetes/docs/v1beta2_resource_claim_template_spec.md new file mode 100644 index 00000000..eba3a64a --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_claim_template_spec.md @@ -0,0 +1,11 @@ +# v1beta2_resource_claim_template_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta2_resource_claim_spec_t**](v1beta2_resource_claim_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_pool.md b/kubernetes/docs/v1beta2_resource_pool.md new file mode 100644 index 00000000..2c8b6079 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_pool.md @@ -0,0 +1,12 @@ +# v1beta2_resource_pool_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**generation** | **long** | Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted. Combined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state. | +**name** | **char \*** | Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. It must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable. | +**resource_slice_count** | **long** | ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero. Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_slice.md b/kubernetes/docs/v1beta2_resource_slice.md new file mode 100644 index 00000000..e6f45359 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_slice.md @@ -0,0 +1,13 @@ +# v1beta2_resource_slice_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_object_meta_t**](v1_object_meta.md) \* | | [optional] +**spec** | [**v1beta2_resource_slice_spec_t**](v1beta2_resource_slice_spec.md) \* | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_slice_list.md b/kubernetes/docs/v1beta2_resource_slice_list.md new file mode 100644 index 00000000..f1074376 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_slice_list.md @@ -0,0 +1,13 @@ +# v1beta2_resource_slice_list_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | **char \*** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**list_t**](v1beta2_resource_slice.md) \* | Items is the list of resource ResourceSlices. | +**kind** | **char \*** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**v1_list_meta_t**](v1_list_meta.md) \* | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v1beta2_resource_slice_spec.md b/kubernetes/docs/v1beta2_resource_slice_spec.md new file mode 100644 index 00000000..e293bb32 --- /dev/null +++ b/kubernetes/docs/v1beta2_resource_slice_spec.md @@ -0,0 +1,17 @@ +# v1beta2_resource_slice_spec_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_nodes** | **int** | AllNodes indicates that all nodes have access to the resources in the pool. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**devices** | [**list_t**](v1beta2_device.md) \* | Devices lists some or all of the devices in this pool. Must not have more than 128 entries. | [optional] +**driver** | **char \*** | Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable. | +**node_name** | **char \*** | NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node. This field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable. | [optional] +**node_selector** | [**v1_node_selector_t**](v1_node_selector.md) \* | | [optional] +**per_device_node_selection** | **int** | PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. | [optional] +**pool** | [**v1beta2_resource_pool_t**](v1beta2_resource_pool.md) \* | | +**shared_counters** | [**list_t**](v1beta2_counter_set.md) \* | SharedCounters defines a list of counter sets, each of which has a name and a list of counters available. The names of the SharedCounters must be unique in the ResourceSlice. The maximum number of counters in all sets is 32. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/kubernetes/docs/v2_hpa_scaling_rules.md b/kubernetes/docs/v2_hpa_scaling_rules.md index 16cec6ac..6e7359d3 100644 --- a/kubernetes/docs/v2_hpa_scaling_rules.md +++ b/kubernetes/docs/v2_hpa_scaling_rules.md @@ -3,9 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policies** | [**list_t**](v2_hpa_scaling_policy.md) \* | policies is a list of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid | [optional] +**policies** | [**list_t**](v2_hpa_scaling_policy.md) \* | policies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window. | [optional] **select_policy** | **char \*** | selectPolicy is used to specify which policy should be used. If not set, the default value Max is used. | [optional] **stabilization_window_seconds** | **int** | stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). | [optional] +**tolerance** | **char \*** | tolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%). For example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi. This is an alpha field and requires enabling the HPAConfigurableTolerance feature gate. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v2_metric_spec.md b/kubernetes/docs/v2_metric_spec.md index 54703199..bb0e1c77 100644 --- a/kubernetes/docs/v2_metric_spec.md +++ b/kubernetes/docs/v2_metric_spec.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **object** | [**v2_object_metric_source_t**](v2_object_metric_source.md) \* | | [optional] **pods** | [**v2_pods_metric_source_t**](v2_pods_metric_source.md) \* | | [optional] **resource** | [**v2_resource_metric_source_t**](v2_resource_metric_source.md) \* | | [optional] -**type** | **char \*** | type is the type of metric source. It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled | +**type** | **char \*** | type is the type of metric source. It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/v2_metric_status.md b/kubernetes/docs/v2_metric_status.md index bcab99a7..a3361ce8 100644 --- a/kubernetes/docs/v2_metric_status.md +++ b/kubernetes/docs/v2_metric_status.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **object** | [**v2_object_metric_status_t**](v2_object_metric_status.md) \* | | [optional] **pods** | [**v2_pods_metric_status_t**](v2_pods_metric_status.md) \* | | [optional] **resource** | [**v2_resource_metric_status_t**](v2_resource_metric_status.md) \* | | [optional] -**type** | **char \*** | type is the type of metric source. It will be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled | +**type** | **char \*** | type is the type of metric source. It will be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/docs/version_info.md b/kubernetes/docs/version_info.md index 95ed864e..2497f5a0 100644 --- a/kubernetes/docs/version_info.md +++ b/kubernetes/docs/version_info.md @@ -5,12 +5,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **build_date** | **char \*** | | **compiler** | **char \*** | | +**emulation_major** | **char \*** | EmulationMajor is the major version of the emulation version | [optional] +**emulation_minor** | **char \*** | EmulationMinor is the minor version of the emulation version | [optional] **git_commit** | **char \*** | | **git_tree_state** | **char \*** | | **git_version** | **char \*** | | **go_version** | **char \*** | | -**major** | **char \*** | | -**minor** | **char \*** | | +**major** | **char \*** | Major is the major version of the binary version | +**min_compatibility_major** | **char \*** | MinCompatibilityMajor is the major version of the minimum compatibility version | [optional] +**min_compatibility_minor** | **char \*** | MinCompatibilityMinor is the minor version of the minimum compatibility version | [optional] +**minor** | **char \*** | Minor is the minor version of the binary version | **platform** | **char \*** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/kubernetes/include/apiClient.h b/kubernetes/include/apiClient.h index b8bf039a..72c718b1 100644 --- a/kubernetes/include/apiClient.h +++ b/kubernetes/include/apiClient.h @@ -19,9 +19,20 @@ typedef struct sslConfig_t { /* 1 -- skip ssl verify for server certificate */ } sslConfig_t; +typedef struct curlConfig_t { + long verbose; /* 0 -- disable verbose (default) */ + /* 1 -- enable verbose */ + int keepalive; /* 0 -- disable keepalive (default) */ + /* 1 -- enable keepalive */ + long keepidle; /* keep-alive idle time: default to 120 seconds */ + long keepintvl; /* interval time between keep-alive probes: default to 60 seconds */ +} curlConfig_t; + typedef struct apiClient_t { char *basePath; sslConfig_t *sslConfig; + curlConfig_t *curlConfig; + void (*curl_pre_invoke_func)(CURL *); void *dataReceived; long dataReceivedLen; void (*data_callback_func)(void **, long *); @@ -40,7 +51,7 @@ apiClient_t* apiClient_create_with_base_path(const char *basePath void apiClient_free(apiClient_t *apiClient); -void apiClient_invoke(apiClient_t *apiClient,const char* operationParameter, list_t *queryParameters, list_t *headerParameters, list_t *formParameters,list_t *headerType,list_t *contentType, const char *bodyParameters, const char *requestType); +void apiClient_invoke(apiClient_t *apiClient,const char* operationParameter, list_t *queryParameters, list_t *headerParameters, list_t *formParameters,list_t *headerType,list_t *contentType, const char *bodyParameters, size_t bodyParametersLength, const char *requestType); sslConfig_t *sslConfig_create(const char *clientCertFile, const char *clientKeyFile, const char *CACertFile, int insecureSkipTlsVerify); diff --git a/kubernetes/model/admissionregistration_v1_service_reference.c b/kubernetes/model/admissionregistration_v1_service_reference.c index ee78bbca..b793e094 100644 --- a/kubernetes/model/admissionregistration_v1_service_reference.c +++ b/kubernetes/model/admissionregistration_v1_service_reference.c @@ -5,7 +5,7 @@ -admissionregistration_v1_service_reference_t *admissionregistration_v1_service_reference_create( +static admissionregistration_v1_service_reference_t *admissionregistration_v1_service_reference_create_internal( char *name, char *_namespace, char *path, @@ -20,14 +20,32 @@ admissionregistration_v1_service_reference_t *admissionregistration_v1_service_r admissionregistration_v1_service_reference_local_var->path = path; admissionregistration_v1_service_reference_local_var->port = port; + admissionregistration_v1_service_reference_local_var->_library_owned = 1; return admissionregistration_v1_service_reference_local_var; } +__attribute__((deprecated)) admissionregistration_v1_service_reference_t *admissionregistration_v1_service_reference_create( + char *name, + char *_namespace, + char *path, + int port + ) { + return admissionregistration_v1_service_reference_create_internal ( + name, + _namespace, + path, + port + ); +} void admissionregistration_v1_service_reference_free(admissionregistration_v1_service_reference_t *admissionregistration_v1_service_reference) { if(NULL == admissionregistration_v1_service_reference){ return ; } + if(admissionregistration_v1_service_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "admissionregistration_v1_service_reference_free"); + return ; + } listEntry_t *listEntry; if (admissionregistration_v1_service_reference->name) { free(admissionregistration_v1_service_reference->name); @@ -94,6 +112,9 @@ admissionregistration_v1_service_reference_t *admissionregistration_v1_service_r // admissionregistration_v1_service_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(admissionregistration_v1_service_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -106,6 +127,9 @@ admissionregistration_v1_service_reference_t *admissionregistration_v1_service_r // admissionregistration_v1_service_reference->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(admissionregistration_v1_service_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (!_namespace) { goto end; } @@ -118,6 +142,9 @@ admissionregistration_v1_service_reference_t *admissionregistration_v1_service_r // admissionregistration_v1_service_reference->path cJSON *path = cJSON_GetObjectItemCaseSensitive(admissionregistration_v1_service_referenceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (path) { if(!cJSON_IsString(path) && !cJSON_IsNull(path)) { @@ -127,6 +154,9 @@ admissionregistration_v1_service_reference_t *admissionregistration_v1_service_r // admissionregistration_v1_service_reference->port cJSON *port = cJSON_GetObjectItemCaseSensitive(admissionregistration_v1_service_referenceJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (port) { if(!cJSON_IsNumber(port)) { @@ -135,7 +165,7 @@ admissionregistration_v1_service_reference_t *admissionregistration_v1_service_r } - admissionregistration_v1_service_reference_local_var = admissionregistration_v1_service_reference_create ( + admissionregistration_v1_service_reference_local_var = admissionregistration_v1_service_reference_create_internal ( strdup(name->valuestring), strdup(_namespace->valuestring), path && !cJSON_IsNull(path) ? strdup(path->valuestring) : NULL, diff --git a/kubernetes/model/admissionregistration_v1_service_reference.h b/kubernetes/model/admissionregistration_v1_service_reference.h index 446c2210..2017525c 100644 --- a/kubernetes/model/admissionregistration_v1_service_reference.h +++ b/kubernetes/model/admissionregistration_v1_service_reference.h @@ -24,9 +24,10 @@ typedef struct admissionregistration_v1_service_reference_t { char *path; // string int port; //numeric + int _library_owned; // Is the library responsible for freeing this object? } admissionregistration_v1_service_reference_t; -admissionregistration_v1_service_reference_t *admissionregistration_v1_service_reference_create( +__attribute__((deprecated)) admissionregistration_v1_service_reference_t *admissionregistration_v1_service_reference_create( char *name, char *_namespace, char *path, diff --git a/kubernetes/model/admissionregistration_v1_webhook_client_config.c b/kubernetes/model/admissionregistration_v1_webhook_client_config.c index 8b172a8a..f852a0e2 100644 --- a/kubernetes/model/admissionregistration_v1_webhook_client_config.c +++ b/kubernetes/model/admissionregistration_v1_webhook_client_config.c @@ -5,7 +5,7 @@ -admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webhook_client_config_create( +static admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webhook_client_config_create_internal( char *ca_bundle, admissionregistration_v1_service_reference_t *service, char *url @@ -18,14 +18,30 @@ admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webho admissionregistration_v1_webhook_client_config_local_var->service = service; admissionregistration_v1_webhook_client_config_local_var->url = url; + admissionregistration_v1_webhook_client_config_local_var->_library_owned = 1; return admissionregistration_v1_webhook_client_config_local_var; } +__attribute__((deprecated)) admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webhook_client_config_create( + char *ca_bundle, + admissionregistration_v1_service_reference_t *service, + char *url + ) { + return admissionregistration_v1_webhook_client_config_create_internal ( + ca_bundle, + service, + url + ); +} void admissionregistration_v1_webhook_client_config_free(admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webhook_client_config) { if(NULL == admissionregistration_v1_webhook_client_config){ return ; } + if(admissionregistration_v1_webhook_client_config->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "admissionregistration_v1_webhook_client_config_free"); + return ; + } listEntry_t *listEntry; if (admissionregistration_v1_webhook_client_config->ca_bundle) { free(admissionregistration_v1_webhook_client_config->ca_bundle); @@ -90,6 +106,9 @@ admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webho // admissionregistration_v1_webhook_client_config->ca_bundle cJSON *ca_bundle = cJSON_GetObjectItemCaseSensitive(admissionregistration_v1_webhook_client_configJSON, "caBundle"); + if (cJSON_IsNull(ca_bundle)) { + ca_bundle = NULL; + } if (ca_bundle) { if(!cJSON_IsString(ca_bundle)) { @@ -99,12 +118,18 @@ admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webho // admissionregistration_v1_webhook_client_config->service cJSON *service = cJSON_GetObjectItemCaseSensitive(admissionregistration_v1_webhook_client_configJSON, "service"); + if (cJSON_IsNull(service)) { + service = NULL; + } if (service) { service_local_nonprim = admissionregistration_v1_service_reference_parseFromJSON(service); //nonprimitive } // admissionregistration_v1_webhook_client_config->url cJSON *url = cJSON_GetObjectItemCaseSensitive(admissionregistration_v1_webhook_client_configJSON, "url"); + if (cJSON_IsNull(url)) { + url = NULL; + } if (url) { if(!cJSON_IsString(url) && !cJSON_IsNull(url)) { @@ -113,7 +138,7 @@ admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webho } - admissionregistration_v1_webhook_client_config_local_var = admissionregistration_v1_webhook_client_config_create ( + admissionregistration_v1_webhook_client_config_local_var = admissionregistration_v1_webhook_client_config_create_internal ( ca_bundle ? strdup(ca_bundle->valuestring) : NULL, service ? service_local_nonprim : NULL, url && !cJSON_IsNull(url) ? strdup(url->valuestring) : NULL diff --git a/kubernetes/model/admissionregistration_v1_webhook_client_config.h b/kubernetes/model/admissionregistration_v1_webhook_client_config.h index c75f2aa0..e46967dd 100644 --- a/kubernetes/model/admissionregistration_v1_webhook_client_config.h +++ b/kubernetes/model/admissionregistration_v1_webhook_client_config.h @@ -24,9 +24,10 @@ typedef struct admissionregistration_v1_webhook_client_config_t { struct admissionregistration_v1_service_reference_t *service; //model char *url; // string + int _library_owned; // Is the library responsible for freeing this object? } admissionregistration_v1_webhook_client_config_t; -admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webhook_client_config_create( +__attribute__((deprecated)) admissionregistration_v1_webhook_client_config_t *admissionregistration_v1_webhook_client_config_create( char *ca_bundle, admissionregistration_v1_service_reference_t *service, char *url diff --git a/kubernetes/model/any_type.h b/kubernetes/model/any_type.h new file mode 100644 index 00000000..7bdc9248 --- /dev/null +++ b/kubernetes/model/any_type.h @@ -0,0 +1,5 @@ +/* + * any_type.h + * + * A placeholder for now, this type isn't really needed. + */ diff --git a/kubernetes/model/apiextensions_v1_service_reference.c b/kubernetes/model/apiextensions_v1_service_reference.c index be40aa05..f1cf38e6 100644 --- a/kubernetes/model/apiextensions_v1_service_reference.c +++ b/kubernetes/model/apiextensions_v1_service_reference.c @@ -5,7 +5,7 @@ -apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_create( +static apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_create_internal( char *name, char *_namespace, char *path, @@ -20,14 +20,32 @@ apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_create( apiextensions_v1_service_reference_local_var->path = path; apiextensions_v1_service_reference_local_var->port = port; + apiextensions_v1_service_reference_local_var->_library_owned = 1; return apiextensions_v1_service_reference_local_var; } +__attribute__((deprecated)) apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_create( + char *name, + char *_namespace, + char *path, + int port + ) { + return apiextensions_v1_service_reference_create_internal ( + name, + _namespace, + path, + port + ); +} void apiextensions_v1_service_reference_free(apiextensions_v1_service_reference_t *apiextensions_v1_service_reference) { if(NULL == apiextensions_v1_service_reference){ return ; } + if(apiextensions_v1_service_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "apiextensions_v1_service_reference_free"); + return ; + } listEntry_t *listEntry; if (apiextensions_v1_service_reference->name) { free(apiextensions_v1_service_reference->name); @@ -94,6 +112,9 @@ apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_parseFr // apiextensions_v1_service_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(apiextensions_v1_service_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -106,6 +127,9 @@ apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_parseFr // apiextensions_v1_service_reference->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(apiextensions_v1_service_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (!_namespace) { goto end; } @@ -118,6 +142,9 @@ apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_parseFr // apiextensions_v1_service_reference->path cJSON *path = cJSON_GetObjectItemCaseSensitive(apiextensions_v1_service_referenceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (path) { if(!cJSON_IsString(path) && !cJSON_IsNull(path)) { @@ -127,6 +154,9 @@ apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_parseFr // apiextensions_v1_service_reference->port cJSON *port = cJSON_GetObjectItemCaseSensitive(apiextensions_v1_service_referenceJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (port) { if(!cJSON_IsNumber(port)) { @@ -135,7 +165,7 @@ apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_parseFr } - apiextensions_v1_service_reference_local_var = apiextensions_v1_service_reference_create ( + apiextensions_v1_service_reference_local_var = apiextensions_v1_service_reference_create_internal ( strdup(name->valuestring), strdup(_namespace->valuestring), path && !cJSON_IsNull(path) ? strdup(path->valuestring) : NULL, diff --git a/kubernetes/model/apiextensions_v1_service_reference.h b/kubernetes/model/apiextensions_v1_service_reference.h index dc49648e..83516efd 100644 --- a/kubernetes/model/apiextensions_v1_service_reference.h +++ b/kubernetes/model/apiextensions_v1_service_reference.h @@ -24,9 +24,10 @@ typedef struct apiextensions_v1_service_reference_t { char *path; // string int port; //numeric + int _library_owned; // Is the library responsible for freeing this object? } apiextensions_v1_service_reference_t; -apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_create( +__attribute__((deprecated)) apiextensions_v1_service_reference_t *apiextensions_v1_service_reference_create( char *name, char *_namespace, char *path, diff --git a/kubernetes/model/apiextensions_v1_webhook_client_config.c b/kubernetes/model/apiextensions_v1_webhook_client_config.c index a7a4c0b2..438a1615 100644 --- a/kubernetes/model/apiextensions_v1_webhook_client_config.c +++ b/kubernetes/model/apiextensions_v1_webhook_client_config.c @@ -5,7 +5,7 @@ -apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config_create( +static apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config_create_internal( char *ca_bundle, apiextensions_v1_service_reference_t *service, char *url @@ -18,14 +18,30 @@ apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config apiextensions_v1_webhook_client_config_local_var->service = service; apiextensions_v1_webhook_client_config_local_var->url = url; + apiextensions_v1_webhook_client_config_local_var->_library_owned = 1; return apiextensions_v1_webhook_client_config_local_var; } +__attribute__((deprecated)) apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config_create( + char *ca_bundle, + apiextensions_v1_service_reference_t *service, + char *url + ) { + return apiextensions_v1_webhook_client_config_create_internal ( + ca_bundle, + service, + url + ); +} void apiextensions_v1_webhook_client_config_free(apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config) { if(NULL == apiextensions_v1_webhook_client_config){ return ; } + if(apiextensions_v1_webhook_client_config->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "apiextensions_v1_webhook_client_config_free"); + return ; + } listEntry_t *listEntry; if (apiextensions_v1_webhook_client_config->ca_bundle) { free(apiextensions_v1_webhook_client_config->ca_bundle); @@ -90,6 +106,9 @@ apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config // apiextensions_v1_webhook_client_config->ca_bundle cJSON *ca_bundle = cJSON_GetObjectItemCaseSensitive(apiextensions_v1_webhook_client_configJSON, "caBundle"); + if (cJSON_IsNull(ca_bundle)) { + ca_bundle = NULL; + } if (ca_bundle) { if(!cJSON_IsString(ca_bundle)) { @@ -99,12 +118,18 @@ apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config // apiextensions_v1_webhook_client_config->service cJSON *service = cJSON_GetObjectItemCaseSensitive(apiextensions_v1_webhook_client_configJSON, "service"); + if (cJSON_IsNull(service)) { + service = NULL; + } if (service) { service_local_nonprim = apiextensions_v1_service_reference_parseFromJSON(service); //nonprimitive } // apiextensions_v1_webhook_client_config->url cJSON *url = cJSON_GetObjectItemCaseSensitive(apiextensions_v1_webhook_client_configJSON, "url"); + if (cJSON_IsNull(url)) { + url = NULL; + } if (url) { if(!cJSON_IsString(url) && !cJSON_IsNull(url)) { @@ -113,7 +138,7 @@ apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config } - apiextensions_v1_webhook_client_config_local_var = apiextensions_v1_webhook_client_config_create ( + apiextensions_v1_webhook_client_config_local_var = apiextensions_v1_webhook_client_config_create_internal ( ca_bundle ? strdup(ca_bundle->valuestring) : NULL, service ? service_local_nonprim : NULL, url && !cJSON_IsNull(url) ? strdup(url->valuestring) : NULL diff --git a/kubernetes/model/apiextensions_v1_webhook_client_config.h b/kubernetes/model/apiextensions_v1_webhook_client_config.h index b8d02e7c..ee6d0ff5 100644 --- a/kubernetes/model/apiextensions_v1_webhook_client_config.h +++ b/kubernetes/model/apiextensions_v1_webhook_client_config.h @@ -24,9 +24,10 @@ typedef struct apiextensions_v1_webhook_client_config_t { struct apiextensions_v1_service_reference_t *service; //model char *url; // string + int _library_owned; // Is the library responsible for freeing this object? } apiextensions_v1_webhook_client_config_t; -apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config_create( +__attribute__((deprecated)) apiextensions_v1_webhook_client_config_t *apiextensions_v1_webhook_client_config_create( char *ca_bundle, apiextensions_v1_service_reference_t *service, char *url diff --git a/kubernetes/model/apiregistration_v1_service_reference.c b/kubernetes/model/apiregistration_v1_service_reference.c index 25321ce3..2f1a0e13 100644 --- a/kubernetes/model/apiregistration_v1_service_reference.c +++ b/kubernetes/model/apiregistration_v1_service_reference.c @@ -5,7 +5,7 @@ -apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_create( +static apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_create_internal( char *name, char *_namespace, int port @@ -18,14 +18,30 @@ apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_cre apiregistration_v1_service_reference_local_var->_namespace = _namespace; apiregistration_v1_service_reference_local_var->port = port; + apiregistration_v1_service_reference_local_var->_library_owned = 1; return apiregistration_v1_service_reference_local_var; } +__attribute__((deprecated)) apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_create( + char *name, + char *_namespace, + int port + ) { + return apiregistration_v1_service_reference_create_internal ( + name, + _namespace, + port + ); +} void apiregistration_v1_service_reference_free(apiregistration_v1_service_reference_t *apiregistration_v1_service_reference) { if(NULL == apiregistration_v1_service_reference){ return ; } + if(apiregistration_v1_service_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "apiregistration_v1_service_reference_free"); + return ; + } listEntry_t *listEntry; if (apiregistration_v1_service_reference->name) { free(apiregistration_v1_service_reference->name); @@ -78,6 +94,9 @@ apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_par // apiregistration_v1_service_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(apiregistration_v1_service_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -87,6 +106,9 @@ apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_par // apiregistration_v1_service_reference->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(apiregistration_v1_service_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -96,6 +118,9 @@ apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_par // apiregistration_v1_service_reference->port cJSON *port = cJSON_GetObjectItemCaseSensitive(apiregistration_v1_service_referenceJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (port) { if(!cJSON_IsNumber(port)) { @@ -104,7 +129,7 @@ apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_par } - apiregistration_v1_service_reference_local_var = apiregistration_v1_service_reference_create ( + apiregistration_v1_service_reference_local_var = apiregistration_v1_service_reference_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, port ? port->valuedouble : 0 diff --git a/kubernetes/model/apiregistration_v1_service_reference.h b/kubernetes/model/apiregistration_v1_service_reference.h index c97d6b82..cde45ba6 100644 --- a/kubernetes/model/apiregistration_v1_service_reference.h +++ b/kubernetes/model/apiregistration_v1_service_reference.h @@ -23,9 +23,10 @@ typedef struct apiregistration_v1_service_reference_t { char *_namespace; // string int port; //numeric + int _library_owned; // Is the library responsible for freeing this object? } apiregistration_v1_service_reference_t; -apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_create( +__attribute__((deprecated)) apiregistration_v1_service_reference_t *apiregistration_v1_service_reference_create( char *name, char *_namespace, int port diff --git a/kubernetes/model/authentication_v1_token_request.c b/kubernetes/model/authentication_v1_token_request.c index 273228de..c39c3da7 100644 --- a/kubernetes/model/authentication_v1_token_request.c +++ b/kubernetes/model/authentication_v1_token_request.c @@ -5,7 +5,7 @@ -authentication_v1_token_request_t *authentication_v1_token_request_create( +static authentication_v1_token_request_t *authentication_v1_token_request_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ authentication_v1_token_request_t *authentication_v1_token_request_create( authentication_v1_token_request_local_var->spec = spec; authentication_v1_token_request_local_var->status = status; + authentication_v1_token_request_local_var->_library_owned = 1; return authentication_v1_token_request_local_var; } +__attribute__((deprecated)) authentication_v1_token_request_t *authentication_v1_token_request_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_token_request_spec_t *spec, + v1_token_request_status_t *status + ) { + return authentication_v1_token_request_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void authentication_v1_token_request_free(authentication_v1_token_request_t *authentication_v1_token_request) { if(NULL == authentication_v1_token_request){ return ; } + if(authentication_v1_token_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "authentication_v1_token_request_free"); + return ; + } listEntry_t *listEntry; if (authentication_v1_token_request->api_version) { free(authentication_v1_token_request->api_version); @@ -135,6 +155,9 @@ authentication_v1_token_request_t *authentication_v1_token_request_parseFromJSON // authentication_v1_token_request->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(authentication_v1_token_requestJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ authentication_v1_token_request_t *authentication_v1_token_request_parseFromJSON // authentication_v1_token_request->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(authentication_v1_token_requestJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ authentication_v1_token_request_t *authentication_v1_token_request_parseFromJSON // authentication_v1_token_request->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(authentication_v1_token_requestJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // authentication_v1_token_request->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(authentication_v1_token_requestJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ authentication_v1_token_request_t *authentication_v1_token_request_parseFromJSON // authentication_v1_token_request->status cJSON *status = cJSON_GetObjectItemCaseSensitive(authentication_v1_token_requestJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_token_request_status_parseFromJSON(status); //nonprimitive } - authentication_v1_token_request_local_var = authentication_v1_token_request_create ( + authentication_v1_token_request_local_var = authentication_v1_token_request_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/authentication_v1_token_request.h b/kubernetes/model/authentication_v1_token_request.h index 2ccee01d..3d995e7d 100644 --- a/kubernetes/model/authentication_v1_token_request.h +++ b/kubernetes/model/authentication_v1_token_request.h @@ -28,9 +28,10 @@ typedef struct authentication_v1_token_request_t { struct v1_token_request_spec_t *spec; //model struct v1_token_request_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } authentication_v1_token_request_t; -authentication_v1_token_request_t *authentication_v1_token_request_create( +__attribute__((deprecated)) authentication_v1_token_request_t *authentication_v1_token_request_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/core_v1_endpoint_port.c b/kubernetes/model/core_v1_endpoint_port.c index 75e4c9a3..d95c71a5 100644 --- a/kubernetes/model/core_v1_endpoint_port.c +++ b/kubernetes/model/core_v1_endpoint_port.c @@ -5,7 +5,7 @@ -core_v1_endpoint_port_t *core_v1_endpoint_port_create( +static core_v1_endpoint_port_t *core_v1_endpoint_port_create_internal( char *app_protocol, char *name, int port, @@ -20,14 +20,32 @@ core_v1_endpoint_port_t *core_v1_endpoint_port_create( core_v1_endpoint_port_local_var->port = port; core_v1_endpoint_port_local_var->protocol = protocol; + core_v1_endpoint_port_local_var->_library_owned = 1; return core_v1_endpoint_port_local_var; } +__attribute__((deprecated)) core_v1_endpoint_port_t *core_v1_endpoint_port_create( + char *app_protocol, + char *name, + int port, + char *protocol + ) { + return core_v1_endpoint_port_create_internal ( + app_protocol, + name, + port, + protocol + ); +} void core_v1_endpoint_port_free(core_v1_endpoint_port_t *core_v1_endpoint_port) { if(NULL == core_v1_endpoint_port){ return ; } + if(core_v1_endpoint_port->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "core_v1_endpoint_port_free"); + return ; + } listEntry_t *listEntry; if (core_v1_endpoint_port->app_protocol) { free(core_v1_endpoint_port->app_protocol); @@ -93,6 +111,9 @@ core_v1_endpoint_port_t *core_v1_endpoint_port_parseFromJSON(cJSON *core_v1_endp // core_v1_endpoint_port->app_protocol cJSON *app_protocol = cJSON_GetObjectItemCaseSensitive(core_v1_endpoint_portJSON, "appProtocol"); + if (cJSON_IsNull(app_protocol)) { + app_protocol = NULL; + } if (app_protocol) { if(!cJSON_IsString(app_protocol) && !cJSON_IsNull(app_protocol)) { @@ -102,6 +123,9 @@ core_v1_endpoint_port_t *core_v1_endpoint_port_parseFromJSON(cJSON *core_v1_endp // core_v1_endpoint_port->name cJSON *name = cJSON_GetObjectItemCaseSensitive(core_v1_endpoint_portJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -111,6 +135,9 @@ core_v1_endpoint_port_t *core_v1_endpoint_port_parseFromJSON(cJSON *core_v1_endp // core_v1_endpoint_port->port cJSON *port = cJSON_GetObjectItemCaseSensitive(core_v1_endpoint_portJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -123,6 +150,9 @@ core_v1_endpoint_port_t *core_v1_endpoint_port_parseFromJSON(cJSON *core_v1_endp // core_v1_endpoint_port->protocol cJSON *protocol = cJSON_GetObjectItemCaseSensitive(core_v1_endpoint_portJSON, "protocol"); + if (cJSON_IsNull(protocol)) { + protocol = NULL; + } if (protocol) { if(!cJSON_IsString(protocol) && !cJSON_IsNull(protocol)) { @@ -131,7 +161,7 @@ core_v1_endpoint_port_t *core_v1_endpoint_port_parseFromJSON(cJSON *core_v1_endp } - core_v1_endpoint_port_local_var = core_v1_endpoint_port_create ( + core_v1_endpoint_port_local_var = core_v1_endpoint_port_create_internal ( app_protocol && !cJSON_IsNull(app_protocol) ? strdup(app_protocol->valuestring) : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, port->valuedouble, diff --git a/kubernetes/model/core_v1_endpoint_port.h b/kubernetes/model/core_v1_endpoint_port.h index aee97445..5ac606a6 100644 --- a/kubernetes/model/core_v1_endpoint_port.h +++ b/kubernetes/model/core_v1_endpoint_port.h @@ -1,7 +1,7 @@ /* * core_v1_endpoint_port.h * - * EndpointPort is a tuple that describes a single port. + * EndpointPort is a tuple that describes a single port. Deprecated: This API is deprecated in v1.33+. */ #ifndef _core_v1_endpoint_port_H_ @@ -24,9 +24,10 @@ typedef struct core_v1_endpoint_port_t { int port; //numeric char *protocol; // string + int _library_owned; // Is the library responsible for freeing this object? } core_v1_endpoint_port_t; -core_v1_endpoint_port_t *core_v1_endpoint_port_create( +__attribute__((deprecated)) core_v1_endpoint_port_t *core_v1_endpoint_port_create( char *app_protocol, char *name, int port, diff --git a/kubernetes/model/core_v1_event.c b/kubernetes/model/core_v1_event.c index 5729a317..e1ad7a45 100644 --- a/kubernetes/model/core_v1_event.c +++ b/kubernetes/model/core_v1_event.c @@ -5,7 +5,7 @@ -core_v1_event_t *core_v1_event_create( +static core_v1_event_t *core_v1_event_create_internal( char *action, char *api_version, int count, @@ -46,14 +46,58 @@ core_v1_event_t *core_v1_event_create( core_v1_event_local_var->source = source; core_v1_event_local_var->type = type; + core_v1_event_local_var->_library_owned = 1; return core_v1_event_local_var; } +__attribute__((deprecated)) core_v1_event_t *core_v1_event_create( + char *action, + char *api_version, + int count, + char *event_time, + char *first_timestamp, + v1_object_reference_t *involved_object, + char *kind, + char *last_timestamp, + char *message, + v1_object_meta_t *metadata, + char *reason, + v1_object_reference_t *related, + char *reporting_component, + char *reporting_instance, + core_v1_event_series_t *series, + v1_event_source_t *source, + char *type + ) { + return core_v1_event_create_internal ( + action, + api_version, + count, + event_time, + first_timestamp, + involved_object, + kind, + last_timestamp, + message, + metadata, + reason, + related, + reporting_component, + reporting_instance, + series, + source, + type + ); +} void core_v1_event_free(core_v1_event_t *core_v1_event) { if(NULL == core_v1_event){ return ; } + if(core_v1_event->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "core_v1_event_free"); + return ; + } listEntry_t *listEntry; if (core_v1_event->action) { free(core_v1_event->action); @@ -316,6 +360,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->action cJSON *action = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "action"); + if (cJSON_IsNull(action)) { + action = NULL; + } if (action) { if(!cJSON_IsString(action) && !cJSON_IsNull(action)) { @@ -325,6 +372,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -334,6 +384,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->count cJSON *count = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } if (count) { if(!cJSON_IsNumber(count)) { @@ -343,6 +396,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->event_time cJSON *event_time = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "eventTime"); + if (cJSON_IsNull(event_time)) { + event_time = NULL; + } if (event_time) { if(!cJSON_IsString(event_time) && !cJSON_IsNull(event_time)) { @@ -352,6 +408,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->first_timestamp cJSON *first_timestamp = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "firstTimestamp"); + if (cJSON_IsNull(first_timestamp)) { + first_timestamp = NULL; + } if (first_timestamp) { if(!cJSON_IsString(first_timestamp) && !cJSON_IsNull(first_timestamp)) { @@ -361,6 +420,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->involved_object cJSON *involved_object = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "involvedObject"); + if (cJSON_IsNull(involved_object)) { + involved_object = NULL; + } if (!involved_object) { goto end; } @@ -370,6 +432,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -379,6 +444,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->last_timestamp cJSON *last_timestamp = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "lastTimestamp"); + if (cJSON_IsNull(last_timestamp)) { + last_timestamp = NULL; + } if (last_timestamp) { if(!cJSON_IsString(last_timestamp) && !cJSON_IsNull(last_timestamp)) { @@ -388,6 +456,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->message cJSON *message = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -397,6 +468,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (!metadata) { goto end; } @@ -406,6 +480,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -415,12 +492,18 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->related cJSON *related = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "related"); + if (cJSON_IsNull(related)) { + related = NULL; + } if (related) { related_local_nonprim = v1_object_reference_parseFromJSON(related); //nonprimitive } // core_v1_event->reporting_component cJSON *reporting_component = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "reportingComponent"); + if (cJSON_IsNull(reporting_component)) { + reporting_component = NULL; + } if (reporting_component) { if(!cJSON_IsString(reporting_component) && !cJSON_IsNull(reporting_component)) { @@ -430,6 +513,9 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->reporting_instance cJSON *reporting_instance = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "reportingInstance"); + if (cJSON_IsNull(reporting_instance)) { + reporting_instance = NULL; + } if (reporting_instance) { if(!cJSON_IsString(reporting_instance) && !cJSON_IsNull(reporting_instance)) { @@ -439,18 +525,27 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ // core_v1_event->series cJSON *series = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "series"); + if (cJSON_IsNull(series)) { + series = NULL; + } if (series) { series_local_nonprim = core_v1_event_series_parseFromJSON(series); //nonprimitive } // core_v1_event->source cJSON *source = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "source"); + if (cJSON_IsNull(source)) { + source = NULL; + } if (source) { source_local_nonprim = v1_event_source_parseFromJSON(source); //nonprimitive } // core_v1_event->type cJSON *type = cJSON_GetObjectItemCaseSensitive(core_v1_eventJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -459,7 +554,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){ } - core_v1_event_local_var = core_v1_event_create ( + core_v1_event_local_var = core_v1_event_create_internal ( action && !cJSON_IsNull(action) ? strdup(action->valuestring) : NULL, api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, count ? count->valuedouble : 0, diff --git a/kubernetes/model/core_v1_event.h b/kubernetes/model/core_v1_event.h index 2acfd0b0..c505e634 100644 --- a/kubernetes/model/core_v1_event.h +++ b/kubernetes/model/core_v1_event.h @@ -41,9 +41,10 @@ typedef struct core_v1_event_t { struct v1_event_source_t *source; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } core_v1_event_t; -core_v1_event_t *core_v1_event_create( +__attribute__((deprecated)) core_v1_event_t *core_v1_event_create( char *action, char *api_version, int count, diff --git a/kubernetes/model/core_v1_event_list.c b/kubernetes/model/core_v1_event_list.c index 5e2a44b5..33a7db15 100644 --- a/kubernetes/model/core_v1_event_list.c +++ b/kubernetes/model/core_v1_event_list.c @@ -5,7 +5,7 @@ -core_v1_event_list_t *core_v1_event_list_create( +static core_v1_event_list_t *core_v1_event_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ core_v1_event_list_t *core_v1_event_list_create( core_v1_event_list_local_var->kind = kind; core_v1_event_list_local_var->metadata = metadata; + core_v1_event_list_local_var->_library_owned = 1; return core_v1_event_list_local_var; } +__attribute__((deprecated)) core_v1_event_list_t *core_v1_event_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return core_v1_event_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void core_v1_event_list_free(core_v1_event_list_t *core_v1_event_list) { if(NULL == core_v1_event_list){ return ; } + if(core_v1_event_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "core_v1_event_list_free"); + return ; + } listEntry_t *listEntry; if (core_v1_event_list->api_version) { free(core_v1_event_list->api_version); @@ -123,6 +141,9 @@ core_v1_event_list_t *core_v1_event_list_parseFromJSON(cJSON *core_v1_event_list // core_v1_event_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(core_v1_event_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ core_v1_event_list_t *core_v1_event_list_parseFromJSON(cJSON *core_v1_event_list // core_v1_event_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(core_v1_event_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ core_v1_event_list_t *core_v1_event_list_parseFromJSON(cJSON *core_v1_event_list // core_v1_event_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(core_v1_event_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ core_v1_event_list_t *core_v1_event_list_parseFromJSON(cJSON *core_v1_event_list // core_v1_event_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(core_v1_event_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - core_v1_event_list_local_var = core_v1_event_list_create ( + core_v1_event_list_local_var = core_v1_event_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/core_v1_event_list.h b/kubernetes/model/core_v1_event_list.h index 0ee29b5a..5069e965 100644 --- a/kubernetes/model/core_v1_event_list.h +++ b/kubernetes/model/core_v1_event_list.h @@ -26,9 +26,10 @@ typedef struct core_v1_event_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } core_v1_event_list_t; -core_v1_event_list_t *core_v1_event_list_create( +__attribute__((deprecated)) core_v1_event_list_t *core_v1_event_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/core_v1_event_series.c b/kubernetes/model/core_v1_event_series.c index e1d77a15..0900d4d7 100644 --- a/kubernetes/model/core_v1_event_series.c +++ b/kubernetes/model/core_v1_event_series.c @@ -5,7 +5,7 @@ -core_v1_event_series_t *core_v1_event_series_create( +static core_v1_event_series_t *core_v1_event_series_create_internal( int count, char *last_observed_time ) { @@ -16,14 +16,28 @@ core_v1_event_series_t *core_v1_event_series_create( core_v1_event_series_local_var->count = count; core_v1_event_series_local_var->last_observed_time = last_observed_time; + core_v1_event_series_local_var->_library_owned = 1; return core_v1_event_series_local_var; } +__attribute__((deprecated)) core_v1_event_series_t *core_v1_event_series_create( + int count, + char *last_observed_time + ) { + return core_v1_event_series_create_internal ( + count, + last_observed_time + ); +} void core_v1_event_series_free(core_v1_event_series_t *core_v1_event_series) { if(NULL == core_v1_event_series){ return ; } + if(core_v1_event_series->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "core_v1_event_series_free"); + return ; + } listEntry_t *listEntry; if (core_v1_event_series->last_observed_time) { free(core_v1_event_series->last_observed_time); @@ -64,6 +78,9 @@ core_v1_event_series_t *core_v1_event_series_parseFromJSON(cJSON *core_v1_event_ // core_v1_event_series->count cJSON *count = cJSON_GetObjectItemCaseSensitive(core_v1_event_seriesJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } if (count) { if(!cJSON_IsNumber(count)) { @@ -73,6 +90,9 @@ core_v1_event_series_t *core_v1_event_series_parseFromJSON(cJSON *core_v1_event_ // core_v1_event_series->last_observed_time cJSON *last_observed_time = cJSON_GetObjectItemCaseSensitive(core_v1_event_seriesJSON, "lastObservedTime"); + if (cJSON_IsNull(last_observed_time)) { + last_observed_time = NULL; + } if (last_observed_time) { if(!cJSON_IsString(last_observed_time) && !cJSON_IsNull(last_observed_time)) { @@ -81,7 +101,7 @@ core_v1_event_series_t *core_v1_event_series_parseFromJSON(cJSON *core_v1_event_ } - core_v1_event_series_local_var = core_v1_event_series_create ( + core_v1_event_series_local_var = core_v1_event_series_create_internal ( count ? count->valuedouble : 0, last_observed_time && !cJSON_IsNull(last_observed_time) ? strdup(last_observed_time->valuestring) : NULL ); diff --git a/kubernetes/model/core_v1_event_series.h b/kubernetes/model/core_v1_event_series.h index 8eeb73f7..36c42752 100644 --- a/kubernetes/model/core_v1_event_series.h +++ b/kubernetes/model/core_v1_event_series.h @@ -22,9 +22,10 @@ typedef struct core_v1_event_series_t { int count; //numeric char *last_observed_time; //date time + int _library_owned; // Is the library responsible for freeing this object? } core_v1_event_series_t; -core_v1_event_series_t *core_v1_event_series_create( +__attribute__((deprecated)) core_v1_event_series_t *core_v1_event_series_create( int count, char *last_observed_time ); diff --git a/kubernetes/model/core_v1_resource_claim.c b/kubernetes/model/core_v1_resource_claim.c new file mode 100644 index 00000000..ca83045d --- /dev/null +++ b/kubernetes/model/core_v1_resource_claim.c @@ -0,0 +1,121 @@ +#include +#include +#include +#include "core_v1_resource_claim.h" + + + +static core_v1_resource_claim_t *core_v1_resource_claim_create_internal( + char *name, + char *request + ) { + core_v1_resource_claim_t *core_v1_resource_claim_local_var = malloc(sizeof(core_v1_resource_claim_t)); + if (!core_v1_resource_claim_local_var) { + return NULL; + } + core_v1_resource_claim_local_var->name = name; + core_v1_resource_claim_local_var->request = request; + + core_v1_resource_claim_local_var->_library_owned = 1; + return core_v1_resource_claim_local_var; +} + +__attribute__((deprecated)) core_v1_resource_claim_t *core_v1_resource_claim_create( + char *name, + char *request + ) { + return core_v1_resource_claim_create_internal ( + name, + request + ); +} + +void core_v1_resource_claim_free(core_v1_resource_claim_t *core_v1_resource_claim) { + if(NULL == core_v1_resource_claim){ + return ; + } + if(core_v1_resource_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "core_v1_resource_claim_free"); + return ; + } + listEntry_t *listEntry; + if (core_v1_resource_claim->name) { + free(core_v1_resource_claim->name); + core_v1_resource_claim->name = NULL; + } + if (core_v1_resource_claim->request) { + free(core_v1_resource_claim->request); + core_v1_resource_claim->request = NULL; + } + free(core_v1_resource_claim); +} + +cJSON *core_v1_resource_claim_convertToJSON(core_v1_resource_claim_t *core_v1_resource_claim) { + cJSON *item = cJSON_CreateObject(); + + // core_v1_resource_claim->name + if (!core_v1_resource_claim->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", core_v1_resource_claim->name) == NULL) { + goto fail; //String + } + + + // core_v1_resource_claim->request + if(core_v1_resource_claim->request) { + if(cJSON_AddStringToObject(item, "request", core_v1_resource_claim->request) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +core_v1_resource_claim_t *core_v1_resource_claim_parseFromJSON(cJSON *core_v1_resource_claimJSON){ + + core_v1_resource_claim_t *core_v1_resource_claim_local_var = NULL; + + // core_v1_resource_claim->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(core_v1_resource_claimJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // core_v1_resource_claim->request + cJSON *request = cJSON_GetObjectItemCaseSensitive(core_v1_resource_claimJSON, "request"); + if (cJSON_IsNull(request)) { + request = NULL; + } + if (request) { + if(!cJSON_IsString(request) && !cJSON_IsNull(request)) + { + goto end; //String + } + } + + + core_v1_resource_claim_local_var = core_v1_resource_claim_create_internal ( + strdup(name->valuestring), + request && !cJSON_IsNull(request) ? strdup(request->valuestring) : NULL + ); + + return core_v1_resource_claim_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/core_v1_resource_claim.h b/kubernetes/model/core_v1_resource_claim.h new file mode 100644 index 00000000..d7052ab8 --- /dev/null +++ b/kubernetes/model/core_v1_resource_claim.h @@ -0,0 +1,40 @@ +/* + * core_v1_resource_claim.h + * + * ResourceClaim references one entry in PodSpec.ResourceClaims. + */ + +#ifndef _core_v1_resource_claim_H_ +#define _core_v1_resource_claim_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct core_v1_resource_claim_t core_v1_resource_claim_t; + + + + +typedef struct core_v1_resource_claim_t { + char *name; // string + char *request; // string + + int _library_owned; // Is the library responsible for freeing this object? +} core_v1_resource_claim_t; + +__attribute__((deprecated)) core_v1_resource_claim_t *core_v1_resource_claim_create( + char *name, + char *request +); + +void core_v1_resource_claim_free(core_v1_resource_claim_t *core_v1_resource_claim); + +core_v1_resource_claim_t *core_v1_resource_claim_parseFromJSON(cJSON *core_v1_resource_claimJSON); + +cJSON *core_v1_resource_claim_convertToJSON(core_v1_resource_claim_t *core_v1_resource_claim); + +#endif /* _core_v1_resource_claim_H_ */ + diff --git a/kubernetes/model/discovery_v1_endpoint_port.c b/kubernetes/model/discovery_v1_endpoint_port.c index 91ac8e7c..ed71b92c 100644 --- a/kubernetes/model/discovery_v1_endpoint_port.c +++ b/kubernetes/model/discovery_v1_endpoint_port.c @@ -5,7 +5,7 @@ -discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_create( +static discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_create_internal( char *app_protocol, char *name, int port, @@ -20,14 +20,32 @@ discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_create( discovery_v1_endpoint_port_local_var->port = port; discovery_v1_endpoint_port_local_var->protocol = protocol; + discovery_v1_endpoint_port_local_var->_library_owned = 1; return discovery_v1_endpoint_port_local_var; } +__attribute__((deprecated)) discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_create( + char *app_protocol, + char *name, + int port, + char *protocol + ) { + return discovery_v1_endpoint_port_create_internal ( + app_protocol, + name, + port, + protocol + ); +} void discovery_v1_endpoint_port_free(discovery_v1_endpoint_port_t *discovery_v1_endpoint_port) { if(NULL == discovery_v1_endpoint_port){ return ; } + if(discovery_v1_endpoint_port->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "discovery_v1_endpoint_port_free"); + return ; + } listEntry_t *listEntry; if (discovery_v1_endpoint_port->app_protocol) { free(discovery_v1_endpoint_port->app_protocol); @@ -92,6 +110,9 @@ discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_parseFromJSON(cJSON *di // discovery_v1_endpoint_port->app_protocol cJSON *app_protocol = cJSON_GetObjectItemCaseSensitive(discovery_v1_endpoint_portJSON, "appProtocol"); + if (cJSON_IsNull(app_protocol)) { + app_protocol = NULL; + } if (app_protocol) { if(!cJSON_IsString(app_protocol) && !cJSON_IsNull(app_protocol)) { @@ -101,6 +122,9 @@ discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_parseFromJSON(cJSON *di // discovery_v1_endpoint_port->name cJSON *name = cJSON_GetObjectItemCaseSensitive(discovery_v1_endpoint_portJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -110,6 +134,9 @@ discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_parseFromJSON(cJSON *di // discovery_v1_endpoint_port->port cJSON *port = cJSON_GetObjectItemCaseSensitive(discovery_v1_endpoint_portJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (port) { if(!cJSON_IsNumber(port)) { @@ -119,6 +146,9 @@ discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_parseFromJSON(cJSON *di // discovery_v1_endpoint_port->protocol cJSON *protocol = cJSON_GetObjectItemCaseSensitive(discovery_v1_endpoint_portJSON, "protocol"); + if (cJSON_IsNull(protocol)) { + protocol = NULL; + } if (protocol) { if(!cJSON_IsString(protocol) && !cJSON_IsNull(protocol)) { @@ -127,7 +157,7 @@ discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_parseFromJSON(cJSON *di } - discovery_v1_endpoint_port_local_var = discovery_v1_endpoint_port_create ( + discovery_v1_endpoint_port_local_var = discovery_v1_endpoint_port_create_internal ( app_protocol && !cJSON_IsNull(app_protocol) ? strdup(app_protocol->valuestring) : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, port ? port->valuedouble : 0, diff --git a/kubernetes/model/discovery_v1_endpoint_port.h b/kubernetes/model/discovery_v1_endpoint_port.h index b376403f..ba99b0ae 100644 --- a/kubernetes/model/discovery_v1_endpoint_port.h +++ b/kubernetes/model/discovery_v1_endpoint_port.h @@ -24,9 +24,10 @@ typedef struct discovery_v1_endpoint_port_t { int port; //numeric char *protocol; // string + int _library_owned; // Is the library responsible for freeing this object? } discovery_v1_endpoint_port_t; -discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_create( +__attribute__((deprecated)) discovery_v1_endpoint_port_t *discovery_v1_endpoint_port_create( char *app_protocol, char *name, int port, diff --git a/kubernetes/model/events_v1_event.c b/kubernetes/model/events_v1_event.c index 59a4e2d8..53782273 100644 --- a/kubernetes/model/events_v1_event.c +++ b/kubernetes/model/events_v1_event.c @@ -5,7 +5,7 @@ -events_v1_event_t *events_v1_event_create( +static events_v1_event_t *events_v1_event_create_internal( char *action, char *api_version, int deprecated_count, @@ -46,14 +46,58 @@ events_v1_event_t *events_v1_event_create( events_v1_event_local_var->series = series; events_v1_event_local_var->type = type; + events_v1_event_local_var->_library_owned = 1; return events_v1_event_local_var; } +__attribute__((deprecated)) events_v1_event_t *events_v1_event_create( + char *action, + char *api_version, + int deprecated_count, + char *deprecated_first_timestamp, + char *deprecated_last_timestamp, + v1_event_source_t *deprecated_source, + char *event_time, + char *kind, + v1_object_meta_t *metadata, + char *note, + char *reason, + v1_object_reference_t *regarding, + v1_object_reference_t *related, + char *reporting_controller, + char *reporting_instance, + events_v1_event_series_t *series, + char *type + ) { + return events_v1_event_create_internal ( + action, + api_version, + deprecated_count, + deprecated_first_timestamp, + deprecated_last_timestamp, + deprecated_source, + event_time, + kind, + metadata, + note, + reason, + regarding, + related, + reporting_controller, + reporting_instance, + series, + type + ); +} void events_v1_event_free(events_v1_event_t *events_v1_event) { if(NULL == events_v1_event){ return ; } + if(events_v1_event->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "events_v1_event_free"); + return ; + } listEntry_t *listEntry; if (events_v1_event->action) { free(events_v1_event->action); @@ -315,6 +359,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->action cJSON *action = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "action"); + if (cJSON_IsNull(action)) { + action = NULL; + } if (action) { if(!cJSON_IsString(action) && !cJSON_IsNull(action)) { @@ -324,6 +371,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -333,6 +383,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->deprecated_count cJSON *deprecated_count = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "deprecatedCount"); + if (cJSON_IsNull(deprecated_count)) { + deprecated_count = NULL; + } if (deprecated_count) { if(!cJSON_IsNumber(deprecated_count)) { @@ -342,6 +395,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->deprecated_first_timestamp cJSON *deprecated_first_timestamp = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "deprecatedFirstTimestamp"); + if (cJSON_IsNull(deprecated_first_timestamp)) { + deprecated_first_timestamp = NULL; + } if (deprecated_first_timestamp) { if(!cJSON_IsString(deprecated_first_timestamp) && !cJSON_IsNull(deprecated_first_timestamp)) { @@ -351,6 +407,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->deprecated_last_timestamp cJSON *deprecated_last_timestamp = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "deprecatedLastTimestamp"); + if (cJSON_IsNull(deprecated_last_timestamp)) { + deprecated_last_timestamp = NULL; + } if (deprecated_last_timestamp) { if(!cJSON_IsString(deprecated_last_timestamp) && !cJSON_IsNull(deprecated_last_timestamp)) { @@ -360,12 +419,18 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->deprecated_source cJSON *deprecated_source = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "deprecatedSource"); + if (cJSON_IsNull(deprecated_source)) { + deprecated_source = NULL; + } if (deprecated_source) { deprecated_source_local_nonprim = v1_event_source_parseFromJSON(deprecated_source); //nonprimitive } // events_v1_event->event_time cJSON *event_time = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "eventTime"); + if (cJSON_IsNull(event_time)) { + event_time = NULL; + } if (!event_time) { goto end; } @@ -378,6 +443,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -387,12 +455,18 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // events_v1_event->note cJSON *note = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "note"); + if (cJSON_IsNull(note)) { + note = NULL; + } if (note) { if(!cJSON_IsString(note) && !cJSON_IsNull(note)) { @@ -402,6 +476,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -411,18 +488,27 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->regarding cJSON *regarding = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "regarding"); + if (cJSON_IsNull(regarding)) { + regarding = NULL; + } if (regarding) { regarding_local_nonprim = v1_object_reference_parseFromJSON(regarding); //nonprimitive } // events_v1_event->related cJSON *related = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "related"); + if (cJSON_IsNull(related)) { + related = NULL; + } if (related) { related_local_nonprim = v1_object_reference_parseFromJSON(related); //nonprimitive } // events_v1_event->reporting_controller cJSON *reporting_controller = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "reportingController"); + if (cJSON_IsNull(reporting_controller)) { + reporting_controller = NULL; + } if (reporting_controller) { if(!cJSON_IsString(reporting_controller) && !cJSON_IsNull(reporting_controller)) { @@ -432,6 +518,9 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->reporting_instance cJSON *reporting_instance = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "reportingInstance"); + if (cJSON_IsNull(reporting_instance)) { + reporting_instance = NULL; + } if (reporting_instance) { if(!cJSON_IsString(reporting_instance) && !cJSON_IsNull(reporting_instance)) { @@ -441,12 +530,18 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ // events_v1_event->series cJSON *series = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "series"); + if (cJSON_IsNull(series)) { + series = NULL; + } if (series) { series_local_nonprim = events_v1_event_series_parseFromJSON(series); //nonprimitive } // events_v1_event->type cJSON *type = cJSON_GetObjectItemCaseSensitive(events_v1_eventJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -455,7 +550,7 @@ events_v1_event_t *events_v1_event_parseFromJSON(cJSON *events_v1_eventJSON){ } - events_v1_event_local_var = events_v1_event_create ( + events_v1_event_local_var = events_v1_event_create_internal ( action && !cJSON_IsNull(action) ? strdup(action->valuestring) : NULL, api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, deprecated_count ? deprecated_count->valuedouble : 0, diff --git a/kubernetes/model/events_v1_event.h b/kubernetes/model/events_v1_event.h index 137e39c4..1cc71e62 100644 --- a/kubernetes/model/events_v1_event.h +++ b/kubernetes/model/events_v1_event.h @@ -41,9 +41,10 @@ typedef struct events_v1_event_t { struct events_v1_event_series_t *series; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } events_v1_event_t; -events_v1_event_t *events_v1_event_create( +__attribute__((deprecated)) events_v1_event_t *events_v1_event_create( char *action, char *api_version, int deprecated_count, diff --git a/kubernetes/model/events_v1_event_list.c b/kubernetes/model/events_v1_event_list.c index 44144285..20c392af 100644 --- a/kubernetes/model/events_v1_event_list.c +++ b/kubernetes/model/events_v1_event_list.c @@ -5,7 +5,7 @@ -events_v1_event_list_t *events_v1_event_list_create( +static events_v1_event_list_t *events_v1_event_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ events_v1_event_list_t *events_v1_event_list_create( events_v1_event_list_local_var->kind = kind; events_v1_event_list_local_var->metadata = metadata; + events_v1_event_list_local_var->_library_owned = 1; return events_v1_event_list_local_var; } +__attribute__((deprecated)) events_v1_event_list_t *events_v1_event_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return events_v1_event_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void events_v1_event_list_free(events_v1_event_list_t *events_v1_event_list) { if(NULL == events_v1_event_list){ return ; } + if(events_v1_event_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "events_v1_event_list_free"); + return ; + } listEntry_t *listEntry; if (events_v1_event_list->api_version) { free(events_v1_event_list->api_version); @@ -123,6 +141,9 @@ events_v1_event_list_t *events_v1_event_list_parseFromJSON(cJSON *events_v1_even // events_v1_event_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(events_v1_event_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ events_v1_event_list_t *events_v1_event_list_parseFromJSON(cJSON *events_v1_even // events_v1_event_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(events_v1_event_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ events_v1_event_list_t *events_v1_event_list_parseFromJSON(cJSON *events_v1_even // events_v1_event_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(events_v1_event_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ events_v1_event_list_t *events_v1_event_list_parseFromJSON(cJSON *events_v1_even // events_v1_event_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(events_v1_event_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - events_v1_event_list_local_var = events_v1_event_list_create ( + events_v1_event_list_local_var = events_v1_event_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/events_v1_event_list.h b/kubernetes/model/events_v1_event_list.h index 3e3c2218..3c0ff406 100644 --- a/kubernetes/model/events_v1_event_list.h +++ b/kubernetes/model/events_v1_event_list.h @@ -26,9 +26,10 @@ typedef struct events_v1_event_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } events_v1_event_list_t; -events_v1_event_list_t *events_v1_event_list_create( +__attribute__((deprecated)) events_v1_event_list_t *events_v1_event_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/events_v1_event_series.c b/kubernetes/model/events_v1_event_series.c index 0b94c80d..9f638fc0 100644 --- a/kubernetes/model/events_v1_event_series.c +++ b/kubernetes/model/events_v1_event_series.c @@ -5,7 +5,7 @@ -events_v1_event_series_t *events_v1_event_series_create( +static events_v1_event_series_t *events_v1_event_series_create_internal( int count, char *last_observed_time ) { @@ -16,14 +16,28 @@ events_v1_event_series_t *events_v1_event_series_create( events_v1_event_series_local_var->count = count; events_v1_event_series_local_var->last_observed_time = last_observed_time; + events_v1_event_series_local_var->_library_owned = 1; return events_v1_event_series_local_var; } +__attribute__((deprecated)) events_v1_event_series_t *events_v1_event_series_create( + int count, + char *last_observed_time + ) { + return events_v1_event_series_create_internal ( + count, + last_observed_time + ); +} void events_v1_event_series_free(events_v1_event_series_t *events_v1_event_series) { if(NULL == events_v1_event_series){ return ; } + if(events_v1_event_series->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "events_v1_event_series_free"); + return ; + } listEntry_t *listEntry; if (events_v1_event_series->last_observed_time) { free(events_v1_event_series->last_observed_time); @@ -66,6 +80,9 @@ events_v1_event_series_t *events_v1_event_series_parseFromJSON(cJSON *events_v1_ // events_v1_event_series->count cJSON *count = cJSON_GetObjectItemCaseSensitive(events_v1_event_seriesJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } if (!count) { goto end; } @@ -78,6 +95,9 @@ events_v1_event_series_t *events_v1_event_series_parseFromJSON(cJSON *events_v1_ // events_v1_event_series->last_observed_time cJSON *last_observed_time = cJSON_GetObjectItemCaseSensitive(events_v1_event_seriesJSON, "lastObservedTime"); + if (cJSON_IsNull(last_observed_time)) { + last_observed_time = NULL; + } if (!last_observed_time) { goto end; } @@ -89,7 +109,7 @@ events_v1_event_series_t *events_v1_event_series_parseFromJSON(cJSON *events_v1_ } - events_v1_event_series_local_var = events_v1_event_series_create ( + events_v1_event_series_local_var = events_v1_event_series_create_internal ( count->valuedouble, strdup(last_observed_time->valuestring) ); diff --git a/kubernetes/model/events_v1_event_series.h b/kubernetes/model/events_v1_event_series.h index ee15360d..5c13a1e4 100644 --- a/kubernetes/model/events_v1_event_series.h +++ b/kubernetes/model/events_v1_event_series.h @@ -22,9 +22,10 @@ typedef struct events_v1_event_series_t { int count; //numeric char *last_observed_time; //date time + int _library_owned; // Is the library responsible for freeing this object? } events_v1_event_series_t; -events_v1_event_series_t *events_v1_event_series_create( +__attribute__((deprecated)) events_v1_event_series_t *events_v1_event_series_create( int count, char *last_observed_time ); diff --git a/kubernetes/model/flowcontrol_v1_subject.c b/kubernetes/model/flowcontrol_v1_subject.c index 5d8377e0..f63032d6 100644 --- a/kubernetes/model/flowcontrol_v1_subject.c +++ b/kubernetes/model/flowcontrol_v1_subject.c @@ -5,7 +5,7 @@ -flowcontrol_v1_subject_t *flowcontrol_v1_subject_create( +static flowcontrol_v1_subject_t *flowcontrol_v1_subject_create_internal( v1_group_subject_t *group, char *kind, v1_service_account_subject_t *service_account, @@ -20,14 +20,32 @@ flowcontrol_v1_subject_t *flowcontrol_v1_subject_create( flowcontrol_v1_subject_local_var->service_account = service_account; flowcontrol_v1_subject_local_var->user = user; + flowcontrol_v1_subject_local_var->_library_owned = 1; return flowcontrol_v1_subject_local_var; } +__attribute__((deprecated)) flowcontrol_v1_subject_t *flowcontrol_v1_subject_create( + v1_group_subject_t *group, + char *kind, + v1_service_account_subject_t *service_account, + v1_user_subject_t *user + ) { + return flowcontrol_v1_subject_create_internal ( + group, + kind, + service_account, + user + ); +} void flowcontrol_v1_subject_free(flowcontrol_v1_subject_t *flowcontrol_v1_subject) { if(NULL == flowcontrol_v1_subject){ return ; } + if(flowcontrol_v1_subject->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "flowcontrol_v1_subject_free"); + return ; + } listEntry_t *listEntry; if (flowcontrol_v1_subject->group) { v1_group_subject_free(flowcontrol_v1_subject->group); @@ -121,12 +139,18 @@ flowcontrol_v1_subject_t *flowcontrol_v1_subject_parseFromJSON(cJSON *flowcontro // flowcontrol_v1_subject->group cJSON *group = cJSON_GetObjectItemCaseSensitive(flowcontrol_v1_subjectJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (group) { group_local_nonprim = v1_group_subject_parseFromJSON(group); //nonprimitive } // flowcontrol_v1_subject->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(flowcontrol_v1_subjectJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -139,18 +163,24 @@ flowcontrol_v1_subject_t *flowcontrol_v1_subject_parseFromJSON(cJSON *flowcontro // flowcontrol_v1_subject->service_account cJSON *service_account = cJSON_GetObjectItemCaseSensitive(flowcontrol_v1_subjectJSON, "serviceAccount"); + if (cJSON_IsNull(service_account)) { + service_account = NULL; + } if (service_account) { service_account_local_nonprim = v1_service_account_subject_parseFromJSON(service_account); //nonprimitive } // flowcontrol_v1_subject->user cJSON *user = cJSON_GetObjectItemCaseSensitive(flowcontrol_v1_subjectJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { user_local_nonprim = v1_user_subject_parseFromJSON(user); //nonprimitive } - flowcontrol_v1_subject_local_var = flowcontrol_v1_subject_create ( + flowcontrol_v1_subject_local_var = flowcontrol_v1_subject_create_internal ( group ? group_local_nonprim : NULL, strdup(kind->valuestring), service_account ? service_account_local_nonprim : NULL, diff --git a/kubernetes/model/flowcontrol_v1_subject.h b/kubernetes/model/flowcontrol_v1_subject.h index c5ec114a..cde29802 100644 --- a/kubernetes/model/flowcontrol_v1_subject.h +++ b/kubernetes/model/flowcontrol_v1_subject.h @@ -27,9 +27,10 @@ typedef struct flowcontrol_v1_subject_t { struct v1_service_account_subject_t *service_account; //model struct v1_user_subject_t *user; //model + int _library_owned; // Is the library responsible for freeing this object? } flowcontrol_v1_subject_t; -flowcontrol_v1_subject_t *flowcontrol_v1_subject_create( +__attribute__((deprecated)) flowcontrol_v1_subject_t *flowcontrol_v1_subject_create( v1_group_subject_t *group, char *kind, v1_service_account_subject_t *service_account, diff --git a/kubernetes/model/rbac_v1_subject.c b/kubernetes/model/rbac_v1_subject.c index 775d4ee9..9bfd9b16 100644 --- a/kubernetes/model/rbac_v1_subject.c +++ b/kubernetes/model/rbac_v1_subject.c @@ -5,7 +5,7 @@ -rbac_v1_subject_t *rbac_v1_subject_create( +static rbac_v1_subject_t *rbac_v1_subject_create_internal( char *api_group, char *kind, char *name, @@ -20,14 +20,32 @@ rbac_v1_subject_t *rbac_v1_subject_create( rbac_v1_subject_local_var->name = name; rbac_v1_subject_local_var->_namespace = _namespace; + rbac_v1_subject_local_var->_library_owned = 1; return rbac_v1_subject_local_var; } +__attribute__((deprecated)) rbac_v1_subject_t *rbac_v1_subject_create( + char *api_group, + char *kind, + char *name, + char *_namespace + ) { + return rbac_v1_subject_create_internal ( + api_group, + kind, + name, + _namespace + ); +} void rbac_v1_subject_free(rbac_v1_subject_t *rbac_v1_subject) { if(NULL == rbac_v1_subject){ return ; } + if(rbac_v1_subject->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "rbac_v1_subject_free"); + return ; + } listEntry_t *listEntry; if (rbac_v1_subject->api_group) { free(rbac_v1_subject->api_group); @@ -98,6 +116,9 @@ rbac_v1_subject_t *rbac_v1_subject_parseFromJSON(cJSON *rbac_v1_subjectJSON){ // rbac_v1_subject->api_group cJSON *api_group = cJSON_GetObjectItemCaseSensitive(rbac_v1_subjectJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } if (api_group) { if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) { @@ -107,6 +128,9 @@ rbac_v1_subject_t *rbac_v1_subject_parseFromJSON(cJSON *rbac_v1_subjectJSON){ // rbac_v1_subject->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(rbac_v1_subjectJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -119,6 +143,9 @@ rbac_v1_subject_t *rbac_v1_subject_parseFromJSON(cJSON *rbac_v1_subjectJSON){ // rbac_v1_subject->name cJSON *name = cJSON_GetObjectItemCaseSensitive(rbac_v1_subjectJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -131,6 +158,9 @@ rbac_v1_subject_t *rbac_v1_subject_parseFromJSON(cJSON *rbac_v1_subjectJSON){ // rbac_v1_subject->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(rbac_v1_subjectJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -139,7 +169,7 @@ rbac_v1_subject_t *rbac_v1_subject_parseFromJSON(cJSON *rbac_v1_subjectJSON){ } - rbac_v1_subject_local_var = rbac_v1_subject_create ( + rbac_v1_subject_local_var = rbac_v1_subject_create_internal ( api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, strdup(kind->valuestring), strdup(name->valuestring), diff --git a/kubernetes/model/rbac_v1_subject.h b/kubernetes/model/rbac_v1_subject.h index 3add3459..bb741968 100644 --- a/kubernetes/model/rbac_v1_subject.h +++ b/kubernetes/model/rbac_v1_subject.h @@ -24,9 +24,10 @@ typedef struct rbac_v1_subject_t { char *name; // string char *_namespace; // string + int _library_owned; // Is the library responsible for freeing this object? } rbac_v1_subject_t; -rbac_v1_subject_t *rbac_v1_subject_create( +__attribute__((deprecated)) rbac_v1_subject_t *rbac_v1_subject_create( char *api_group, char *kind, char *name, diff --git a/kubernetes/model/resource_v1_resource_claim.c b/kubernetes/model/resource_v1_resource_claim.c new file mode 100644 index 00000000..60ba42fd --- /dev/null +++ b/kubernetes/model/resource_v1_resource_claim.c @@ -0,0 +1,235 @@ +#include +#include +#include +#include "resource_v1_resource_claim.h" + + + +static resource_v1_resource_claim_t *resource_v1_resource_claim_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_claim_spec_t *spec, + v1_resource_claim_status_t *status + ) { + resource_v1_resource_claim_t *resource_v1_resource_claim_local_var = malloc(sizeof(resource_v1_resource_claim_t)); + if (!resource_v1_resource_claim_local_var) { + return NULL; + } + resource_v1_resource_claim_local_var->api_version = api_version; + resource_v1_resource_claim_local_var->kind = kind; + resource_v1_resource_claim_local_var->metadata = metadata; + resource_v1_resource_claim_local_var->spec = spec; + resource_v1_resource_claim_local_var->status = status; + + resource_v1_resource_claim_local_var->_library_owned = 1; + return resource_v1_resource_claim_local_var; +} + +__attribute__((deprecated)) resource_v1_resource_claim_t *resource_v1_resource_claim_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_claim_spec_t *spec, + v1_resource_claim_status_t *status + ) { + return resource_v1_resource_claim_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} + +void resource_v1_resource_claim_free(resource_v1_resource_claim_t *resource_v1_resource_claim) { + if(NULL == resource_v1_resource_claim){ + return ; + } + if(resource_v1_resource_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "resource_v1_resource_claim_free"); + return ; + } + listEntry_t *listEntry; + if (resource_v1_resource_claim->api_version) { + free(resource_v1_resource_claim->api_version); + resource_v1_resource_claim->api_version = NULL; + } + if (resource_v1_resource_claim->kind) { + free(resource_v1_resource_claim->kind); + resource_v1_resource_claim->kind = NULL; + } + if (resource_v1_resource_claim->metadata) { + v1_object_meta_free(resource_v1_resource_claim->metadata); + resource_v1_resource_claim->metadata = NULL; + } + if (resource_v1_resource_claim->spec) { + v1_resource_claim_spec_free(resource_v1_resource_claim->spec); + resource_v1_resource_claim->spec = NULL; + } + if (resource_v1_resource_claim->status) { + v1_resource_claim_status_free(resource_v1_resource_claim->status); + resource_v1_resource_claim->status = NULL; + } + free(resource_v1_resource_claim); +} + +cJSON *resource_v1_resource_claim_convertToJSON(resource_v1_resource_claim_t *resource_v1_resource_claim) { + cJSON *item = cJSON_CreateObject(); + + // resource_v1_resource_claim->api_version + if(resource_v1_resource_claim->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", resource_v1_resource_claim->api_version) == NULL) { + goto fail; //String + } + } + + + // resource_v1_resource_claim->kind + if(resource_v1_resource_claim->kind) { + if(cJSON_AddStringToObject(item, "kind", resource_v1_resource_claim->kind) == NULL) { + goto fail; //String + } + } + + + // resource_v1_resource_claim->metadata + if(resource_v1_resource_claim->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(resource_v1_resource_claim->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // resource_v1_resource_claim->spec + if (!resource_v1_resource_claim->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1_resource_claim_spec_convertToJSON(resource_v1_resource_claim->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + + // resource_v1_resource_claim->status + if(resource_v1_resource_claim->status) { + cJSON *status_local_JSON = v1_resource_claim_status_convertToJSON(resource_v1_resource_claim->status); + if(status_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "status", status_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +resource_v1_resource_claim_t *resource_v1_resource_claim_parseFromJSON(cJSON *resource_v1_resource_claimJSON){ + + resource_v1_resource_claim_t *resource_v1_resource_claim_local_var = NULL; + + // define the local variable for resource_v1_resource_claim->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for resource_v1_resource_claim->spec + v1_resource_claim_spec_t *spec_local_nonprim = NULL; + + // define the local variable for resource_v1_resource_claim->status + v1_resource_claim_status_t *status_local_nonprim = NULL; + + // resource_v1_resource_claim->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(resource_v1_resource_claimJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // resource_v1_resource_claim->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(resource_v1_resource_claimJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // resource_v1_resource_claim->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(resource_v1_resource_claimJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // resource_v1_resource_claim->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(resource_v1_resource_claimJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1_resource_claim_spec_parseFromJSON(spec); //nonprimitive + + // resource_v1_resource_claim->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(resource_v1_resource_claimJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } + if (status) { + status_local_nonprim = v1_resource_claim_status_parseFromJSON(status); //nonprimitive + } + + + resource_v1_resource_claim_local_var = resource_v1_resource_claim_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim, + status ? status_local_nonprim : NULL + ); + + return resource_v1_resource_claim_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1_resource_claim_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + if (status_local_nonprim) { + v1_resource_claim_status_free(status_local_nonprim); + status_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/resource_v1_resource_claim.h b/kubernetes/model/resource_v1_resource_claim.h new file mode 100644 index 00000000..0efa5288 --- /dev/null +++ b/kubernetes/model/resource_v1_resource_claim.h @@ -0,0 +1,49 @@ +/* + * resource_v1_resource_claim.h + * + * ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _resource_v1_resource_claim_H_ +#define _resource_v1_resource_claim_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct resource_v1_resource_claim_t resource_v1_resource_claim_t; + +#include "v1_object_meta.h" +#include "v1_resource_claim_spec.h" +#include "v1_resource_claim_status.h" + + + +typedef struct resource_v1_resource_claim_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1_resource_claim_spec_t *spec; //model + struct v1_resource_claim_status_t *status; //model + + int _library_owned; // Is the library responsible for freeing this object? +} resource_v1_resource_claim_t; + +__attribute__((deprecated)) resource_v1_resource_claim_t *resource_v1_resource_claim_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_claim_spec_t *spec, + v1_resource_claim_status_t *status +); + +void resource_v1_resource_claim_free(resource_v1_resource_claim_t *resource_v1_resource_claim); + +resource_v1_resource_claim_t *resource_v1_resource_claim_parseFromJSON(cJSON *resource_v1_resource_claimJSON); + +cJSON *resource_v1_resource_claim_convertToJSON(resource_v1_resource_claim_t *resource_v1_resource_claim); + +#endif /* _resource_v1_resource_claim_H_ */ + diff --git a/kubernetes/model/storage_v1_token_request.c b/kubernetes/model/storage_v1_token_request.c index 87e89fbe..58eabb82 100644 --- a/kubernetes/model/storage_v1_token_request.c +++ b/kubernetes/model/storage_v1_token_request.c @@ -5,7 +5,7 @@ -storage_v1_token_request_t *storage_v1_token_request_create( +static storage_v1_token_request_t *storage_v1_token_request_create_internal( char *audience, long expiration_seconds ) { @@ -16,14 +16,28 @@ storage_v1_token_request_t *storage_v1_token_request_create( storage_v1_token_request_local_var->audience = audience; storage_v1_token_request_local_var->expiration_seconds = expiration_seconds; + storage_v1_token_request_local_var->_library_owned = 1; return storage_v1_token_request_local_var; } +__attribute__((deprecated)) storage_v1_token_request_t *storage_v1_token_request_create( + char *audience, + long expiration_seconds + ) { + return storage_v1_token_request_create_internal ( + audience, + expiration_seconds + ); +} void storage_v1_token_request_free(storage_v1_token_request_t *storage_v1_token_request) { if(NULL == storage_v1_token_request){ return ; } + if(storage_v1_token_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "storage_v1_token_request_free"); + return ; + } listEntry_t *listEntry; if (storage_v1_token_request->audience) { free(storage_v1_token_request->audience); @@ -65,6 +79,9 @@ storage_v1_token_request_t *storage_v1_token_request_parseFromJSON(cJSON *storag // storage_v1_token_request->audience cJSON *audience = cJSON_GetObjectItemCaseSensitive(storage_v1_token_requestJSON, "audience"); + if (cJSON_IsNull(audience)) { + audience = NULL; + } if (!audience) { goto end; } @@ -77,6 +94,9 @@ storage_v1_token_request_t *storage_v1_token_request_parseFromJSON(cJSON *storag // storage_v1_token_request->expiration_seconds cJSON *expiration_seconds = cJSON_GetObjectItemCaseSensitive(storage_v1_token_requestJSON, "expirationSeconds"); + if (cJSON_IsNull(expiration_seconds)) { + expiration_seconds = NULL; + } if (expiration_seconds) { if(!cJSON_IsNumber(expiration_seconds)) { @@ -85,7 +105,7 @@ storage_v1_token_request_t *storage_v1_token_request_parseFromJSON(cJSON *storag } - storage_v1_token_request_local_var = storage_v1_token_request_create ( + storage_v1_token_request_local_var = storage_v1_token_request_create_internal ( strdup(audience->valuestring), expiration_seconds ? expiration_seconds->valuedouble : 0 ); diff --git a/kubernetes/model/storage_v1_token_request.h b/kubernetes/model/storage_v1_token_request.h index 6cfc4136..92364ddc 100644 --- a/kubernetes/model/storage_v1_token_request.h +++ b/kubernetes/model/storage_v1_token_request.h @@ -22,9 +22,10 @@ typedef struct storage_v1_token_request_t { char *audience; // string long expiration_seconds; //numeric + int _library_owned; // Is the library responsible for freeing this object? } storage_v1_token_request_t; -storage_v1_token_request_t *storage_v1_token_request_create( +__attribute__((deprecated)) storage_v1_token_request_t *storage_v1_token_request_create( char *audience, long expiration_seconds ); diff --git a/kubernetes/model/v1_affinity.c b/kubernetes/model/v1_affinity.c index 4f0d3e79..30c5d4fe 100644 --- a/kubernetes/model/v1_affinity.c +++ b/kubernetes/model/v1_affinity.c @@ -5,7 +5,7 @@ -v1_affinity_t *v1_affinity_create( +static v1_affinity_t *v1_affinity_create_internal( v1_node_affinity_t *node_affinity, v1_pod_affinity_t *pod_affinity, v1_pod_anti_affinity_t *pod_anti_affinity @@ -18,14 +18,30 @@ v1_affinity_t *v1_affinity_create( v1_affinity_local_var->pod_affinity = pod_affinity; v1_affinity_local_var->pod_anti_affinity = pod_anti_affinity; + v1_affinity_local_var->_library_owned = 1; return v1_affinity_local_var; } +__attribute__((deprecated)) v1_affinity_t *v1_affinity_create( + v1_node_affinity_t *node_affinity, + v1_pod_affinity_t *pod_affinity, + v1_pod_anti_affinity_t *pod_anti_affinity + ) { + return v1_affinity_create_internal ( + node_affinity, + pod_affinity, + pod_anti_affinity + ); +} void v1_affinity_free(v1_affinity_t *v1_affinity) { if(NULL == v1_affinity){ return ; } + if(v1_affinity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_affinity_free"); + return ; + } listEntry_t *listEntry; if (v1_affinity->node_affinity) { v1_node_affinity_free(v1_affinity->node_affinity); @@ -106,24 +122,33 @@ v1_affinity_t *v1_affinity_parseFromJSON(cJSON *v1_affinityJSON){ // v1_affinity->node_affinity cJSON *node_affinity = cJSON_GetObjectItemCaseSensitive(v1_affinityJSON, "nodeAffinity"); + if (cJSON_IsNull(node_affinity)) { + node_affinity = NULL; + } if (node_affinity) { node_affinity_local_nonprim = v1_node_affinity_parseFromJSON(node_affinity); //nonprimitive } // v1_affinity->pod_affinity cJSON *pod_affinity = cJSON_GetObjectItemCaseSensitive(v1_affinityJSON, "podAffinity"); + if (cJSON_IsNull(pod_affinity)) { + pod_affinity = NULL; + } if (pod_affinity) { pod_affinity_local_nonprim = v1_pod_affinity_parseFromJSON(pod_affinity); //nonprimitive } // v1_affinity->pod_anti_affinity cJSON *pod_anti_affinity = cJSON_GetObjectItemCaseSensitive(v1_affinityJSON, "podAntiAffinity"); + if (cJSON_IsNull(pod_anti_affinity)) { + pod_anti_affinity = NULL; + } if (pod_anti_affinity) { pod_anti_affinity_local_nonprim = v1_pod_anti_affinity_parseFromJSON(pod_anti_affinity); //nonprimitive } - v1_affinity_local_var = v1_affinity_create ( + v1_affinity_local_var = v1_affinity_create_internal ( node_affinity ? node_affinity_local_nonprim : NULL, pod_affinity ? pod_affinity_local_nonprim : NULL, pod_anti_affinity ? pod_anti_affinity_local_nonprim : NULL diff --git a/kubernetes/model/v1_affinity.h b/kubernetes/model/v1_affinity.h index 8ef572ab..3e564b41 100644 --- a/kubernetes/model/v1_affinity.h +++ b/kubernetes/model/v1_affinity.h @@ -26,9 +26,10 @@ typedef struct v1_affinity_t { struct v1_pod_affinity_t *pod_affinity; //model struct v1_pod_anti_affinity_t *pod_anti_affinity; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_affinity_t; -v1_affinity_t *v1_affinity_create( +__attribute__((deprecated)) v1_affinity_t *v1_affinity_create( v1_node_affinity_t *node_affinity, v1_pod_affinity_t *pod_affinity, v1_pod_anti_affinity_t *pod_anti_affinity diff --git a/kubernetes/model/v1_aggregation_rule.c b/kubernetes/model/v1_aggregation_rule.c index e2f6bec4..2d7348f9 100644 --- a/kubernetes/model/v1_aggregation_rule.c +++ b/kubernetes/model/v1_aggregation_rule.c @@ -5,7 +5,7 @@ -v1_aggregation_rule_t *v1_aggregation_rule_create( +static v1_aggregation_rule_t *v1_aggregation_rule_create_internal( list_t *cluster_role_selectors ) { v1_aggregation_rule_t *v1_aggregation_rule_local_var = malloc(sizeof(v1_aggregation_rule_t)); @@ -14,14 +14,26 @@ v1_aggregation_rule_t *v1_aggregation_rule_create( } v1_aggregation_rule_local_var->cluster_role_selectors = cluster_role_selectors; + v1_aggregation_rule_local_var->_library_owned = 1; return v1_aggregation_rule_local_var; } +__attribute__((deprecated)) v1_aggregation_rule_t *v1_aggregation_rule_create( + list_t *cluster_role_selectors + ) { + return v1_aggregation_rule_create_internal ( + cluster_role_selectors + ); +} void v1_aggregation_rule_free(v1_aggregation_rule_t *v1_aggregation_rule) { if(NULL == v1_aggregation_rule){ return ; } + if(v1_aggregation_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_aggregation_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_aggregation_rule->cluster_role_selectors) { list_ForEach(listEntry, v1_aggregation_rule->cluster_role_selectors) { @@ -72,6 +84,9 @@ v1_aggregation_rule_t *v1_aggregation_rule_parseFromJSON(cJSON *v1_aggregation_r // v1_aggregation_rule->cluster_role_selectors cJSON *cluster_role_selectors = cJSON_GetObjectItemCaseSensitive(v1_aggregation_ruleJSON, "clusterRoleSelectors"); + if (cJSON_IsNull(cluster_role_selectors)) { + cluster_role_selectors = NULL; + } if (cluster_role_selectors) { cJSON *cluster_role_selectors_local_nonprimitive = NULL; if(!cJSON_IsArray(cluster_role_selectors)){ @@ -92,7 +107,7 @@ v1_aggregation_rule_t *v1_aggregation_rule_parseFromJSON(cJSON *v1_aggregation_r } - v1_aggregation_rule_local_var = v1_aggregation_rule_create ( + v1_aggregation_rule_local_var = v1_aggregation_rule_create_internal ( cluster_role_selectors ? cluster_role_selectorsList : NULL ); diff --git a/kubernetes/model/v1_aggregation_rule.h b/kubernetes/model/v1_aggregation_rule.h index 61fe3706..bbda7f87 100644 --- a/kubernetes/model/v1_aggregation_rule.h +++ b/kubernetes/model/v1_aggregation_rule.h @@ -22,9 +22,10 @@ typedef struct v1_aggregation_rule_t v1_aggregation_rule_t; typedef struct v1_aggregation_rule_t { list_t *cluster_role_selectors; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_aggregation_rule_t; -v1_aggregation_rule_t *v1_aggregation_rule_create( +__attribute__((deprecated)) v1_aggregation_rule_t *v1_aggregation_rule_create( list_t *cluster_role_selectors ); diff --git a/kubernetes/model/v1_allocated_device_status.c b/kubernetes/model/v1_allocated_device_status.c new file mode 100644 index 00000000..e0f728de --- /dev/null +++ b/kubernetes/model/v1_allocated_device_status.c @@ -0,0 +1,325 @@ +#include +#include +#include +#include "v1_allocated_device_status.h" + + + +static v1_allocated_device_status_t *v1_allocated_device_status_create_internal( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1_network_device_data_t *network_data, + char *pool, + char *share_id + ) { + v1_allocated_device_status_t *v1_allocated_device_status_local_var = malloc(sizeof(v1_allocated_device_status_t)); + if (!v1_allocated_device_status_local_var) { + return NULL; + } + v1_allocated_device_status_local_var->conditions = conditions; + v1_allocated_device_status_local_var->data = data; + v1_allocated_device_status_local_var->device = device; + v1_allocated_device_status_local_var->driver = driver; + v1_allocated_device_status_local_var->network_data = network_data; + v1_allocated_device_status_local_var->pool = pool; + v1_allocated_device_status_local_var->share_id = share_id; + + v1_allocated_device_status_local_var->_library_owned = 1; + return v1_allocated_device_status_local_var; +} + +__attribute__((deprecated)) v1_allocated_device_status_t *v1_allocated_device_status_create( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1_network_device_data_t *network_data, + char *pool, + char *share_id + ) { + return v1_allocated_device_status_create_internal ( + conditions, + data, + device, + driver, + network_data, + pool, + share_id + ); +} + +void v1_allocated_device_status_free(v1_allocated_device_status_t *v1_allocated_device_status) { + if(NULL == v1_allocated_device_status){ + return ; + } + if(v1_allocated_device_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_allocated_device_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1_allocated_device_status->conditions) { + list_ForEach(listEntry, v1_allocated_device_status->conditions) { + v1_condition_free(listEntry->data); + } + list_freeList(v1_allocated_device_status->conditions); + v1_allocated_device_status->conditions = NULL; + } + if (v1_allocated_device_status->data) { + object_free(v1_allocated_device_status->data); + v1_allocated_device_status->data = NULL; + } + if (v1_allocated_device_status->device) { + free(v1_allocated_device_status->device); + v1_allocated_device_status->device = NULL; + } + if (v1_allocated_device_status->driver) { + free(v1_allocated_device_status->driver); + v1_allocated_device_status->driver = NULL; + } + if (v1_allocated_device_status->network_data) { + v1_network_device_data_free(v1_allocated_device_status->network_data); + v1_allocated_device_status->network_data = NULL; + } + if (v1_allocated_device_status->pool) { + free(v1_allocated_device_status->pool); + v1_allocated_device_status->pool = NULL; + } + if (v1_allocated_device_status->share_id) { + free(v1_allocated_device_status->share_id); + v1_allocated_device_status->share_id = NULL; + } + free(v1_allocated_device_status); +} + +cJSON *v1_allocated_device_status_convertToJSON(v1_allocated_device_status_t *v1_allocated_device_status) { + cJSON *item = cJSON_CreateObject(); + + // v1_allocated_device_status->conditions + if(v1_allocated_device_status->conditions) { + cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); + if(conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *conditionsListEntry; + if (v1_allocated_device_status->conditions) { + list_ForEach(conditionsListEntry, v1_allocated_device_status->conditions) { + cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(conditions, itemLocal); + } + } + } + + + // v1_allocated_device_status->data + if(v1_allocated_device_status->data) { + cJSON *data_object = object_convertToJSON(v1_allocated_device_status->data); + if(data_object == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "data", data_object); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_allocated_device_status->device + if (!v1_allocated_device_status->device) { + goto fail; + } + if(cJSON_AddStringToObject(item, "device", v1_allocated_device_status->device) == NULL) { + goto fail; //String + } + + + // v1_allocated_device_status->driver + if (!v1_allocated_device_status->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1_allocated_device_status->driver) == NULL) { + goto fail; //String + } + + + // v1_allocated_device_status->network_data + if(v1_allocated_device_status->network_data) { + cJSON *network_data_local_JSON = v1_network_device_data_convertToJSON(v1_allocated_device_status->network_data); + if(network_data_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "networkData", network_data_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_allocated_device_status->pool + if (!v1_allocated_device_status->pool) { + goto fail; + } + if(cJSON_AddStringToObject(item, "pool", v1_allocated_device_status->pool) == NULL) { + goto fail; //String + } + + + // v1_allocated_device_status->share_id + if(v1_allocated_device_status->share_id) { + if(cJSON_AddStringToObject(item, "shareID", v1_allocated_device_status->share_id) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_allocated_device_status_t *v1_allocated_device_status_parseFromJSON(cJSON *v1_allocated_device_statusJSON){ + + v1_allocated_device_status_t *v1_allocated_device_status_local_var = NULL; + + // define the local list for v1_allocated_device_status->conditions + list_t *conditionsList = NULL; + + // define the local variable for v1_allocated_device_status->network_data + v1_network_device_data_t *network_data_local_nonprim = NULL; + + // v1_allocated_device_status->conditions + cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_allocated_device_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } + if (conditions) { + cJSON *conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(conditions)){ + goto end; //nonprimitive container + } + + conditionsList = list_createList(); + + cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) + { + if(!cJSON_IsObject(conditions_local_nonprimitive)){ + goto end; + } + v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); + + list_addElement(conditionsList, conditionsItem); + } + } + + // v1_allocated_device_status->data + cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_allocated_device_statusJSON, "data"); + if (cJSON_IsNull(data)) { + data = NULL; + } + object_t *data_local_object = NULL; + if (data) { + data_local_object = object_parseFromJSON(data); //object + } + + // v1_allocated_device_status->device + cJSON *device = cJSON_GetObjectItemCaseSensitive(v1_allocated_device_statusJSON, "device"); + if (cJSON_IsNull(device)) { + device = NULL; + } + if (!device) { + goto end; + } + + + if(!cJSON_IsString(device)) + { + goto end; //String + } + + // v1_allocated_device_status->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_allocated_device_statusJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1_allocated_device_status->network_data + cJSON *network_data = cJSON_GetObjectItemCaseSensitive(v1_allocated_device_statusJSON, "networkData"); + if (cJSON_IsNull(network_data)) { + network_data = NULL; + } + if (network_data) { + network_data_local_nonprim = v1_network_device_data_parseFromJSON(network_data); //nonprimitive + } + + // v1_allocated_device_status->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1_allocated_device_statusJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + if(!cJSON_IsString(pool)) + { + goto end; //String + } + + // v1_allocated_device_status->share_id + cJSON *share_id = cJSON_GetObjectItemCaseSensitive(v1_allocated_device_statusJSON, "shareID"); + if (cJSON_IsNull(share_id)) { + share_id = NULL; + } + if (share_id) { + if(!cJSON_IsString(share_id) && !cJSON_IsNull(share_id)) + { + goto end; //String + } + } + + + v1_allocated_device_status_local_var = v1_allocated_device_status_create_internal ( + conditions ? conditionsList : NULL, + data ? data_local_object : NULL, + strdup(device->valuestring), + strdup(driver->valuestring), + network_data ? network_data_local_nonprim : NULL, + strdup(pool->valuestring), + share_id && !cJSON_IsNull(share_id) ? strdup(share_id->valuestring) : NULL + ); + + return v1_allocated_device_status_local_var; +end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (network_data_local_nonprim) { + v1_network_device_data_free(network_data_local_nonprim); + network_data_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_allocated_device_status.h b/kubernetes/model/v1_allocated_device_status.h new file mode 100644 index 00000000..51c9f350 --- /dev/null +++ b/kubernetes/model/v1_allocated_device_status.h @@ -0,0 +1,53 @@ +/* + * v1_allocated_device_status.h + * + * AllocatedDeviceStatus contains the status of an allocated device, if the driver chooses to report it. This may include driver-specific information. The combination of Driver, Pool, Device, and ShareID must match the corresponding key in Status.Allocation.Devices. + */ + +#ifndef _v1_allocated_device_status_H_ +#define _v1_allocated_device_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_allocated_device_status_t v1_allocated_device_status_t; + +#include "object.h" +#include "v1_condition.h" +#include "v1_network_device_data.h" + + + +typedef struct v1_allocated_device_status_t { + list_t *conditions; //nonprimitive container + object_t *data; //object + char *device; // string + char *driver; // string + struct v1_network_device_data_t *network_data; //model + char *pool; // string + char *share_id; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_allocated_device_status_t; + +__attribute__((deprecated)) v1_allocated_device_status_t *v1_allocated_device_status_create( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1_network_device_data_t *network_data, + char *pool, + char *share_id +); + +void v1_allocated_device_status_free(v1_allocated_device_status_t *v1_allocated_device_status); + +v1_allocated_device_status_t *v1_allocated_device_status_parseFromJSON(cJSON *v1_allocated_device_statusJSON); + +cJSON *v1_allocated_device_status_convertToJSON(v1_allocated_device_status_t *v1_allocated_device_status); + +#endif /* _v1_allocated_device_status_H_ */ + diff --git a/kubernetes/model/v1_allocation_result.c b/kubernetes/model/v1_allocation_result.c new file mode 100644 index 00000000..0c6f02ff --- /dev/null +++ b/kubernetes/model/v1_allocation_result.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include "v1_allocation_result.h" + + + +static v1_allocation_result_t *v1_allocation_result_create_internal( + char *allocation_timestamp, + v1_device_allocation_result_t *devices, + v1_node_selector_t *node_selector + ) { + v1_allocation_result_t *v1_allocation_result_local_var = malloc(sizeof(v1_allocation_result_t)); + if (!v1_allocation_result_local_var) { + return NULL; + } + v1_allocation_result_local_var->allocation_timestamp = allocation_timestamp; + v1_allocation_result_local_var->devices = devices; + v1_allocation_result_local_var->node_selector = node_selector; + + v1_allocation_result_local_var->_library_owned = 1; + return v1_allocation_result_local_var; +} + +__attribute__((deprecated)) v1_allocation_result_t *v1_allocation_result_create( + char *allocation_timestamp, + v1_device_allocation_result_t *devices, + v1_node_selector_t *node_selector + ) { + return v1_allocation_result_create_internal ( + allocation_timestamp, + devices, + node_selector + ); +} + +void v1_allocation_result_free(v1_allocation_result_t *v1_allocation_result) { + if(NULL == v1_allocation_result){ + return ; + } + if(v1_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1_allocation_result->allocation_timestamp) { + free(v1_allocation_result->allocation_timestamp); + v1_allocation_result->allocation_timestamp = NULL; + } + if (v1_allocation_result->devices) { + v1_device_allocation_result_free(v1_allocation_result->devices); + v1_allocation_result->devices = NULL; + } + if (v1_allocation_result->node_selector) { + v1_node_selector_free(v1_allocation_result->node_selector); + v1_allocation_result->node_selector = NULL; + } + free(v1_allocation_result); +} + +cJSON *v1_allocation_result_convertToJSON(v1_allocation_result_t *v1_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1_allocation_result->allocation_timestamp + if(v1_allocation_result->allocation_timestamp) { + if(cJSON_AddStringToObject(item, "allocationTimestamp", v1_allocation_result->allocation_timestamp) == NULL) { + goto fail; //Date-Time + } + } + + + // v1_allocation_result->devices + if(v1_allocation_result->devices) { + cJSON *devices_local_JSON = v1_device_allocation_result_convertToJSON(v1_allocation_result->devices); + if(devices_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "devices", devices_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_allocation_result->node_selector + if(v1_allocation_result->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1_allocation_result->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_allocation_result_t *v1_allocation_result_parseFromJSON(cJSON *v1_allocation_resultJSON){ + + v1_allocation_result_t *v1_allocation_result_local_var = NULL; + + // define the local variable for v1_allocation_result->devices + v1_device_allocation_result_t *devices_local_nonprim = NULL; + + // define the local variable for v1_allocation_result->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // v1_allocation_result->allocation_timestamp + cJSON *allocation_timestamp = cJSON_GetObjectItemCaseSensitive(v1_allocation_resultJSON, "allocationTimestamp"); + if (cJSON_IsNull(allocation_timestamp)) { + allocation_timestamp = NULL; + } + if (allocation_timestamp) { + if(!cJSON_IsString(allocation_timestamp) && !cJSON_IsNull(allocation_timestamp)) + { + goto end; //DateTime + } + } + + // v1_allocation_result->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1_allocation_resultJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + devices_local_nonprim = v1_device_allocation_result_parseFromJSON(devices); //nonprimitive + } + + // v1_allocation_result->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_allocation_resultJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + + v1_allocation_result_local_var = v1_allocation_result_create_internal ( + allocation_timestamp && !cJSON_IsNull(allocation_timestamp) ? strdup(allocation_timestamp->valuestring) : NULL, + devices ? devices_local_nonprim : NULL, + node_selector ? node_selector_local_nonprim : NULL + ); + + return v1_allocation_result_local_var; +end: + if (devices_local_nonprim) { + v1_device_allocation_result_free(devices_local_nonprim); + devices_local_nonprim = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_allocation_result.h b/kubernetes/model/v1_allocation_result.h new file mode 100644 index 00000000..2718c6cb --- /dev/null +++ b/kubernetes/model/v1_allocation_result.h @@ -0,0 +1,44 @@ +/* + * v1_allocation_result.h + * + * AllocationResult contains attributes of an allocated resource. + */ + +#ifndef _v1_allocation_result_H_ +#define _v1_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_allocation_result_t v1_allocation_result_t; + +#include "v1_device_allocation_result.h" +#include "v1_node_selector.h" + + + +typedef struct v1_allocation_result_t { + char *allocation_timestamp; //date time + struct v1_device_allocation_result_t *devices; //model + struct v1_node_selector_t *node_selector; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_allocation_result_t; + +__attribute__((deprecated)) v1_allocation_result_t *v1_allocation_result_create( + char *allocation_timestamp, + v1_device_allocation_result_t *devices, + v1_node_selector_t *node_selector +); + +void v1_allocation_result_free(v1_allocation_result_t *v1_allocation_result); + +v1_allocation_result_t *v1_allocation_result_parseFromJSON(cJSON *v1_allocation_resultJSON); + +cJSON *v1_allocation_result_convertToJSON(v1_allocation_result_t *v1_allocation_result); + +#endif /* _v1_allocation_result_H_ */ + diff --git a/kubernetes/model/v1_api_group.c b/kubernetes/model/v1_api_group.c index 9a9d98d4..7ab691bb 100644 --- a/kubernetes/model/v1_api_group.c +++ b/kubernetes/model/v1_api_group.c @@ -5,7 +5,7 @@ -v1_api_group_t *v1_api_group_create( +static v1_api_group_t *v1_api_group_create_internal( char *api_version, char *kind, char *name, @@ -24,14 +24,36 @@ v1_api_group_t *v1_api_group_create( v1_api_group_local_var->server_address_by_client_cidrs = server_address_by_client_cidrs; v1_api_group_local_var->versions = versions; + v1_api_group_local_var->_library_owned = 1; return v1_api_group_local_var; } +__attribute__((deprecated)) v1_api_group_t *v1_api_group_create( + char *api_version, + char *kind, + char *name, + v1_group_version_for_discovery_t *preferred_version, + list_t *server_address_by_client_cidrs, + list_t *versions + ) { + return v1_api_group_create_internal ( + api_version, + kind, + name, + preferred_version, + server_address_by_client_cidrs, + versions + ); +} void v1_api_group_free(v1_api_group_t *v1_api_group) { if(NULL == v1_api_group){ return ; } + if(v1_api_group->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_group_free"); + return ; + } listEntry_t *listEntry; if (v1_api_group->api_version) { free(v1_api_group->api_version); @@ -170,6 +192,9 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ // v1_api_group->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -179,6 +204,9 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ // v1_api_group->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -188,6 +216,9 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ // v1_api_group->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -200,12 +231,18 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ // v1_api_group->preferred_version cJSON *preferred_version = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "preferredVersion"); + if (cJSON_IsNull(preferred_version)) { + preferred_version = NULL; + } if (preferred_version) { preferred_version_local_nonprim = v1_group_version_for_discovery_parseFromJSON(preferred_version); //nonprimitive } // v1_api_group->server_address_by_client_cidrs cJSON *server_address_by_client_cidrs = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "serverAddressByClientCIDRs"); + if (cJSON_IsNull(server_address_by_client_cidrs)) { + server_address_by_client_cidrs = NULL; + } if (server_address_by_client_cidrs) { cJSON *server_address_by_client_cidrs_local_nonprimitive = NULL; if(!cJSON_IsArray(server_address_by_client_cidrs)){ @@ -227,6 +264,9 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ // v1_api_group->versions cJSON *versions = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "versions"); + if (cJSON_IsNull(versions)) { + versions = NULL; + } if (!versions) { goto end; } @@ -250,7 +290,7 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ } - v1_api_group_local_var = v1_api_group_create ( + v1_api_group_local_var = v1_api_group_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, strdup(name->valuestring), diff --git a/kubernetes/model/v1_api_group.h b/kubernetes/model/v1_api_group.h index b44fd31d..0813a9e9 100644 --- a/kubernetes/model/v1_api_group.h +++ b/kubernetes/model/v1_api_group.h @@ -28,9 +28,10 @@ typedef struct v1_api_group_t { list_t *server_address_by_client_cidrs; //nonprimitive container list_t *versions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_api_group_t; -v1_api_group_t *v1_api_group_create( +__attribute__((deprecated)) v1_api_group_t *v1_api_group_create( char *api_version, char *kind, char *name, diff --git a/kubernetes/model/v1_api_group_list.c b/kubernetes/model/v1_api_group_list.c index 67744251..0331ffe2 100644 --- a/kubernetes/model/v1_api_group_list.c +++ b/kubernetes/model/v1_api_group_list.c @@ -5,7 +5,7 @@ -v1_api_group_list_t *v1_api_group_list_create( +static v1_api_group_list_t *v1_api_group_list_create_internal( char *api_version, list_t *groups, char *kind @@ -18,14 +18,30 @@ v1_api_group_list_t *v1_api_group_list_create( v1_api_group_list_local_var->groups = groups; v1_api_group_list_local_var->kind = kind; + v1_api_group_list_local_var->_library_owned = 1; return v1_api_group_list_local_var; } +__attribute__((deprecated)) v1_api_group_list_t *v1_api_group_list_create( + char *api_version, + list_t *groups, + char *kind + ) { + return v1_api_group_list_create_internal ( + api_version, + groups, + kind + ); +} void v1_api_group_list_free(v1_api_group_list_t *v1_api_group_list) { if(NULL == v1_api_group_list){ return ; } + if(v1_api_group_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_group_list_free"); + return ; + } listEntry_t *listEntry; if (v1_api_group_list->api_version) { free(v1_api_group_list->api_version); @@ -101,6 +117,9 @@ v1_api_group_list_t *v1_api_group_list_parseFromJSON(cJSON *v1_api_group_listJSO // v1_api_group_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_group_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -110,6 +129,9 @@ v1_api_group_list_t *v1_api_group_list_parseFromJSON(cJSON *v1_api_group_listJSO // v1_api_group_list->groups cJSON *groups = cJSON_GetObjectItemCaseSensitive(v1_api_group_listJSON, "groups"); + if (cJSON_IsNull(groups)) { + groups = NULL; + } if (!groups) { goto end; } @@ -134,6 +156,9 @@ v1_api_group_list_t *v1_api_group_list_parseFromJSON(cJSON *v1_api_group_listJSO // v1_api_group_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_api_group_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -142,7 +167,7 @@ v1_api_group_list_t *v1_api_group_list_parseFromJSON(cJSON *v1_api_group_listJSO } - v1_api_group_list_local_var = v1_api_group_list_create ( + v1_api_group_list_local_var = v1_api_group_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, groupsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL diff --git a/kubernetes/model/v1_api_group_list.h b/kubernetes/model/v1_api_group_list.h index 31f40645..446b05f1 100644 --- a/kubernetes/model/v1_api_group_list.h +++ b/kubernetes/model/v1_api_group_list.h @@ -24,9 +24,10 @@ typedef struct v1_api_group_list_t { list_t *groups; //nonprimitive container char *kind; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_api_group_list_t; -v1_api_group_list_t *v1_api_group_list_create( +__attribute__((deprecated)) v1_api_group_list_t *v1_api_group_list_create( char *api_version, list_t *groups, char *kind diff --git a/kubernetes/model/v1_api_resource.c b/kubernetes/model/v1_api_resource.c index a295132c..cec6d5bb 100644 --- a/kubernetes/model/v1_api_resource.c +++ b/kubernetes/model/v1_api_resource.c @@ -5,7 +5,7 @@ -v1_api_resource_t *v1_api_resource_create( +static v1_api_resource_t *v1_api_resource_create_internal( list_t *categories, char *group, char *kind, @@ -32,14 +32,44 @@ v1_api_resource_t *v1_api_resource_create( v1_api_resource_local_var->verbs = verbs; v1_api_resource_local_var->version = version; + v1_api_resource_local_var->_library_owned = 1; return v1_api_resource_local_var; } +__attribute__((deprecated)) v1_api_resource_t *v1_api_resource_create( + list_t *categories, + char *group, + char *kind, + char *name, + int namespaced, + list_t *short_names, + char *singular_name, + char *storage_version_hash, + list_t *verbs, + char *version + ) { + return v1_api_resource_create_internal ( + categories, + group, + kind, + name, + namespaced, + short_names, + singular_name, + storage_version_hash, + verbs, + version + ); +} void v1_api_resource_free(v1_api_resource_t *v1_api_resource) { if(NULL == v1_api_resource){ return ; } + if(v1_api_resource->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_resource_free"); + return ; + } listEntry_t *listEntry; if (v1_api_resource->categories) { list_ForEach(listEntry, v1_api_resource->categories) { @@ -101,7 +131,7 @@ cJSON *v1_api_resource_convertToJSON(v1_api_resource_t *v1_api_resource) { listEntry_t *categoriesListEntry; list_ForEach(categoriesListEntry, v1_api_resource->categories) { - if(cJSON_AddStringToObject(categories, "", (char*)categoriesListEntry->data) == NULL) + if(cJSON_AddStringToObject(categories, "", categoriesListEntry->data) == NULL) { goto fail; } @@ -153,7 +183,7 @@ cJSON *v1_api_resource_convertToJSON(v1_api_resource_t *v1_api_resource) { listEntry_t *short_namesListEntry; list_ForEach(short_namesListEntry, v1_api_resource->short_names) { - if(cJSON_AddStringToObject(short_names, "", (char*)short_namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(short_names, "", short_namesListEntry->data) == NULL) { goto fail; } @@ -189,7 +219,7 @@ cJSON *v1_api_resource_convertToJSON(v1_api_resource_t *v1_api_resource) { listEntry_t *verbsListEntry; list_ForEach(verbsListEntry, v1_api_resource->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) + if(cJSON_AddStringToObject(verbs, "", verbsListEntry->data) == NULL) { goto fail; } @@ -226,6 +256,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->categories cJSON *categories = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "categories"); + if (cJSON_IsNull(categories)) { + categories = NULL; + } if (categories) { cJSON *categories_local = NULL; if(!cJSON_IsArray(categories)) { @@ -245,6 +278,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->group cJSON *group = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (group) { if(!cJSON_IsString(group) && !cJSON_IsNull(group)) { @@ -254,6 +290,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -266,6 +305,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -278,6 +320,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->namespaced cJSON *namespaced = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "namespaced"); + if (cJSON_IsNull(namespaced)) { + namespaced = NULL; + } if (!namespaced) { goto end; } @@ -290,6 +335,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->short_names cJSON *short_names = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "shortNames"); + if (cJSON_IsNull(short_names)) { + short_names = NULL; + } if (short_names) { cJSON *short_names_local = NULL; if(!cJSON_IsArray(short_names)) { @@ -309,6 +357,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->singular_name cJSON *singular_name = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "singularName"); + if (cJSON_IsNull(singular_name)) { + singular_name = NULL; + } if (!singular_name) { goto end; } @@ -321,6 +372,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->storage_version_hash cJSON *storage_version_hash = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "storageVersionHash"); + if (cJSON_IsNull(storage_version_hash)) { + storage_version_hash = NULL; + } if (storage_version_hash) { if(!cJSON_IsString(storage_version_hash) && !cJSON_IsNull(storage_version_hash)) { @@ -330,6 +384,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->verbs cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "verbs"); + if (cJSON_IsNull(verbs)) { + verbs = NULL; + } if (!verbs) { goto end; } @@ -352,6 +409,9 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->version cJSON *version = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } if (version) { if(!cJSON_IsString(version) && !cJSON_IsNull(version)) { @@ -360,7 +420,7 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ } - v1_api_resource_local_var = v1_api_resource_create ( + v1_api_resource_local_var = v1_api_resource_create_internal ( categories ? categoriesList : NULL, group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, strdup(kind->valuestring), diff --git a/kubernetes/model/v1_api_resource.h b/kubernetes/model/v1_api_resource.h index 59d961a2..34e693b8 100644 --- a/kubernetes/model/v1_api_resource.h +++ b/kubernetes/model/v1_api_resource.h @@ -30,9 +30,10 @@ typedef struct v1_api_resource_t { list_t *verbs; //primitive container char *version; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_api_resource_t; -v1_api_resource_t *v1_api_resource_create( +__attribute__((deprecated)) v1_api_resource_t *v1_api_resource_create( list_t *categories, char *group, char *kind, diff --git a/kubernetes/model/v1_api_resource_list.c b/kubernetes/model/v1_api_resource_list.c index 4c363f20..84bee266 100644 --- a/kubernetes/model/v1_api_resource_list.c +++ b/kubernetes/model/v1_api_resource_list.c @@ -5,7 +5,7 @@ -v1_api_resource_list_t *v1_api_resource_list_create( +static v1_api_resource_list_t *v1_api_resource_list_create_internal( char *api_version, char *group_version, char *kind, @@ -20,14 +20,32 @@ v1_api_resource_list_t *v1_api_resource_list_create( v1_api_resource_list_local_var->kind = kind; v1_api_resource_list_local_var->resources = resources; + v1_api_resource_list_local_var->_library_owned = 1; return v1_api_resource_list_local_var; } +__attribute__((deprecated)) v1_api_resource_list_t *v1_api_resource_list_create( + char *api_version, + char *group_version, + char *kind, + list_t *resources + ) { + return v1_api_resource_list_create_internal ( + api_version, + group_version, + kind, + resources + ); +} void v1_api_resource_list_free(v1_api_resource_list_t *v1_api_resource_list) { if(NULL == v1_api_resource_list){ return ; } + if(v1_api_resource_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_resource_list_free"); + return ; + } listEntry_t *listEntry; if (v1_api_resource_list->api_version) { free(v1_api_resource_list->api_version); @@ -116,6 +134,9 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc // v1_api_resource_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_resource_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -125,6 +146,9 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc // v1_api_resource_list->group_version cJSON *group_version = cJSON_GetObjectItemCaseSensitive(v1_api_resource_listJSON, "groupVersion"); + if (cJSON_IsNull(group_version)) { + group_version = NULL; + } if (!group_version) { goto end; } @@ -137,6 +161,9 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc // v1_api_resource_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_api_resource_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -146,6 +173,9 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc // v1_api_resource_list->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_api_resource_listJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (!resources) { goto end; } @@ -169,7 +199,7 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc } - v1_api_resource_list_local_var = v1_api_resource_list_create ( + v1_api_resource_list_local_var = v1_api_resource_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, strdup(group_version->valuestring), kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_api_resource_list.h b/kubernetes/model/v1_api_resource_list.h index e1ae0f08..c36d4323 100644 --- a/kubernetes/model/v1_api_resource_list.h +++ b/kubernetes/model/v1_api_resource_list.h @@ -25,9 +25,10 @@ typedef struct v1_api_resource_list_t { char *kind; // string list_t *resources; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_api_resource_list_t; -v1_api_resource_list_t *v1_api_resource_list_create( +__attribute__((deprecated)) v1_api_resource_list_t *v1_api_resource_list_create( char *api_version, char *group_version, char *kind, diff --git a/kubernetes/model/v1_api_service.c b/kubernetes/model/v1_api_service.c index c8f75998..f0f4543b 100644 --- a/kubernetes/model/v1_api_service.c +++ b/kubernetes/model/v1_api_service.c @@ -5,7 +5,7 @@ -v1_api_service_t *v1_api_service_create( +static v1_api_service_t *v1_api_service_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_api_service_t *v1_api_service_create( v1_api_service_local_var->spec = spec; v1_api_service_local_var->status = status; + v1_api_service_local_var->_library_owned = 1; return v1_api_service_local_var; } +__attribute__((deprecated)) v1_api_service_t *v1_api_service_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_api_service_spec_t *spec, + v1_api_service_status_t *status + ) { + return v1_api_service_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_api_service_free(v1_api_service_t *v1_api_service) { if(NULL == v1_api_service){ return ; } + if(v1_api_service->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_service_free"); + return ; + } listEntry_t *listEntry; if (v1_api_service->api_version) { free(v1_api_service->api_version); @@ -134,6 +154,9 @@ v1_api_service_t *v1_api_service_parseFromJSON(cJSON *v1_api_serviceJSON){ // v1_api_service->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_serviceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_api_service_t *v1_api_service_parseFromJSON(cJSON *v1_api_serviceJSON){ // v1_api_service->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_api_serviceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_api_service_t *v1_api_service_parseFromJSON(cJSON *v1_api_serviceJSON){ // v1_api_service->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_api_serviceJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_api_service->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_api_serviceJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_api_service_spec_parseFromJSON(spec); //nonprimitive } // v1_api_service->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_api_serviceJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_api_service_status_parseFromJSON(status); //nonprimitive } - v1_api_service_local_var = v1_api_service_create ( + v1_api_service_local_var = v1_api_service_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_api_service.h b/kubernetes/model/v1_api_service.h index 13b4c861..f1bdaac3 100644 --- a/kubernetes/model/v1_api_service.h +++ b/kubernetes/model/v1_api_service.h @@ -28,9 +28,10 @@ typedef struct v1_api_service_t { struct v1_api_service_spec_t *spec; //model struct v1_api_service_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_api_service_t; -v1_api_service_t *v1_api_service_create( +__attribute__((deprecated)) v1_api_service_t *v1_api_service_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_api_service_condition.c b/kubernetes/model/v1_api_service_condition.c index a27ccf17..fa1fd058 100644 --- a/kubernetes/model/v1_api_service_condition.c +++ b/kubernetes/model/v1_api_service_condition.c @@ -5,7 +5,7 @@ -v1_api_service_condition_t *v1_api_service_condition_create( +static v1_api_service_condition_t *v1_api_service_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_api_service_condition_t *v1_api_service_condition_create( v1_api_service_condition_local_var->status = status; v1_api_service_condition_local_var->type = type; + v1_api_service_condition_local_var->_library_owned = 1; return v1_api_service_condition_local_var; } +__attribute__((deprecated)) v1_api_service_condition_t *v1_api_service_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_api_service_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_api_service_condition_free(v1_api_service_condition_t *v1_api_service_condition) { if(NULL == v1_api_service_condition){ return ; } + if(v1_api_service_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_service_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_api_service_condition->last_transition_time) { free(v1_api_service_condition->last_transition_time); @@ -112,6 +132,9 @@ v1_api_service_condition_t *v1_api_service_condition_parseFromJSON(cJSON *v1_api // v1_api_service_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_api_service_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v1_api_service_condition_t *v1_api_service_condition_parseFromJSON(cJSON *v1_api // v1_api_service_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_api_service_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1_api_service_condition_t *v1_api_service_condition_parseFromJSON(cJSON *v1_api // v1_api_service_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_api_service_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1_api_service_condition_t *v1_api_service_condition_parseFromJSON(cJSON *v1_api // v1_api_service_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_api_service_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1_api_service_condition_t *v1_api_service_condition_parseFromJSON(cJSON *v1_api // v1_api_service_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_api_service_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1_api_service_condition_t *v1_api_service_condition_parseFromJSON(cJSON *v1_api } - v1_api_service_condition_local_var = v1_api_service_condition_create ( + v1_api_service_condition_local_var = v1_api_service_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_api_service_condition.h b/kubernetes/model/v1_api_service_condition.h index 59c5922b..439d8f0e 100644 --- a/kubernetes/model/v1_api_service_condition.h +++ b/kubernetes/model/v1_api_service_condition.h @@ -25,9 +25,10 @@ typedef struct v1_api_service_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_api_service_condition_t; -v1_api_service_condition_t *v1_api_service_condition_create( +__attribute__((deprecated)) v1_api_service_condition_t *v1_api_service_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_api_service_list.c b/kubernetes/model/v1_api_service_list.c index ac102c65..e4215a69 100644 --- a/kubernetes/model/v1_api_service_list.c +++ b/kubernetes/model/v1_api_service_list.c @@ -5,7 +5,7 @@ -v1_api_service_list_t *v1_api_service_list_create( +static v1_api_service_list_t *v1_api_service_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_api_service_list_t *v1_api_service_list_create( v1_api_service_list_local_var->kind = kind; v1_api_service_list_local_var->metadata = metadata; + v1_api_service_list_local_var->_library_owned = 1; return v1_api_service_list_local_var; } +__attribute__((deprecated)) v1_api_service_list_t *v1_api_service_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_api_service_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_api_service_list_free(v1_api_service_list_t *v1_api_service_list) { if(NULL == v1_api_service_list){ return ; } + if(v1_api_service_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_service_list_free"); + return ; + } listEntry_t *listEntry; if (v1_api_service_list->api_version) { free(v1_api_service_list->api_version); @@ -123,6 +141,9 @@ v1_api_service_list_t *v1_api_service_list_parseFromJSON(cJSON *v1_api_service_l // v1_api_service_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_service_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_api_service_list_t *v1_api_service_list_parseFromJSON(cJSON *v1_api_service_l // v1_api_service_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_api_service_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_api_service_list_t *v1_api_service_list_parseFromJSON(cJSON *v1_api_service_l // v1_api_service_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_api_service_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_api_service_list_t *v1_api_service_list_parseFromJSON(cJSON *v1_api_service_l // v1_api_service_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_api_service_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_api_service_list_local_var = v1_api_service_list_create ( + v1_api_service_list_local_var = v1_api_service_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_api_service_list.h b/kubernetes/model/v1_api_service_list.h index b28f2b64..d1b53d14 100644 --- a/kubernetes/model/v1_api_service_list.h +++ b/kubernetes/model/v1_api_service_list.h @@ -26,9 +26,10 @@ typedef struct v1_api_service_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_api_service_list_t; -v1_api_service_list_t *v1_api_service_list_create( +__attribute__((deprecated)) v1_api_service_list_t *v1_api_service_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_api_service_spec.c b/kubernetes/model/v1_api_service_spec.c index c2ec8f4e..1a117d8c 100644 --- a/kubernetes/model/v1_api_service_spec.c +++ b/kubernetes/model/v1_api_service_spec.c @@ -5,7 +5,7 @@ -v1_api_service_spec_t *v1_api_service_spec_create( +static v1_api_service_spec_t *v1_api_service_spec_create_internal( char *ca_bundle, char *group, int group_priority_minimum, @@ -26,14 +26,38 @@ v1_api_service_spec_t *v1_api_service_spec_create( v1_api_service_spec_local_var->version = version; v1_api_service_spec_local_var->version_priority = version_priority; + v1_api_service_spec_local_var->_library_owned = 1; return v1_api_service_spec_local_var; } +__attribute__((deprecated)) v1_api_service_spec_t *v1_api_service_spec_create( + char *ca_bundle, + char *group, + int group_priority_minimum, + int insecure_skip_tls_verify, + apiregistration_v1_service_reference_t *service, + char *version, + int version_priority + ) { + return v1_api_service_spec_create_internal ( + ca_bundle, + group, + group_priority_minimum, + insecure_skip_tls_verify, + service, + version, + version_priority + ); +} void v1_api_service_spec_free(v1_api_service_spec_t *v1_api_service_spec) { if(NULL == v1_api_service_spec){ return ; } + if(v1_api_service_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_service_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_api_service_spec->ca_bundle) { free(v1_api_service_spec->ca_bundle); @@ -136,6 +160,9 @@ v1_api_service_spec_t *v1_api_service_spec_parseFromJSON(cJSON *v1_api_service_s // v1_api_service_spec->ca_bundle cJSON *ca_bundle = cJSON_GetObjectItemCaseSensitive(v1_api_service_specJSON, "caBundle"); + if (cJSON_IsNull(ca_bundle)) { + ca_bundle = NULL; + } if (ca_bundle) { if(!cJSON_IsString(ca_bundle)) { @@ -145,6 +172,9 @@ v1_api_service_spec_t *v1_api_service_spec_parseFromJSON(cJSON *v1_api_service_s // v1_api_service_spec->group cJSON *group = cJSON_GetObjectItemCaseSensitive(v1_api_service_specJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (group) { if(!cJSON_IsString(group) && !cJSON_IsNull(group)) { @@ -154,6 +184,9 @@ v1_api_service_spec_t *v1_api_service_spec_parseFromJSON(cJSON *v1_api_service_s // v1_api_service_spec->group_priority_minimum cJSON *group_priority_minimum = cJSON_GetObjectItemCaseSensitive(v1_api_service_specJSON, "groupPriorityMinimum"); + if (cJSON_IsNull(group_priority_minimum)) { + group_priority_minimum = NULL; + } if (!group_priority_minimum) { goto end; } @@ -166,6 +199,9 @@ v1_api_service_spec_t *v1_api_service_spec_parseFromJSON(cJSON *v1_api_service_s // v1_api_service_spec->insecure_skip_tls_verify cJSON *insecure_skip_tls_verify = cJSON_GetObjectItemCaseSensitive(v1_api_service_specJSON, "insecureSkipTLSVerify"); + if (cJSON_IsNull(insecure_skip_tls_verify)) { + insecure_skip_tls_verify = NULL; + } if (insecure_skip_tls_verify) { if(!cJSON_IsBool(insecure_skip_tls_verify)) { @@ -175,12 +211,18 @@ v1_api_service_spec_t *v1_api_service_spec_parseFromJSON(cJSON *v1_api_service_s // v1_api_service_spec->service cJSON *service = cJSON_GetObjectItemCaseSensitive(v1_api_service_specJSON, "service"); + if (cJSON_IsNull(service)) { + service = NULL; + } if (service) { service_local_nonprim = apiregistration_v1_service_reference_parseFromJSON(service); //nonprimitive } // v1_api_service_spec->version cJSON *version = cJSON_GetObjectItemCaseSensitive(v1_api_service_specJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } if (version) { if(!cJSON_IsString(version) && !cJSON_IsNull(version)) { @@ -190,6 +232,9 @@ v1_api_service_spec_t *v1_api_service_spec_parseFromJSON(cJSON *v1_api_service_s // v1_api_service_spec->version_priority cJSON *version_priority = cJSON_GetObjectItemCaseSensitive(v1_api_service_specJSON, "versionPriority"); + if (cJSON_IsNull(version_priority)) { + version_priority = NULL; + } if (!version_priority) { goto end; } @@ -201,7 +246,7 @@ v1_api_service_spec_t *v1_api_service_spec_parseFromJSON(cJSON *v1_api_service_s } - v1_api_service_spec_local_var = v1_api_service_spec_create ( + v1_api_service_spec_local_var = v1_api_service_spec_create_internal ( ca_bundle ? strdup(ca_bundle->valuestring) : NULL, group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, group_priority_minimum->valuedouble, diff --git a/kubernetes/model/v1_api_service_spec.h b/kubernetes/model/v1_api_service_spec.h index d1457ddf..52be9b29 100644 --- a/kubernetes/model/v1_api_service_spec.h +++ b/kubernetes/model/v1_api_service_spec.h @@ -28,9 +28,10 @@ typedef struct v1_api_service_spec_t { char *version; // string int version_priority; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_api_service_spec_t; -v1_api_service_spec_t *v1_api_service_spec_create( +__attribute__((deprecated)) v1_api_service_spec_t *v1_api_service_spec_create( char *ca_bundle, char *group, int group_priority_minimum, diff --git a/kubernetes/model/v1_api_service_status.c b/kubernetes/model/v1_api_service_status.c index a9bb5e8f..722a51ba 100644 --- a/kubernetes/model/v1_api_service_status.c +++ b/kubernetes/model/v1_api_service_status.c @@ -5,7 +5,7 @@ -v1_api_service_status_t *v1_api_service_status_create( +static v1_api_service_status_t *v1_api_service_status_create_internal( list_t *conditions ) { v1_api_service_status_t *v1_api_service_status_local_var = malloc(sizeof(v1_api_service_status_t)); @@ -14,14 +14,26 @@ v1_api_service_status_t *v1_api_service_status_create( } v1_api_service_status_local_var->conditions = conditions; + v1_api_service_status_local_var->_library_owned = 1; return v1_api_service_status_local_var; } +__attribute__((deprecated)) v1_api_service_status_t *v1_api_service_status_create( + list_t *conditions + ) { + return v1_api_service_status_create_internal ( + conditions + ); +} void v1_api_service_status_free(v1_api_service_status_t *v1_api_service_status) { if(NULL == v1_api_service_status){ return ; } + if(v1_api_service_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_service_status_free"); + return ; + } listEntry_t *listEntry; if (v1_api_service_status->conditions) { list_ForEach(listEntry, v1_api_service_status->conditions) { @@ -72,6 +84,9 @@ v1_api_service_status_t *v1_api_service_status_parseFromJSON(cJSON *v1_api_servi // v1_api_service_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_api_service_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -92,7 +107,7 @@ v1_api_service_status_t *v1_api_service_status_parseFromJSON(cJSON *v1_api_servi } - v1_api_service_status_local_var = v1_api_service_status_create ( + v1_api_service_status_local_var = v1_api_service_status_create_internal ( conditions ? conditionsList : NULL ); diff --git a/kubernetes/model/v1_api_service_status.h b/kubernetes/model/v1_api_service_status.h index b3491133..90494074 100644 --- a/kubernetes/model/v1_api_service_status.h +++ b/kubernetes/model/v1_api_service_status.h @@ -22,9 +22,10 @@ typedef struct v1_api_service_status_t v1_api_service_status_t; typedef struct v1_api_service_status_t { list_t *conditions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_api_service_status_t; -v1_api_service_status_t *v1_api_service_status_create( +__attribute__((deprecated)) v1_api_service_status_t *v1_api_service_status_create( list_t *conditions ); diff --git a/kubernetes/model/v1_api_versions.c b/kubernetes/model/v1_api_versions.c index 6f5e539e..402c16b4 100644 --- a/kubernetes/model/v1_api_versions.c +++ b/kubernetes/model/v1_api_versions.c @@ -5,7 +5,7 @@ -v1_api_versions_t *v1_api_versions_create( +static v1_api_versions_t *v1_api_versions_create_internal( char *api_version, char *kind, list_t *server_address_by_client_cidrs, @@ -20,14 +20,32 @@ v1_api_versions_t *v1_api_versions_create( v1_api_versions_local_var->server_address_by_client_cidrs = server_address_by_client_cidrs; v1_api_versions_local_var->versions = versions; + v1_api_versions_local_var->_library_owned = 1; return v1_api_versions_local_var; } +__attribute__((deprecated)) v1_api_versions_t *v1_api_versions_create( + char *api_version, + char *kind, + list_t *server_address_by_client_cidrs, + list_t *versions + ) { + return v1_api_versions_create_internal ( + api_version, + kind, + server_address_by_client_cidrs, + versions + ); +} void v1_api_versions_free(v1_api_versions_t *v1_api_versions) { if(NULL == v1_api_versions){ return ; } + if(v1_api_versions->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_api_versions_free"); + return ; + } listEntry_t *listEntry; if (v1_api_versions->api_version) { free(v1_api_versions->api_version); @@ -105,7 +123,7 @@ cJSON *v1_api_versions_convertToJSON(v1_api_versions_t *v1_api_versions) { listEntry_t *versionsListEntry; list_ForEach(versionsListEntry, v1_api_versions->versions) { - if(cJSON_AddStringToObject(versions, "", (char*)versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(versions, "", versionsListEntry->data) == NULL) { goto fail; } @@ -131,6 +149,9 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ // v1_api_versions->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_versionsJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -140,6 +161,9 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ // v1_api_versions->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_api_versionsJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -149,6 +173,9 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ // v1_api_versions->server_address_by_client_cidrs cJSON *server_address_by_client_cidrs = cJSON_GetObjectItemCaseSensitive(v1_api_versionsJSON, "serverAddressByClientCIDRs"); + if (cJSON_IsNull(server_address_by_client_cidrs)) { + server_address_by_client_cidrs = NULL; + } if (!server_address_by_client_cidrs) { goto end; } @@ -173,6 +200,9 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ // v1_api_versions->versions cJSON *versions = cJSON_GetObjectItemCaseSensitive(v1_api_versionsJSON, "versions"); + if (cJSON_IsNull(versions)) { + versions = NULL; + } if (!versions) { goto end; } @@ -194,7 +224,7 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ } - v1_api_versions_local_var = v1_api_versions_create ( + v1_api_versions_local_var = v1_api_versions_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, server_address_by_client_cidrsList, diff --git a/kubernetes/model/v1_api_versions.h b/kubernetes/model/v1_api_versions.h index 34c44871..c67f3c47 100644 --- a/kubernetes/model/v1_api_versions.h +++ b/kubernetes/model/v1_api_versions.h @@ -25,9 +25,10 @@ typedef struct v1_api_versions_t { list_t *server_address_by_client_cidrs; //nonprimitive container list_t *versions; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_api_versions_t; -v1_api_versions_t *v1_api_versions_create( +__attribute__((deprecated)) v1_api_versions_t *v1_api_versions_create( char *api_version, char *kind, list_t *server_address_by_client_cidrs, diff --git a/kubernetes/model/v1_app_armor_profile.c b/kubernetes/model/v1_app_armor_profile.c index 8a94e794..35a74cc7 100644 --- a/kubernetes/model/v1_app_armor_profile.c +++ b/kubernetes/model/v1_app_armor_profile.c @@ -5,7 +5,7 @@ -v1_app_armor_profile_t *v1_app_armor_profile_create( +static v1_app_armor_profile_t *v1_app_armor_profile_create_internal( char *localhost_profile, char *type ) { @@ -16,14 +16,28 @@ v1_app_armor_profile_t *v1_app_armor_profile_create( v1_app_armor_profile_local_var->localhost_profile = localhost_profile; v1_app_armor_profile_local_var->type = type; + v1_app_armor_profile_local_var->_library_owned = 1; return v1_app_armor_profile_local_var; } +__attribute__((deprecated)) v1_app_armor_profile_t *v1_app_armor_profile_create( + char *localhost_profile, + char *type + ) { + return v1_app_armor_profile_create_internal ( + localhost_profile, + type + ); +} void v1_app_armor_profile_free(v1_app_armor_profile_t *v1_app_armor_profile) { if(NULL == v1_app_armor_profile){ return ; } + if(v1_app_armor_profile->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_app_armor_profile_free"); + return ; + } listEntry_t *listEntry; if (v1_app_armor_profile->localhost_profile) { free(v1_app_armor_profile->localhost_profile); @@ -69,6 +83,9 @@ v1_app_armor_profile_t *v1_app_armor_profile_parseFromJSON(cJSON *v1_app_armor_p // v1_app_armor_profile->localhost_profile cJSON *localhost_profile = cJSON_GetObjectItemCaseSensitive(v1_app_armor_profileJSON, "localhostProfile"); + if (cJSON_IsNull(localhost_profile)) { + localhost_profile = NULL; + } if (localhost_profile) { if(!cJSON_IsString(localhost_profile) && !cJSON_IsNull(localhost_profile)) { @@ -78,6 +95,9 @@ v1_app_armor_profile_t *v1_app_armor_profile_parseFromJSON(cJSON *v1_app_armor_p // v1_app_armor_profile->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_app_armor_profileJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -89,7 +109,7 @@ v1_app_armor_profile_t *v1_app_armor_profile_parseFromJSON(cJSON *v1_app_armor_p } - v1_app_armor_profile_local_var = v1_app_armor_profile_create ( + v1_app_armor_profile_local_var = v1_app_armor_profile_create_internal ( localhost_profile && !cJSON_IsNull(localhost_profile) ? strdup(localhost_profile->valuestring) : NULL, strdup(type->valuestring) ); diff --git a/kubernetes/model/v1_app_armor_profile.h b/kubernetes/model/v1_app_armor_profile.h index b35ab3a9..9df4e43f 100644 --- a/kubernetes/model/v1_app_armor_profile.h +++ b/kubernetes/model/v1_app_armor_profile.h @@ -22,9 +22,10 @@ typedef struct v1_app_armor_profile_t { char *localhost_profile; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_app_armor_profile_t; -v1_app_armor_profile_t *v1_app_armor_profile_create( +__attribute__((deprecated)) v1_app_armor_profile_t *v1_app_armor_profile_create( char *localhost_profile, char *type ); diff --git a/kubernetes/model/v1_attached_volume.c b/kubernetes/model/v1_attached_volume.c index c044c1a7..c2bc8f9d 100644 --- a/kubernetes/model/v1_attached_volume.c +++ b/kubernetes/model/v1_attached_volume.c @@ -5,7 +5,7 @@ -v1_attached_volume_t *v1_attached_volume_create( +static v1_attached_volume_t *v1_attached_volume_create_internal( char *device_path, char *name ) { @@ -16,14 +16,28 @@ v1_attached_volume_t *v1_attached_volume_create( v1_attached_volume_local_var->device_path = device_path; v1_attached_volume_local_var->name = name; + v1_attached_volume_local_var->_library_owned = 1; return v1_attached_volume_local_var; } +__attribute__((deprecated)) v1_attached_volume_t *v1_attached_volume_create( + char *device_path, + char *name + ) { + return v1_attached_volume_create_internal ( + device_path, + name + ); +} void v1_attached_volume_free(v1_attached_volume_t *v1_attached_volume) { if(NULL == v1_attached_volume){ return ; } + if(v1_attached_volume->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_attached_volume_free"); + return ; + } listEntry_t *listEntry; if (v1_attached_volume->device_path) { free(v1_attached_volume->device_path); @@ -70,6 +84,9 @@ v1_attached_volume_t *v1_attached_volume_parseFromJSON(cJSON *v1_attached_volume // v1_attached_volume->device_path cJSON *device_path = cJSON_GetObjectItemCaseSensitive(v1_attached_volumeJSON, "devicePath"); + if (cJSON_IsNull(device_path)) { + device_path = NULL; + } if (!device_path) { goto end; } @@ -82,6 +99,9 @@ v1_attached_volume_t *v1_attached_volume_parseFromJSON(cJSON *v1_attached_volume // v1_attached_volume->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_attached_volumeJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1_attached_volume_t *v1_attached_volume_parseFromJSON(cJSON *v1_attached_volume } - v1_attached_volume_local_var = v1_attached_volume_create ( + v1_attached_volume_local_var = v1_attached_volume_create_internal ( strdup(device_path->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_attached_volume.h b/kubernetes/model/v1_attached_volume.h index 45b6684f..5ba1aa87 100644 --- a/kubernetes/model/v1_attached_volume.h +++ b/kubernetes/model/v1_attached_volume.h @@ -22,9 +22,10 @@ typedef struct v1_attached_volume_t { char *device_path; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_attached_volume_t; -v1_attached_volume_t *v1_attached_volume_create( +__attribute__((deprecated)) v1_attached_volume_t *v1_attached_volume_create( char *device_path, char *name ); diff --git a/kubernetes/model/v1_audit_annotation.c b/kubernetes/model/v1_audit_annotation.c index 9bcfd4e5..fc54c4a8 100644 --- a/kubernetes/model/v1_audit_annotation.c +++ b/kubernetes/model/v1_audit_annotation.c @@ -5,7 +5,7 @@ -v1_audit_annotation_t *v1_audit_annotation_create( +static v1_audit_annotation_t *v1_audit_annotation_create_internal( char *key, char *value_expression ) { @@ -16,14 +16,28 @@ v1_audit_annotation_t *v1_audit_annotation_create( v1_audit_annotation_local_var->key = key; v1_audit_annotation_local_var->value_expression = value_expression; + v1_audit_annotation_local_var->_library_owned = 1; return v1_audit_annotation_local_var; } +__attribute__((deprecated)) v1_audit_annotation_t *v1_audit_annotation_create( + char *key, + char *value_expression + ) { + return v1_audit_annotation_create_internal ( + key, + value_expression + ); +} void v1_audit_annotation_free(v1_audit_annotation_t *v1_audit_annotation) { if(NULL == v1_audit_annotation){ return ; } + if(v1_audit_annotation->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_audit_annotation_free"); + return ; + } listEntry_t *listEntry; if (v1_audit_annotation->key) { free(v1_audit_annotation->key); @@ -70,6 +84,9 @@ v1_audit_annotation_t *v1_audit_annotation_parseFromJSON(cJSON *v1_audit_annotat // v1_audit_annotation->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_audit_annotationJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -82,6 +99,9 @@ v1_audit_annotation_t *v1_audit_annotation_parseFromJSON(cJSON *v1_audit_annotat // v1_audit_annotation->value_expression cJSON *value_expression = cJSON_GetObjectItemCaseSensitive(v1_audit_annotationJSON, "valueExpression"); + if (cJSON_IsNull(value_expression)) { + value_expression = NULL; + } if (!value_expression) { goto end; } @@ -93,7 +113,7 @@ v1_audit_annotation_t *v1_audit_annotation_parseFromJSON(cJSON *v1_audit_annotat } - v1_audit_annotation_local_var = v1_audit_annotation_create ( + v1_audit_annotation_local_var = v1_audit_annotation_create_internal ( strdup(key->valuestring), strdup(value_expression->valuestring) ); diff --git a/kubernetes/model/v1_audit_annotation.h b/kubernetes/model/v1_audit_annotation.h index 43a9c1be..97b9de47 100644 --- a/kubernetes/model/v1_audit_annotation.h +++ b/kubernetes/model/v1_audit_annotation.h @@ -22,9 +22,10 @@ typedef struct v1_audit_annotation_t { char *key; // string char *value_expression; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_audit_annotation_t; -v1_audit_annotation_t *v1_audit_annotation_create( +__attribute__((deprecated)) v1_audit_annotation_t *v1_audit_annotation_create( char *key, char *value_expression ); diff --git a/kubernetes/model/v1_aws_elastic_block_store_volume_source.c b/kubernetes/model/v1_aws_elastic_block_store_volume_source.c index ce6f760b..576e4961 100644 --- a/kubernetes/model/v1_aws_elastic_block_store_volume_source.c +++ b/kubernetes/model/v1_aws_elastic_block_store_volume_source.c @@ -5,7 +5,7 @@ -v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_source_create( +static v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_source_create_internal( char *fs_type, int partition, int read_only, @@ -20,14 +20,32 @@ v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_so v1_aws_elastic_block_store_volume_source_local_var->read_only = read_only; v1_aws_elastic_block_store_volume_source_local_var->volume_id = volume_id; + v1_aws_elastic_block_store_volume_source_local_var->_library_owned = 1; return v1_aws_elastic_block_store_volume_source_local_var; } +__attribute__((deprecated)) v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_source_create( + char *fs_type, + int partition, + int read_only, + char *volume_id + ) { + return v1_aws_elastic_block_store_volume_source_create_internal ( + fs_type, + partition, + read_only, + volume_id + ); +} void v1_aws_elastic_block_store_volume_source_free(v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_source) { if(NULL == v1_aws_elastic_block_store_volume_source){ return ; } + if(v1_aws_elastic_block_store_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_aws_elastic_block_store_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_aws_elastic_block_store_volume_source->fs_type) { free(v1_aws_elastic_block_store_volume_source->fs_type); @@ -89,6 +107,9 @@ v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_so // v1_aws_elastic_block_store_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_aws_elastic_block_store_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -98,6 +119,9 @@ v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_so // v1_aws_elastic_block_store_volume_source->partition cJSON *partition = cJSON_GetObjectItemCaseSensitive(v1_aws_elastic_block_store_volume_sourceJSON, "partition"); + if (cJSON_IsNull(partition)) { + partition = NULL; + } if (partition) { if(!cJSON_IsNumber(partition)) { @@ -107,6 +131,9 @@ v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_so // v1_aws_elastic_block_store_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_aws_elastic_block_store_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -116,6 +143,9 @@ v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_so // v1_aws_elastic_block_store_volume_source->volume_id cJSON *volume_id = cJSON_GetObjectItemCaseSensitive(v1_aws_elastic_block_store_volume_sourceJSON, "volumeID"); + if (cJSON_IsNull(volume_id)) { + volume_id = NULL; + } if (!volume_id) { goto end; } @@ -127,7 +157,7 @@ v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_so } - v1_aws_elastic_block_store_volume_source_local_var = v1_aws_elastic_block_store_volume_source_create ( + v1_aws_elastic_block_store_volume_source_local_var = v1_aws_elastic_block_store_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, partition ? partition->valuedouble : 0, read_only ? read_only->valueint : 0, diff --git a/kubernetes/model/v1_aws_elastic_block_store_volume_source.h b/kubernetes/model/v1_aws_elastic_block_store_volume_source.h index 112384a3..5b895827 100644 --- a/kubernetes/model/v1_aws_elastic_block_store_volume_source.h +++ b/kubernetes/model/v1_aws_elastic_block_store_volume_source.h @@ -24,9 +24,10 @@ typedef struct v1_aws_elastic_block_store_volume_source_t { int read_only; //boolean char *volume_id; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_aws_elastic_block_store_volume_source_t; -v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_source_create( +__attribute__((deprecated)) v1_aws_elastic_block_store_volume_source_t *v1_aws_elastic_block_store_volume_source_create( char *fs_type, int partition, int read_only, diff --git a/kubernetes/model/v1_azure_disk_volume_source.c b/kubernetes/model/v1_azure_disk_volume_source.c index 558e6413..cfb8982a 100644 --- a/kubernetes/model/v1_azure_disk_volume_source.c +++ b/kubernetes/model/v1_azure_disk_volume_source.c @@ -5,7 +5,7 @@ -v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_create( +static v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_create_internal( char *caching_mode, char *disk_name, char *disk_uri, @@ -24,14 +24,36 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_create( v1_azure_disk_volume_source_local_var->kind = kind; v1_azure_disk_volume_source_local_var->read_only = read_only; + v1_azure_disk_volume_source_local_var->_library_owned = 1; return v1_azure_disk_volume_source_local_var; } +__attribute__((deprecated)) v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_create( + char *caching_mode, + char *disk_name, + char *disk_uri, + char *fs_type, + char *kind, + int read_only + ) { + return v1_azure_disk_volume_source_create_internal ( + caching_mode, + disk_name, + disk_uri, + fs_type, + kind, + read_only + ); +} void v1_azure_disk_volume_source_free(v1_azure_disk_volume_source_t *v1_azure_disk_volume_source) { if(NULL == v1_azure_disk_volume_source){ return ; } + if(v1_azure_disk_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_azure_disk_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_azure_disk_volume_source->caching_mode) { free(v1_azure_disk_volume_source->caching_mode); @@ -122,6 +144,9 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_parseFromJSON(cJSON * // v1_azure_disk_volume_source->caching_mode cJSON *caching_mode = cJSON_GetObjectItemCaseSensitive(v1_azure_disk_volume_sourceJSON, "cachingMode"); + if (cJSON_IsNull(caching_mode)) { + caching_mode = NULL; + } if (caching_mode) { if(!cJSON_IsString(caching_mode) && !cJSON_IsNull(caching_mode)) { @@ -131,6 +156,9 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_parseFromJSON(cJSON * // v1_azure_disk_volume_source->disk_name cJSON *disk_name = cJSON_GetObjectItemCaseSensitive(v1_azure_disk_volume_sourceJSON, "diskName"); + if (cJSON_IsNull(disk_name)) { + disk_name = NULL; + } if (!disk_name) { goto end; } @@ -143,6 +171,9 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_parseFromJSON(cJSON * // v1_azure_disk_volume_source->disk_uri cJSON *disk_uri = cJSON_GetObjectItemCaseSensitive(v1_azure_disk_volume_sourceJSON, "diskURI"); + if (cJSON_IsNull(disk_uri)) { + disk_uri = NULL; + } if (!disk_uri) { goto end; } @@ -155,6 +186,9 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_parseFromJSON(cJSON * // v1_azure_disk_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_azure_disk_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -164,6 +198,9 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_parseFromJSON(cJSON * // v1_azure_disk_volume_source->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_azure_disk_volume_sourceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -173,6 +210,9 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_parseFromJSON(cJSON * // v1_azure_disk_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_azure_disk_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -181,7 +221,7 @@ v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_parseFromJSON(cJSON * } - v1_azure_disk_volume_source_local_var = v1_azure_disk_volume_source_create ( + v1_azure_disk_volume_source_local_var = v1_azure_disk_volume_source_create_internal ( caching_mode && !cJSON_IsNull(caching_mode) ? strdup(caching_mode->valuestring) : NULL, strdup(disk_name->valuestring), strdup(disk_uri->valuestring), diff --git a/kubernetes/model/v1_azure_disk_volume_source.h b/kubernetes/model/v1_azure_disk_volume_source.h index 1e12a2c8..f306f7c7 100644 --- a/kubernetes/model/v1_azure_disk_volume_source.h +++ b/kubernetes/model/v1_azure_disk_volume_source.h @@ -26,9 +26,10 @@ typedef struct v1_azure_disk_volume_source_t { char *kind; // string int read_only; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_azure_disk_volume_source_t; -v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_create( +__attribute__((deprecated)) v1_azure_disk_volume_source_t *v1_azure_disk_volume_source_create( char *caching_mode, char *disk_name, char *disk_uri, diff --git a/kubernetes/model/v1_azure_file_persistent_volume_source.c b/kubernetes/model/v1_azure_file_persistent_volume_source.c index 203f7151..a5e144cd 100644 --- a/kubernetes/model/v1_azure_file_persistent_volume_source.c +++ b/kubernetes/model/v1_azure_file_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source_create( +static v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source_create_internal( int read_only, char *secret_name, char *secret_namespace, @@ -20,14 +20,32 @@ v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source v1_azure_file_persistent_volume_source_local_var->secret_namespace = secret_namespace; v1_azure_file_persistent_volume_source_local_var->share_name = share_name; + v1_azure_file_persistent_volume_source_local_var->_library_owned = 1; return v1_azure_file_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source_create( + int read_only, + char *secret_name, + char *secret_namespace, + char *share_name + ) { + return v1_azure_file_persistent_volume_source_create_internal ( + read_only, + secret_name, + secret_namespace, + share_name + ); +} void v1_azure_file_persistent_volume_source_free(v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source) { if(NULL == v1_azure_file_persistent_volume_source){ return ; } + if(v1_azure_file_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_azure_file_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_azure_file_persistent_volume_source->secret_name) { free(v1_azure_file_persistent_volume_source->secret_name); @@ -94,6 +112,9 @@ v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source // v1_azure_file_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_azure_file_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -103,6 +124,9 @@ v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source // v1_azure_file_persistent_volume_source->secret_name cJSON *secret_name = cJSON_GetObjectItemCaseSensitive(v1_azure_file_persistent_volume_sourceJSON, "secretName"); + if (cJSON_IsNull(secret_name)) { + secret_name = NULL; + } if (!secret_name) { goto end; } @@ -115,6 +139,9 @@ v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source // v1_azure_file_persistent_volume_source->secret_namespace cJSON *secret_namespace = cJSON_GetObjectItemCaseSensitive(v1_azure_file_persistent_volume_sourceJSON, "secretNamespace"); + if (cJSON_IsNull(secret_namespace)) { + secret_namespace = NULL; + } if (secret_namespace) { if(!cJSON_IsString(secret_namespace) && !cJSON_IsNull(secret_namespace)) { @@ -124,6 +151,9 @@ v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source // v1_azure_file_persistent_volume_source->share_name cJSON *share_name = cJSON_GetObjectItemCaseSensitive(v1_azure_file_persistent_volume_sourceJSON, "shareName"); + if (cJSON_IsNull(share_name)) { + share_name = NULL; + } if (!share_name) { goto end; } @@ -135,7 +165,7 @@ v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source } - v1_azure_file_persistent_volume_source_local_var = v1_azure_file_persistent_volume_source_create ( + v1_azure_file_persistent_volume_source_local_var = v1_azure_file_persistent_volume_source_create_internal ( read_only ? read_only->valueint : 0, strdup(secret_name->valuestring), secret_namespace && !cJSON_IsNull(secret_namespace) ? strdup(secret_namespace->valuestring) : NULL, diff --git a/kubernetes/model/v1_azure_file_persistent_volume_source.h b/kubernetes/model/v1_azure_file_persistent_volume_source.h index fbcc4711..90ea8b24 100644 --- a/kubernetes/model/v1_azure_file_persistent_volume_source.h +++ b/kubernetes/model/v1_azure_file_persistent_volume_source.h @@ -24,9 +24,10 @@ typedef struct v1_azure_file_persistent_volume_source_t { char *secret_namespace; // string char *share_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_azure_file_persistent_volume_source_t; -v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source_create( +__attribute__((deprecated)) v1_azure_file_persistent_volume_source_t *v1_azure_file_persistent_volume_source_create( int read_only, char *secret_name, char *secret_namespace, diff --git a/kubernetes/model/v1_azure_file_volume_source.c b/kubernetes/model/v1_azure_file_volume_source.c index aa055eda..37a8dc1c 100644 --- a/kubernetes/model/v1_azure_file_volume_source.c +++ b/kubernetes/model/v1_azure_file_volume_source.c @@ -5,7 +5,7 @@ -v1_azure_file_volume_source_t *v1_azure_file_volume_source_create( +static v1_azure_file_volume_source_t *v1_azure_file_volume_source_create_internal( int read_only, char *secret_name, char *share_name @@ -18,14 +18,30 @@ v1_azure_file_volume_source_t *v1_azure_file_volume_source_create( v1_azure_file_volume_source_local_var->secret_name = secret_name; v1_azure_file_volume_source_local_var->share_name = share_name; + v1_azure_file_volume_source_local_var->_library_owned = 1; return v1_azure_file_volume_source_local_var; } +__attribute__((deprecated)) v1_azure_file_volume_source_t *v1_azure_file_volume_source_create( + int read_only, + char *secret_name, + char *share_name + ) { + return v1_azure_file_volume_source_create_internal ( + read_only, + secret_name, + share_name + ); +} void v1_azure_file_volume_source_free(v1_azure_file_volume_source_t *v1_azure_file_volume_source) { if(NULL == v1_azure_file_volume_source){ return ; } + if(v1_azure_file_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_azure_file_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_azure_file_volume_source->secret_name) { free(v1_azure_file_volume_source->secret_name); @@ -80,6 +96,9 @@ v1_azure_file_volume_source_t *v1_azure_file_volume_source_parseFromJSON(cJSON * // v1_azure_file_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_azure_file_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -89,6 +108,9 @@ v1_azure_file_volume_source_t *v1_azure_file_volume_source_parseFromJSON(cJSON * // v1_azure_file_volume_source->secret_name cJSON *secret_name = cJSON_GetObjectItemCaseSensitive(v1_azure_file_volume_sourceJSON, "secretName"); + if (cJSON_IsNull(secret_name)) { + secret_name = NULL; + } if (!secret_name) { goto end; } @@ -101,6 +123,9 @@ v1_azure_file_volume_source_t *v1_azure_file_volume_source_parseFromJSON(cJSON * // v1_azure_file_volume_source->share_name cJSON *share_name = cJSON_GetObjectItemCaseSensitive(v1_azure_file_volume_sourceJSON, "shareName"); + if (cJSON_IsNull(share_name)) { + share_name = NULL; + } if (!share_name) { goto end; } @@ -112,7 +137,7 @@ v1_azure_file_volume_source_t *v1_azure_file_volume_source_parseFromJSON(cJSON * } - v1_azure_file_volume_source_local_var = v1_azure_file_volume_source_create ( + v1_azure_file_volume_source_local_var = v1_azure_file_volume_source_create_internal ( read_only ? read_only->valueint : 0, strdup(secret_name->valuestring), strdup(share_name->valuestring) diff --git a/kubernetes/model/v1_azure_file_volume_source.h b/kubernetes/model/v1_azure_file_volume_source.h index 3e8a5c96..6441d147 100644 --- a/kubernetes/model/v1_azure_file_volume_source.h +++ b/kubernetes/model/v1_azure_file_volume_source.h @@ -23,9 +23,10 @@ typedef struct v1_azure_file_volume_source_t { char *secret_name; // string char *share_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_azure_file_volume_source_t; -v1_azure_file_volume_source_t *v1_azure_file_volume_source_create( +__attribute__((deprecated)) v1_azure_file_volume_source_t *v1_azure_file_volume_source_create( int read_only, char *secret_name, char *share_name diff --git a/kubernetes/model/v1_binding.c b/kubernetes/model/v1_binding.c index 0757ba4f..17e6986a 100644 --- a/kubernetes/model/v1_binding.c +++ b/kubernetes/model/v1_binding.c @@ -5,7 +5,7 @@ -v1_binding_t *v1_binding_create( +static v1_binding_t *v1_binding_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_binding_t *v1_binding_create( v1_binding_local_var->metadata = metadata; v1_binding_local_var->target = target; + v1_binding_local_var->_library_owned = 1; return v1_binding_local_var; } +__attribute__((deprecated)) v1_binding_t *v1_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_object_reference_t *target + ) { + return v1_binding_create_internal ( + api_version, + kind, + metadata, + target + ); +} void v1_binding_free(v1_binding_t *v1_binding) { if(NULL == v1_binding){ return ; } + if(v1_binding->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_binding_free"); + return ; + } listEntry_t *listEntry; if (v1_binding->api_version) { free(v1_binding->api_version); @@ -113,6 +131,9 @@ v1_binding_t *v1_binding_parseFromJSON(cJSON *v1_bindingJSON){ // v1_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_bindingJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -122,6 +143,9 @@ v1_binding_t *v1_binding_parseFromJSON(cJSON *v1_bindingJSON){ // v1_binding->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_bindingJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -131,12 +155,18 @@ v1_binding_t *v1_binding_parseFromJSON(cJSON *v1_bindingJSON){ // v1_binding->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_bindingJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_binding->target cJSON *target = cJSON_GetObjectItemCaseSensitive(v1_bindingJSON, "target"); + if (cJSON_IsNull(target)) { + target = NULL; + } if (!target) { goto end; } @@ -145,7 +175,7 @@ v1_binding_t *v1_binding_parseFromJSON(cJSON *v1_bindingJSON){ target_local_nonprim = v1_object_reference_parseFromJSON(target); //nonprimitive - v1_binding_local_var = v1_binding_create ( + v1_binding_local_var = v1_binding_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_binding.h b/kubernetes/model/v1_binding.h index acbdbc98..4213c548 100644 --- a/kubernetes/model/v1_binding.h +++ b/kubernetes/model/v1_binding.h @@ -1,7 +1,7 @@ /* * v1_binding.h * - * Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. + * Binding ties one object to another; for example, a pod is bound to a node by a scheduler. */ #ifndef _v1_binding_H_ @@ -26,9 +26,10 @@ typedef struct v1_binding_t { struct v1_object_meta_t *metadata; //model struct v1_object_reference_t *target; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_binding_t; -v1_binding_t *v1_binding_create( +__attribute__((deprecated)) v1_binding_t *v1_binding_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_bound_object_reference.c b/kubernetes/model/v1_bound_object_reference.c index ccb2b3a4..a4631b0b 100644 --- a/kubernetes/model/v1_bound_object_reference.c +++ b/kubernetes/model/v1_bound_object_reference.c @@ -5,7 +5,7 @@ -v1_bound_object_reference_t *v1_bound_object_reference_create( +static v1_bound_object_reference_t *v1_bound_object_reference_create_internal( char *api_version, char *kind, char *name, @@ -20,14 +20,32 @@ v1_bound_object_reference_t *v1_bound_object_reference_create( v1_bound_object_reference_local_var->name = name; v1_bound_object_reference_local_var->uid = uid; + v1_bound_object_reference_local_var->_library_owned = 1; return v1_bound_object_reference_local_var; } +__attribute__((deprecated)) v1_bound_object_reference_t *v1_bound_object_reference_create( + char *api_version, + char *kind, + char *name, + char *uid + ) { + return v1_bound_object_reference_create_internal ( + api_version, + kind, + name, + uid + ); +} void v1_bound_object_reference_free(v1_bound_object_reference_t *v1_bound_object_reference) { if(NULL == v1_bound_object_reference){ return ; } + if(v1_bound_object_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_bound_object_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_bound_object_reference->api_version) { free(v1_bound_object_reference->api_version); @@ -96,6 +114,9 @@ v1_bound_object_reference_t *v1_bound_object_reference_parseFromJSON(cJSON *v1_b // v1_bound_object_reference->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_bound_object_referenceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -105,6 +126,9 @@ v1_bound_object_reference_t *v1_bound_object_reference_parseFromJSON(cJSON *v1_b // v1_bound_object_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_bound_object_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -114,6 +138,9 @@ v1_bound_object_reference_t *v1_bound_object_reference_parseFromJSON(cJSON *v1_b // v1_bound_object_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_bound_object_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -123,6 +150,9 @@ v1_bound_object_reference_t *v1_bound_object_reference_parseFromJSON(cJSON *v1_b // v1_bound_object_reference->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_bound_object_referenceJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -131,7 +161,7 @@ v1_bound_object_reference_t *v1_bound_object_reference_parseFromJSON(cJSON *v1_b } - v1_bound_object_reference_local_var = v1_bound_object_reference_create ( + v1_bound_object_reference_local_var = v1_bound_object_reference_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, diff --git a/kubernetes/model/v1_bound_object_reference.h b/kubernetes/model/v1_bound_object_reference.h index 7529c6cd..72e0aa19 100644 --- a/kubernetes/model/v1_bound_object_reference.h +++ b/kubernetes/model/v1_bound_object_reference.h @@ -24,9 +24,10 @@ typedef struct v1_bound_object_reference_t { char *name; // string char *uid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_bound_object_reference_t; -v1_bound_object_reference_t *v1_bound_object_reference_create( +__attribute__((deprecated)) v1_bound_object_reference_t *v1_bound_object_reference_create( char *api_version, char *kind, char *name, diff --git a/kubernetes/model/v1_capabilities.c b/kubernetes/model/v1_capabilities.c index 15f84997..fa688784 100644 --- a/kubernetes/model/v1_capabilities.c +++ b/kubernetes/model/v1_capabilities.c @@ -5,7 +5,7 @@ -v1_capabilities_t *v1_capabilities_create( +static v1_capabilities_t *v1_capabilities_create_internal( list_t *add, list_t *drop ) { @@ -16,14 +16,28 @@ v1_capabilities_t *v1_capabilities_create( v1_capabilities_local_var->add = add; v1_capabilities_local_var->drop = drop; + v1_capabilities_local_var->_library_owned = 1; return v1_capabilities_local_var; } +__attribute__((deprecated)) v1_capabilities_t *v1_capabilities_create( + list_t *add, + list_t *drop + ) { + return v1_capabilities_create_internal ( + add, + drop + ); +} void v1_capabilities_free(v1_capabilities_t *v1_capabilities) { if(NULL == v1_capabilities){ return ; } + if(v1_capabilities->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_capabilities_free"); + return ; + } listEntry_t *listEntry; if (v1_capabilities->add) { list_ForEach(listEntry, v1_capabilities->add) { @@ -54,7 +68,7 @@ cJSON *v1_capabilities_convertToJSON(v1_capabilities_t *v1_capabilities) { listEntry_t *addListEntry; list_ForEach(addListEntry, v1_capabilities->add) { - if(cJSON_AddStringToObject(add, "", (char*)addListEntry->data) == NULL) + if(cJSON_AddStringToObject(add, "", addListEntry->data) == NULL) { goto fail; } @@ -71,7 +85,7 @@ cJSON *v1_capabilities_convertToJSON(v1_capabilities_t *v1_capabilities) { listEntry_t *dropListEntry; list_ForEach(dropListEntry, v1_capabilities->drop) { - if(cJSON_AddStringToObject(drop, "", (char*)dropListEntry->data) == NULL) + if(cJSON_AddStringToObject(drop, "", dropListEntry->data) == NULL) { goto fail; } @@ -98,6 +112,9 @@ v1_capabilities_t *v1_capabilities_parseFromJSON(cJSON *v1_capabilitiesJSON){ // v1_capabilities->add cJSON *add = cJSON_GetObjectItemCaseSensitive(v1_capabilitiesJSON, "add"); + if (cJSON_IsNull(add)) { + add = NULL; + } if (add) { cJSON *add_local = NULL; if(!cJSON_IsArray(add)) { @@ -117,6 +134,9 @@ v1_capabilities_t *v1_capabilities_parseFromJSON(cJSON *v1_capabilitiesJSON){ // v1_capabilities->drop cJSON *drop = cJSON_GetObjectItemCaseSensitive(v1_capabilitiesJSON, "drop"); + if (cJSON_IsNull(drop)) { + drop = NULL; + } if (drop) { cJSON *drop_local = NULL; if(!cJSON_IsArray(drop)) { @@ -135,7 +155,7 @@ v1_capabilities_t *v1_capabilities_parseFromJSON(cJSON *v1_capabilitiesJSON){ } - v1_capabilities_local_var = v1_capabilities_create ( + v1_capabilities_local_var = v1_capabilities_create_internal ( add ? addList : NULL, drop ? dropList : NULL ); diff --git a/kubernetes/model/v1_capabilities.h b/kubernetes/model/v1_capabilities.h index 9c1cf7bc..ed17e4db 100644 --- a/kubernetes/model/v1_capabilities.h +++ b/kubernetes/model/v1_capabilities.h @@ -22,9 +22,10 @@ typedef struct v1_capabilities_t { list_t *add; //primitive container list_t *drop; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_capabilities_t; -v1_capabilities_t *v1_capabilities_create( +__attribute__((deprecated)) v1_capabilities_t *v1_capabilities_create( list_t *add, list_t *drop ); diff --git a/kubernetes/model/v1_capacity_request_policy.c b/kubernetes/model/v1_capacity_request_policy.c new file mode 100644 index 00000000..0c7efc8e --- /dev/null +++ b/kubernetes/model/v1_capacity_request_policy.c @@ -0,0 +1,189 @@ +#include +#include +#include +#include "v1_capacity_request_policy.h" + + + +static v1_capacity_request_policy_t *v1_capacity_request_policy_create_internal( + char *_default, + v1_capacity_request_policy_range_t *valid_range, + list_t *valid_values + ) { + v1_capacity_request_policy_t *v1_capacity_request_policy_local_var = malloc(sizeof(v1_capacity_request_policy_t)); + if (!v1_capacity_request_policy_local_var) { + return NULL; + } + v1_capacity_request_policy_local_var->_default = _default; + v1_capacity_request_policy_local_var->valid_range = valid_range; + v1_capacity_request_policy_local_var->valid_values = valid_values; + + v1_capacity_request_policy_local_var->_library_owned = 1; + return v1_capacity_request_policy_local_var; +} + +__attribute__((deprecated)) v1_capacity_request_policy_t *v1_capacity_request_policy_create( + char *_default, + v1_capacity_request_policy_range_t *valid_range, + list_t *valid_values + ) { + return v1_capacity_request_policy_create_internal ( + _default, + valid_range, + valid_values + ); +} + +void v1_capacity_request_policy_free(v1_capacity_request_policy_t *v1_capacity_request_policy) { + if(NULL == v1_capacity_request_policy){ + return ; + } + if(v1_capacity_request_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_capacity_request_policy_free"); + return ; + } + listEntry_t *listEntry; + if (v1_capacity_request_policy->_default) { + free(v1_capacity_request_policy->_default); + v1_capacity_request_policy->_default = NULL; + } + if (v1_capacity_request_policy->valid_range) { + v1_capacity_request_policy_range_free(v1_capacity_request_policy->valid_range); + v1_capacity_request_policy->valid_range = NULL; + } + if (v1_capacity_request_policy->valid_values) { + list_ForEach(listEntry, v1_capacity_request_policy->valid_values) { + free(listEntry->data); + } + list_freeList(v1_capacity_request_policy->valid_values); + v1_capacity_request_policy->valid_values = NULL; + } + free(v1_capacity_request_policy); +} + +cJSON *v1_capacity_request_policy_convertToJSON(v1_capacity_request_policy_t *v1_capacity_request_policy) { + cJSON *item = cJSON_CreateObject(); + + // v1_capacity_request_policy->_default + if(v1_capacity_request_policy->_default) { + if(cJSON_AddStringToObject(item, "default", v1_capacity_request_policy->_default) == NULL) { + goto fail; //String + } + } + + + // v1_capacity_request_policy->valid_range + if(v1_capacity_request_policy->valid_range) { + cJSON *valid_range_local_JSON = v1_capacity_request_policy_range_convertToJSON(v1_capacity_request_policy->valid_range); + if(valid_range_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "validRange", valid_range_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_capacity_request_policy->valid_values + if(v1_capacity_request_policy->valid_values) { + cJSON *valid_values = cJSON_AddArrayToObject(item, "validValues"); + if(valid_values == NULL) { + goto fail; //primitive container + } + + listEntry_t *valid_valuesListEntry; + list_ForEach(valid_valuesListEntry, v1_capacity_request_policy->valid_values) { + if(cJSON_AddStringToObject(valid_values, "", valid_valuesListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_capacity_request_policy_t *v1_capacity_request_policy_parseFromJSON(cJSON *v1_capacity_request_policyJSON){ + + v1_capacity_request_policy_t *v1_capacity_request_policy_local_var = NULL; + + // define the local variable for v1_capacity_request_policy->valid_range + v1_capacity_request_policy_range_t *valid_range_local_nonprim = NULL; + + // define the local list for v1_capacity_request_policy->valid_values + list_t *valid_valuesList = NULL; + + // v1_capacity_request_policy->_default + cJSON *_default = cJSON_GetObjectItemCaseSensitive(v1_capacity_request_policyJSON, "default"); + if (cJSON_IsNull(_default)) { + _default = NULL; + } + if (_default) { + if(!cJSON_IsString(_default) && !cJSON_IsNull(_default)) + { + goto end; //String + } + } + + // v1_capacity_request_policy->valid_range + cJSON *valid_range = cJSON_GetObjectItemCaseSensitive(v1_capacity_request_policyJSON, "validRange"); + if (cJSON_IsNull(valid_range)) { + valid_range = NULL; + } + if (valid_range) { + valid_range_local_nonprim = v1_capacity_request_policy_range_parseFromJSON(valid_range); //nonprimitive + } + + // v1_capacity_request_policy->valid_values + cJSON *valid_values = cJSON_GetObjectItemCaseSensitive(v1_capacity_request_policyJSON, "validValues"); + if (cJSON_IsNull(valid_values)) { + valid_values = NULL; + } + if (valid_values) { + cJSON *valid_values_local = NULL; + if(!cJSON_IsArray(valid_values)) { + goto end;//primitive container + } + valid_valuesList = list_createList(); + + cJSON_ArrayForEach(valid_values_local, valid_values) + { + if(!cJSON_IsString(valid_values_local)) + { + goto end; + } + list_addElement(valid_valuesList , strdup(valid_values_local->valuestring)); + } + } + + + v1_capacity_request_policy_local_var = v1_capacity_request_policy_create_internal ( + _default && !cJSON_IsNull(_default) ? strdup(_default->valuestring) : NULL, + valid_range ? valid_range_local_nonprim : NULL, + valid_values ? valid_valuesList : NULL + ); + + return v1_capacity_request_policy_local_var; +end: + if (valid_range_local_nonprim) { + v1_capacity_request_policy_range_free(valid_range_local_nonprim); + valid_range_local_nonprim = NULL; + } + if (valid_valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valid_valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valid_valuesList); + valid_valuesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_capacity_request_policy.h b/kubernetes/model/v1_capacity_request_policy.h new file mode 100644 index 00000000..24b10c08 --- /dev/null +++ b/kubernetes/model/v1_capacity_request_policy.h @@ -0,0 +1,43 @@ +/* + * v1_capacity_request_policy.h + * + * CapacityRequestPolicy defines how requests consume device capacity. Must not set more than one ValidRequestValues. + */ + +#ifndef _v1_capacity_request_policy_H_ +#define _v1_capacity_request_policy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_capacity_request_policy_t v1_capacity_request_policy_t; + +#include "v1_capacity_request_policy_range.h" + + + +typedef struct v1_capacity_request_policy_t { + char *_default; // string + struct v1_capacity_request_policy_range_t *valid_range; //model + list_t *valid_values; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_capacity_request_policy_t; + +__attribute__((deprecated)) v1_capacity_request_policy_t *v1_capacity_request_policy_create( + char *_default, + v1_capacity_request_policy_range_t *valid_range, + list_t *valid_values +); + +void v1_capacity_request_policy_free(v1_capacity_request_policy_t *v1_capacity_request_policy); + +v1_capacity_request_policy_t *v1_capacity_request_policy_parseFromJSON(cJSON *v1_capacity_request_policyJSON); + +cJSON *v1_capacity_request_policy_convertToJSON(v1_capacity_request_policy_t *v1_capacity_request_policy); + +#endif /* _v1_capacity_request_policy_H_ */ + diff --git a/kubernetes/model/v1_capacity_request_policy_range.c b/kubernetes/model/v1_capacity_request_policy_range.c new file mode 100644 index 00000000..09b534fe --- /dev/null +++ b/kubernetes/model/v1_capacity_request_policy_range.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include "v1_capacity_request_policy_range.h" + + + +static v1_capacity_request_policy_range_t *v1_capacity_request_policy_range_create_internal( + char *max, + char *min, + char *step + ) { + v1_capacity_request_policy_range_t *v1_capacity_request_policy_range_local_var = malloc(sizeof(v1_capacity_request_policy_range_t)); + if (!v1_capacity_request_policy_range_local_var) { + return NULL; + } + v1_capacity_request_policy_range_local_var->max = max; + v1_capacity_request_policy_range_local_var->min = min; + v1_capacity_request_policy_range_local_var->step = step; + + v1_capacity_request_policy_range_local_var->_library_owned = 1; + return v1_capacity_request_policy_range_local_var; +} + +__attribute__((deprecated)) v1_capacity_request_policy_range_t *v1_capacity_request_policy_range_create( + char *max, + char *min, + char *step + ) { + return v1_capacity_request_policy_range_create_internal ( + max, + min, + step + ); +} + +void v1_capacity_request_policy_range_free(v1_capacity_request_policy_range_t *v1_capacity_request_policy_range) { + if(NULL == v1_capacity_request_policy_range){ + return ; + } + if(v1_capacity_request_policy_range->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_capacity_request_policy_range_free"); + return ; + } + listEntry_t *listEntry; + if (v1_capacity_request_policy_range->max) { + free(v1_capacity_request_policy_range->max); + v1_capacity_request_policy_range->max = NULL; + } + if (v1_capacity_request_policy_range->min) { + free(v1_capacity_request_policy_range->min); + v1_capacity_request_policy_range->min = NULL; + } + if (v1_capacity_request_policy_range->step) { + free(v1_capacity_request_policy_range->step); + v1_capacity_request_policy_range->step = NULL; + } + free(v1_capacity_request_policy_range); +} + +cJSON *v1_capacity_request_policy_range_convertToJSON(v1_capacity_request_policy_range_t *v1_capacity_request_policy_range) { + cJSON *item = cJSON_CreateObject(); + + // v1_capacity_request_policy_range->max + if(v1_capacity_request_policy_range->max) { + if(cJSON_AddStringToObject(item, "max", v1_capacity_request_policy_range->max) == NULL) { + goto fail; //String + } + } + + + // v1_capacity_request_policy_range->min + if (!v1_capacity_request_policy_range->min) { + goto fail; + } + if(cJSON_AddStringToObject(item, "min", v1_capacity_request_policy_range->min) == NULL) { + goto fail; //String + } + + + // v1_capacity_request_policy_range->step + if(v1_capacity_request_policy_range->step) { + if(cJSON_AddStringToObject(item, "step", v1_capacity_request_policy_range->step) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_capacity_request_policy_range_t *v1_capacity_request_policy_range_parseFromJSON(cJSON *v1_capacity_request_policy_rangeJSON){ + + v1_capacity_request_policy_range_t *v1_capacity_request_policy_range_local_var = NULL; + + // v1_capacity_request_policy_range->max + cJSON *max = cJSON_GetObjectItemCaseSensitive(v1_capacity_request_policy_rangeJSON, "max"); + if (cJSON_IsNull(max)) { + max = NULL; + } + if (max) { + if(!cJSON_IsString(max) && !cJSON_IsNull(max)) + { + goto end; //String + } + } + + // v1_capacity_request_policy_range->min + cJSON *min = cJSON_GetObjectItemCaseSensitive(v1_capacity_request_policy_rangeJSON, "min"); + if (cJSON_IsNull(min)) { + min = NULL; + } + if (!min) { + goto end; + } + + + if(!cJSON_IsString(min)) + { + goto end; //String + } + + // v1_capacity_request_policy_range->step + cJSON *step = cJSON_GetObjectItemCaseSensitive(v1_capacity_request_policy_rangeJSON, "step"); + if (cJSON_IsNull(step)) { + step = NULL; + } + if (step) { + if(!cJSON_IsString(step) && !cJSON_IsNull(step)) + { + goto end; //String + } + } + + + v1_capacity_request_policy_range_local_var = v1_capacity_request_policy_range_create_internal ( + max && !cJSON_IsNull(max) ? strdup(max->valuestring) : NULL, + strdup(min->valuestring), + step && !cJSON_IsNull(step) ? strdup(step->valuestring) : NULL + ); + + return v1_capacity_request_policy_range_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_capacity_request_policy_range.h b/kubernetes/model/v1_capacity_request_policy_range.h new file mode 100644 index 00000000..adf5582c --- /dev/null +++ b/kubernetes/model/v1_capacity_request_policy_range.h @@ -0,0 +1,42 @@ +/* + * v1_capacity_request_policy_range.h + * + * CapacityRequestPolicyRange defines a valid range for consumable capacity values. - If the requested amount is less than Min, it is rounded up to the Min value. - If Step is set and the requested amount is between Min and Max but not aligned with Step, it will be rounded up to the next value equal to Min + (n * Step). - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set). - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy, and the device cannot be allocated. + */ + +#ifndef _v1_capacity_request_policy_range_H_ +#define _v1_capacity_request_policy_range_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_capacity_request_policy_range_t v1_capacity_request_policy_range_t; + + + + +typedef struct v1_capacity_request_policy_range_t { + char *max; // string + char *min; // string + char *step; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_capacity_request_policy_range_t; + +__attribute__((deprecated)) v1_capacity_request_policy_range_t *v1_capacity_request_policy_range_create( + char *max, + char *min, + char *step +); + +void v1_capacity_request_policy_range_free(v1_capacity_request_policy_range_t *v1_capacity_request_policy_range); + +v1_capacity_request_policy_range_t *v1_capacity_request_policy_range_parseFromJSON(cJSON *v1_capacity_request_policy_rangeJSON); + +cJSON *v1_capacity_request_policy_range_convertToJSON(v1_capacity_request_policy_range_t *v1_capacity_request_policy_range); + +#endif /* _v1_capacity_request_policy_range_H_ */ + diff --git a/kubernetes/model/v1_capacity_requirements.c b/kubernetes/model/v1_capacity_requirements.c new file mode 100644 index 00000000..20f99bcf --- /dev/null +++ b/kubernetes/model/v1_capacity_requirements.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include "v1_capacity_requirements.h" + + + +static v1_capacity_requirements_t *v1_capacity_requirements_create_internal( + list_t* requests + ) { + v1_capacity_requirements_t *v1_capacity_requirements_local_var = malloc(sizeof(v1_capacity_requirements_t)); + if (!v1_capacity_requirements_local_var) { + return NULL; + } + v1_capacity_requirements_local_var->requests = requests; + + v1_capacity_requirements_local_var->_library_owned = 1; + return v1_capacity_requirements_local_var; +} + +__attribute__((deprecated)) v1_capacity_requirements_t *v1_capacity_requirements_create( + list_t* requests + ) { + return v1_capacity_requirements_create_internal ( + requests + ); +} + +void v1_capacity_requirements_free(v1_capacity_requirements_t *v1_capacity_requirements) { + if(NULL == v1_capacity_requirements){ + return ; + } + if(v1_capacity_requirements->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_capacity_requirements_free"); + return ; + } + listEntry_t *listEntry; + if (v1_capacity_requirements->requests) { + list_ForEach(listEntry, v1_capacity_requirements->requests) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1_capacity_requirements->requests); + v1_capacity_requirements->requests = NULL; + } + free(v1_capacity_requirements); +} + +cJSON *v1_capacity_requirements_convertToJSON(v1_capacity_requirements_t *v1_capacity_requirements) { + cJSON *item = cJSON_CreateObject(); + + // v1_capacity_requirements->requests + if(v1_capacity_requirements->requests) { + cJSON *requests = cJSON_AddObjectToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = requests; + listEntry_t *requestsListEntry; + if (v1_capacity_requirements->requests) { + list_ForEach(requestsListEntry, v1_capacity_requirements->requests) { + keyValuePair_t *localKeyValue = requestsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_capacity_requirements_t *v1_capacity_requirements_parseFromJSON(cJSON *v1_capacity_requirementsJSON){ + + v1_capacity_requirements_t *v1_capacity_requirements_local_var = NULL; + + // define the local map for v1_capacity_requirements->requests + list_t *requestsList = NULL; + + // v1_capacity_requirements->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_capacity_requirementsJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local_map = NULL; + if(!cJSON_IsObject(requests) && !cJSON_IsNull(requests)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(requests)) + { + requestsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(requests_local_map, requests) + { + cJSON *localMapObject = requests_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(requestsList , localMapKeyPair); + } + } + } + + + v1_capacity_requirements_local_var = v1_capacity_requirements_create_internal ( + requests ? requestsList : NULL + ); + + return v1_capacity_requirements_local_var; +end: + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_capacity_requirements.h b/kubernetes/model/v1_capacity_requirements.h new file mode 100644 index 00000000..9542028f --- /dev/null +++ b/kubernetes/model/v1_capacity_requirements.h @@ -0,0 +1,38 @@ +/* + * v1_capacity_requirements.h + * + * CapacityRequirements defines the capacity requirements for a specific device request. + */ + +#ifndef _v1_capacity_requirements_H_ +#define _v1_capacity_requirements_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_capacity_requirements_t v1_capacity_requirements_t; + + + + +typedef struct v1_capacity_requirements_t { + list_t* requests; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1_capacity_requirements_t; + +__attribute__((deprecated)) v1_capacity_requirements_t *v1_capacity_requirements_create( + list_t* requests +); + +void v1_capacity_requirements_free(v1_capacity_requirements_t *v1_capacity_requirements); + +v1_capacity_requirements_t *v1_capacity_requirements_parseFromJSON(cJSON *v1_capacity_requirementsJSON); + +cJSON *v1_capacity_requirements_convertToJSON(v1_capacity_requirements_t *v1_capacity_requirements); + +#endif /* _v1_capacity_requirements_H_ */ + diff --git a/kubernetes/model/v1_cel_device_selector.c b/kubernetes/model/v1_cel_device_selector.c new file mode 100644 index 00000000..d31ce9ce --- /dev/null +++ b/kubernetes/model/v1_cel_device_selector.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1_cel_device_selector.h" + + + +static v1_cel_device_selector_t *v1_cel_device_selector_create_internal( + char *expression + ) { + v1_cel_device_selector_t *v1_cel_device_selector_local_var = malloc(sizeof(v1_cel_device_selector_t)); + if (!v1_cel_device_selector_local_var) { + return NULL; + } + v1_cel_device_selector_local_var->expression = expression; + + v1_cel_device_selector_local_var->_library_owned = 1; + return v1_cel_device_selector_local_var; +} + +__attribute__((deprecated)) v1_cel_device_selector_t *v1_cel_device_selector_create( + char *expression + ) { + return v1_cel_device_selector_create_internal ( + expression + ); +} + +void v1_cel_device_selector_free(v1_cel_device_selector_t *v1_cel_device_selector) { + if(NULL == v1_cel_device_selector){ + return ; + } + if(v1_cel_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cel_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1_cel_device_selector->expression) { + free(v1_cel_device_selector->expression); + v1_cel_device_selector->expression = NULL; + } + free(v1_cel_device_selector); +} + +cJSON *v1_cel_device_selector_convertToJSON(v1_cel_device_selector_t *v1_cel_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1_cel_device_selector->expression + if (!v1_cel_device_selector->expression) { + goto fail; + } + if(cJSON_AddStringToObject(item, "expression", v1_cel_device_selector->expression) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_cel_device_selector_t *v1_cel_device_selector_parseFromJSON(cJSON *v1_cel_device_selectorJSON){ + + v1_cel_device_selector_t *v1_cel_device_selector_local_var = NULL; + + // v1_cel_device_selector->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1_cel_device_selectorJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (!expression) { + goto end; + } + + + if(!cJSON_IsString(expression)) + { + goto end; //String + } + + + v1_cel_device_selector_local_var = v1_cel_device_selector_create_internal ( + strdup(expression->valuestring) + ); + + return v1_cel_device_selector_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_cel_device_selector.h b/kubernetes/model/v1_cel_device_selector.h new file mode 100644 index 00000000..e97460fb --- /dev/null +++ b/kubernetes/model/v1_cel_device_selector.h @@ -0,0 +1,38 @@ +/* + * v1_cel_device_selector.h + * + * CELDeviceSelector contains a CEL expression for selecting a device. + */ + +#ifndef _v1_cel_device_selector_H_ +#define _v1_cel_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_cel_device_selector_t v1_cel_device_selector_t; + + + + +typedef struct v1_cel_device_selector_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_cel_device_selector_t; + +__attribute__((deprecated)) v1_cel_device_selector_t *v1_cel_device_selector_create( + char *expression +); + +void v1_cel_device_selector_free(v1_cel_device_selector_t *v1_cel_device_selector); + +v1_cel_device_selector_t *v1_cel_device_selector_parseFromJSON(cJSON *v1_cel_device_selectorJSON); + +cJSON *v1_cel_device_selector_convertToJSON(v1_cel_device_selector_t *v1_cel_device_selector); + +#endif /* _v1_cel_device_selector_H_ */ + diff --git a/kubernetes/model/v1_ceph_fs_persistent_volume_source.c b/kubernetes/model/v1_ceph_fs_persistent_volume_source.c index 0c775349..b8150441 100644 --- a/kubernetes/model/v1_ceph_fs_persistent_volume_source.c +++ b/kubernetes/model/v1_ceph_fs_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_create( +static v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_create_internal( list_t *monitors, char *path, int read_only, @@ -24,14 +24,36 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_creat v1_ceph_fs_persistent_volume_source_local_var->secret_ref = secret_ref; v1_ceph_fs_persistent_volume_source_local_var->user = user; + v1_ceph_fs_persistent_volume_source_local_var->_library_owned = 1; return v1_ceph_fs_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_create( + list_t *monitors, + char *path, + int read_only, + char *secret_file, + v1_secret_reference_t *secret_ref, + char *user + ) { + return v1_ceph_fs_persistent_volume_source_create_internal ( + monitors, + path, + read_only, + secret_file, + secret_ref, + user + ); +} void v1_ceph_fs_persistent_volume_source_free(v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source) { if(NULL == v1_ceph_fs_persistent_volume_source){ return ; } + if(v1_ceph_fs_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ceph_fs_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_ceph_fs_persistent_volume_source->monitors) { list_ForEach(listEntry, v1_ceph_fs_persistent_volume_source->monitors) { @@ -73,7 +95,7 @@ cJSON *v1_ceph_fs_persistent_volume_source_convertToJSON(v1_ceph_fs_persistent_v listEntry_t *monitorsListEntry; list_ForEach(monitorsListEntry, v1_ceph_fs_persistent_volume_source->monitors) { - if(cJSON_AddStringToObject(monitors, "", (char*)monitorsListEntry->data) == NULL) + if(cJSON_AddStringToObject(monitors, "", monitorsListEntry->data) == NULL) { goto fail; } @@ -144,6 +166,9 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse // v1_ceph_fs_persistent_volume_source->monitors cJSON *monitors = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_persistent_volume_sourceJSON, "monitors"); + if (cJSON_IsNull(monitors)) { + monitors = NULL; + } if (!monitors) { goto end; } @@ -166,6 +191,9 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse // v1_ceph_fs_persistent_volume_source->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_persistent_volume_sourceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (path) { if(!cJSON_IsString(path) && !cJSON_IsNull(path)) { @@ -175,6 +203,9 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse // v1_ceph_fs_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -184,6 +215,9 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse // v1_ceph_fs_persistent_volume_source->secret_file cJSON *secret_file = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_persistent_volume_sourceJSON, "secretFile"); + if (cJSON_IsNull(secret_file)) { + secret_file = NULL; + } if (secret_file) { if(!cJSON_IsString(secret_file) && !cJSON_IsNull(secret_file)) { @@ -193,12 +227,18 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse // v1_ceph_fs_persistent_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_persistent_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_ceph_fs_persistent_volume_source->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_persistent_volume_sourceJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { if(!cJSON_IsString(user) && !cJSON_IsNull(user)) { @@ -207,7 +247,7 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse } - v1_ceph_fs_persistent_volume_source_local_var = v1_ceph_fs_persistent_volume_source_create ( + v1_ceph_fs_persistent_volume_source_local_var = v1_ceph_fs_persistent_volume_source_create_internal ( monitorsList, path && !cJSON_IsNull(path) ? strdup(path->valuestring) : NULL, read_only ? read_only->valueint : 0, diff --git a/kubernetes/model/v1_ceph_fs_persistent_volume_source.h b/kubernetes/model/v1_ceph_fs_persistent_volume_source.h index e566dfbf..1303f1e5 100644 --- a/kubernetes/model/v1_ceph_fs_persistent_volume_source.h +++ b/kubernetes/model/v1_ceph_fs_persistent_volume_source.h @@ -27,9 +27,10 @@ typedef struct v1_ceph_fs_persistent_volume_source_t { struct v1_secret_reference_t *secret_ref; //model char *user; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_ceph_fs_persistent_volume_source_t; -v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_create( +__attribute__((deprecated)) v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_create( list_t *monitors, char *path, int read_only, diff --git a/kubernetes/model/v1_ceph_fs_volume_source.c b/kubernetes/model/v1_ceph_fs_volume_source.c index 8fb840ed..7273b6fa 100644 --- a/kubernetes/model/v1_ceph_fs_volume_source.c +++ b/kubernetes/model/v1_ceph_fs_volume_source.c @@ -5,7 +5,7 @@ -v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_create( +static v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_create_internal( list_t *monitors, char *path, int read_only, @@ -24,14 +24,36 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_create( v1_ceph_fs_volume_source_local_var->secret_ref = secret_ref; v1_ceph_fs_volume_source_local_var->user = user; + v1_ceph_fs_volume_source_local_var->_library_owned = 1; return v1_ceph_fs_volume_source_local_var; } +__attribute__((deprecated)) v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_create( + list_t *monitors, + char *path, + int read_only, + char *secret_file, + v1_local_object_reference_t *secret_ref, + char *user + ) { + return v1_ceph_fs_volume_source_create_internal ( + monitors, + path, + read_only, + secret_file, + secret_ref, + user + ); +} void v1_ceph_fs_volume_source_free(v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source) { if(NULL == v1_ceph_fs_volume_source){ return ; } + if(v1_ceph_fs_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ceph_fs_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_ceph_fs_volume_source->monitors) { list_ForEach(listEntry, v1_ceph_fs_volume_source->monitors) { @@ -73,7 +95,7 @@ cJSON *v1_ceph_fs_volume_source_convertToJSON(v1_ceph_fs_volume_source_t *v1_cep listEntry_t *monitorsListEntry; list_ForEach(monitorsListEntry, v1_ceph_fs_volume_source->monitors) { - if(cJSON_AddStringToObject(monitors, "", (char*)monitorsListEntry->data) == NULL) + if(cJSON_AddStringToObject(monitors, "", monitorsListEntry->data) == NULL) { goto fail; } @@ -144,6 +166,9 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep // v1_ceph_fs_volume_source->monitors cJSON *monitors = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_volume_sourceJSON, "monitors"); + if (cJSON_IsNull(monitors)) { + monitors = NULL; + } if (!monitors) { goto end; } @@ -166,6 +191,9 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep // v1_ceph_fs_volume_source->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_volume_sourceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (path) { if(!cJSON_IsString(path) && !cJSON_IsNull(path)) { @@ -175,6 +203,9 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep // v1_ceph_fs_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -184,6 +215,9 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep // v1_ceph_fs_volume_source->secret_file cJSON *secret_file = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_volume_sourceJSON, "secretFile"); + if (cJSON_IsNull(secret_file)) { + secret_file = NULL; + } if (secret_file) { if(!cJSON_IsString(secret_file) && !cJSON_IsNull(secret_file)) { @@ -193,12 +227,18 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep // v1_ceph_fs_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_local_object_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_ceph_fs_volume_source->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_ceph_fs_volume_sourceJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { if(!cJSON_IsString(user) && !cJSON_IsNull(user)) { @@ -207,7 +247,7 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep } - v1_ceph_fs_volume_source_local_var = v1_ceph_fs_volume_source_create ( + v1_ceph_fs_volume_source_local_var = v1_ceph_fs_volume_source_create_internal ( monitorsList, path && !cJSON_IsNull(path) ? strdup(path->valuestring) : NULL, read_only ? read_only->valueint : 0, diff --git a/kubernetes/model/v1_ceph_fs_volume_source.h b/kubernetes/model/v1_ceph_fs_volume_source.h index 9b23444d..5951587c 100644 --- a/kubernetes/model/v1_ceph_fs_volume_source.h +++ b/kubernetes/model/v1_ceph_fs_volume_source.h @@ -27,9 +27,10 @@ typedef struct v1_ceph_fs_volume_source_t { struct v1_local_object_reference_t *secret_ref; //model char *user; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_ceph_fs_volume_source_t; -v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_create( +__attribute__((deprecated)) v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_create( list_t *monitors, char *path, int read_only, diff --git a/kubernetes/model/v1_certificate_signing_request.c b/kubernetes/model/v1_certificate_signing_request.c index c551e175..27a76c3e 100644 --- a/kubernetes/model/v1_certificate_signing_request.c +++ b/kubernetes/model/v1_certificate_signing_request.c @@ -5,7 +5,7 @@ -v1_certificate_signing_request_t *v1_certificate_signing_request_create( +static v1_certificate_signing_request_t *v1_certificate_signing_request_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_certificate_signing_request_t *v1_certificate_signing_request_create( v1_certificate_signing_request_local_var->spec = spec; v1_certificate_signing_request_local_var->status = status; + v1_certificate_signing_request_local_var->_library_owned = 1; return v1_certificate_signing_request_local_var; } +__attribute__((deprecated)) v1_certificate_signing_request_t *v1_certificate_signing_request_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_certificate_signing_request_spec_t *spec, + v1_certificate_signing_request_status_t *status + ) { + return v1_certificate_signing_request_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_certificate_signing_request_free(v1_certificate_signing_request_t *v1_certificate_signing_request) { if(NULL == v1_certificate_signing_request){ return ; } + if(v1_certificate_signing_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_certificate_signing_request_free"); + return ; + } listEntry_t *listEntry; if (v1_certificate_signing_request->api_version) { free(v1_certificate_signing_request->api_version); @@ -135,6 +155,9 @@ v1_certificate_signing_request_t *v1_certificate_signing_request_parseFromJSON(c // v1_certificate_signing_request->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_requestJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_certificate_signing_request_t *v1_certificate_signing_request_parseFromJSON(c // v1_certificate_signing_request->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_requestJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_certificate_signing_request_t *v1_certificate_signing_request_parseFromJSON(c // v1_certificate_signing_request->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_requestJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_certificate_signing_request->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_requestJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_certificate_signing_request_t *v1_certificate_signing_request_parseFromJSON(c // v1_certificate_signing_request->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_requestJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_certificate_signing_request_status_parseFromJSON(status); //nonprimitive } - v1_certificate_signing_request_local_var = v1_certificate_signing_request_create ( + v1_certificate_signing_request_local_var = v1_certificate_signing_request_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_certificate_signing_request.h b/kubernetes/model/v1_certificate_signing_request.h index 89a43566..c4ef5f50 100644 --- a/kubernetes/model/v1_certificate_signing_request.h +++ b/kubernetes/model/v1_certificate_signing_request.h @@ -28,9 +28,10 @@ typedef struct v1_certificate_signing_request_t { struct v1_certificate_signing_request_spec_t *spec; //model struct v1_certificate_signing_request_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_certificate_signing_request_t; -v1_certificate_signing_request_t *v1_certificate_signing_request_create( +__attribute__((deprecated)) v1_certificate_signing_request_t *v1_certificate_signing_request_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_certificate_signing_request_condition.c b/kubernetes/model/v1_certificate_signing_request_condition.c index 93e82fd6..16a47051 100644 --- a/kubernetes/model/v1_certificate_signing_request_condition.c +++ b/kubernetes/model/v1_certificate_signing_request_condition.c @@ -5,7 +5,7 @@ -v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condition_create( +static v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condition_create_internal( char *last_transition_time, char *last_update_time, char *message, @@ -24,14 +24,36 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi v1_certificate_signing_request_condition_local_var->status = status; v1_certificate_signing_request_condition_local_var->type = type; + v1_certificate_signing_request_condition_local_var->_library_owned = 1; return v1_certificate_signing_request_condition_local_var; } +__attribute__((deprecated)) v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condition_create( + char *last_transition_time, + char *last_update_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_certificate_signing_request_condition_create_internal ( + last_transition_time, + last_update_time, + message, + reason, + status, + type + ); +} void v1_certificate_signing_request_condition_free(v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condition) { if(NULL == v1_certificate_signing_request_condition){ return ; } + if(v1_certificate_signing_request_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_certificate_signing_request_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_certificate_signing_request_condition->last_transition_time) { free(v1_certificate_signing_request_condition->last_transition_time); @@ -126,6 +148,9 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi // v1_certificate_signing_request_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -135,6 +160,9 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi // v1_certificate_signing_request_condition->last_update_time cJSON *last_update_time = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_conditionJSON, "lastUpdateTime"); + if (cJSON_IsNull(last_update_time)) { + last_update_time = NULL; + } if (last_update_time) { if(!cJSON_IsString(last_update_time) && !cJSON_IsNull(last_update_time)) { @@ -144,6 +172,9 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi // v1_certificate_signing_request_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -153,6 +184,9 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi // v1_certificate_signing_request_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -162,6 +196,9 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi // v1_certificate_signing_request_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -174,6 +211,9 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi // v1_certificate_signing_request_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -185,7 +225,7 @@ v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condi } - v1_certificate_signing_request_condition_local_var = v1_certificate_signing_request_condition_create ( + v1_certificate_signing_request_condition_local_var = v1_certificate_signing_request_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, last_update_time && !cJSON_IsNull(last_update_time) ? strdup(last_update_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, diff --git a/kubernetes/model/v1_certificate_signing_request_condition.h b/kubernetes/model/v1_certificate_signing_request_condition.h index 274b6d36..e05a9485 100644 --- a/kubernetes/model/v1_certificate_signing_request_condition.h +++ b/kubernetes/model/v1_certificate_signing_request_condition.h @@ -26,9 +26,10 @@ typedef struct v1_certificate_signing_request_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_certificate_signing_request_condition_t; -v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condition_create( +__attribute__((deprecated)) v1_certificate_signing_request_condition_t *v1_certificate_signing_request_condition_create( char *last_transition_time, char *last_update_time, char *message, diff --git a/kubernetes/model/v1_certificate_signing_request_list.c b/kubernetes/model/v1_certificate_signing_request_list.c index cb757e3c..c243f21d 100644 --- a/kubernetes/model/v1_certificate_signing_request_list.c +++ b/kubernetes/model/v1_certificate_signing_request_list.c @@ -5,7 +5,7 @@ -v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_create( +static v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_creat v1_certificate_signing_request_list_local_var->kind = kind; v1_certificate_signing_request_list_local_var->metadata = metadata; + v1_certificate_signing_request_list_local_var->_library_owned = 1; return v1_certificate_signing_request_list_local_var; } +__attribute__((deprecated)) v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_certificate_signing_request_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_certificate_signing_request_list_free(v1_certificate_signing_request_list_t *v1_certificate_signing_request_list) { if(NULL == v1_certificate_signing_request_list){ return ; } + if(v1_certificate_signing_request_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_certificate_signing_request_list_free"); + return ; + } listEntry_t *listEntry; if (v1_certificate_signing_request_list->api_version) { free(v1_certificate_signing_request_list->api_version); @@ -123,6 +141,9 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_parse // v1_certificate_signing_request_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_parse // v1_certificate_signing_request_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_parse // v1_certificate_signing_request_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_parse // v1_certificate_signing_request_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_certificate_signing_request_list_local_var = v1_certificate_signing_request_list_create ( + v1_certificate_signing_request_list_local_var = v1_certificate_signing_request_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_certificate_signing_request_list.h b/kubernetes/model/v1_certificate_signing_request_list.h index 9f57142e..10e126c9 100644 --- a/kubernetes/model/v1_certificate_signing_request_list.h +++ b/kubernetes/model/v1_certificate_signing_request_list.h @@ -26,9 +26,10 @@ typedef struct v1_certificate_signing_request_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_certificate_signing_request_list_t; -v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_create( +__attribute__((deprecated)) v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_certificate_signing_request_spec.c b/kubernetes/model/v1_certificate_signing_request_spec.c index d559fd83..dc1ada35 100644 --- a/kubernetes/model/v1_certificate_signing_request_spec.c +++ b/kubernetes/model/v1_certificate_signing_request_spec.c @@ -5,7 +5,7 @@ -v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_create( +static v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_create_internal( int expiration_seconds, list_t* extra, list_t *groups, @@ -28,18 +28,44 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_creat v1_certificate_signing_request_spec_local_var->usages = usages; v1_certificate_signing_request_spec_local_var->username = username; + v1_certificate_signing_request_spec_local_var->_library_owned = 1; return v1_certificate_signing_request_spec_local_var; } +__attribute__((deprecated)) v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_create( + int expiration_seconds, + list_t* extra, + list_t *groups, + char *request, + char *signer_name, + char *uid, + list_t *usages, + char *username + ) { + return v1_certificate_signing_request_spec_create_internal ( + expiration_seconds, + extra, + groups, + request, + signer_name, + uid, + usages, + username + ); +} void v1_certificate_signing_request_spec_free(v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec) { if(NULL == v1_certificate_signing_request_spec){ return ; } + if(v1_certificate_signing_request_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_certificate_signing_request_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_certificate_signing_request_spec->extra) { list_ForEach(listEntry, v1_certificate_signing_request_spec->extra) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -101,7 +127,7 @@ cJSON *v1_certificate_signing_request_spec_convertToJSON(v1_certificate_signing_ listEntry_t *extraListEntry; if (v1_certificate_signing_request_spec->extra) { list_ForEach(extraListEntry, v1_certificate_signing_request_spec->extra) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)extraListEntry->data; + keyValuePair_t *localKeyValue = extraListEntry->data; } } } @@ -116,7 +142,7 @@ cJSON *v1_certificate_signing_request_spec_convertToJSON(v1_certificate_signing_ listEntry_t *groupsListEntry; list_ForEach(groupsListEntry, v1_certificate_signing_request_spec->groups) { - if(cJSON_AddStringToObject(groups, "", (char*)groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(groups, "", groupsListEntry->data) == NULL) { goto fail; } @@ -159,7 +185,7 @@ cJSON *v1_certificate_signing_request_spec_convertToJSON(v1_certificate_signing_ listEntry_t *usagesListEntry; list_ForEach(usagesListEntry, v1_certificate_signing_request_spec->usages) { - if(cJSON_AddStringToObject(usages, "", (char*)usagesListEntry->data) == NULL) + if(cJSON_AddStringToObject(usages, "", usagesListEntry->data) == NULL) { goto fail; } @@ -197,6 +223,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->expiration_seconds cJSON *expiration_seconds = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "expirationSeconds"); + if (cJSON_IsNull(expiration_seconds)) { + expiration_seconds = NULL; + } if (expiration_seconds) { if(!cJSON_IsNumber(expiration_seconds)) { @@ -206,6 +235,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "extra"); + if (cJSON_IsNull(extra)) { + extra = NULL; + } if (extra) { cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) @@ -226,6 +258,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->groups cJSON *groups = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "groups"); + if (cJSON_IsNull(groups)) { + groups = NULL; + } if (groups) { cJSON *groups_local = NULL; if(!cJSON_IsArray(groups)) { @@ -245,6 +280,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->request cJSON *request = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "request"); + if (cJSON_IsNull(request)) { + request = NULL; + } if (!request) { goto end; } @@ -257,6 +295,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->signer_name cJSON *signer_name = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "signerName"); + if (cJSON_IsNull(signer_name)) { + signer_name = NULL; + } if (!signer_name) { goto end; } @@ -269,6 +310,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -278,6 +322,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->usages cJSON *usages = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "usages"); + if (cJSON_IsNull(usages)) { + usages = NULL; + } if (usages) { cJSON *usages_local = NULL; if(!cJSON_IsArray(usages)) { @@ -297,6 +344,9 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->username cJSON *username = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "username"); + if (cJSON_IsNull(username)) { + username = NULL; + } if (username) { if(!cJSON_IsString(username) && !cJSON_IsNull(username)) { @@ -305,7 +355,7 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse } - v1_certificate_signing_request_spec_local_var = v1_certificate_signing_request_spec_create ( + v1_certificate_signing_request_spec_local_var = v1_certificate_signing_request_spec_create_internal ( expiration_seconds ? expiration_seconds->valuedouble : 0, extra ? extraList : NULL, groups ? groupsList : NULL, @@ -321,7 +371,7 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse if (extraList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, extraList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; keyValuePair_free(localKeyValue); diff --git a/kubernetes/model/v1_certificate_signing_request_spec.h b/kubernetes/model/v1_certificate_signing_request_spec.h index 9188ceb7..20e35792 100644 --- a/kubernetes/model/v1_certificate_signing_request_spec.h +++ b/kubernetes/model/v1_certificate_signing_request_spec.h @@ -28,9 +28,10 @@ typedef struct v1_certificate_signing_request_spec_t { list_t *usages; //primitive container char *username; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_certificate_signing_request_spec_t; -v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_create( +__attribute__((deprecated)) v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_create( int expiration_seconds, list_t* extra, list_t *groups, diff --git a/kubernetes/model/v1_certificate_signing_request_status.c b/kubernetes/model/v1_certificate_signing_request_status.c index d9b88b2e..c134b039 100644 --- a/kubernetes/model/v1_certificate_signing_request_status.c +++ b/kubernetes/model/v1_certificate_signing_request_status.c @@ -5,7 +5,7 @@ -v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_create( +static v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_create_internal( char *certificate, list_t *conditions ) { @@ -16,14 +16,28 @@ v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_c v1_certificate_signing_request_status_local_var->certificate = certificate; v1_certificate_signing_request_status_local_var->conditions = conditions; + v1_certificate_signing_request_status_local_var->_library_owned = 1; return v1_certificate_signing_request_status_local_var; } +__attribute__((deprecated)) v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_create( + char *certificate, + list_t *conditions + ) { + return v1_certificate_signing_request_status_create_internal ( + certificate, + conditions + ); +} void v1_certificate_signing_request_status_free(v1_certificate_signing_request_status_t *v1_certificate_signing_request_status) { if(NULL == v1_certificate_signing_request_status){ return ; } + if(v1_certificate_signing_request_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_certificate_signing_request_status_free"); + return ; + } listEntry_t *listEntry; if (v1_certificate_signing_request_status->certificate) { free(v1_certificate_signing_request_status->certificate); @@ -86,6 +100,9 @@ v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_p // v1_certificate_signing_request_status->certificate cJSON *certificate = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_statusJSON, "certificate"); + if (cJSON_IsNull(certificate)) { + certificate = NULL; + } if (certificate) { if(!cJSON_IsString(certificate)) { @@ -95,6 +112,9 @@ v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_p // v1_certificate_signing_request_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -115,7 +135,7 @@ v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_p } - v1_certificate_signing_request_status_local_var = v1_certificate_signing_request_status_create ( + v1_certificate_signing_request_status_local_var = v1_certificate_signing_request_status_create_internal ( certificate ? strdup(certificate->valuestring) : NULL, conditions ? conditionsList : NULL ); diff --git a/kubernetes/model/v1_certificate_signing_request_status.h b/kubernetes/model/v1_certificate_signing_request_status.h index 3d94b99b..12b8fe7a 100644 --- a/kubernetes/model/v1_certificate_signing_request_status.h +++ b/kubernetes/model/v1_certificate_signing_request_status.h @@ -23,9 +23,10 @@ typedef struct v1_certificate_signing_request_status_t { char *certificate; //ByteArray list_t *conditions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_certificate_signing_request_status_t; -v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_create( +__attribute__((deprecated)) v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_create( char *certificate, list_t *conditions ); diff --git a/kubernetes/model/v1_cinder_persistent_volume_source.c b/kubernetes/model/v1_cinder_persistent_volume_source.c index 186407f6..c2dd43d9 100644 --- a/kubernetes/model/v1_cinder_persistent_volume_source.c +++ b/kubernetes/model/v1_cinder_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_create( +static v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_create_internal( char *fs_type, int read_only, v1_secret_reference_t *secret_ref, @@ -20,14 +20,32 @@ v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_create( v1_cinder_persistent_volume_source_local_var->secret_ref = secret_ref; v1_cinder_persistent_volume_source_local_var->volume_id = volume_id; + v1_cinder_persistent_volume_source_local_var->_library_owned = 1; return v1_cinder_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_create( + char *fs_type, + int read_only, + v1_secret_reference_t *secret_ref, + char *volume_id + ) { + return v1_cinder_persistent_volume_source_create_internal ( + fs_type, + read_only, + secret_ref, + volume_id + ); +} void v1_cinder_persistent_volume_source_free(v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source) { if(NULL == v1_cinder_persistent_volume_source){ return ; } + if(v1_cinder_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cinder_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_cinder_persistent_volume_source->fs_type) { free(v1_cinder_persistent_volume_source->fs_type); @@ -101,6 +119,9 @@ v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_parseFr // v1_cinder_persistent_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_cinder_persistent_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -110,6 +131,9 @@ v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_parseFr // v1_cinder_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_cinder_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -119,12 +143,18 @@ v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_parseFr // v1_cinder_persistent_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_cinder_persistent_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_cinder_persistent_volume_source->volume_id cJSON *volume_id = cJSON_GetObjectItemCaseSensitive(v1_cinder_persistent_volume_sourceJSON, "volumeID"); + if (cJSON_IsNull(volume_id)) { + volume_id = NULL; + } if (!volume_id) { goto end; } @@ -136,7 +166,7 @@ v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_parseFr } - v1_cinder_persistent_volume_source_local_var = v1_cinder_persistent_volume_source_create ( + v1_cinder_persistent_volume_source_local_var = v1_cinder_persistent_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, read_only ? read_only->valueint : 0, secret_ref ? secret_ref_local_nonprim : NULL, diff --git a/kubernetes/model/v1_cinder_persistent_volume_source.h b/kubernetes/model/v1_cinder_persistent_volume_source.h index cec4f2fb..3504ff0b 100644 --- a/kubernetes/model/v1_cinder_persistent_volume_source.h +++ b/kubernetes/model/v1_cinder_persistent_volume_source.h @@ -25,9 +25,10 @@ typedef struct v1_cinder_persistent_volume_source_t { struct v1_secret_reference_t *secret_ref; //model char *volume_id; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_cinder_persistent_volume_source_t; -v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_create( +__attribute__((deprecated)) v1_cinder_persistent_volume_source_t *v1_cinder_persistent_volume_source_create( char *fs_type, int read_only, v1_secret_reference_t *secret_ref, diff --git a/kubernetes/model/v1_cinder_volume_source.c b/kubernetes/model/v1_cinder_volume_source.c index e8aedc9e..902590c7 100644 --- a/kubernetes/model/v1_cinder_volume_source.c +++ b/kubernetes/model/v1_cinder_volume_source.c @@ -5,7 +5,7 @@ -v1_cinder_volume_source_t *v1_cinder_volume_source_create( +static v1_cinder_volume_source_t *v1_cinder_volume_source_create_internal( char *fs_type, int read_only, v1_local_object_reference_t *secret_ref, @@ -20,14 +20,32 @@ v1_cinder_volume_source_t *v1_cinder_volume_source_create( v1_cinder_volume_source_local_var->secret_ref = secret_ref; v1_cinder_volume_source_local_var->volume_id = volume_id; + v1_cinder_volume_source_local_var->_library_owned = 1; return v1_cinder_volume_source_local_var; } +__attribute__((deprecated)) v1_cinder_volume_source_t *v1_cinder_volume_source_create( + char *fs_type, + int read_only, + v1_local_object_reference_t *secret_ref, + char *volume_id + ) { + return v1_cinder_volume_source_create_internal ( + fs_type, + read_only, + secret_ref, + volume_id + ); +} void v1_cinder_volume_source_free(v1_cinder_volume_source_t *v1_cinder_volume_source) { if(NULL == v1_cinder_volume_source){ return ; } + if(v1_cinder_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cinder_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_cinder_volume_source->fs_type) { free(v1_cinder_volume_source->fs_type); @@ -101,6 +119,9 @@ v1_cinder_volume_source_t *v1_cinder_volume_source_parseFromJSON(cJSON *v1_cinde // v1_cinder_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_cinder_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -110,6 +131,9 @@ v1_cinder_volume_source_t *v1_cinder_volume_source_parseFromJSON(cJSON *v1_cinde // v1_cinder_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_cinder_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -119,12 +143,18 @@ v1_cinder_volume_source_t *v1_cinder_volume_source_parseFromJSON(cJSON *v1_cinde // v1_cinder_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_cinder_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_local_object_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_cinder_volume_source->volume_id cJSON *volume_id = cJSON_GetObjectItemCaseSensitive(v1_cinder_volume_sourceJSON, "volumeID"); + if (cJSON_IsNull(volume_id)) { + volume_id = NULL; + } if (!volume_id) { goto end; } @@ -136,7 +166,7 @@ v1_cinder_volume_source_t *v1_cinder_volume_source_parseFromJSON(cJSON *v1_cinde } - v1_cinder_volume_source_local_var = v1_cinder_volume_source_create ( + v1_cinder_volume_source_local_var = v1_cinder_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, read_only ? read_only->valueint : 0, secret_ref ? secret_ref_local_nonprim : NULL, diff --git a/kubernetes/model/v1_cinder_volume_source.h b/kubernetes/model/v1_cinder_volume_source.h index 3664235d..f1aa3ec0 100644 --- a/kubernetes/model/v1_cinder_volume_source.h +++ b/kubernetes/model/v1_cinder_volume_source.h @@ -25,9 +25,10 @@ typedef struct v1_cinder_volume_source_t { struct v1_local_object_reference_t *secret_ref; //model char *volume_id; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_cinder_volume_source_t; -v1_cinder_volume_source_t *v1_cinder_volume_source_create( +__attribute__((deprecated)) v1_cinder_volume_source_t *v1_cinder_volume_source_create( char *fs_type, int read_only, v1_local_object_reference_t *secret_ref, diff --git a/kubernetes/model/v1_claim_source.c b/kubernetes/model/v1_claim_source.c deleted file mode 100644 index 8453692b..00000000 --- a/kubernetes/model/v1_claim_source.c +++ /dev/null @@ -1,97 +0,0 @@ -#include -#include -#include -#include "v1_claim_source.h" - - - -v1_claim_source_t *v1_claim_source_create( - char *resource_claim_name, - char *resource_claim_template_name - ) { - v1_claim_source_t *v1_claim_source_local_var = malloc(sizeof(v1_claim_source_t)); - if (!v1_claim_source_local_var) { - return NULL; - } - v1_claim_source_local_var->resource_claim_name = resource_claim_name; - v1_claim_source_local_var->resource_claim_template_name = resource_claim_template_name; - - return v1_claim_source_local_var; -} - - -void v1_claim_source_free(v1_claim_source_t *v1_claim_source) { - if(NULL == v1_claim_source){ - return ; - } - listEntry_t *listEntry; - if (v1_claim_source->resource_claim_name) { - free(v1_claim_source->resource_claim_name); - v1_claim_source->resource_claim_name = NULL; - } - if (v1_claim_source->resource_claim_template_name) { - free(v1_claim_source->resource_claim_template_name); - v1_claim_source->resource_claim_template_name = NULL; - } - free(v1_claim_source); -} - -cJSON *v1_claim_source_convertToJSON(v1_claim_source_t *v1_claim_source) { - cJSON *item = cJSON_CreateObject(); - - // v1_claim_source->resource_claim_name - if(v1_claim_source->resource_claim_name) { - if(cJSON_AddStringToObject(item, "resourceClaimName", v1_claim_source->resource_claim_name) == NULL) { - goto fail; //String - } - } - - - // v1_claim_source->resource_claim_template_name - if(v1_claim_source->resource_claim_template_name) { - if(cJSON_AddStringToObject(item, "resourceClaimTemplateName", v1_claim_source->resource_claim_template_name) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1_claim_source_t *v1_claim_source_parseFromJSON(cJSON *v1_claim_sourceJSON){ - - v1_claim_source_t *v1_claim_source_local_var = NULL; - - // v1_claim_source->resource_claim_name - cJSON *resource_claim_name = cJSON_GetObjectItemCaseSensitive(v1_claim_sourceJSON, "resourceClaimName"); - if (resource_claim_name) { - if(!cJSON_IsString(resource_claim_name) && !cJSON_IsNull(resource_claim_name)) - { - goto end; //String - } - } - - // v1_claim_source->resource_claim_template_name - cJSON *resource_claim_template_name = cJSON_GetObjectItemCaseSensitive(v1_claim_sourceJSON, "resourceClaimTemplateName"); - if (resource_claim_template_name) { - if(!cJSON_IsString(resource_claim_template_name) && !cJSON_IsNull(resource_claim_template_name)) - { - goto end; //String - } - } - - - v1_claim_source_local_var = v1_claim_source_create ( - resource_claim_name && !cJSON_IsNull(resource_claim_name) ? strdup(resource_claim_name->valuestring) : NULL, - resource_claim_template_name && !cJSON_IsNull(resource_claim_template_name) ? strdup(resource_claim_template_name->valuestring) : NULL - ); - - return v1_claim_source_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1_claim_source.h b/kubernetes/model/v1_claim_source.h deleted file mode 100644 index 3d99dcf0..00000000 --- a/kubernetes/model/v1_claim_source.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1_claim_source.h - * - * ClaimSource describes a reference to a ResourceClaim. Exactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value. - */ - -#ifndef _v1_claim_source_H_ -#define _v1_claim_source_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1_claim_source_t v1_claim_source_t; - - - - -typedef struct v1_claim_source_t { - char *resource_claim_name; // string - char *resource_claim_template_name; // string - -} v1_claim_source_t; - -v1_claim_source_t *v1_claim_source_create( - char *resource_claim_name, - char *resource_claim_template_name -); - -void v1_claim_source_free(v1_claim_source_t *v1_claim_source); - -v1_claim_source_t *v1_claim_source_parseFromJSON(cJSON *v1_claim_sourceJSON); - -cJSON *v1_claim_source_convertToJSON(v1_claim_source_t *v1_claim_source); - -#endif /* _v1_claim_source_H_ */ - diff --git a/kubernetes/model/v1_client_ip_config.c b/kubernetes/model/v1_client_ip_config.c index 45f7c6c8..a3bbefb0 100644 --- a/kubernetes/model/v1_client_ip_config.c +++ b/kubernetes/model/v1_client_ip_config.c @@ -5,7 +5,7 @@ -v1_client_ip_config_t *v1_client_ip_config_create( +static v1_client_ip_config_t *v1_client_ip_config_create_internal( int timeout_seconds ) { v1_client_ip_config_t *v1_client_ip_config_local_var = malloc(sizeof(v1_client_ip_config_t)); @@ -14,14 +14,26 @@ v1_client_ip_config_t *v1_client_ip_config_create( } v1_client_ip_config_local_var->timeout_seconds = timeout_seconds; + v1_client_ip_config_local_var->_library_owned = 1; return v1_client_ip_config_local_var; } +__attribute__((deprecated)) v1_client_ip_config_t *v1_client_ip_config_create( + int timeout_seconds + ) { + return v1_client_ip_config_create_internal ( + timeout_seconds + ); +} void v1_client_ip_config_free(v1_client_ip_config_t *v1_client_ip_config) { if(NULL == v1_client_ip_config){ return ; } + if(v1_client_ip_config->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_client_ip_config_free"); + return ; + } listEntry_t *listEntry; free(v1_client_ip_config); } @@ -50,6 +62,9 @@ v1_client_ip_config_t *v1_client_ip_config_parseFromJSON(cJSON *v1_client_ip_con // v1_client_ip_config->timeout_seconds cJSON *timeout_seconds = cJSON_GetObjectItemCaseSensitive(v1_client_ip_configJSON, "timeoutSeconds"); + if (cJSON_IsNull(timeout_seconds)) { + timeout_seconds = NULL; + } if (timeout_seconds) { if(!cJSON_IsNumber(timeout_seconds)) { @@ -58,7 +73,7 @@ v1_client_ip_config_t *v1_client_ip_config_parseFromJSON(cJSON *v1_client_ip_con } - v1_client_ip_config_local_var = v1_client_ip_config_create ( + v1_client_ip_config_local_var = v1_client_ip_config_create_internal ( timeout_seconds ? timeout_seconds->valuedouble : 0 ); diff --git a/kubernetes/model/v1_client_ip_config.h b/kubernetes/model/v1_client_ip_config.h index 84c497f7..651d9214 100644 --- a/kubernetes/model/v1_client_ip_config.h +++ b/kubernetes/model/v1_client_ip_config.h @@ -21,9 +21,10 @@ typedef struct v1_client_ip_config_t v1_client_ip_config_t; typedef struct v1_client_ip_config_t { int timeout_seconds; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_client_ip_config_t; -v1_client_ip_config_t *v1_client_ip_config_create( +__attribute__((deprecated)) v1_client_ip_config_t *v1_client_ip_config_create( int timeout_seconds ); diff --git a/kubernetes/model/v1_cluster_role.c b/kubernetes/model/v1_cluster_role.c index adeb2006..21deba99 100644 --- a/kubernetes/model/v1_cluster_role.c +++ b/kubernetes/model/v1_cluster_role.c @@ -5,7 +5,7 @@ -v1_cluster_role_t *v1_cluster_role_create( +static v1_cluster_role_t *v1_cluster_role_create_internal( v1_aggregation_rule_t *aggregation_rule, char *api_version, char *kind, @@ -22,14 +22,34 @@ v1_cluster_role_t *v1_cluster_role_create( v1_cluster_role_local_var->metadata = metadata; v1_cluster_role_local_var->rules = rules; + v1_cluster_role_local_var->_library_owned = 1; return v1_cluster_role_local_var; } +__attribute__((deprecated)) v1_cluster_role_t *v1_cluster_role_create( + v1_aggregation_rule_t *aggregation_rule, + char *api_version, + char *kind, + v1_object_meta_t *metadata, + list_t *rules + ) { + return v1_cluster_role_create_internal ( + aggregation_rule, + api_version, + kind, + metadata, + rules + ); +} void v1_cluster_role_free(v1_cluster_role_t *v1_cluster_role) { if(NULL == v1_cluster_role){ return ; } + if(v1_cluster_role->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cluster_role_free"); + return ; + } listEntry_t *listEntry; if (v1_cluster_role->aggregation_rule) { v1_aggregation_rule_free(v1_cluster_role->aggregation_rule); @@ -144,12 +164,18 @@ v1_cluster_role_t *v1_cluster_role_parseFromJSON(cJSON *v1_cluster_roleJSON){ // v1_cluster_role->aggregation_rule cJSON *aggregation_rule = cJSON_GetObjectItemCaseSensitive(v1_cluster_roleJSON, "aggregationRule"); + if (cJSON_IsNull(aggregation_rule)) { + aggregation_rule = NULL; + } if (aggregation_rule) { aggregation_rule_local_nonprim = v1_aggregation_rule_parseFromJSON(aggregation_rule); //nonprimitive } // v1_cluster_role->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cluster_roleJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -159,6 +185,9 @@ v1_cluster_role_t *v1_cluster_role_parseFromJSON(cJSON *v1_cluster_roleJSON){ // v1_cluster_role->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_cluster_roleJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -168,12 +197,18 @@ v1_cluster_role_t *v1_cluster_role_parseFromJSON(cJSON *v1_cluster_roleJSON){ // v1_cluster_role->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_cluster_roleJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_cluster_role->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_cluster_roleJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (rules) { cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ @@ -194,7 +229,7 @@ v1_cluster_role_t *v1_cluster_role_parseFromJSON(cJSON *v1_cluster_roleJSON){ } - v1_cluster_role_local_var = v1_cluster_role_create ( + v1_cluster_role_local_var = v1_cluster_role_create_internal ( aggregation_rule ? aggregation_rule_local_nonprim : NULL, api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_cluster_role.h b/kubernetes/model/v1_cluster_role.h index 4f4204b9..b3b73dff 100644 --- a/kubernetes/model/v1_cluster_role.h +++ b/kubernetes/model/v1_cluster_role.h @@ -28,9 +28,10 @@ typedef struct v1_cluster_role_t { struct v1_object_meta_t *metadata; //model list_t *rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_cluster_role_t; -v1_cluster_role_t *v1_cluster_role_create( +__attribute__((deprecated)) v1_cluster_role_t *v1_cluster_role_create( v1_aggregation_rule_t *aggregation_rule, char *api_version, char *kind, diff --git a/kubernetes/model/v1_cluster_role_binding.c b/kubernetes/model/v1_cluster_role_binding.c index aeb44353..a2bb8b00 100644 --- a/kubernetes/model/v1_cluster_role_binding.c +++ b/kubernetes/model/v1_cluster_role_binding.c @@ -5,7 +5,7 @@ -v1_cluster_role_binding_t *v1_cluster_role_binding_create( +static v1_cluster_role_binding_t *v1_cluster_role_binding_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_create( v1_cluster_role_binding_local_var->role_ref = role_ref; v1_cluster_role_binding_local_var->subjects = subjects; + v1_cluster_role_binding_local_var->_library_owned = 1; return v1_cluster_role_binding_local_var; } +__attribute__((deprecated)) v1_cluster_role_binding_t *v1_cluster_role_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_role_ref_t *role_ref, + list_t *subjects + ) { + return v1_cluster_role_binding_create_internal ( + api_version, + kind, + metadata, + role_ref, + subjects + ); +} void v1_cluster_role_binding_free(v1_cluster_role_binding_t *v1_cluster_role_binding) { if(NULL == v1_cluster_role_binding){ return ; } + if(v1_cluster_role_binding->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cluster_role_binding_free"); + return ; + } listEntry_t *listEntry; if (v1_cluster_role_binding->api_version) { free(v1_cluster_role_binding->api_version); @@ -145,6 +165,9 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust // v1_cluster_role_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_bindingJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -154,6 +177,9 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust // v1_cluster_role_binding->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_bindingJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -163,12 +189,18 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust // v1_cluster_role_binding->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_bindingJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_cluster_role_binding->role_ref cJSON *role_ref = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_bindingJSON, "roleRef"); + if (cJSON_IsNull(role_ref)) { + role_ref = NULL; + } if (!role_ref) { goto end; } @@ -178,6 +210,9 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust // v1_cluster_role_binding->subjects cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_bindingJSON, "subjects"); + if (cJSON_IsNull(subjects)) { + subjects = NULL; + } if (subjects) { cJSON *subjects_local_nonprimitive = NULL; if(!cJSON_IsArray(subjects)){ @@ -198,7 +233,7 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust } - v1_cluster_role_binding_local_var = v1_cluster_role_binding_create ( + v1_cluster_role_binding_local_var = v1_cluster_role_binding_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_cluster_role_binding.h b/kubernetes/model/v1_cluster_role_binding.h index 73a8de5b..aa926198 100644 --- a/kubernetes/model/v1_cluster_role_binding.h +++ b/kubernetes/model/v1_cluster_role_binding.h @@ -28,9 +28,10 @@ typedef struct v1_cluster_role_binding_t { struct v1_role_ref_t *role_ref; //model list_t *subjects; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_cluster_role_binding_t; -v1_cluster_role_binding_t *v1_cluster_role_binding_create( +__attribute__((deprecated)) v1_cluster_role_binding_t *v1_cluster_role_binding_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_cluster_role_binding_list.c b/kubernetes/model/v1_cluster_role_binding_list.c index 48ed6f18..bc854512 100644 --- a/kubernetes/model/v1_cluster_role_binding_list.c +++ b/kubernetes/model/v1_cluster_role_binding_list.c @@ -5,7 +5,7 @@ -v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_create( +static v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_create( v1_cluster_role_binding_list_local_var->kind = kind; v1_cluster_role_binding_list_local_var->metadata = metadata; + v1_cluster_role_binding_list_local_var->_library_owned = 1; return v1_cluster_role_binding_list_local_var; } +__attribute__((deprecated)) v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_cluster_role_binding_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_cluster_role_binding_list_free(v1_cluster_role_binding_list_t *v1_cluster_role_binding_list) { if(NULL == v1_cluster_role_binding_list){ return ; } + if(v1_cluster_role_binding_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cluster_role_binding_list_free"); + return ; + } listEntry_t *listEntry; if (v1_cluster_role_binding_list->api_version) { free(v1_cluster_role_binding_list->api_version); @@ -123,6 +141,9 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_parseFromJSON(cJSON // v1_cluster_role_binding_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_binding_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_parseFromJSON(cJSON // v1_cluster_role_binding_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_binding_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_parseFromJSON(cJSON // v1_cluster_role_binding_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_binding_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_parseFromJSON(cJSON // v1_cluster_role_binding_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_binding_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_cluster_role_binding_list_local_var = v1_cluster_role_binding_list_create ( + v1_cluster_role_binding_list_local_var = v1_cluster_role_binding_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_cluster_role_binding_list.h b/kubernetes/model/v1_cluster_role_binding_list.h index 6b1255ae..15e033cf 100644 --- a/kubernetes/model/v1_cluster_role_binding_list.h +++ b/kubernetes/model/v1_cluster_role_binding_list.h @@ -26,9 +26,10 @@ typedef struct v1_cluster_role_binding_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_cluster_role_binding_list_t; -v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_create( +__attribute__((deprecated)) v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_cluster_role_list.c b/kubernetes/model/v1_cluster_role_list.c index f4a9cbb1..a2ce3326 100644 --- a/kubernetes/model/v1_cluster_role_list.c +++ b/kubernetes/model/v1_cluster_role_list.c @@ -5,7 +5,7 @@ -v1_cluster_role_list_t *v1_cluster_role_list_create( +static v1_cluster_role_list_t *v1_cluster_role_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_cluster_role_list_t *v1_cluster_role_list_create( v1_cluster_role_list_local_var->kind = kind; v1_cluster_role_list_local_var->metadata = metadata; + v1_cluster_role_list_local_var->_library_owned = 1; return v1_cluster_role_list_local_var; } +__attribute__((deprecated)) v1_cluster_role_list_t *v1_cluster_role_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_cluster_role_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_cluster_role_list_free(v1_cluster_role_list_t *v1_cluster_role_list) { if(NULL == v1_cluster_role_list){ return ; } + if(v1_cluster_role_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cluster_role_list_free"); + return ; + } listEntry_t *listEntry; if (v1_cluster_role_list->api_version) { free(v1_cluster_role_list->api_version); @@ -123,6 +141,9 @@ v1_cluster_role_list_t *v1_cluster_role_list_parseFromJSON(cJSON *v1_cluster_rol // v1_cluster_role_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_cluster_role_list_t *v1_cluster_role_list_parseFromJSON(cJSON *v1_cluster_rol // v1_cluster_role_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_cluster_role_list_t *v1_cluster_role_list_parseFromJSON(cJSON *v1_cluster_rol // v1_cluster_role_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_cluster_role_list_t *v1_cluster_role_list_parseFromJSON(cJSON *v1_cluster_rol // v1_cluster_role_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_cluster_role_list_local_var = v1_cluster_role_list_create ( + v1_cluster_role_list_local_var = v1_cluster_role_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_cluster_role_list.h b/kubernetes/model/v1_cluster_role_list.h index d54a4c36..e7e05cdb 100644 --- a/kubernetes/model/v1_cluster_role_list.h +++ b/kubernetes/model/v1_cluster_role_list.h @@ -26,9 +26,10 @@ typedef struct v1_cluster_role_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_cluster_role_list_t; -v1_cluster_role_list_t *v1_cluster_role_list_create( +__attribute__((deprecated)) v1_cluster_role_list_t *v1_cluster_role_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_cluster_trust_bundle_projection.c b/kubernetes/model/v1_cluster_trust_bundle_projection.c index a1ff3461..0e213c92 100644 --- a/kubernetes/model/v1_cluster_trust_bundle_projection.c +++ b/kubernetes/model/v1_cluster_trust_bundle_projection.c @@ -5,7 +5,7 @@ -v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_create( +static v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_create_internal( v1_label_selector_t *label_selector, char *name, int optional, @@ -22,14 +22,34 @@ v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_create( v1_cluster_trust_bundle_projection_local_var->path = path; v1_cluster_trust_bundle_projection_local_var->signer_name = signer_name; + v1_cluster_trust_bundle_projection_local_var->_library_owned = 1; return v1_cluster_trust_bundle_projection_local_var; } +__attribute__((deprecated)) v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_create( + v1_label_selector_t *label_selector, + char *name, + int optional, + char *path, + char *signer_name + ) { + return v1_cluster_trust_bundle_projection_create_internal ( + label_selector, + name, + optional, + path, + signer_name + ); +} void v1_cluster_trust_bundle_projection_free(v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection) { if(NULL == v1_cluster_trust_bundle_projection){ return ; } + if(v1_cluster_trust_bundle_projection->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cluster_trust_bundle_projection_free"); + return ; + } listEntry_t *listEntry; if (v1_cluster_trust_bundle_projection->label_selector) { v1_label_selector_free(v1_cluster_trust_bundle_projection->label_selector); @@ -115,12 +135,18 @@ v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_parseFr // v1_cluster_trust_bundle_projection->label_selector cJSON *label_selector = cJSON_GetObjectItemCaseSensitive(v1_cluster_trust_bundle_projectionJSON, "labelSelector"); + if (cJSON_IsNull(label_selector)) { + label_selector = NULL; + } if (label_selector) { label_selector_local_nonprim = v1_label_selector_parseFromJSON(label_selector); //nonprimitive } // v1_cluster_trust_bundle_projection->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_cluster_trust_bundle_projectionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -130,6 +156,9 @@ v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_parseFr // v1_cluster_trust_bundle_projection->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_cluster_trust_bundle_projectionJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -139,6 +168,9 @@ v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_parseFr // v1_cluster_trust_bundle_projection->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_cluster_trust_bundle_projectionJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -151,6 +183,9 @@ v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_parseFr // v1_cluster_trust_bundle_projection->signer_name cJSON *signer_name = cJSON_GetObjectItemCaseSensitive(v1_cluster_trust_bundle_projectionJSON, "signerName"); + if (cJSON_IsNull(signer_name)) { + signer_name = NULL; + } if (signer_name) { if(!cJSON_IsString(signer_name) && !cJSON_IsNull(signer_name)) { @@ -159,7 +194,7 @@ v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_parseFr } - v1_cluster_trust_bundle_projection_local_var = v1_cluster_trust_bundle_projection_create ( + v1_cluster_trust_bundle_projection_local_var = v1_cluster_trust_bundle_projection_create_internal ( label_selector ? label_selector_local_nonprim : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, optional ? optional->valueint : 0, diff --git a/kubernetes/model/v1_cluster_trust_bundle_projection.h b/kubernetes/model/v1_cluster_trust_bundle_projection.h index 76e197f5..65299749 100644 --- a/kubernetes/model/v1_cluster_trust_bundle_projection.h +++ b/kubernetes/model/v1_cluster_trust_bundle_projection.h @@ -26,9 +26,10 @@ typedef struct v1_cluster_trust_bundle_projection_t { char *path; // string char *signer_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_cluster_trust_bundle_projection_t; -v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_create( +__attribute__((deprecated)) v1_cluster_trust_bundle_projection_t *v1_cluster_trust_bundle_projection_create( v1_label_selector_t *label_selector, char *name, int optional, diff --git a/kubernetes/model/v1_component_condition.c b/kubernetes/model/v1_component_condition.c index a6e220fa..0e66c1db 100644 --- a/kubernetes/model/v1_component_condition.c +++ b/kubernetes/model/v1_component_condition.c @@ -5,7 +5,7 @@ -v1_component_condition_t *v1_component_condition_create( +static v1_component_condition_t *v1_component_condition_create_internal( char *error, char *message, char *status, @@ -20,14 +20,32 @@ v1_component_condition_t *v1_component_condition_create( v1_component_condition_local_var->status = status; v1_component_condition_local_var->type = type; + v1_component_condition_local_var->_library_owned = 1; return v1_component_condition_local_var; } +__attribute__((deprecated)) v1_component_condition_t *v1_component_condition_create( + char *error, + char *message, + char *status, + char *type + ) { + return v1_component_condition_create_internal ( + error, + message, + status, + type + ); +} void v1_component_condition_free(v1_component_condition_t *v1_component_condition) { if(NULL == v1_component_condition){ return ; } + if(v1_component_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_component_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_component_condition->error) { free(v1_component_condition->error); @@ -98,6 +116,9 @@ v1_component_condition_t *v1_component_condition_parseFromJSON(cJSON *v1_compone // v1_component_condition->error cJSON *error = cJSON_GetObjectItemCaseSensitive(v1_component_conditionJSON, "error"); + if (cJSON_IsNull(error)) { + error = NULL; + } if (error) { if(!cJSON_IsString(error) && !cJSON_IsNull(error)) { @@ -107,6 +128,9 @@ v1_component_condition_t *v1_component_condition_parseFromJSON(cJSON *v1_compone // v1_component_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_component_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -116,6 +140,9 @@ v1_component_condition_t *v1_component_condition_parseFromJSON(cJSON *v1_compone // v1_component_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_component_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -128,6 +155,9 @@ v1_component_condition_t *v1_component_condition_parseFromJSON(cJSON *v1_compone // v1_component_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_component_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -139,7 +169,7 @@ v1_component_condition_t *v1_component_condition_parseFromJSON(cJSON *v1_compone } - v1_component_condition_local_var = v1_component_condition_create ( + v1_component_condition_local_var = v1_component_condition_create_internal ( error && !cJSON_IsNull(error) ? strdup(error->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, strdup(status->valuestring), diff --git a/kubernetes/model/v1_component_condition.h b/kubernetes/model/v1_component_condition.h index fcbc93b0..e00fe5cc 100644 --- a/kubernetes/model/v1_component_condition.h +++ b/kubernetes/model/v1_component_condition.h @@ -24,9 +24,10 @@ typedef struct v1_component_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_component_condition_t; -v1_component_condition_t *v1_component_condition_create( +__attribute__((deprecated)) v1_component_condition_t *v1_component_condition_create( char *error, char *message, char *status, diff --git a/kubernetes/model/v1_component_status.c b/kubernetes/model/v1_component_status.c index cb9eace8..9cc2698c 100644 --- a/kubernetes/model/v1_component_status.c +++ b/kubernetes/model/v1_component_status.c @@ -5,7 +5,7 @@ -v1_component_status_t *v1_component_status_create( +static v1_component_status_t *v1_component_status_create_internal( char *api_version, list_t *conditions, char *kind, @@ -20,14 +20,32 @@ v1_component_status_t *v1_component_status_create( v1_component_status_local_var->kind = kind; v1_component_status_local_var->metadata = metadata; + v1_component_status_local_var->_library_owned = 1; return v1_component_status_local_var; } +__attribute__((deprecated)) v1_component_status_t *v1_component_status_create( + char *api_version, + list_t *conditions, + char *kind, + v1_object_meta_t *metadata + ) { + return v1_component_status_create_internal ( + api_version, + conditions, + kind, + metadata + ); +} void v1_component_status_free(v1_component_status_t *v1_component_status) { if(NULL == v1_component_status){ return ; } + if(v1_component_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_component_status_free"); + return ; + } listEntry_t *listEntry; if (v1_component_status->api_version) { free(v1_component_status->api_version); @@ -122,6 +140,9 @@ v1_component_status_t *v1_component_status_parseFromJSON(cJSON *v1_component_sta // v1_component_status->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_component_statusJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -131,6 +152,9 @@ v1_component_status_t *v1_component_status_parseFromJSON(cJSON *v1_component_sta // v1_component_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_component_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -152,6 +176,9 @@ v1_component_status_t *v1_component_status_parseFromJSON(cJSON *v1_component_sta // v1_component_status->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_component_statusJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -161,12 +188,15 @@ v1_component_status_t *v1_component_status_parseFromJSON(cJSON *v1_component_sta // v1_component_status->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_component_statusJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } - v1_component_status_local_var = v1_component_status_create ( + v1_component_status_local_var = v1_component_status_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, conditions ? conditionsList : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_component_status.h b/kubernetes/model/v1_component_status.h index 4a4dc510..3442f7f7 100644 --- a/kubernetes/model/v1_component_status.h +++ b/kubernetes/model/v1_component_status.h @@ -26,9 +26,10 @@ typedef struct v1_component_status_t { char *kind; // string struct v1_object_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_component_status_t; -v1_component_status_t *v1_component_status_create( +__attribute__((deprecated)) v1_component_status_t *v1_component_status_create( char *api_version, list_t *conditions, char *kind, diff --git a/kubernetes/model/v1_component_status_list.c b/kubernetes/model/v1_component_status_list.c index 4671645e..03e95e00 100644 --- a/kubernetes/model/v1_component_status_list.c +++ b/kubernetes/model/v1_component_status_list.c @@ -5,7 +5,7 @@ -v1_component_status_list_t *v1_component_status_list_create( +static v1_component_status_list_t *v1_component_status_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_component_status_list_t *v1_component_status_list_create( v1_component_status_list_local_var->kind = kind; v1_component_status_list_local_var->metadata = metadata; + v1_component_status_list_local_var->_library_owned = 1; return v1_component_status_list_local_var; } +__attribute__((deprecated)) v1_component_status_list_t *v1_component_status_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_component_status_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_component_status_list_free(v1_component_status_list_t *v1_component_status_list) { if(NULL == v1_component_status_list){ return ; } + if(v1_component_status_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_component_status_list_free"); + return ; + } listEntry_t *listEntry; if (v1_component_status_list->api_version) { free(v1_component_status_list->api_version); @@ -123,6 +141,9 @@ v1_component_status_list_t *v1_component_status_list_parseFromJSON(cJSON *v1_com // v1_component_status_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_component_status_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_component_status_list_t *v1_component_status_list_parseFromJSON(cJSON *v1_com // v1_component_status_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_component_status_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_component_status_list_t *v1_component_status_list_parseFromJSON(cJSON *v1_com // v1_component_status_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_component_status_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_component_status_list_t *v1_component_status_list_parseFromJSON(cJSON *v1_com // v1_component_status_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_component_status_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_component_status_list_local_var = v1_component_status_list_create ( + v1_component_status_list_local_var = v1_component_status_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_component_status_list.h b/kubernetes/model/v1_component_status_list.h index 2f2ec1f7..280b639d 100644 --- a/kubernetes/model/v1_component_status_list.h +++ b/kubernetes/model/v1_component_status_list.h @@ -26,9 +26,10 @@ typedef struct v1_component_status_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_component_status_list_t; -v1_component_status_list_t *v1_component_status_list_create( +__attribute__((deprecated)) v1_component_status_list_t *v1_component_status_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_condition.c b/kubernetes/model/v1_condition.c index a8120fb6..950de16e 100644 --- a/kubernetes/model/v1_condition.c +++ b/kubernetes/model/v1_condition.c @@ -5,7 +5,7 @@ -v1_condition_t *v1_condition_create( +static v1_condition_t *v1_condition_create_internal( char *last_transition_time, char *message, long observed_generation, @@ -24,14 +24,36 @@ v1_condition_t *v1_condition_create( v1_condition_local_var->status = status; v1_condition_local_var->type = type; + v1_condition_local_var->_library_owned = 1; return v1_condition_local_var; } +__attribute__((deprecated)) v1_condition_t *v1_condition_create( + char *last_transition_time, + char *message, + long observed_generation, + char *reason, + char *status, + char *type + ) { + return v1_condition_create_internal ( + last_transition_time, + message, + observed_generation, + reason, + status, + type + ); +} void v1_condition_free(v1_condition_t *v1_condition) { if(NULL == v1_condition){ return ; } + if(v1_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_condition->last_transition_time) { free(v1_condition->last_transition_time); @@ -125,6 +147,9 @@ v1_condition_t *v1_condition_parseFromJSON(cJSON *v1_conditionJSON){ // v1_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (!last_transition_time) { goto end; } @@ -137,6 +162,9 @@ v1_condition_t *v1_condition_parseFromJSON(cJSON *v1_conditionJSON){ // v1_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (!message) { goto end; } @@ -149,6 +177,9 @@ v1_condition_t *v1_condition_parseFromJSON(cJSON *v1_conditionJSON){ // v1_condition->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_conditionJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -158,6 +189,9 @@ v1_condition_t *v1_condition_parseFromJSON(cJSON *v1_conditionJSON){ // v1_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (!reason) { goto end; } @@ -170,6 +204,9 @@ v1_condition_t *v1_condition_parseFromJSON(cJSON *v1_conditionJSON){ // v1_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -182,6 +219,9 @@ v1_condition_t *v1_condition_parseFromJSON(cJSON *v1_conditionJSON){ // v1_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -193,7 +233,7 @@ v1_condition_t *v1_condition_parseFromJSON(cJSON *v1_conditionJSON){ } - v1_condition_local_var = v1_condition_create ( + v1_condition_local_var = v1_condition_create_internal ( strdup(last_transition_time->valuestring), strdup(message->valuestring), observed_generation ? observed_generation->valuedouble : 0, diff --git a/kubernetes/model/v1_condition.h b/kubernetes/model/v1_condition.h index deb2553b..30751726 100644 --- a/kubernetes/model/v1_condition.h +++ b/kubernetes/model/v1_condition.h @@ -26,9 +26,10 @@ typedef struct v1_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_condition_t; -v1_condition_t *v1_condition_create( +__attribute__((deprecated)) v1_condition_t *v1_condition_create( char *last_transition_time, char *message, long observed_generation, diff --git a/kubernetes/model/v1_config_map.c b/kubernetes/model/v1_config_map.c index 2493d0ac..8b81c452 100644 --- a/kubernetes/model/v1_config_map.c +++ b/kubernetes/model/v1_config_map.c @@ -5,7 +5,7 @@ -v1_config_map_t *v1_config_map_create( +static v1_config_map_t *v1_config_map_create_internal( char *api_version, list_t* binary_data, list_t* data, @@ -24,14 +24,36 @@ v1_config_map_t *v1_config_map_create( v1_config_map_local_var->kind = kind; v1_config_map_local_var->metadata = metadata; + v1_config_map_local_var->_library_owned = 1; return v1_config_map_local_var; } +__attribute__((deprecated)) v1_config_map_t *v1_config_map_create( + char *api_version, + list_t* binary_data, + list_t* data, + int immutable, + char *kind, + v1_object_meta_t *metadata + ) { + return v1_config_map_create_internal ( + api_version, + binary_data, + data, + immutable, + kind, + metadata + ); +} void v1_config_map_free(v1_config_map_t *v1_config_map) { if(NULL == v1_config_map){ return ; } + if(v1_config_map->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_config_map_free"); + return ; + } listEntry_t *listEntry; if (v1_config_map->api_version) { free(v1_config_map->api_version); @@ -39,7 +61,7 @@ void v1_config_map_free(v1_config_map_t *v1_config_map) { } if (v1_config_map->binary_data) { list_ForEach(listEntry, v1_config_map->binary_data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -49,7 +71,7 @@ void v1_config_map_free(v1_config_map_t *v1_config_map) { } if (v1_config_map->data) { list_ForEach(listEntry, v1_config_map->data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -89,8 +111,8 @@ cJSON *v1_config_map_convertToJSON(v1_config_map_t *v1_config_map) { listEntry_t *binary_dataListEntry; if (v1_config_map->binary_data) { list_ForEach(binary_dataListEntry, v1_config_map->binary_data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)binary_dataListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = binary_dataListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -109,8 +131,8 @@ cJSON *v1_config_map_convertToJSON(v1_config_map_t *v1_config_map) { listEntry_t *dataListEntry; if (v1_config_map->data) { list_ForEach(dataListEntry, v1_config_map->data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)dataListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = dataListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -170,6 +192,9 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -179,6 +204,9 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->binary_data cJSON *binary_data = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "binaryData"); + if (cJSON_IsNull(binary_data)) { + binary_data = NULL; + } if (binary_data) { cJSON *binary_data_local_map = NULL; if(!cJSON_IsObject(binary_data) && !cJSON_IsNull(binary_data)) @@ -204,6 +232,9 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->data cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "data"); + if (cJSON_IsNull(data)) { + data = NULL; + } if (data) { cJSON *data_local_map = NULL; if(!cJSON_IsObject(data) && !cJSON_IsNull(data)) @@ -229,6 +260,9 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->immutable cJSON *immutable = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "immutable"); + if (cJSON_IsNull(immutable)) { + immutable = NULL; + } if (immutable) { if(!cJSON_IsBool(immutable)) { @@ -238,6 +272,9 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -247,12 +284,15 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } - v1_config_map_local_var = v1_config_map_create ( + v1_config_map_local_var = v1_config_map_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, binary_data ? binary_dataList : NULL, data ? dataList : NULL, @@ -266,7 +306,7 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ if (binary_dataList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, binary_dataList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -280,7 +320,7 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ if (dataList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, dataList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_config_map.h b/kubernetes/model/v1_config_map.h index 533f86a5..3b6aca40 100644 --- a/kubernetes/model/v1_config_map.h +++ b/kubernetes/model/v1_config_map.h @@ -27,9 +27,10 @@ typedef struct v1_config_map_t { char *kind; // string struct v1_object_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_config_map_t; -v1_config_map_t *v1_config_map_create( +__attribute__((deprecated)) v1_config_map_t *v1_config_map_create( char *api_version, list_t* binary_data, list_t* data, diff --git a/kubernetes/model/v1_config_map_env_source.c b/kubernetes/model/v1_config_map_env_source.c index c9295b56..5f5ec211 100644 --- a/kubernetes/model/v1_config_map_env_source.c +++ b/kubernetes/model/v1_config_map_env_source.c @@ -5,7 +5,7 @@ -v1_config_map_env_source_t *v1_config_map_env_source_create( +static v1_config_map_env_source_t *v1_config_map_env_source_create_internal( char *name, int optional ) { @@ -16,14 +16,28 @@ v1_config_map_env_source_t *v1_config_map_env_source_create( v1_config_map_env_source_local_var->name = name; v1_config_map_env_source_local_var->optional = optional; + v1_config_map_env_source_local_var->_library_owned = 1; return v1_config_map_env_source_local_var; } +__attribute__((deprecated)) v1_config_map_env_source_t *v1_config_map_env_source_create( + char *name, + int optional + ) { + return v1_config_map_env_source_create_internal ( + name, + optional + ); +} void v1_config_map_env_source_free(v1_config_map_env_source_t *v1_config_map_env_source) { if(NULL == v1_config_map_env_source){ return ; } + if(v1_config_map_env_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_config_map_env_source_free"); + return ; + } listEntry_t *listEntry; if (v1_config_map_env_source->name) { free(v1_config_map_env_source->name); @@ -64,6 +78,9 @@ v1_config_map_env_source_t *v1_config_map_env_source_parseFromJSON(cJSON *v1_con // v1_config_map_env_source->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_config_map_env_sourceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -73,6 +90,9 @@ v1_config_map_env_source_t *v1_config_map_env_source_parseFromJSON(cJSON *v1_con // v1_config_map_env_source->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_config_map_env_sourceJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -81,7 +101,7 @@ v1_config_map_env_source_t *v1_config_map_env_source_parseFromJSON(cJSON *v1_con } - v1_config_map_env_source_local_var = v1_config_map_env_source_create ( + v1_config_map_env_source_local_var = v1_config_map_env_source_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, optional ? optional->valueint : 0 ); diff --git a/kubernetes/model/v1_config_map_env_source.h b/kubernetes/model/v1_config_map_env_source.h index 19c8bb41..82486e3e 100644 --- a/kubernetes/model/v1_config_map_env_source.h +++ b/kubernetes/model/v1_config_map_env_source.h @@ -22,9 +22,10 @@ typedef struct v1_config_map_env_source_t { char *name; // string int optional; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_config_map_env_source_t; -v1_config_map_env_source_t *v1_config_map_env_source_create( +__attribute__((deprecated)) v1_config_map_env_source_t *v1_config_map_env_source_create( char *name, int optional ); diff --git a/kubernetes/model/v1_config_map_key_selector.c b/kubernetes/model/v1_config_map_key_selector.c index f0644ff8..6440dd4c 100644 --- a/kubernetes/model/v1_config_map_key_selector.c +++ b/kubernetes/model/v1_config_map_key_selector.c @@ -5,7 +5,7 @@ -v1_config_map_key_selector_t *v1_config_map_key_selector_create( +static v1_config_map_key_selector_t *v1_config_map_key_selector_create_internal( char *key, char *name, int optional @@ -18,14 +18,30 @@ v1_config_map_key_selector_t *v1_config_map_key_selector_create( v1_config_map_key_selector_local_var->name = name; v1_config_map_key_selector_local_var->optional = optional; + v1_config_map_key_selector_local_var->_library_owned = 1; return v1_config_map_key_selector_local_var; } +__attribute__((deprecated)) v1_config_map_key_selector_t *v1_config_map_key_selector_create( + char *key, + char *name, + int optional + ) { + return v1_config_map_key_selector_create_internal ( + key, + name, + optional + ); +} void v1_config_map_key_selector_free(v1_config_map_key_selector_t *v1_config_map_key_selector) { if(NULL == v1_config_map_key_selector){ return ; } + if(v1_config_map_key_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_config_map_key_selector_free"); + return ; + } listEntry_t *listEntry; if (v1_config_map_key_selector->key) { free(v1_config_map_key_selector->key); @@ -79,6 +95,9 @@ v1_config_map_key_selector_t *v1_config_map_key_selector_parseFromJSON(cJSON *v1 // v1_config_map_key_selector->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_config_map_key_selectorJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -91,6 +110,9 @@ v1_config_map_key_selector_t *v1_config_map_key_selector_parseFromJSON(cJSON *v1 // v1_config_map_key_selector->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_config_map_key_selectorJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -100,6 +122,9 @@ v1_config_map_key_selector_t *v1_config_map_key_selector_parseFromJSON(cJSON *v1 // v1_config_map_key_selector->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_config_map_key_selectorJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -108,7 +133,7 @@ v1_config_map_key_selector_t *v1_config_map_key_selector_parseFromJSON(cJSON *v1 } - v1_config_map_key_selector_local_var = v1_config_map_key_selector_create ( + v1_config_map_key_selector_local_var = v1_config_map_key_selector_create_internal ( strdup(key->valuestring), name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, optional ? optional->valueint : 0 diff --git a/kubernetes/model/v1_config_map_key_selector.h b/kubernetes/model/v1_config_map_key_selector.h index d11d7123..a7678122 100644 --- a/kubernetes/model/v1_config_map_key_selector.h +++ b/kubernetes/model/v1_config_map_key_selector.h @@ -23,9 +23,10 @@ typedef struct v1_config_map_key_selector_t { char *name; // string int optional; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_config_map_key_selector_t; -v1_config_map_key_selector_t *v1_config_map_key_selector_create( +__attribute__((deprecated)) v1_config_map_key_selector_t *v1_config_map_key_selector_create( char *key, char *name, int optional diff --git a/kubernetes/model/v1_config_map_list.c b/kubernetes/model/v1_config_map_list.c index a69bfdb1..b0d53eb9 100644 --- a/kubernetes/model/v1_config_map_list.c +++ b/kubernetes/model/v1_config_map_list.c @@ -5,7 +5,7 @@ -v1_config_map_list_t *v1_config_map_list_create( +static v1_config_map_list_t *v1_config_map_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_config_map_list_t *v1_config_map_list_create( v1_config_map_list_local_var->kind = kind; v1_config_map_list_local_var->metadata = metadata; + v1_config_map_list_local_var->_library_owned = 1; return v1_config_map_list_local_var; } +__attribute__((deprecated)) v1_config_map_list_t *v1_config_map_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_config_map_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_config_map_list_free(v1_config_map_list_t *v1_config_map_list) { if(NULL == v1_config_map_list){ return ; } + if(v1_config_map_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_config_map_list_free"); + return ; + } listEntry_t *listEntry; if (v1_config_map_list->api_version) { free(v1_config_map_list->api_version); @@ -123,6 +141,9 @@ v1_config_map_list_t *v1_config_map_list_parseFromJSON(cJSON *v1_config_map_list // v1_config_map_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_config_map_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_config_map_list_t *v1_config_map_list_parseFromJSON(cJSON *v1_config_map_list // v1_config_map_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_config_map_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_config_map_list_t *v1_config_map_list_parseFromJSON(cJSON *v1_config_map_list // v1_config_map_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_config_map_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_config_map_list_t *v1_config_map_list_parseFromJSON(cJSON *v1_config_map_list // v1_config_map_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_config_map_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_config_map_list_local_var = v1_config_map_list_create ( + v1_config_map_list_local_var = v1_config_map_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_config_map_list.h b/kubernetes/model/v1_config_map_list.h index ec892e00..b489e329 100644 --- a/kubernetes/model/v1_config_map_list.h +++ b/kubernetes/model/v1_config_map_list.h @@ -26,9 +26,10 @@ typedef struct v1_config_map_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_config_map_list_t; -v1_config_map_list_t *v1_config_map_list_create( +__attribute__((deprecated)) v1_config_map_list_t *v1_config_map_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_config_map_node_config_source.c b/kubernetes/model/v1_config_map_node_config_source.c index 334fcf7c..14a0b262 100644 --- a/kubernetes/model/v1_config_map_node_config_source.c +++ b/kubernetes/model/v1_config_map_node_config_source.c @@ -5,7 +5,7 @@ -v1_config_map_node_config_source_t *v1_config_map_node_config_source_create( +static v1_config_map_node_config_source_t *v1_config_map_node_config_source_create_internal( char *kubelet_config_key, char *name, char *_namespace, @@ -22,14 +22,34 @@ v1_config_map_node_config_source_t *v1_config_map_node_config_source_create( v1_config_map_node_config_source_local_var->resource_version = resource_version; v1_config_map_node_config_source_local_var->uid = uid; + v1_config_map_node_config_source_local_var->_library_owned = 1; return v1_config_map_node_config_source_local_var; } +__attribute__((deprecated)) v1_config_map_node_config_source_t *v1_config_map_node_config_source_create( + char *kubelet_config_key, + char *name, + char *_namespace, + char *resource_version, + char *uid + ) { + return v1_config_map_node_config_source_create_internal ( + kubelet_config_key, + name, + _namespace, + resource_version, + uid + ); +} void v1_config_map_node_config_source_free(v1_config_map_node_config_source_t *v1_config_map_node_config_source) { if(NULL == v1_config_map_node_config_source){ return ; } + if(v1_config_map_node_config_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_config_map_node_config_source_free"); + return ; + } listEntry_t *listEntry; if (v1_config_map_node_config_source->kubelet_config_key) { free(v1_config_map_node_config_source->kubelet_config_key); @@ -113,6 +133,9 @@ v1_config_map_node_config_source_t *v1_config_map_node_config_source_parseFromJS // v1_config_map_node_config_source->kubelet_config_key cJSON *kubelet_config_key = cJSON_GetObjectItemCaseSensitive(v1_config_map_node_config_sourceJSON, "kubeletConfigKey"); + if (cJSON_IsNull(kubelet_config_key)) { + kubelet_config_key = NULL; + } if (!kubelet_config_key) { goto end; } @@ -125,6 +148,9 @@ v1_config_map_node_config_source_t *v1_config_map_node_config_source_parseFromJS // v1_config_map_node_config_source->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_config_map_node_config_sourceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -137,6 +163,9 @@ v1_config_map_node_config_source_t *v1_config_map_node_config_source_parseFromJS // v1_config_map_node_config_source->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_config_map_node_config_sourceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (!_namespace) { goto end; } @@ -149,6 +178,9 @@ v1_config_map_node_config_source_t *v1_config_map_node_config_source_parseFromJS // v1_config_map_node_config_source->resource_version cJSON *resource_version = cJSON_GetObjectItemCaseSensitive(v1_config_map_node_config_sourceJSON, "resourceVersion"); + if (cJSON_IsNull(resource_version)) { + resource_version = NULL; + } if (resource_version) { if(!cJSON_IsString(resource_version) && !cJSON_IsNull(resource_version)) { @@ -158,6 +190,9 @@ v1_config_map_node_config_source_t *v1_config_map_node_config_source_parseFromJS // v1_config_map_node_config_source->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_config_map_node_config_sourceJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -166,7 +201,7 @@ v1_config_map_node_config_source_t *v1_config_map_node_config_source_parseFromJS } - v1_config_map_node_config_source_local_var = v1_config_map_node_config_source_create ( + v1_config_map_node_config_source_local_var = v1_config_map_node_config_source_create_internal ( strdup(kubelet_config_key->valuestring), strdup(name->valuestring), strdup(_namespace->valuestring), diff --git a/kubernetes/model/v1_config_map_node_config_source.h b/kubernetes/model/v1_config_map_node_config_source.h index a7a636ce..527491a1 100644 --- a/kubernetes/model/v1_config_map_node_config_source.h +++ b/kubernetes/model/v1_config_map_node_config_source.h @@ -25,9 +25,10 @@ typedef struct v1_config_map_node_config_source_t { char *resource_version; // string char *uid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_config_map_node_config_source_t; -v1_config_map_node_config_source_t *v1_config_map_node_config_source_create( +__attribute__((deprecated)) v1_config_map_node_config_source_t *v1_config_map_node_config_source_create( char *kubelet_config_key, char *name, char *_namespace, diff --git a/kubernetes/model/v1_config_map_projection.c b/kubernetes/model/v1_config_map_projection.c index 37329a78..75ace9d2 100644 --- a/kubernetes/model/v1_config_map_projection.c +++ b/kubernetes/model/v1_config_map_projection.c @@ -5,7 +5,7 @@ -v1_config_map_projection_t *v1_config_map_projection_create( +static v1_config_map_projection_t *v1_config_map_projection_create_internal( list_t *items, char *name, int optional @@ -18,14 +18,30 @@ v1_config_map_projection_t *v1_config_map_projection_create( v1_config_map_projection_local_var->name = name; v1_config_map_projection_local_var->optional = optional; + v1_config_map_projection_local_var->_library_owned = 1; return v1_config_map_projection_local_var; } +__attribute__((deprecated)) v1_config_map_projection_t *v1_config_map_projection_create( + list_t *items, + char *name, + int optional + ) { + return v1_config_map_projection_create_internal ( + items, + name, + optional + ); +} void v1_config_map_projection_free(v1_config_map_projection_t *v1_config_map_projection) { if(NULL == v1_config_map_projection){ return ; } + if(v1_config_map_projection->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_config_map_projection_free"); + return ; + } listEntry_t *listEntry; if (v1_config_map_projection->items) { list_ForEach(listEntry, v1_config_map_projection->items) { @@ -96,6 +112,9 @@ v1_config_map_projection_t *v1_config_map_projection_parseFromJSON(cJSON *v1_con // v1_config_map_projection->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_config_map_projectionJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (items) { cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ @@ -117,6 +136,9 @@ v1_config_map_projection_t *v1_config_map_projection_parseFromJSON(cJSON *v1_con // v1_config_map_projection->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_config_map_projectionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -126,6 +148,9 @@ v1_config_map_projection_t *v1_config_map_projection_parseFromJSON(cJSON *v1_con // v1_config_map_projection->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_config_map_projectionJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -134,7 +159,7 @@ v1_config_map_projection_t *v1_config_map_projection_parseFromJSON(cJSON *v1_con } - v1_config_map_projection_local_var = v1_config_map_projection_create ( + v1_config_map_projection_local_var = v1_config_map_projection_create_internal ( items ? itemsList : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, optional ? optional->valueint : 0 diff --git a/kubernetes/model/v1_config_map_projection.h b/kubernetes/model/v1_config_map_projection.h index e8d4e966..0e8cb09b 100644 --- a/kubernetes/model/v1_config_map_projection.h +++ b/kubernetes/model/v1_config_map_projection.h @@ -24,9 +24,10 @@ typedef struct v1_config_map_projection_t { char *name; // string int optional; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_config_map_projection_t; -v1_config_map_projection_t *v1_config_map_projection_create( +__attribute__((deprecated)) v1_config_map_projection_t *v1_config_map_projection_create( list_t *items, char *name, int optional diff --git a/kubernetes/model/v1_config_map_volume_source.c b/kubernetes/model/v1_config_map_volume_source.c index ff28e18a..64c2fa65 100644 --- a/kubernetes/model/v1_config_map_volume_source.c +++ b/kubernetes/model/v1_config_map_volume_source.c @@ -5,7 +5,7 @@ -v1_config_map_volume_source_t *v1_config_map_volume_source_create( +static v1_config_map_volume_source_t *v1_config_map_volume_source_create_internal( int default_mode, list_t *items, char *name, @@ -20,14 +20,32 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_create( v1_config_map_volume_source_local_var->name = name; v1_config_map_volume_source_local_var->optional = optional; + v1_config_map_volume_source_local_var->_library_owned = 1; return v1_config_map_volume_source_local_var; } +__attribute__((deprecated)) v1_config_map_volume_source_t *v1_config_map_volume_source_create( + int default_mode, + list_t *items, + char *name, + int optional + ) { + return v1_config_map_volume_source_create_internal ( + default_mode, + items, + name, + optional + ); +} void v1_config_map_volume_source_free(v1_config_map_volume_source_t *v1_config_map_volume_source) { if(NULL == v1_config_map_volume_source){ return ; } + if(v1_config_map_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_config_map_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_config_map_volume_source->items) { list_ForEach(listEntry, v1_config_map_volume_source->items) { @@ -106,6 +124,9 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * // v1_config_map_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_config_map_volume_sourceJSON, "defaultMode"); + if (cJSON_IsNull(default_mode)) { + default_mode = NULL; + } if (default_mode) { if(!cJSON_IsNumber(default_mode)) { @@ -115,6 +136,9 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * // v1_config_map_volume_source->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_config_map_volume_sourceJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (items) { cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ @@ -136,6 +160,9 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * // v1_config_map_volume_source->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_config_map_volume_sourceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -145,6 +172,9 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * // v1_config_map_volume_source->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_config_map_volume_sourceJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -153,7 +183,7 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * } - v1_config_map_volume_source_local_var = v1_config_map_volume_source_create ( + v1_config_map_volume_source_local_var = v1_config_map_volume_source_create_internal ( default_mode ? default_mode->valuedouble : 0, items ? itemsList : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, diff --git a/kubernetes/model/v1_config_map_volume_source.h b/kubernetes/model/v1_config_map_volume_source.h index ac1c58d1..e776e9e5 100644 --- a/kubernetes/model/v1_config_map_volume_source.h +++ b/kubernetes/model/v1_config_map_volume_source.h @@ -25,9 +25,10 @@ typedef struct v1_config_map_volume_source_t { char *name; // string int optional; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_config_map_volume_source_t; -v1_config_map_volume_source_t *v1_config_map_volume_source_create( +__attribute__((deprecated)) v1_config_map_volume_source_t *v1_config_map_volume_source_create( int default_mode, list_t *items, char *name, diff --git a/kubernetes/model/v1_container.c b/kubernetes/model/v1_container.c index 65659c81..a6984945 100644 --- a/kubernetes/model/v1_container.c +++ b/kubernetes/model/v1_container.c @@ -5,7 +5,7 @@ -v1_container_t *v1_container_create( +static v1_container_t *v1_container_create_internal( list_t *args, list_t *command, list_t *env, @@ -20,6 +20,7 @@ v1_container_t *v1_container_create( list_t *resize_policy, v1_resource_requirements_t *resources, char *restart_policy, + list_t *restart_policy_rules, v1_security_context_t *security_context, v1_probe_t *startup_probe, int _stdin, @@ -49,6 +50,7 @@ v1_container_t *v1_container_create( v1_container_local_var->resize_policy = resize_policy; v1_container_local_var->resources = resources; v1_container_local_var->restart_policy = restart_policy; + v1_container_local_var->restart_policy_rules = restart_policy_rules; v1_container_local_var->security_context = security_context; v1_container_local_var->startup_probe = startup_probe; v1_container_local_var->_stdin = _stdin; @@ -60,14 +62,74 @@ v1_container_t *v1_container_create( v1_container_local_var->volume_mounts = volume_mounts; v1_container_local_var->working_dir = working_dir; + v1_container_local_var->_library_owned = 1; return v1_container_local_var; } +__attribute__((deprecated)) v1_container_t *v1_container_create( + list_t *args, + list_t *command, + list_t *env, + list_t *env_from, + char *image, + char *image_pull_policy, + v1_lifecycle_t *lifecycle, + v1_probe_t *liveness_probe, + char *name, + list_t *ports, + v1_probe_t *readiness_probe, + list_t *resize_policy, + v1_resource_requirements_t *resources, + char *restart_policy, + list_t *restart_policy_rules, + v1_security_context_t *security_context, + v1_probe_t *startup_probe, + int _stdin, + int stdin_once, + char *termination_message_path, + char *termination_message_policy, + int tty, + list_t *volume_devices, + list_t *volume_mounts, + char *working_dir + ) { + return v1_container_create_internal ( + args, + command, + env, + env_from, + image, + image_pull_policy, + lifecycle, + liveness_probe, + name, + ports, + readiness_probe, + resize_policy, + resources, + restart_policy, + restart_policy_rules, + security_context, + startup_probe, + _stdin, + stdin_once, + termination_message_path, + termination_message_policy, + tty, + volume_devices, + volume_mounts, + working_dir + ); +} void v1_container_free(v1_container_t *v1_container) { if(NULL == v1_container){ return ; } + if(v1_container->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_free"); + return ; + } listEntry_t *listEntry; if (v1_container->args) { list_ForEach(listEntry, v1_container->args) { @@ -143,6 +205,13 @@ void v1_container_free(v1_container_t *v1_container) { free(v1_container->restart_policy); v1_container->restart_policy = NULL; } + if (v1_container->restart_policy_rules) { + list_ForEach(listEntry, v1_container->restart_policy_rules) { + v1_container_restart_rule_free(listEntry->data); + } + list_freeList(v1_container->restart_policy_rules); + v1_container->restart_policy_rules = NULL; + } if (v1_container->security_context) { v1_security_context_free(v1_container->security_context); v1_container->security_context = NULL; @@ -192,7 +261,7 @@ cJSON *v1_container_convertToJSON(v1_container_t *v1_container) { listEntry_t *argsListEntry; list_ForEach(argsListEntry, v1_container->args) { - if(cJSON_AddStringToObject(args, "", (char*)argsListEntry->data) == NULL) + if(cJSON_AddStringToObject(args, "", argsListEntry->data) == NULL) { goto fail; } @@ -209,7 +278,7 @@ cJSON *v1_container_convertToJSON(v1_container_t *v1_container) { listEntry_t *commandListEntry; list_ForEach(commandListEntry, v1_container->command) { - if(cJSON_AddStringToObject(command, "", (char*)commandListEntry->data) == NULL) + if(cJSON_AddStringToObject(command, "", commandListEntry->data) == NULL) { goto fail; } @@ -382,6 +451,26 @@ cJSON *v1_container_convertToJSON(v1_container_t *v1_container) { } + // v1_container->restart_policy_rules + if(v1_container->restart_policy_rules) { + cJSON *restart_policy_rules = cJSON_AddArrayToObject(item, "restartPolicyRules"); + if(restart_policy_rules == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *restart_policy_rulesListEntry; + if (v1_container->restart_policy_rules) { + list_ForEach(restart_policy_rulesListEntry, v1_container->restart_policy_rules) { + cJSON *itemLocal = v1_container_restart_rule_convertToJSON(restart_policy_rulesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(restart_policy_rules, itemLocal); + } + } + } + + // v1_container->security_context if(v1_container->security_context) { cJSON *security_context_local_JSON = v1_security_context_convertToJSON(v1_container->security_context); @@ -537,6 +626,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // define the local variable for v1_container->resources v1_resource_requirements_t *resources_local_nonprim = NULL; + // define the local list for v1_container->restart_policy_rules + list_t *restart_policy_rulesList = NULL; + // define the local variable for v1_container->security_context v1_security_context_t *security_context_local_nonprim = NULL; @@ -551,6 +643,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->args cJSON *args = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "args"); + if (cJSON_IsNull(args)) { + args = NULL; + } if (args) { cJSON *args_local = NULL; if(!cJSON_IsArray(args)) { @@ -570,6 +665,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->command cJSON *command = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "command"); + if (cJSON_IsNull(command)) { + command = NULL; + } if (command) { cJSON *command_local = NULL; if(!cJSON_IsArray(command)) { @@ -589,6 +687,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->env cJSON *env = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "env"); + if (cJSON_IsNull(env)) { + env = NULL; + } if (env) { cJSON *env_local_nonprimitive = NULL; if(!cJSON_IsArray(env)){ @@ -610,6 +711,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->env_from cJSON *env_from = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "envFrom"); + if (cJSON_IsNull(env_from)) { + env_from = NULL; + } if (env_from) { cJSON *env_from_local_nonprimitive = NULL; if(!cJSON_IsArray(env_from)){ @@ -631,6 +735,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->image cJSON *image = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "image"); + if (cJSON_IsNull(image)) { + image = NULL; + } if (image) { if(!cJSON_IsString(image) && !cJSON_IsNull(image)) { @@ -640,6 +747,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->image_pull_policy cJSON *image_pull_policy = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "imagePullPolicy"); + if (cJSON_IsNull(image_pull_policy)) { + image_pull_policy = NULL; + } if (image_pull_policy) { if(!cJSON_IsString(image_pull_policy) && !cJSON_IsNull(image_pull_policy)) { @@ -649,18 +759,27 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->lifecycle cJSON *lifecycle = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "lifecycle"); + if (cJSON_IsNull(lifecycle)) { + lifecycle = NULL; + } if (lifecycle) { lifecycle_local_nonprim = v1_lifecycle_parseFromJSON(lifecycle); //nonprimitive } // v1_container->liveness_probe cJSON *liveness_probe = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "livenessProbe"); + if (cJSON_IsNull(liveness_probe)) { + liveness_probe = NULL; + } if (liveness_probe) { liveness_probe_local_nonprim = v1_probe_parseFromJSON(liveness_probe); //nonprimitive } // v1_container->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -673,6 +792,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -694,12 +816,18 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->readiness_probe cJSON *readiness_probe = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "readinessProbe"); + if (cJSON_IsNull(readiness_probe)) { + readiness_probe = NULL; + } if (readiness_probe) { readiness_probe_local_nonprim = v1_probe_parseFromJSON(readiness_probe); //nonprimitive } // v1_container->resize_policy cJSON *resize_policy = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "resizePolicy"); + if (cJSON_IsNull(resize_policy)) { + resize_policy = NULL; + } if (resize_policy) { cJSON *resize_policy_local_nonprimitive = NULL; if(!cJSON_IsArray(resize_policy)){ @@ -721,12 +849,18 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { resources_local_nonprim = v1_resource_requirements_parseFromJSON(resources); //nonprimitive } // v1_container->restart_policy cJSON *restart_policy = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "restartPolicy"); + if (cJSON_IsNull(restart_policy)) { + restart_policy = NULL; + } if (restart_policy) { if(!cJSON_IsString(restart_policy) && !cJSON_IsNull(restart_policy)) { @@ -734,20 +868,53 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ } } + // v1_container->restart_policy_rules + cJSON *restart_policy_rules = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "restartPolicyRules"); + if (cJSON_IsNull(restart_policy_rules)) { + restart_policy_rules = NULL; + } + if (restart_policy_rules) { + cJSON *restart_policy_rules_local_nonprimitive = NULL; + if(!cJSON_IsArray(restart_policy_rules)){ + goto end; //nonprimitive container + } + + restart_policy_rulesList = list_createList(); + + cJSON_ArrayForEach(restart_policy_rules_local_nonprimitive,restart_policy_rules ) + { + if(!cJSON_IsObject(restart_policy_rules_local_nonprimitive)){ + goto end; + } + v1_container_restart_rule_t *restart_policy_rulesItem = v1_container_restart_rule_parseFromJSON(restart_policy_rules_local_nonprimitive); + + list_addElement(restart_policy_rulesList, restart_policy_rulesItem); + } + } + // v1_container->security_context cJSON *security_context = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "securityContext"); + if (cJSON_IsNull(security_context)) { + security_context = NULL; + } if (security_context) { security_context_local_nonprim = v1_security_context_parseFromJSON(security_context); //nonprimitive } // v1_container->startup_probe cJSON *startup_probe = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "startupProbe"); + if (cJSON_IsNull(startup_probe)) { + startup_probe = NULL; + } if (startup_probe) { startup_probe_local_nonprim = v1_probe_parseFromJSON(startup_probe); //nonprimitive } // v1_container->_stdin cJSON *_stdin = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "stdin"); + if (cJSON_IsNull(_stdin)) { + _stdin = NULL; + } if (_stdin) { if(!cJSON_IsBool(_stdin)) { @@ -757,6 +924,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->stdin_once cJSON *stdin_once = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "stdinOnce"); + if (cJSON_IsNull(stdin_once)) { + stdin_once = NULL; + } if (stdin_once) { if(!cJSON_IsBool(stdin_once)) { @@ -766,6 +936,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->termination_message_path cJSON *termination_message_path = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "terminationMessagePath"); + if (cJSON_IsNull(termination_message_path)) { + termination_message_path = NULL; + } if (termination_message_path) { if(!cJSON_IsString(termination_message_path) && !cJSON_IsNull(termination_message_path)) { @@ -775,6 +948,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->termination_message_policy cJSON *termination_message_policy = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "terminationMessagePolicy"); + if (cJSON_IsNull(termination_message_policy)) { + termination_message_policy = NULL; + } if (termination_message_policy) { if(!cJSON_IsString(termination_message_policy) && !cJSON_IsNull(termination_message_policy)) { @@ -784,6 +960,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->tty cJSON *tty = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "tty"); + if (cJSON_IsNull(tty)) { + tty = NULL; + } if (tty) { if(!cJSON_IsBool(tty)) { @@ -793,6 +972,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->volume_devices cJSON *volume_devices = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "volumeDevices"); + if (cJSON_IsNull(volume_devices)) { + volume_devices = NULL; + } if (volume_devices) { cJSON *volume_devices_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_devices)){ @@ -814,6 +996,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->volume_mounts cJSON *volume_mounts = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "volumeMounts"); + if (cJSON_IsNull(volume_mounts)) { + volume_mounts = NULL; + } if (volume_mounts) { cJSON *volume_mounts_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_mounts)){ @@ -835,6 +1020,9 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->working_dir cJSON *working_dir = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "workingDir"); + if (cJSON_IsNull(working_dir)) { + working_dir = NULL; + } if (working_dir) { if(!cJSON_IsString(working_dir) && !cJSON_IsNull(working_dir)) { @@ -843,7 +1031,7 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ } - v1_container_local_var = v1_container_create ( + v1_container_local_var = v1_container_create_internal ( args ? argsList : NULL, command ? commandList : NULL, env ? envList : NULL, @@ -858,6 +1046,7 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ resize_policy ? resize_policyList : NULL, resources ? resources_local_nonprim : NULL, restart_policy && !cJSON_IsNull(restart_policy) ? strdup(restart_policy->valuestring) : NULL, + restart_policy_rules ? restart_policy_rulesList : NULL, security_context ? security_context_local_nonprim : NULL, startup_probe ? startup_probe_local_nonprim : NULL, _stdin ? _stdin->valueint : 0, @@ -942,6 +1131,15 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ v1_resource_requirements_free(resources_local_nonprim); resources_local_nonprim = NULL; } + if (restart_policy_rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, restart_policy_rulesList) { + v1_container_restart_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(restart_policy_rulesList); + restart_policy_rulesList = NULL; + } if (security_context_local_nonprim) { v1_security_context_free(security_context_local_nonprim); security_context_local_nonprim = NULL; diff --git a/kubernetes/model/v1_container.h b/kubernetes/model/v1_container.h index f8b6869e..471d2feb 100644 --- a/kubernetes/model/v1_container.h +++ b/kubernetes/model/v1_container.h @@ -17,6 +17,7 @@ typedef struct v1_container_t v1_container_t; #include "v1_container_port.h" #include "v1_container_resize_policy.h" +#include "v1_container_restart_rule.h" #include "v1_env_from_source.h" #include "v1_env_var.h" #include "v1_lifecycle.h" @@ -43,6 +44,7 @@ typedef struct v1_container_t { list_t *resize_policy; //nonprimitive container struct v1_resource_requirements_t *resources; //model char *restart_policy; // string + list_t *restart_policy_rules; //nonprimitive container struct v1_security_context_t *security_context; //model struct v1_probe_t *startup_probe; //model int _stdin; //boolean @@ -54,9 +56,10 @@ typedef struct v1_container_t { list_t *volume_mounts; //nonprimitive container char *working_dir; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_container_t; -v1_container_t *v1_container_create( +__attribute__((deprecated)) v1_container_t *v1_container_create( list_t *args, list_t *command, list_t *env, @@ -71,6 +74,7 @@ v1_container_t *v1_container_create( list_t *resize_policy, v1_resource_requirements_t *resources, char *restart_policy, + list_t *restart_policy_rules, v1_security_context_t *security_context, v1_probe_t *startup_probe, int _stdin, diff --git a/kubernetes/model/v1_container_extended_resource_request.c b/kubernetes/model/v1_container_extended_resource_request.c new file mode 100644 index 00000000..81573478 --- /dev/null +++ b/kubernetes/model/v1_container_extended_resource_request.c @@ -0,0 +1,158 @@ +#include +#include +#include +#include "v1_container_extended_resource_request.h" + + + +static v1_container_extended_resource_request_t *v1_container_extended_resource_request_create_internal( + char *container_name, + char *request_name, + char *resource_name + ) { + v1_container_extended_resource_request_t *v1_container_extended_resource_request_local_var = malloc(sizeof(v1_container_extended_resource_request_t)); + if (!v1_container_extended_resource_request_local_var) { + return NULL; + } + v1_container_extended_resource_request_local_var->container_name = container_name; + v1_container_extended_resource_request_local_var->request_name = request_name; + v1_container_extended_resource_request_local_var->resource_name = resource_name; + + v1_container_extended_resource_request_local_var->_library_owned = 1; + return v1_container_extended_resource_request_local_var; +} + +__attribute__((deprecated)) v1_container_extended_resource_request_t *v1_container_extended_resource_request_create( + char *container_name, + char *request_name, + char *resource_name + ) { + return v1_container_extended_resource_request_create_internal ( + container_name, + request_name, + resource_name + ); +} + +void v1_container_extended_resource_request_free(v1_container_extended_resource_request_t *v1_container_extended_resource_request) { + if(NULL == v1_container_extended_resource_request){ + return ; + } + if(v1_container_extended_resource_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_extended_resource_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1_container_extended_resource_request->container_name) { + free(v1_container_extended_resource_request->container_name); + v1_container_extended_resource_request->container_name = NULL; + } + if (v1_container_extended_resource_request->request_name) { + free(v1_container_extended_resource_request->request_name); + v1_container_extended_resource_request->request_name = NULL; + } + if (v1_container_extended_resource_request->resource_name) { + free(v1_container_extended_resource_request->resource_name); + v1_container_extended_resource_request->resource_name = NULL; + } + free(v1_container_extended_resource_request); +} + +cJSON *v1_container_extended_resource_request_convertToJSON(v1_container_extended_resource_request_t *v1_container_extended_resource_request) { + cJSON *item = cJSON_CreateObject(); + + // v1_container_extended_resource_request->container_name + if (!v1_container_extended_resource_request->container_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "containerName", v1_container_extended_resource_request->container_name) == NULL) { + goto fail; //String + } + + + // v1_container_extended_resource_request->request_name + if (!v1_container_extended_resource_request->request_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "requestName", v1_container_extended_resource_request->request_name) == NULL) { + goto fail; //String + } + + + // v1_container_extended_resource_request->resource_name + if (!v1_container_extended_resource_request->resource_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resourceName", v1_container_extended_resource_request->resource_name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_container_extended_resource_request_t *v1_container_extended_resource_request_parseFromJSON(cJSON *v1_container_extended_resource_requestJSON){ + + v1_container_extended_resource_request_t *v1_container_extended_resource_request_local_var = NULL; + + // v1_container_extended_resource_request->container_name + cJSON *container_name = cJSON_GetObjectItemCaseSensitive(v1_container_extended_resource_requestJSON, "containerName"); + if (cJSON_IsNull(container_name)) { + container_name = NULL; + } + if (!container_name) { + goto end; + } + + + if(!cJSON_IsString(container_name)) + { + goto end; //String + } + + // v1_container_extended_resource_request->request_name + cJSON *request_name = cJSON_GetObjectItemCaseSensitive(v1_container_extended_resource_requestJSON, "requestName"); + if (cJSON_IsNull(request_name)) { + request_name = NULL; + } + if (!request_name) { + goto end; + } + + + if(!cJSON_IsString(request_name)) + { + goto end; //String + } + + // v1_container_extended_resource_request->resource_name + cJSON *resource_name = cJSON_GetObjectItemCaseSensitive(v1_container_extended_resource_requestJSON, "resourceName"); + if (cJSON_IsNull(resource_name)) { + resource_name = NULL; + } + if (!resource_name) { + goto end; + } + + + if(!cJSON_IsString(resource_name)) + { + goto end; //String + } + + + v1_container_extended_resource_request_local_var = v1_container_extended_resource_request_create_internal ( + strdup(container_name->valuestring), + strdup(request_name->valuestring), + strdup(resource_name->valuestring) + ); + + return v1_container_extended_resource_request_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_container_extended_resource_request.h b/kubernetes/model/v1_container_extended_resource_request.h new file mode 100644 index 00000000..8abecdbd --- /dev/null +++ b/kubernetes/model/v1_container_extended_resource_request.h @@ -0,0 +1,42 @@ +/* + * v1_container_extended_resource_request.h + * + * ContainerExtendedResourceRequest has the mapping of container name, extended resource name to the device request name. + */ + +#ifndef _v1_container_extended_resource_request_H_ +#define _v1_container_extended_resource_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_container_extended_resource_request_t v1_container_extended_resource_request_t; + + + + +typedef struct v1_container_extended_resource_request_t { + char *container_name; // string + char *request_name; // string + char *resource_name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_container_extended_resource_request_t; + +__attribute__((deprecated)) v1_container_extended_resource_request_t *v1_container_extended_resource_request_create( + char *container_name, + char *request_name, + char *resource_name +); + +void v1_container_extended_resource_request_free(v1_container_extended_resource_request_t *v1_container_extended_resource_request); + +v1_container_extended_resource_request_t *v1_container_extended_resource_request_parseFromJSON(cJSON *v1_container_extended_resource_requestJSON); + +cJSON *v1_container_extended_resource_request_convertToJSON(v1_container_extended_resource_request_t *v1_container_extended_resource_request); + +#endif /* _v1_container_extended_resource_request_H_ */ + diff --git a/kubernetes/model/v1_container_image.c b/kubernetes/model/v1_container_image.c index 125f3d62..d07c58b0 100644 --- a/kubernetes/model/v1_container_image.c +++ b/kubernetes/model/v1_container_image.c @@ -5,7 +5,7 @@ -v1_container_image_t *v1_container_image_create( +static v1_container_image_t *v1_container_image_create_internal( list_t *names, long size_bytes ) { @@ -16,14 +16,28 @@ v1_container_image_t *v1_container_image_create( v1_container_image_local_var->names = names; v1_container_image_local_var->size_bytes = size_bytes; + v1_container_image_local_var->_library_owned = 1; return v1_container_image_local_var; } +__attribute__((deprecated)) v1_container_image_t *v1_container_image_create( + list_t *names, + long size_bytes + ) { + return v1_container_image_create_internal ( + names, + size_bytes + ); +} void v1_container_image_free(v1_container_image_t *v1_container_image) { if(NULL == v1_container_image){ return ; } + if(v1_container_image->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_image_free"); + return ; + } listEntry_t *listEntry; if (v1_container_image->names) { list_ForEach(listEntry, v1_container_image->names) { @@ -47,7 +61,7 @@ cJSON *v1_container_image_convertToJSON(v1_container_image_t *v1_container_image listEntry_t *namesListEntry; list_ForEach(namesListEntry, v1_container_image->names) { - if(cJSON_AddStringToObject(names, "", (char*)namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(names, "", namesListEntry->data) == NULL) { goto fail; } @@ -79,6 +93,9 @@ v1_container_image_t *v1_container_image_parseFromJSON(cJSON *v1_container_image // v1_container_image->names cJSON *names = cJSON_GetObjectItemCaseSensitive(v1_container_imageJSON, "names"); + if (cJSON_IsNull(names)) { + names = NULL; + } if (names) { cJSON *names_local = NULL; if(!cJSON_IsArray(names)) { @@ -98,6 +115,9 @@ v1_container_image_t *v1_container_image_parseFromJSON(cJSON *v1_container_image // v1_container_image->size_bytes cJSON *size_bytes = cJSON_GetObjectItemCaseSensitive(v1_container_imageJSON, "sizeBytes"); + if (cJSON_IsNull(size_bytes)) { + size_bytes = NULL; + } if (size_bytes) { if(!cJSON_IsNumber(size_bytes)) { @@ -106,7 +126,7 @@ v1_container_image_t *v1_container_image_parseFromJSON(cJSON *v1_container_image } - v1_container_image_local_var = v1_container_image_create ( + v1_container_image_local_var = v1_container_image_create_internal ( names ? namesList : NULL, size_bytes ? size_bytes->valuedouble : 0 ); diff --git a/kubernetes/model/v1_container_image.h b/kubernetes/model/v1_container_image.h index 462681dc..a1bb8d1e 100644 --- a/kubernetes/model/v1_container_image.h +++ b/kubernetes/model/v1_container_image.h @@ -22,9 +22,10 @@ typedef struct v1_container_image_t { list_t *names; //primitive container long size_bytes; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_container_image_t; -v1_container_image_t *v1_container_image_create( +__attribute__((deprecated)) v1_container_image_t *v1_container_image_create( list_t *names, long size_bytes ); diff --git a/kubernetes/model/v1_container_port.c b/kubernetes/model/v1_container_port.c index f72e1cc0..c7d3ca85 100644 --- a/kubernetes/model/v1_container_port.c +++ b/kubernetes/model/v1_container_port.c @@ -5,7 +5,7 @@ -v1_container_port_t *v1_container_port_create( +static v1_container_port_t *v1_container_port_create_internal( int container_port, char *host_ip, int host_port, @@ -22,14 +22,34 @@ v1_container_port_t *v1_container_port_create( v1_container_port_local_var->name = name; v1_container_port_local_var->protocol = protocol; + v1_container_port_local_var->_library_owned = 1; return v1_container_port_local_var; } +__attribute__((deprecated)) v1_container_port_t *v1_container_port_create( + int container_port, + char *host_ip, + int host_port, + char *name, + char *protocol + ) { + return v1_container_port_create_internal ( + container_port, + host_ip, + host_port, + name, + protocol + ); +} void v1_container_port_free(v1_container_port_t *v1_container_port) { if(NULL == v1_container_port){ return ; } + if(v1_container_port->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_port_free"); + return ; + } listEntry_t *listEntry; if (v1_container_port->host_ip) { free(v1_container_port->host_ip); @@ -103,6 +123,9 @@ v1_container_port_t *v1_container_port_parseFromJSON(cJSON *v1_container_portJSO // v1_container_port->container_port cJSON *container_port = cJSON_GetObjectItemCaseSensitive(v1_container_portJSON, "containerPort"); + if (cJSON_IsNull(container_port)) { + container_port = NULL; + } if (!container_port) { goto end; } @@ -115,6 +138,9 @@ v1_container_port_t *v1_container_port_parseFromJSON(cJSON *v1_container_portJSO // v1_container_port->host_ip cJSON *host_ip = cJSON_GetObjectItemCaseSensitive(v1_container_portJSON, "hostIP"); + if (cJSON_IsNull(host_ip)) { + host_ip = NULL; + } if (host_ip) { if(!cJSON_IsString(host_ip) && !cJSON_IsNull(host_ip)) { @@ -124,6 +150,9 @@ v1_container_port_t *v1_container_port_parseFromJSON(cJSON *v1_container_portJSO // v1_container_port->host_port cJSON *host_port = cJSON_GetObjectItemCaseSensitive(v1_container_portJSON, "hostPort"); + if (cJSON_IsNull(host_port)) { + host_port = NULL; + } if (host_port) { if(!cJSON_IsNumber(host_port)) { @@ -133,6 +162,9 @@ v1_container_port_t *v1_container_port_parseFromJSON(cJSON *v1_container_portJSO // v1_container_port->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_container_portJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -142,6 +174,9 @@ v1_container_port_t *v1_container_port_parseFromJSON(cJSON *v1_container_portJSO // v1_container_port->protocol cJSON *protocol = cJSON_GetObjectItemCaseSensitive(v1_container_portJSON, "protocol"); + if (cJSON_IsNull(protocol)) { + protocol = NULL; + } if (protocol) { if(!cJSON_IsString(protocol) && !cJSON_IsNull(protocol)) { @@ -150,7 +185,7 @@ v1_container_port_t *v1_container_port_parseFromJSON(cJSON *v1_container_portJSO } - v1_container_port_local_var = v1_container_port_create ( + v1_container_port_local_var = v1_container_port_create_internal ( container_port->valuedouble, host_ip && !cJSON_IsNull(host_ip) ? strdup(host_ip->valuestring) : NULL, host_port ? host_port->valuedouble : 0, diff --git a/kubernetes/model/v1_container_port.h b/kubernetes/model/v1_container_port.h index 221e8df7..f4a23449 100644 --- a/kubernetes/model/v1_container_port.h +++ b/kubernetes/model/v1_container_port.h @@ -25,9 +25,10 @@ typedef struct v1_container_port_t { char *name; // string char *protocol; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_container_port_t; -v1_container_port_t *v1_container_port_create( +__attribute__((deprecated)) v1_container_port_t *v1_container_port_create( int container_port, char *host_ip, int host_port, diff --git a/kubernetes/model/v1_container_resize_policy.c b/kubernetes/model/v1_container_resize_policy.c index c328cf2e..cdc4d96d 100644 --- a/kubernetes/model/v1_container_resize_policy.c +++ b/kubernetes/model/v1_container_resize_policy.c @@ -5,7 +5,7 @@ -v1_container_resize_policy_t *v1_container_resize_policy_create( +static v1_container_resize_policy_t *v1_container_resize_policy_create_internal( char *resource_name, char *restart_policy ) { @@ -16,14 +16,28 @@ v1_container_resize_policy_t *v1_container_resize_policy_create( v1_container_resize_policy_local_var->resource_name = resource_name; v1_container_resize_policy_local_var->restart_policy = restart_policy; + v1_container_resize_policy_local_var->_library_owned = 1; return v1_container_resize_policy_local_var; } +__attribute__((deprecated)) v1_container_resize_policy_t *v1_container_resize_policy_create( + char *resource_name, + char *restart_policy + ) { + return v1_container_resize_policy_create_internal ( + resource_name, + restart_policy + ); +} void v1_container_resize_policy_free(v1_container_resize_policy_t *v1_container_resize_policy) { if(NULL == v1_container_resize_policy){ return ; } + if(v1_container_resize_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_resize_policy_free"); + return ; + } listEntry_t *listEntry; if (v1_container_resize_policy->resource_name) { free(v1_container_resize_policy->resource_name); @@ -70,6 +84,9 @@ v1_container_resize_policy_t *v1_container_resize_policy_parseFromJSON(cJSON *v1 // v1_container_resize_policy->resource_name cJSON *resource_name = cJSON_GetObjectItemCaseSensitive(v1_container_resize_policyJSON, "resourceName"); + if (cJSON_IsNull(resource_name)) { + resource_name = NULL; + } if (!resource_name) { goto end; } @@ -82,6 +99,9 @@ v1_container_resize_policy_t *v1_container_resize_policy_parseFromJSON(cJSON *v1 // v1_container_resize_policy->restart_policy cJSON *restart_policy = cJSON_GetObjectItemCaseSensitive(v1_container_resize_policyJSON, "restartPolicy"); + if (cJSON_IsNull(restart_policy)) { + restart_policy = NULL; + } if (!restart_policy) { goto end; } @@ -93,7 +113,7 @@ v1_container_resize_policy_t *v1_container_resize_policy_parseFromJSON(cJSON *v1 } - v1_container_resize_policy_local_var = v1_container_resize_policy_create ( + v1_container_resize_policy_local_var = v1_container_resize_policy_create_internal ( strdup(resource_name->valuestring), strdup(restart_policy->valuestring) ); diff --git a/kubernetes/model/v1_container_resize_policy.h b/kubernetes/model/v1_container_resize_policy.h index 2950b019..0456a40b 100644 --- a/kubernetes/model/v1_container_resize_policy.h +++ b/kubernetes/model/v1_container_resize_policy.h @@ -22,9 +22,10 @@ typedef struct v1_container_resize_policy_t { char *resource_name; // string char *restart_policy; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_container_resize_policy_t; -v1_container_resize_policy_t *v1_container_resize_policy_create( +__attribute__((deprecated)) v1_container_resize_policy_t *v1_container_resize_policy_create( char *resource_name, char *restart_policy ); diff --git a/kubernetes/model/v1_container_restart_rule.c b/kubernetes/model/v1_container_restart_rule.c new file mode 100644 index 00000000..6e2e9907 --- /dev/null +++ b/kubernetes/model/v1_container_restart_rule.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include "v1_container_restart_rule.h" + + + +static v1_container_restart_rule_t *v1_container_restart_rule_create_internal( + char *action, + v1_container_restart_rule_on_exit_codes_t *exit_codes + ) { + v1_container_restart_rule_t *v1_container_restart_rule_local_var = malloc(sizeof(v1_container_restart_rule_t)); + if (!v1_container_restart_rule_local_var) { + return NULL; + } + v1_container_restart_rule_local_var->action = action; + v1_container_restart_rule_local_var->exit_codes = exit_codes; + + v1_container_restart_rule_local_var->_library_owned = 1; + return v1_container_restart_rule_local_var; +} + +__attribute__((deprecated)) v1_container_restart_rule_t *v1_container_restart_rule_create( + char *action, + v1_container_restart_rule_on_exit_codes_t *exit_codes + ) { + return v1_container_restart_rule_create_internal ( + action, + exit_codes + ); +} + +void v1_container_restart_rule_free(v1_container_restart_rule_t *v1_container_restart_rule) { + if(NULL == v1_container_restart_rule){ + return ; + } + if(v1_container_restart_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_restart_rule_free"); + return ; + } + listEntry_t *listEntry; + if (v1_container_restart_rule->action) { + free(v1_container_restart_rule->action); + v1_container_restart_rule->action = NULL; + } + if (v1_container_restart_rule->exit_codes) { + v1_container_restart_rule_on_exit_codes_free(v1_container_restart_rule->exit_codes); + v1_container_restart_rule->exit_codes = NULL; + } + free(v1_container_restart_rule); +} + +cJSON *v1_container_restart_rule_convertToJSON(v1_container_restart_rule_t *v1_container_restart_rule) { + cJSON *item = cJSON_CreateObject(); + + // v1_container_restart_rule->action + if (!v1_container_restart_rule->action) { + goto fail; + } + if(cJSON_AddStringToObject(item, "action", v1_container_restart_rule->action) == NULL) { + goto fail; //String + } + + + // v1_container_restart_rule->exit_codes + if(v1_container_restart_rule->exit_codes) { + cJSON *exit_codes_local_JSON = v1_container_restart_rule_on_exit_codes_convertToJSON(v1_container_restart_rule->exit_codes); + if(exit_codes_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "exitCodes", exit_codes_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_container_restart_rule_t *v1_container_restart_rule_parseFromJSON(cJSON *v1_container_restart_ruleJSON){ + + v1_container_restart_rule_t *v1_container_restart_rule_local_var = NULL; + + // define the local variable for v1_container_restart_rule->exit_codes + v1_container_restart_rule_on_exit_codes_t *exit_codes_local_nonprim = NULL; + + // v1_container_restart_rule->action + cJSON *action = cJSON_GetObjectItemCaseSensitive(v1_container_restart_ruleJSON, "action"); + if (cJSON_IsNull(action)) { + action = NULL; + } + if (!action) { + goto end; + } + + + if(!cJSON_IsString(action)) + { + goto end; //String + } + + // v1_container_restart_rule->exit_codes + cJSON *exit_codes = cJSON_GetObjectItemCaseSensitive(v1_container_restart_ruleJSON, "exitCodes"); + if (cJSON_IsNull(exit_codes)) { + exit_codes = NULL; + } + if (exit_codes) { + exit_codes_local_nonprim = v1_container_restart_rule_on_exit_codes_parseFromJSON(exit_codes); //nonprimitive + } + + + v1_container_restart_rule_local_var = v1_container_restart_rule_create_internal ( + strdup(action->valuestring), + exit_codes ? exit_codes_local_nonprim : NULL + ); + + return v1_container_restart_rule_local_var; +end: + if (exit_codes_local_nonprim) { + v1_container_restart_rule_on_exit_codes_free(exit_codes_local_nonprim); + exit_codes_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_container_restart_rule.h b/kubernetes/model/v1_container_restart_rule.h new file mode 100644 index 00000000..01bf276a --- /dev/null +++ b/kubernetes/model/v1_container_restart_rule.h @@ -0,0 +1,41 @@ +/* + * v1_container_restart_rule.h + * + * ContainerRestartRule describes how a container exit is handled. + */ + +#ifndef _v1_container_restart_rule_H_ +#define _v1_container_restart_rule_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_container_restart_rule_t v1_container_restart_rule_t; + +#include "v1_container_restart_rule_on_exit_codes.h" + + + +typedef struct v1_container_restart_rule_t { + char *action; // string + struct v1_container_restart_rule_on_exit_codes_t *exit_codes; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_container_restart_rule_t; + +__attribute__((deprecated)) v1_container_restart_rule_t *v1_container_restart_rule_create( + char *action, + v1_container_restart_rule_on_exit_codes_t *exit_codes +); + +void v1_container_restart_rule_free(v1_container_restart_rule_t *v1_container_restart_rule); + +v1_container_restart_rule_t *v1_container_restart_rule_parseFromJSON(cJSON *v1_container_restart_ruleJSON); + +cJSON *v1_container_restart_rule_convertToJSON(v1_container_restart_rule_t *v1_container_restart_rule); + +#endif /* _v1_container_restart_rule_H_ */ + diff --git a/kubernetes/model/v1_container_restart_rule_on_exit_codes.c b/kubernetes/model/v1_container_restart_rule_on_exit_codes.c new file mode 100644 index 00000000..28fb1233 --- /dev/null +++ b/kubernetes/model/v1_container_restart_rule_on_exit_codes.c @@ -0,0 +1,161 @@ +#include +#include +#include +#include "v1_container_restart_rule_on_exit_codes.h" + + + +static v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes_create_internal( + char *_operator, + list_t *values + ) { + v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes_local_var = malloc(sizeof(v1_container_restart_rule_on_exit_codes_t)); + if (!v1_container_restart_rule_on_exit_codes_local_var) { + return NULL; + } + v1_container_restart_rule_on_exit_codes_local_var->_operator = _operator; + v1_container_restart_rule_on_exit_codes_local_var->values = values; + + v1_container_restart_rule_on_exit_codes_local_var->_library_owned = 1; + return v1_container_restart_rule_on_exit_codes_local_var; +} + +__attribute__((deprecated)) v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes_create( + char *_operator, + list_t *values + ) { + return v1_container_restart_rule_on_exit_codes_create_internal ( + _operator, + values + ); +} + +void v1_container_restart_rule_on_exit_codes_free(v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes) { + if(NULL == v1_container_restart_rule_on_exit_codes){ + return ; + } + if(v1_container_restart_rule_on_exit_codes->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_restart_rule_on_exit_codes_free"); + return ; + } + listEntry_t *listEntry; + if (v1_container_restart_rule_on_exit_codes->_operator) { + free(v1_container_restart_rule_on_exit_codes->_operator); + v1_container_restart_rule_on_exit_codes->_operator = NULL; + } + if (v1_container_restart_rule_on_exit_codes->values) { + list_ForEach(listEntry, v1_container_restart_rule_on_exit_codes->values) { + free(listEntry->data); + } + list_freeList(v1_container_restart_rule_on_exit_codes->values); + v1_container_restart_rule_on_exit_codes->values = NULL; + } + free(v1_container_restart_rule_on_exit_codes); +} + +cJSON *v1_container_restart_rule_on_exit_codes_convertToJSON(v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes) { + cJSON *item = cJSON_CreateObject(); + + // v1_container_restart_rule_on_exit_codes->_operator + if (!v1_container_restart_rule_on_exit_codes->_operator) { + goto fail; + } + if(cJSON_AddStringToObject(item, "operator", v1_container_restart_rule_on_exit_codes->_operator) == NULL) { + goto fail; //String + } + + + // v1_container_restart_rule_on_exit_codes->values + if(v1_container_restart_rule_on_exit_codes->values) { + cJSON *values = cJSON_AddArrayToObject(item, "values"); + if(values == NULL) { + goto fail; //primitive container + } + + listEntry_t *valuesListEntry; + list_ForEach(valuesListEntry, v1_container_restart_rule_on_exit_codes->values) { + if(cJSON_AddNumberToObject(values, "", *(double *)valuesListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes_parseFromJSON(cJSON *v1_container_restart_rule_on_exit_codesJSON){ + + v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes_local_var = NULL; + + // define the local list for v1_container_restart_rule_on_exit_codes->values + list_t *valuesList = NULL; + + // v1_container_restart_rule_on_exit_codes->_operator + cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_container_restart_rule_on_exit_codesJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } + if (!_operator) { + goto end; + } + + + if(!cJSON_IsString(_operator)) + { + goto end; //String + } + + // v1_container_restart_rule_on_exit_codes->values + cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_container_restart_rule_on_exit_codesJSON, "values"); + if (cJSON_IsNull(values)) { + values = NULL; + } + if (values) { + cJSON *values_local = NULL; + if(!cJSON_IsArray(values)) { + goto end;//primitive container + } + valuesList = list_createList(); + + cJSON_ArrayForEach(values_local, values) + { + if(!cJSON_IsNumber(values_local)) + { + goto end; + } + double *values_local_value = calloc(1, sizeof(double)); + if(!values_local_value) + { + goto end; + } + *values_local_value = values_local->valuedouble; + list_addElement(valuesList , values_local_value); + } + } + + + v1_container_restart_rule_on_exit_codes_local_var = v1_container_restart_rule_on_exit_codes_create_internal ( + strdup(_operator->valuestring), + values ? valuesList : NULL + ); + + return v1_container_restart_rule_on_exit_codes_local_var; +end: + if (valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valuesList); + valuesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_container_restart_rule_on_exit_codes.h b/kubernetes/model/v1_container_restart_rule_on_exit_codes.h new file mode 100644 index 00000000..ea4ab869 --- /dev/null +++ b/kubernetes/model/v1_container_restart_rule_on_exit_codes.h @@ -0,0 +1,40 @@ +/* + * v1_container_restart_rule_on_exit_codes.h + * + * ContainerRestartRuleOnExitCodes describes the condition for handling an exited container based on its exit codes. + */ + +#ifndef _v1_container_restart_rule_on_exit_codes_H_ +#define _v1_container_restart_rule_on_exit_codes_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_container_restart_rule_on_exit_codes_t v1_container_restart_rule_on_exit_codes_t; + + + + +typedef struct v1_container_restart_rule_on_exit_codes_t { + char *_operator; // string + list_t *values; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_container_restart_rule_on_exit_codes_t; + +__attribute__((deprecated)) v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes_create( + char *_operator, + list_t *values +); + +void v1_container_restart_rule_on_exit_codes_free(v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes); + +v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes_parseFromJSON(cJSON *v1_container_restart_rule_on_exit_codesJSON); + +cJSON *v1_container_restart_rule_on_exit_codes_convertToJSON(v1_container_restart_rule_on_exit_codes_t *v1_container_restart_rule_on_exit_codes); + +#endif /* _v1_container_restart_rule_on_exit_codes_H_ */ + diff --git a/kubernetes/model/v1_container_state.c b/kubernetes/model/v1_container_state.c index 026dd7a9..39d70edb 100644 --- a/kubernetes/model/v1_container_state.c +++ b/kubernetes/model/v1_container_state.c @@ -5,7 +5,7 @@ -v1_container_state_t *v1_container_state_create( +static v1_container_state_t *v1_container_state_create_internal( v1_container_state_running_t *running, v1_container_state_terminated_t *terminated, v1_container_state_waiting_t *waiting @@ -18,14 +18,30 @@ v1_container_state_t *v1_container_state_create( v1_container_state_local_var->terminated = terminated; v1_container_state_local_var->waiting = waiting; + v1_container_state_local_var->_library_owned = 1; return v1_container_state_local_var; } +__attribute__((deprecated)) v1_container_state_t *v1_container_state_create( + v1_container_state_running_t *running, + v1_container_state_terminated_t *terminated, + v1_container_state_waiting_t *waiting + ) { + return v1_container_state_create_internal ( + running, + terminated, + waiting + ); +} void v1_container_state_free(v1_container_state_t *v1_container_state) { if(NULL == v1_container_state){ return ; } + if(v1_container_state->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_state_free"); + return ; + } listEntry_t *listEntry; if (v1_container_state->running) { v1_container_state_running_free(v1_container_state->running); @@ -106,24 +122,33 @@ v1_container_state_t *v1_container_state_parseFromJSON(cJSON *v1_container_state // v1_container_state->running cJSON *running = cJSON_GetObjectItemCaseSensitive(v1_container_stateJSON, "running"); + if (cJSON_IsNull(running)) { + running = NULL; + } if (running) { running_local_nonprim = v1_container_state_running_parseFromJSON(running); //nonprimitive } // v1_container_state->terminated cJSON *terminated = cJSON_GetObjectItemCaseSensitive(v1_container_stateJSON, "terminated"); + if (cJSON_IsNull(terminated)) { + terminated = NULL; + } if (terminated) { terminated_local_nonprim = v1_container_state_terminated_parseFromJSON(terminated); //nonprimitive } // v1_container_state->waiting cJSON *waiting = cJSON_GetObjectItemCaseSensitive(v1_container_stateJSON, "waiting"); + if (cJSON_IsNull(waiting)) { + waiting = NULL; + } if (waiting) { waiting_local_nonprim = v1_container_state_waiting_parseFromJSON(waiting); //nonprimitive } - v1_container_state_local_var = v1_container_state_create ( + v1_container_state_local_var = v1_container_state_create_internal ( running ? running_local_nonprim : NULL, terminated ? terminated_local_nonprim : NULL, waiting ? waiting_local_nonprim : NULL diff --git a/kubernetes/model/v1_container_state.h b/kubernetes/model/v1_container_state.h index 00d3c09b..2f9957e2 100644 --- a/kubernetes/model/v1_container_state.h +++ b/kubernetes/model/v1_container_state.h @@ -26,9 +26,10 @@ typedef struct v1_container_state_t { struct v1_container_state_terminated_t *terminated; //model struct v1_container_state_waiting_t *waiting; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_container_state_t; -v1_container_state_t *v1_container_state_create( +__attribute__((deprecated)) v1_container_state_t *v1_container_state_create( v1_container_state_running_t *running, v1_container_state_terminated_t *terminated, v1_container_state_waiting_t *waiting diff --git a/kubernetes/model/v1_container_state_running.c b/kubernetes/model/v1_container_state_running.c index ea7178b5..e6edb1ae 100644 --- a/kubernetes/model/v1_container_state_running.c +++ b/kubernetes/model/v1_container_state_running.c @@ -5,7 +5,7 @@ -v1_container_state_running_t *v1_container_state_running_create( +static v1_container_state_running_t *v1_container_state_running_create_internal( char *started_at ) { v1_container_state_running_t *v1_container_state_running_local_var = malloc(sizeof(v1_container_state_running_t)); @@ -14,14 +14,26 @@ v1_container_state_running_t *v1_container_state_running_create( } v1_container_state_running_local_var->started_at = started_at; + v1_container_state_running_local_var->_library_owned = 1; return v1_container_state_running_local_var; } +__attribute__((deprecated)) v1_container_state_running_t *v1_container_state_running_create( + char *started_at + ) { + return v1_container_state_running_create_internal ( + started_at + ); +} void v1_container_state_running_free(v1_container_state_running_t *v1_container_state_running) { if(NULL == v1_container_state_running){ return ; } + if(v1_container_state_running->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_state_running_free"); + return ; + } listEntry_t *listEntry; if (v1_container_state_running->started_at) { free(v1_container_state_running->started_at); @@ -54,6 +66,9 @@ v1_container_state_running_t *v1_container_state_running_parseFromJSON(cJSON *v1 // v1_container_state_running->started_at cJSON *started_at = cJSON_GetObjectItemCaseSensitive(v1_container_state_runningJSON, "startedAt"); + if (cJSON_IsNull(started_at)) { + started_at = NULL; + } if (started_at) { if(!cJSON_IsString(started_at) && !cJSON_IsNull(started_at)) { @@ -62,7 +77,7 @@ v1_container_state_running_t *v1_container_state_running_parseFromJSON(cJSON *v1 } - v1_container_state_running_local_var = v1_container_state_running_create ( + v1_container_state_running_local_var = v1_container_state_running_create_internal ( started_at && !cJSON_IsNull(started_at) ? strdup(started_at->valuestring) : NULL ); diff --git a/kubernetes/model/v1_container_state_running.h b/kubernetes/model/v1_container_state_running.h index 90638d54..77435e30 100644 --- a/kubernetes/model/v1_container_state_running.h +++ b/kubernetes/model/v1_container_state_running.h @@ -21,9 +21,10 @@ typedef struct v1_container_state_running_t v1_container_state_running_t; typedef struct v1_container_state_running_t { char *started_at; //date time + int _library_owned; // Is the library responsible for freeing this object? } v1_container_state_running_t; -v1_container_state_running_t *v1_container_state_running_create( +__attribute__((deprecated)) v1_container_state_running_t *v1_container_state_running_create( char *started_at ); diff --git a/kubernetes/model/v1_container_state_terminated.c b/kubernetes/model/v1_container_state_terminated.c index d7d30d24..88b3f5a1 100644 --- a/kubernetes/model/v1_container_state_terminated.c +++ b/kubernetes/model/v1_container_state_terminated.c @@ -5,7 +5,7 @@ -v1_container_state_terminated_t *v1_container_state_terminated_create( +static v1_container_state_terminated_t *v1_container_state_terminated_create_internal( char *container_id, int exit_code, char *finished_at, @@ -26,14 +26,38 @@ v1_container_state_terminated_t *v1_container_state_terminated_create( v1_container_state_terminated_local_var->signal = signal; v1_container_state_terminated_local_var->started_at = started_at; + v1_container_state_terminated_local_var->_library_owned = 1; return v1_container_state_terminated_local_var; } +__attribute__((deprecated)) v1_container_state_terminated_t *v1_container_state_terminated_create( + char *container_id, + int exit_code, + char *finished_at, + char *message, + char *reason, + int signal, + char *started_at + ) { + return v1_container_state_terminated_create_internal ( + container_id, + exit_code, + finished_at, + message, + reason, + signal, + started_at + ); +} void v1_container_state_terminated_free(v1_container_state_terminated_t *v1_container_state_terminated) { if(NULL == v1_container_state_terminated){ return ; } + if(v1_container_state_terminated->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_state_terminated_free"); + return ; + } listEntry_t *listEntry; if (v1_container_state_terminated->container_id) { free(v1_container_state_terminated->container_id); @@ -131,6 +155,9 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS // v1_container_state_terminated->container_id cJSON *container_id = cJSON_GetObjectItemCaseSensitive(v1_container_state_terminatedJSON, "containerID"); + if (cJSON_IsNull(container_id)) { + container_id = NULL; + } if (container_id) { if(!cJSON_IsString(container_id) && !cJSON_IsNull(container_id)) { @@ -140,6 +167,9 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS // v1_container_state_terminated->exit_code cJSON *exit_code = cJSON_GetObjectItemCaseSensitive(v1_container_state_terminatedJSON, "exitCode"); + if (cJSON_IsNull(exit_code)) { + exit_code = NULL; + } if (!exit_code) { goto end; } @@ -152,6 +182,9 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS // v1_container_state_terminated->finished_at cJSON *finished_at = cJSON_GetObjectItemCaseSensitive(v1_container_state_terminatedJSON, "finishedAt"); + if (cJSON_IsNull(finished_at)) { + finished_at = NULL; + } if (finished_at) { if(!cJSON_IsString(finished_at) && !cJSON_IsNull(finished_at)) { @@ -161,6 +194,9 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS // v1_container_state_terminated->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_container_state_terminatedJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -170,6 +206,9 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS // v1_container_state_terminated->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_container_state_terminatedJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -179,6 +218,9 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS // v1_container_state_terminated->signal cJSON *signal = cJSON_GetObjectItemCaseSensitive(v1_container_state_terminatedJSON, "signal"); + if (cJSON_IsNull(signal)) { + signal = NULL; + } if (signal) { if(!cJSON_IsNumber(signal)) { @@ -188,6 +230,9 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS // v1_container_state_terminated->started_at cJSON *started_at = cJSON_GetObjectItemCaseSensitive(v1_container_state_terminatedJSON, "startedAt"); + if (cJSON_IsNull(started_at)) { + started_at = NULL; + } if (started_at) { if(!cJSON_IsString(started_at) && !cJSON_IsNull(started_at)) { @@ -196,7 +241,7 @@ v1_container_state_terminated_t *v1_container_state_terminated_parseFromJSON(cJS } - v1_container_state_terminated_local_var = v1_container_state_terminated_create ( + v1_container_state_terminated_local_var = v1_container_state_terminated_create_internal ( container_id && !cJSON_IsNull(container_id) ? strdup(container_id->valuestring) : NULL, exit_code->valuedouble, finished_at && !cJSON_IsNull(finished_at) ? strdup(finished_at->valuestring) : NULL, diff --git a/kubernetes/model/v1_container_state_terminated.h b/kubernetes/model/v1_container_state_terminated.h index 24998c8d..5ee4b865 100644 --- a/kubernetes/model/v1_container_state_terminated.h +++ b/kubernetes/model/v1_container_state_terminated.h @@ -27,9 +27,10 @@ typedef struct v1_container_state_terminated_t { int signal; //numeric char *started_at; //date time + int _library_owned; // Is the library responsible for freeing this object? } v1_container_state_terminated_t; -v1_container_state_terminated_t *v1_container_state_terminated_create( +__attribute__((deprecated)) v1_container_state_terminated_t *v1_container_state_terminated_create( char *container_id, int exit_code, char *finished_at, diff --git a/kubernetes/model/v1_container_state_waiting.c b/kubernetes/model/v1_container_state_waiting.c index 40307351..4ae0a5be 100644 --- a/kubernetes/model/v1_container_state_waiting.c +++ b/kubernetes/model/v1_container_state_waiting.c @@ -5,7 +5,7 @@ -v1_container_state_waiting_t *v1_container_state_waiting_create( +static v1_container_state_waiting_t *v1_container_state_waiting_create_internal( char *message, char *reason ) { @@ -16,14 +16,28 @@ v1_container_state_waiting_t *v1_container_state_waiting_create( v1_container_state_waiting_local_var->message = message; v1_container_state_waiting_local_var->reason = reason; + v1_container_state_waiting_local_var->_library_owned = 1; return v1_container_state_waiting_local_var; } +__attribute__((deprecated)) v1_container_state_waiting_t *v1_container_state_waiting_create( + char *message, + char *reason + ) { + return v1_container_state_waiting_create_internal ( + message, + reason + ); +} void v1_container_state_waiting_free(v1_container_state_waiting_t *v1_container_state_waiting) { if(NULL == v1_container_state_waiting){ return ; } + if(v1_container_state_waiting->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_state_waiting_free"); + return ; + } listEntry_t *listEntry; if (v1_container_state_waiting->message) { free(v1_container_state_waiting->message); @@ -68,6 +82,9 @@ v1_container_state_waiting_t *v1_container_state_waiting_parseFromJSON(cJSON *v1 // v1_container_state_waiting->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_container_state_waitingJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -77,6 +94,9 @@ v1_container_state_waiting_t *v1_container_state_waiting_parseFromJSON(cJSON *v1 // v1_container_state_waiting->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_container_state_waitingJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -85,7 +105,7 @@ v1_container_state_waiting_t *v1_container_state_waiting_parseFromJSON(cJSON *v1 } - v1_container_state_waiting_local_var = v1_container_state_waiting_create ( + v1_container_state_waiting_local_var = v1_container_state_waiting_create_internal ( message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL ); diff --git a/kubernetes/model/v1_container_state_waiting.h b/kubernetes/model/v1_container_state_waiting.h index 0b4df173..199f5ca1 100644 --- a/kubernetes/model/v1_container_state_waiting.h +++ b/kubernetes/model/v1_container_state_waiting.h @@ -22,9 +22,10 @@ typedef struct v1_container_state_waiting_t { char *message; // string char *reason; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_container_state_waiting_t; -v1_container_state_waiting_t *v1_container_state_waiting_create( +__attribute__((deprecated)) v1_container_state_waiting_t *v1_container_state_waiting_create( char *message, char *reason ); diff --git a/kubernetes/model/v1_container_status.c b/kubernetes/model/v1_container_status.c index 256caf2d..a5148b4b 100644 --- a/kubernetes/model/v1_container_status.c +++ b/kubernetes/model/v1_container_status.c @@ -5,8 +5,9 @@ -v1_container_status_t *v1_container_status_create( +static v1_container_status_t *v1_container_status_create_internal( list_t* allocated_resources, + list_t *allocated_resources_status, char *container_id, char *image, char *image_id, @@ -17,6 +18,8 @@ v1_container_status_t *v1_container_status_create( int restart_count, int started, v1_container_state_t *state, + char *stop_signal, + v1_container_user_t *user, list_t *volume_mounts ) { v1_container_status_t *v1_container_status_local_var = malloc(sizeof(v1_container_status_t)); @@ -24,6 +27,7 @@ v1_container_status_t *v1_container_status_create( return NULL; } v1_container_status_local_var->allocated_resources = allocated_resources; + v1_container_status_local_var->allocated_resources_status = allocated_resources_status; v1_container_status_local_var->container_id = container_id; v1_container_status_local_var->image = image; v1_container_status_local_var->image_id = image_id; @@ -34,20 +38,62 @@ v1_container_status_t *v1_container_status_create( v1_container_status_local_var->restart_count = restart_count; v1_container_status_local_var->started = started; v1_container_status_local_var->state = state; + v1_container_status_local_var->stop_signal = stop_signal; + v1_container_status_local_var->user = user; v1_container_status_local_var->volume_mounts = volume_mounts; + v1_container_status_local_var->_library_owned = 1; return v1_container_status_local_var; } +__attribute__((deprecated)) v1_container_status_t *v1_container_status_create( + list_t* allocated_resources, + list_t *allocated_resources_status, + char *container_id, + char *image, + char *image_id, + v1_container_state_t *last_state, + char *name, + int ready, + v1_resource_requirements_t *resources, + int restart_count, + int started, + v1_container_state_t *state, + char *stop_signal, + v1_container_user_t *user, + list_t *volume_mounts + ) { + return v1_container_status_create_internal ( + allocated_resources, + allocated_resources_status, + container_id, + image, + image_id, + last_state, + name, + ready, + resources, + restart_count, + started, + state, + stop_signal, + user, + volume_mounts + ); +} void v1_container_status_free(v1_container_status_t *v1_container_status) { if(NULL == v1_container_status){ return ; } + if(v1_container_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_status_free"); + return ; + } listEntry_t *listEntry; if (v1_container_status->allocated_resources) { list_ForEach(listEntry, v1_container_status->allocated_resources) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -55,6 +101,13 @@ void v1_container_status_free(v1_container_status_t *v1_container_status) { list_freeList(v1_container_status->allocated_resources); v1_container_status->allocated_resources = NULL; } + if (v1_container_status->allocated_resources_status) { + list_ForEach(listEntry, v1_container_status->allocated_resources_status) { + v1_resource_status_free(listEntry->data); + } + list_freeList(v1_container_status->allocated_resources_status); + v1_container_status->allocated_resources_status = NULL; + } if (v1_container_status->container_id) { free(v1_container_status->container_id); v1_container_status->container_id = NULL; @@ -83,6 +136,14 @@ void v1_container_status_free(v1_container_status_t *v1_container_status) { v1_container_state_free(v1_container_status->state); v1_container_status->state = NULL; } + if (v1_container_status->stop_signal) { + free(v1_container_status->stop_signal); + v1_container_status->stop_signal = NULL; + } + if (v1_container_status->user) { + v1_container_user_free(v1_container_status->user); + v1_container_status->user = NULL; + } if (v1_container_status->volume_mounts) { list_ForEach(listEntry, v1_container_status->volume_mounts) { v1_volume_mount_status_free(listEntry->data); @@ -106,8 +167,8 @@ cJSON *v1_container_status_convertToJSON(v1_container_status_t *v1_container_sta listEntry_t *allocated_resourcesListEntry; if (v1_container_status->allocated_resources) { list_ForEach(allocated_resourcesListEntry, v1_container_status->allocated_resources) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)allocated_resourcesListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = allocated_resourcesListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -116,6 +177,26 @@ cJSON *v1_container_status_convertToJSON(v1_container_status_t *v1_container_sta } + // v1_container_status->allocated_resources_status + if(v1_container_status->allocated_resources_status) { + cJSON *allocated_resources_status = cJSON_AddArrayToObject(item, "allocatedResourcesStatus"); + if(allocated_resources_status == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *allocated_resources_statusListEntry; + if (v1_container_status->allocated_resources_status) { + list_ForEach(allocated_resources_statusListEntry, v1_container_status->allocated_resources_status) { + cJSON *itemLocal = v1_resource_status_convertToJSON(allocated_resources_statusListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(allocated_resources_status, itemLocal); + } + } + } + + // v1_container_status->container_id if(v1_container_status->container_id) { if(cJSON_AddStringToObject(item, "containerID", v1_container_status->container_id) == NULL) { @@ -216,6 +297,27 @@ cJSON *v1_container_status_convertToJSON(v1_container_status_t *v1_container_sta } + // v1_container_status->stop_signal + if(v1_container_status->stop_signal) { + if(cJSON_AddStringToObject(item, "stopSignal", v1_container_status->stop_signal) == NULL) { + goto fail; //String + } + } + + + // v1_container_status->user + if(v1_container_status->user) { + cJSON *user_local_JSON = v1_container_user_convertToJSON(v1_container_status->user); + if(user_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "user", user_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_container_status->volume_mounts if(v1_container_status->volume_mounts) { cJSON *volume_mounts = cJSON_AddArrayToObject(item, "volumeMounts"); @@ -250,6 +352,9 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // define the local map for v1_container_status->allocated_resources list_t *allocated_resourcesList = NULL; + // define the local list for v1_container_status->allocated_resources_status + list_t *allocated_resources_statusList = NULL; + // define the local variable for v1_container_status->last_state v1_container_state_t *last_state_local_nonprim = NULL; @@ -259,11 +364,17 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // define the local variable for v1_container_status->state v1_container_state_t *state_local_nonprim = NULL; + // define the local variable for v1_container_status->user + v1_container_user_t *user_local_nonprim = NULL; + // define the local list for v1_container_status->volume_mounts list_t *volume_mountsList = NULL; // v1_container_status->allocated_resources cJSON *allocated_resources = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "allocatedResources"); + if (cJSON_IsNull(allocated_resources)) { + allocated_resources = NULL; + } if (allocated_resources) { cJSON *allocated_resources_local_map = NULL; if(!cJSON_IsObject(allocated_resources) && !cJSON_IsNull(allocated_resources)) @@ -287,8 +398,35 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta } } + // v1_container_status->allocated_resources_status + cJSON *allocated_resources_status = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "allocatedResourcesStatus"); + if (cJSON_IsNull(allocated_resources_status)) { + allocated_resources_status = NULL; + } + if (allocated_resources_status) { + cJSON *allocated_resources_status_local_nonprimitive = NULL; + if(!cJSON_IsArray(allocated_resources_status)){ + goto end; //nonprimitive container + } + + allocated_resources_statusList = list_createList(); + + cJSON_ArrayForEach(allocated_resources_status_local_nonprimitive,allocated_resources_status ) + { + if(!cJSON_IsObject(allocated_resources_status_local_nonprimitive)){ + goto end; + } + v1_resource_status_t *allocated_resources_statusItem = v1_resource_status_parseFromJSON(allocated_resources_status_local_nonprimitive); + + list_addElement(allocated_resources_statusList, allocated_resources_statusItem); + } + } + // v1_container_status->container_id cJSON *container_id = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "containerID"); + if (cJSON_IsNull(container_id)) { + container_id = NULL; + } if (container_id) { if(!cJSON_IsString(container_id) && !cJSON_IsNull(container_id)) { @@ -298,6 +436,9 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // v1_container_status->image cJSON *image = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "image"); + if (cJSON_IsNull(image)) { + image = NULL; + } if (!image) { goto end; } @@ -310,6 +451,9 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // v1_container_status->image_id cJSON *image_id = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "imageID"); + if (cJSON_IsNull(image_id)) { + image_id = NULL; + } if (!image_id) { goto end; } @@ -322,12 +466,18 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // v1_container_status->last_state cJSON *last_state = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "lastState"); + if (cJSON_IsNull(last_state)) { + last_state = NULL; + } if (last_state) { last_state_local_nonprim = v1_container_state_parseFromJSON(last_state); //nonprimitive } // v1_container_status->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -340,6 +490,9 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // v1_container_status->ready cJSON *ready = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "ready"); + if (cJSON_IsNull(ready)) { + ready = NULL; + } if (!ready) { goto end; } @@ -352,12 +505,18 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // v1_container_status->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { resources_local_nonprim = v1_resource_requirements_parseFromJSON(resources); //nonprimitive } // v1_container_status->restart_count cJSON *restart_count = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "restartCount"); + if (cJSON_IsNull(restart_count)) { + restart_count = NULL; + } if (!restart_count) { goto end; } @@ -370,6 +529,9 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // v1_container_status->started cJSON *started = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "started"); + if (cJSON_IsNull(started)) { + started = NULL; + } if (started) { if(!cJSON_IsBool(started)) { @@ -379,12 +541,39 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta // v1_container_status->state cJSON *state = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "state"); + if (cJSON_IsNull(state)) { + state = NULL; + } if (state) { state_local_nonprim = v1_container_state_parseFromJSON(state); //nonprimitive } + // v1_container_status->stop_signal + cJSON *stop_signal = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "stopSignal"); + if (cJSON_IsNull(stop_signal)) { + stop_signal = NULL; + } + if (stop_signal) { + if(!cJSON_IsString(stop_signal) && !cJSON_IsNull(stop_signal)) + { + goto end; //String + } + } + + // v1_container_status->user + cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } + if (user) { + user_local_nonprim = v1_container_user_parseFromJSON(user); //nonprimitive + } + // v1_container_status->volume_mounts cJSON *volume_mounts = cJSON_GetObjectItemCaseSensitive(v1_container_statusJSON, "volumeMounts"); + if (cJSON_IsNull(volume_mounts)) { + volume_mounts = NULL; + } if (volume_mounts) { cJSON *volume_mounts_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_mounts)){ @@ -405,8 +594,9 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta } - v1_container_status_local_var = v1_container_status_create ( + v1_container_status_local_var = v1_container_status_create_internal ( allocated_resources ? allocated_resourcesList : NULL, + allocated_resources_status ? allocated_resources_statusList : NULL, container_id && !cJSON_IsNull(container_id) ? strdup(container_id->valuestring) : NULL, strdup(image->valuestring), strdup(image_id->valuestring), @@ -417,6 +607,8 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta restart_count->valuedouble, started ? started->valueint : 0, state ? state_local_nonprim : NULL, + stop_signal && !cJSON_IsNull(stop_signal) ? strdup(stop_signal->valuestring) : NULL, + user ? user_local_nonprim : NULL, volume_mounts ? volume_mountsList : NULL ); @@ -425,7 +617,7 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta if (allocated_resourcesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, allocated_resourcesList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -436,6 +628,15 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta list_freeList(allocated_resourcesList); allocated_resourcesList = NULL; } + if (allocated_resources_statusList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allocated_resources_statusList) { + v1_resource_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allocated_resources_statusList); + allocated_resources_statusList = NULL; + } if (last_state_local_nonprim) { v1_container_state_free(last_state_local_nonprim); last_state_local_nonprim = NULL; @@ -448,6 +649,10 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta v1_container_state_free(state_local_nonprim); state_local_nonprim = NULL; } + if (user_local_nonprim) { + v1_container_user_free(user_local_nonprim); + user_local_nonprim = NULL; + } if (volume_mountsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, volume_mountsList) { diff --git a/kubernetes/model/v1_container_status.h b/kubernetes/model/v1_container_status.h index 16af6710..cb804eb1 100644 --- a/kubernetes/model/v1_container_status.h +++ b/kubernetes/model/v1_container_status.h @@ -16,13 +16,16 @@ typedef struct v1_container_status_t v1_container_status_t; #include "v1_container_state.h" +#include "v1_container_user.h" #include "v1_resource_requirements.h" +#include "v1_resource_status.h" #include "v1_volume_mount_status.h" typedef struct v1_container_status_t { list_t* allocated_resources; //map + list_t *allocated_resources_status; //nonprimitive container char *container_id; // string char *image; // string char *image_id; // string @@ -33,12 +36,16 @@ typedef struct v1_container_status_t { int restart_count; //numeric int started; //boolean struct v1_container_state_t *state; //model + char *stop_signal; // string + struct v1_container_user_t *user; //model list_t *volume_mounts; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_container_status_t; -v1_container_status_t *v1_container_status_create( +__attribute__((deprecated)) v1_container_status_t *v1_container_status_create( list_t* allocated_resources, + list_t *allocated_resources_status, char *container_id, char *image, char *image_id, @@ -49,6 +56,8 @@ v1_container_status_t *v1_container_status_create( int restart_count, int started, v1_container_state_t *state, + char *stop_signal, + v1_container_user_t *user, list_t *volume_mounts ); diff --git a/kubernetes/model/v1_container_user.c b/kubernetes/model/v1_container_user.c new file mode 100644 index 00000000..2ba91878 --- /dev/null +++ b/kubernetes/model/v1_container_user.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1_container_user.h" + + + +static v1_container_user_t *v1_container_user_create_internal( + v1_linux_container_user_t *_linux + ) { + v1_container_user_t *v1_container_user_local_var = malloc(sizeof(v1_container_user_t)); + if (!v1_container_user_local_var) { + return NULL; + } + v1_container_user_local_var->_linux = _linux; + + v1_container_user_local_var->_library_owned = 1; + return v1_container_user_local_var; +} + +__attribute__((deprecated)) v1_container_user_t *v1_container_user_create( + v1_linux_container_user_t *_linux + ) { + return v1_container_user_create_internal ( + _linux + ); +} + +void v1_container_user_free(v1_container_user_t *v1_container_user) { + if(NULL == v1_container_user){ + return ; + } + if(v1_container_user->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_container_user_free"); + return ; + } + listEntry_t *listEntry; + if (v1_container_user->_linux) { + v1_linux_container_user_free(v1_container_user->_linux); + v1_container_user->_linux = NULL; + } + free(v1_container_user); +} + +cJSON *v1_container_user_convertToJSON(v1_container_user_t *v1_container_user) { + cJSON *item = cJSON_CreateObject(); + + // v1_container_user->_linux + if(v1_container_user->_linux) { + cJSON *_linux_local_JSON = v1_linux_container_user_convertToJSON(v1_container_user->_linux); + if(_linux_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "linux", _linux_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_container_user_t *v1_container_user_parseFromJSON(cJSON *v1_container_userJSON){ + + v1_container_user_t *v1_container_user_local_var = NULL; + + // define the local variable for v1_container_user->_linux + v1_linux_container_user_t *_linux_local_nonprim = NULL; + + // v1_container_user->_linux + cJSON *_linux = cJSON_GetObjectItemCaseSensitive(v1_container_userJSON, "linux"); + if (cJSON_IsNull(_linux)) { + _linux = NULL; + } + if (_linux) { + _linux_local_nonprim = v1_linux_container_user_parseFromJSON(_linux); //nonprimitive + } + + + v1_container_user_local_var = v1_container_user_create_internal ( + _linux ? _linux_local_nonprim : NULL + ); + + return v1_container_user_local_var; +end: + if (_linux_local_nonprim) { + v1_linux_container_user_free(_linux_local_nonprim); + _linux_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_container_user.h b/kubernetes/model/v1_container_user.h new file mode 100644 index 00000000..c3f7a1d1 --- /dev/null +++ b/kubernetes/model/v1_container_user.h @@ -0,0 +1,39 @@ +/* + * v1_container_user.h + * + * ContainerUser represents user identity information + */ + +#ifndef _v1_container_user_H_ +#define _v1_container_user_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_container_user_t v1_container_user_t; + +#include "v1_linux_container_user.h" + + + +typedef struct v1_container_user_t { + struct v1_linux_container_user_t *_linux; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_container_user_t; + +__attribute__((deprecated)) v1_container_user_t *v1_container_user_create( + v1_linux_container_user_t *_linux +); + +void v1_container_user_free(v1_container_user_t *v1_container_user); + +v1_container_user_t *v1_container_user_parseFromJSON(cJSON *v1_container_userJSON); + +cJSON *v1_container_user_convertToJSON(v1_container_user_t *v1_container_user); + +#endif /* _v1_container_user_H_ */ + diff --git a/kubernetes/model/v1_controller_revision.c b/kubernetes/model/v1_controller_revision.c index c1c799f6..1b73be92 100644 --- a/kubernetes/model/v1_controller_revision.c +++ b/kubernetes/model/v1_controller_revision.c @@ -5,7 +5,7 @@ -v1_controller_revision_t *v1_controller_revision_create( +static v1_controller_revision_t *v1_controller_revision_create_internal( char *api_version, object_t *data, char *kind, @@ -22,14 +22,34 @@ v1_controller_revision_t *v1_controller_revision_create( v1_controller_revision_local_var->metadata = metadata; v1_controller_revision_local_var->revision = revision; + v1_controller_revision_local_var->_library_owned = 1; return v1_controller_revision_local_var; } +__attribute__((deprecated)) v1_controller_revision_t *v1_controller_revision_create( + char *api_version, + object_t *data, + char *kind, + v1_object_meta_t *metadata, + long revision + ) { + return v1_controller_revision_create_internal ( + api_version, + data, + kind, + metadata, + revision + ); +} void v1_controller_revision_free(v1_controller_revision_t *v1_controller_revision) { if(NULL == v1_controller_revision){ return ; } + if(v1_controller_revision->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_controller_revision_free"); + return ; + } listEntry_t *listEntry; if (v1_controller_revision->api_version) { free(v1_controller_revision->api_version); @@ -120,6 +140,9 @@ v1_controller_revision_t *v1_controller_revision_parseFromJSON(cJSON *v1_control // v1_controller_revision->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_controller_revisionJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -129,6 +152,9 @@ v1_controller_revision_t *v1_controller_revision_parseFromJSON(cJSON *v1_control // v1_controller_revision->data cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_controller_revisionJSON, "data"); + if (cJSON_IsNull(data)) { + data = NULL; + } object_t *data_local_object = NULL; if (data) { data_local_object = object_parseFromJSON(data); //object @@ -136,6 +162,9 @@ v1_controller_revision_t *v1_controller_revision_parseFromJSON(cJSON *v1_control // v1_controller_revision->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_controller_revisionJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -145,12 +174,18 @@ v1_controller_revision_t *v1_controller_revision_parseFromJSON(cJSON *v1_control // v1_controller_revision->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_controller_revisionJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_controller_revision->revision cJSON *revision = cJSON_GetObjectItemCaseSensitive(v1_controller_revisionJSON, "revision"); + if (cJSON_IsNull(revision)) { + revision = NULL; + } if (!revision) { goto end; } @@ -162,7 +197,7 @@ v1_controller_revision_t *v1_controller_revision_parseFromJSON(cJSON *v1_control } - v1_controller_revision_local_var = v1_controller_revision_create ( + v1_controller_revision_local_var = v1_controller_revision_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, data ? data_local_object : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_controller_revision.h b/kubernetes/model/v1_controller_revision.h index a2e5fb32..e56c3da1 100644 --- a/kubernetes/model/v1_controller_revision.h +++ b/kubernetes/model/v1_controller_revision.h @@ -27,9 +27,10 @@ typedef struct v1_controller_revision_t { struct v1_object_meta_t *metadata; //model long revision; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_controller_revision_t; -v1_controller_revision_t *v1_controller_revision_create( +__attribute__((deprecated)) v1_controller_revision_t *v1_controller_revision_create( char *api_version, object_t *data, char *kind, diff --git a/kubernetes/model/v1_controller_revision_list.c b/kubernetes/model/v1_controller_revision_list.c index 2b0ecdcc..0ef75c4b 100644 --- a/kubernetes/model/v1_controller_revision_list.c +++ b/kubernetes/model/v1_controller_revision_list.c @@ -5,7 +5,7 @@ -v1_controller_revision_list_t *v1_controller_revision_list_create( +static v1_controller_revision_list_t *v1_controller_revision_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_controller_revision_list_t *v1_controller_revision_list_create( v1_controller_revision_list_local_var->kind = kind; v1_controller_revision_list_local_var->metadata = metadata; + v1_controller_revision_list_local_var->_library_owned = 1; return v1_controller_revision_list_local_var; } +__attribute__((deprecated)) v1_controller_revision_list_t *v1_controller_revision_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_controller_revision_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_controller_revision_list_free(v1_controller_revision_list_t *v1_controller_revision_list) { if(NULL == v1_controller_revision_list){ return ; } + if(v1_controller_revision_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_controller_revision_list_free"); + return ; + } listEntry_t *listEntry; if (v1_controller_revision_list->api_version) { free(v1_controller_revision_list->api_version); @@ -123,6 +141,9 @@ v1_controller_revision_list_t *v1_controller_revision_list_parseFromJSON(cJSON * // v1_controller_revision_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_controller_revision_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_controller_revision_list_t *v1_controller_revision_list_parseFromJSON(cJSON * // v1_controller_revision_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_controller_revision_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_controller_revision_list_t *v1_controller_revision_list_parseFromJSON(cJSON * // v1_controller_revision_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_controller_revision_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_controller_revision_list_t *v1_controller_revision_list_parseFromJSON(cJSON * // v1_controller_revision_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_controller_revision_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_controller_revision_list_local_var = v1_controller_revision_list_create ( + v1_controller_revision_list_local_var = v1_controller_revision_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_controller_revision_list.h b/kubernetes/model/v1_controller_revision_list.h index 6e157c93..e866bab3 100644 --- a/kubernetes/model/v1_controller_revision_list.h +++ b/kubernetes/model/v1_controller_revision_list.h @@ -26,9 +26,10 @@ typedef struct v1_controller_revision_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_controller_revision_list_t; -v1_controller_revision_list_t *v1_controller_revision_list_create( +__attribute__((deprecated)) v1_controller_revision_list_t *v1_controller_revision_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_counter.c b/kubernetes/model/v1_counter.c new file mode 100644 index 00000000..a0271bc6 --- /dev/null +++ b/kubernetes/model/v1_counter.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1_counter.h" + + + +static v1_counter_t *v1_counter_create_internal( + char *value + ) { + v1_counter_t *v1_counter_local_var = malloc(sizeof(v1_counter_t)); + if (!v1_counter_local_var) { + return NULL; + } + v1_counter_local_var->value = value; + + v1_counter_local_var->_library_owned = 1; + return v1_counter_local_var; +} + +__attribute__((deprecated)) v1_counter_t *v1_counter_create( + char *value + ) { + return v1_counter_create_internal ( + value + ); +} + +void v1_counter_free(v1_counter_t *v1_counter) { + if(NULL == v1_counter){ + return ; + } + if(v1_counter->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_counter_free"); + return ; + } + listEntry_t *listEntry; + if (v1_counter->value) { + free(v1_counter->value); + v1_counter->value = NULL; + } + free(v1_counter); +} + +cJSON *v1_counter_convertToJSON(v1_counter_t *v1_counter) { + cJSON *item = cJSON_CreateObject(); + + // v1_counter->value + if (!v1_counter->value) { + goto fail; + } + if(cJSON_AddStringToObject(item, "value", v1_counter->value) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_counter_t *v1_counter_parseFromJSON(cJSON *v1_counterJSON){ + + v1_counter_t *v1_counter_local_var = NULL; + + // v1_counter->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_counterJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (!value) { + goto end; + } + + + if(!cJSON_IsString(value)) + { + goto end; //String + } + + + v1_counter_local_var = v1_counter_create_internal ( + strdup(value->valuestring) + ); + + return v1_counter_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_counter.h b/kubernetes/model/v1_counter.h new file mode 100644 index 00000000..705f064d --- /dev/null +++ b/kubernetes/model/v1_counter.h @@ -0,0 +1,38 @@ +/* + * v1_counter.h + * + * Counter describes a quantity associated with a device. + */ + +#ifndef _v1_counter_H_ +#define _v1_counter_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_counter_t v1_counter_t; + + + + +typedef struct v1_counter_t { + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_counter_t; + +__attribute__((deprecated)) v1_counter_t *v1_counter_create( + char *value +); + +void v1_counter_free(v1_counter_t *v1_counter); + +v1_counter_t *v1_counter_parseFromJSON(cJSON *v1_counterJSON); + +cJSON *v1_counter_convertToJSON(v1_counter_t *v1_counter); + +#endif /* _v1_counter_H_ */ + diff --git a/kubernetes/model/v1_counter_set.c b/kubernetes/model/v1_counter_set.c new file mode 100644 index 00000000..7b59923d --- /dev/null +++ b/kubernetes/model/v1_counter_set.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1_counter_set.h" + + + +static v1_counter_set_t *v1_counter_set_create_internal( + list_t* counters, + char *name + ) { + v1_counter_set_t *v1_counter_set_local_var = malloc(sizeof(v1_counter_set_t)); + if (!v1_counter_set_local_var) { + return NULL; + } + v1_counter_set_local_var->counters = counters; + v1_counter_set_local_var->name = name; + + v1_counter_set_local_var->_library_owned = 1; + return v1_counter_set_local_var; +} + +__attribute__((deprecated)) v1_counter_set_t *v1_counter_set_create( + list_t* counters, + char *name + ) { + return v1_counter_set_create_internal ( + counters, + name + ); +} + +void v1_counter_set_free(v1_counter_set_t *v1_counter_set) { + if(NULL == v1_counter_set){ + return ; + } + if(v1_counter_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_counter_set_free"); + return ; + } + listEntry_t *listEntry; + if (v1_counter_set->counters) { + list_ForEach(listEntry, v1_counter_set->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1_counter_set->counters); + v1_counter_set->counters = NULL; + } + if (v1_counter_set->name) { + free(v1_counter_set->name); + v1_counter_set->name = NULL; + } + free(v1_counter_set); +} + +cJSON *v1_counter_set_convertToJSON(v1_counter_set_t *v1_counter_set) { + cJSON *item = cJSON_CreateObject(); + + // v1_counter_set->counters + if (!v1_counter_set->counters) { + goto fail; + } + cJSON *counters = cJSON_AddObjectToObject(item, "counters"); + if(counters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = counters; + listEntry_t *countersListEntry; + if (v1_counter_set->counters) { + list_ForEach(countersListEntry, v1_counter_set->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + + // v1_counter_set->name + if (!v1_counter_set->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_counter_set->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_counter_set_t *v1_counter_set_parseFromJSON(cJSON *v1_counter_setJSON){ + + v1_counter_set_t *v1_counter_set_local_var = NULL; + + // define the local map for v1_counter_set->counters + list_t *countersList = NULL; + + // v1_counter_set->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1_counter_setJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1_counter_set->counters is currently not supported. + + + // v1_counter_set->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_counter_setJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1_counter_set_local_var = v1_counter_set_create_internal ( + countersList, + strdup(name->valuestring) + ); + + return v1_counter_set_local_var; +end: + + // The data type of the elements in v1_counter_set->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1_counter_set.h b/kubernetes/model/v1_counter_set.h new file mode 100644 index 00000000..e8ab985e --- /dev/null +++ b/kubernetes/model/v1_counter_set.h @@ -0,0 +1,41 @@ +/* + * v1_counter_set.h + * + * CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice. The counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices. + */ + +#ifndef _v1_counter_set_H_ +#define _v1_counter_set_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_counter_set_t v1_counter_set_t; + +#include "v1_counter.h" + + + +typedef struct v1_counter_set_t { + list_t* counters; //map + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_counter_set_t; + +__attribute__((deprecated)) v1_counter_set_t *v1_counter_set_create( + list_t* counters, + char *name +); + +void v1_counter_set_free(v1_counter_set_t *v1_counter_set); + +v1_counter_set_t *v1_counter_set_parseFromJSON(cJSON *v1_counter_setJSON); + +cJSON *v1_counter_set_convertToJSON(v1_counter_set_t *v1_counter_set); + +#endif /* _v1_counter_set_H_ */ + diff --git a/kubernetes/model/v1_cron_job.c b/kubernetes/model/v1_cron_job.c index e5970a30..99cf933d 100644 --- a/kubernetes/model/v1_cron_job.c +++ b/kubernetes/model/v1_cron_job.c @@ -5,7 +5,7 @@ -v1_cron_job_t *v1_cron_job_create( +static v1_cron_job_t *v1_cron_job_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_cron_job_t *v1_cron_job_create( v1_cron_job_local_var->spec = spec; v1_cron_job_local_var->status = status; + v1_cron_job_local_var->_library_owned = 1; return v1_cron_job_local_var; } +__attribute__((deprecated)) v1_cron_job_t *v1_cron_job_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_cron_job_spec_t *spec, + v1_cron_job_status_t *status + ) { + return v1_cron_job_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_cron_job_free(v1_cron_job_t *v1_cron_job) { if(NULL == v1_cron_job){ return ; } + if(v1_cron_job->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cron_job_free"); + return ; + } listEntry_t *listEntry; if (v1_cron_job->api_version) { free(v1_cron_job->api_version); @@ -134,6 +154,9 @@ v1_cron_job_t *v1_cron_job_parseFromJSON(cJSON *v1_cron_jobJSON){ // v1_cron_job->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cron_jobJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_cron_job_t *v1_cron_job_parseFromJSON(cJSON *v1_cron_jobJSON){ // v1_cron_job->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_cron_jobJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_cron_job_t *v1_cron_job_parseFromJSON(cJSON *v1_cron_jobJSON){ // v1_cron_job->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_cron_jobJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_cron_job->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_cron_jobJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_cron_job_spec_parseFromJSON(spec); //nonprimitive } // v1_cron_job->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_cron_jobJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_cron_job_status_parseFromJSON(status); //nonprimitive } - v1_cron_job_local_var = v1_cron_job_create ( + v1_cron_job_local_var = v1_cron_job_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_cron_job.h b/kubernetes/model/v1_cron_job.h index 977b4004..9c7344cf 100644 --- a/kubernetes/model/v1_cron_job.h +++ b/kubernetes/model/v1_cron_job.h @@ -28,9 +28,10 @@ typedef struct v1_cron_job_t { struct v1_cron_job_spec_t *spec; //model struct v1_cron_job_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_cron_job_t; -v1_cron_job_t *v1_cron_job_create( +__attribute__((deprecated)) v1_cron_job_t *v1_cron_job_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_cron_job_list.c b/kubernetes/model/v1_cron_job_list.c index ce8f82de..2ff1d06a 100644 --- a/kubernetes/model/v1_cron_job_list.c +++ b/kubernetes/model/v1_cron_job_list.c @@ -5,7 +5,7 @@ -v1_cron_job_list_t *v1_cron_job_list_create( +static v1_cron_job_list_t *v1_cron_job_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_cron_job_list_t *v1_cron_job_list_create( v1_cron_job_list_local_var->kind = kind; v1_cron_job_list_local_var->metadata = metadata; + v1_cron_job_list_local_var->_library_owned = 1; return v1_cron_job_list_local_var; } +__attribute__((deprecated)) v1_cron_job_list_t *v1_cron_job_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_cron_job_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_cron_job_list_free(v1_cron_job_list_t *v1_cron_job_list) { if(NULL == v1_cron_job_list){ return ; } + if(v1_cron_job_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cron_job_list_free"); + return ; + } listEntry_t *listEntry; if (v1_cron_job_list->api_version) { free(v1_cron_job_list->api_version); @@ -123,6 +141,9 @@ v1_cron_job_list_t *v1_cron_job_list_parseFromJSON(cJSON *v1_cron_job_listJSON){ // v1_cron_job_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cron_job_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_cron_job_list_t *v1_cron_job_list_parseFromJSON(cJSON *v1_cron_job_listJSON){ // v1_cron_job_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_cron_job_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_cron_job_list_t *v1_cron_job_list_parseFromJSON(cJSON *v1_cron_job_listJSON){ // v1_cron_job_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_cron_job_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_cron_job_list_t *v1_cron_job_list_parseFromJSON(cJSON *v1_cron_job_listJSON){ // v1_cron_job_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_cron_job_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_cron_job_list_local_var = v1_cron_job_list_create ( + v1_cron_job_list_local_var = v1_cron_job_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_cron_job_list.h b/kubernetes/model/v1_cron_job_list.h index d0ac7753..0e372a37 100644 --- a/kubernetes/model/v1_cron_job_list.h +++ b/kubernetes/model/v1_cron_job_list.h @@ -26,9 +26,10 @@ typedef struct v1_cron_job_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_cron_job_list_t; -v1_cron_job_list_t *v1_cron_job_list_create( +__attribute__((deprecated)) v1_cron_job_list_t *v1_cron_job_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_cron_job_spec.c b/kubernetes/model/v1_cron_job_spec.c index 4cbfb714..f3ef2185 100644 --- a/kubernetes/model/v1_cron_job_spec.c +++ b/kubernetes/model/v1_cron_job_spec.c @@ -5,7 +5,7 @@ -v1_cron_job_spec_t *v1_cron_job_spec_create( +static v1_cron_job_spec_t *v1_cron_job_spec_create_internal( char *concurrency_policy, int failed_jobs_history_limit, v1_job_template_spec_t *job_template, @@ -28,14 +28,40 @@ v1_cron_job_spec_t *v1_cron_job_spec_create( v1_cron_job_spec_local_var->suspend = suspend; v1_cron_job_spec_local_var->time_zone = time_zone; + v1_cron_job_spec_local_var->_library_owned = 1; return v1_cron_job_spec_local_var; } +__attribute__((deprecated)) v1_cron_job_spec_t *v1_cron_job_spec_create( + char *concurrency_policy, + int failed_jobs_history_limit, + v1_job_template_spec_t *job_template, + char *schedule, + long starting_deadline_seconds, + int successful_jobs_history_limit, + int suspend, + char *time_zone + ) { + return v1_cron_job_spec_create_internal ( + concurrency_policy, + failed_jobs_history_limit, + job_template, + schedule, + starting_deadline_seconds, + successful_jobs_history_limit, + suspend, + time_zone + ); +} void v1_cron_job_spec_free(v1_cron_job_spec_t *v1_cron_job_spec) { if(NULL == v1_cron_job_spec){ return ; } + if(v1_cron_job_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cron_job_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_cron_job_spec->concurrency_policy) { free(v1_cron_job_spec->concurrency_policy); @@ -146,6 +172,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->concurrency_policy cJSON *concurrency_policy = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "concurrencyPolicy"); + if (cJSON_IsNull(concurrency_policy)) { + concurrency_policy = NULL; + } if (concurrency_policy) { if(!cJSON_IsString(concurrency_policy) && !cJSON_IsNull(concurrency_policy)) { @@ -155,6 +184,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->failed_jobs_history_limit cJSON *failed_jobs_history_limit = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "failedJobsHistoryLimit"); + if (cJSON_IsNull(failed_jobs_history_limit)) { + failed_jobs_history_limit = NULL; + } if (failed_jobs_history_limit) { if(!cJSON_IsNumber(failed_jobs_history_limit)) { @@ -164,6 +196,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->job_template cJSON *job_template = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "jobTemplate"); + if (cJSON_IsNull(job_template)) { + job_template = NULL; + } if (!job_template) { goto end; } @@ -173,6 +208,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->schedule cJSON *schedule = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "schedule"); + if (cJSON_IsNull(schedule)) { + schedule = NULL; + } if (!schedule) { goto end; } @@ -185,6 +223,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->starting_deadline_seconds cJSON *starting_deadline_seconds = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "startingDeadlineSeconds"); + if (cJSON_IsNull(starting_deadline_seconds)) { + starting_deadline_seconds = NULL; + } if (starting_deadline_seconds) { if(!cJSON_IsNumber(starting_deadline_seconds)) { @@ -194,6 +235,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->successful_jobs_history_limit cJSON *successful_jobs_history_limit = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "successfulJobsHistoryLimit"); + if (cJSON_IsNull(successful_jobs_history_limit)) { + successful_jobs_history_limit = NULL; + } if (successful_jobs_history_limit) { if(!cJSON_IsNumber(successful_jobs_history_limit)) { @@ -203,6 +247,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->suspend cJSON *suspend = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "suspend"); + if (cJSON_IsNull(suspend)) { + suspend = NULL; + } if (suspend) { if(!cJSON_IsBool(suspend)) { @@ -212,6 +259,9 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ // v1_cron_job_spec->time_zone cJSON *time_zone = cJSON_GetObjectItemCaseSensitive(v1_cron_job_specJSON, "timeZone"); + if (cJSON_IsNull(time_zone)) { + time_zone = NULL; + } if (time_zone) { if(!cJSON_IsString(time_zone) && !cJSON_IsNull(time_zone)) { @@ -220,7 +270,7 @@ v1_cron_job_spec_t *v1_cron_job_spec_parseFromJSON(cJSON *v1_cron_job_specJSON){ } - v1_cron_job_spec_local_var = v1_cron_job_spec_create ( + v1_cron_job_spec_local_var = v1_cron_job_spec_create_internal ( concurrency_policy && !cJSON_IsNull(concurrency_policy) ? strdup(concurrency_policy->valuestring) : NULL, failed_jobs_history_limit ? failed_jobs_history_limit->valuedouble : 0, job_template_local_nonprim, diff --git a/kubernetes/model/v1_cron_job_spec.h b/kubernetes/model/v1_cron_job_spec.h index 6ba99007..888e63ff 100644 --- a/kubernetes/model/v1_cron_job_spec.h +++ b/kubernetes/model/v1_cron_job_spec.h @@ -29,9 +29,10 @@ typedef struct v1_cron_job_spec_t { int suspend; //boolean char *time_zone; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_cron_job_spec_t; -v1_cron_job_spec_t *v1_cron_job_spec_create( +__attribute__((deprecated)) v1_cron_job_spec_t *v1_cron_job_spec_create( char *concurrency_policy, int failed_jobs_history_limit, v1_job_template_spec_t *job_template, diff --git a/kubernetes/model/v1_cron_job_status.c b/kubernetes/model/v1_cron_job_status.c index 350bf3f9..f73b46b3 100644 --- a/kubernetes/model/v1_cron_job_status.c +++ b/kubernetes/model/v1_cron_job_status.c @@ -5,7 +5,7 @@ -v1_cron_job_status_t *v1_cron_job_status_create( +static v1_cron_job_status_t *v1_cron_job_status_create_internal( list_t *active, char *last_schedule_time, char *last_successful_time @@ -18,14 +18,30 @@ v1_cron_job_status_t *v1_cron_job_status_create( v1_cron_job_status_local_var->last_schedule_time = last_schedule_time; v1_cron_job_status_local_var->last_successful_time = last_successful_time; + v1_cron_job_status_local_var->_library_owned = 1; return v1_cron_job_status_local_var; } +__attribute__((deprecated)) v1_cron_job_status_t *v1_cron_job_status_create( + list_t *active, + char *last_schedule_time, + char *last_successful_time + ) { + return v1_cron_job_status_create_internal ( + active, + last_schedule_time, + last_successful_time + ); +} void v1_cron_job_status_free(v1_cron_job_status_t *v1_cron_job_status) { if(NULL == v1_cron_job_status){ return ; } + if(v1_cron_job_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cron_job_status_free"); + return ; + } listEntry_t *listEntry; if (v1_cron_job_status->active) { list_ForEach(listEntry, v1_cron_job_status->active) { @@ -100,6 +116,9 @@ v1_cron_job_status_t *v1_cron_job_status_parseFromJSON(cJSON *v1_cron_job_status // v1_cron_job_status->active cJSON *active = cJSON_GetObjectItemCaseSensitive(v1_cron_job_statusJSON, "active"); + if (cJSON_IsNull(active)) { + active = NULL; + } if (active) { cJSON *active_local_nonprimitive = NULL; if(!cJSON_IsArray(active)){ @@ -121,6 +140,9 @@ v1_cron_job_status_t *v1_cron_job_status_parseFromJSON(cJSON *v1_cron_job_status // v1_cron_job_status->last_schedule_time cJSON *last_schedule_time = cJSON_GetObjectItemCaseSensitive(v1_cron_job_statusJSON, "lastScheduleTime"); + if (cJSON_IsNull(last_schedule_time)) { + last_schedule_time = NULL; + } if (last_schedule_time) { if(!cJSON_IsString(last_schedule_time) && !cJSON_IsNull(last_schedule_time)) { @@ -130,6 +152,9 @@ v1_cron_job_status_t *v1_cron_job_status_parseFromJSON(cJSON *v1_cron_job_status // v1_cron_job_status->last_successful_time cJSON *last_successful_time = cJSON_GetObjectItemCaseSensitive(v1_cron_job_statusJSON, "lastSuccessfulTime"); + if (cJSON_IsNull(last_successful_time)) { + last_successful_time = NULL; + } if (last_successful_time) { if(!cJSON_IsString(last_successful_time) && !cJSON_IsNull(last_successful_time)) { @@ -138,7 +163,7 @@ v1_cron_job_status_t *v1_cron_job_status_parseFromJSON(cJSON *v1_cron_job_status } - v1_cron_job_status_local_var = v1_cron_job_status_create ( + v1_cron_job_status_local_var = v1_cron_job_status_create_internal ( active ? activeList : NULL, last_schedule_time && !cJSON_IsNull(last_schedule_time) ? strdup(last_schedule_time->valuestring) : NULL, last_successful_time && !cJSON_IsNull(last_successful_time) ? strdup(last_successful_time->valuestring) : NULL diff --git a/kubernetes/model/v1_cron_job_status.h b/kubernetes/model/v1_cron_job_status.h index 61a257ca..6817356f 100644 --- a/kubernetes/model/v1_cron_job_status.h +++ b/kubernetes/model/v1_cron_job_status.h @@ -24,9 +24,10 @@ typedef struct v1_cron_job_status_t { char *last_schedule_time; //date time char *last_successful_time; //date time + int _library_owned; // Is the library responsible for freeing this object? } v1_cron_job_status_t; -v1_cron_job_status_t *v1_cron_job_status_create( +__attribute__((deprecated)) v1_cron_job_status_t *v1_cron_job_status_create( list_t *active, char *last_schedule_time, char *last_successful_time diff --git a/kubernetes/model/v1_cross_version_object_reference.c b/kubernetes/model/v1_cross_version_object_reference.c index f8ea97ca..c8014036 100644 --- a/kubernetes/model/v1_cross_version_object_reference.c +++ b/kubernetes/model/v1_cross_version_object_reference.c @@ -5,7 +5,7 @@ -v1_cross_version_object_reference_t *v1_cross_version_object_reference_create( +static v1_cross_version_object_reference_t *v1_cross_version_object_reference_create_internal( char *api_version, char *kind, char *name @@ -18,14 +18,30 @@ v1_cross_version_object_reference_t *v1_cross_version_object_reference_create( v1_cross_version_object_reference_local_var->kind = kind; v1_cross_version_object_reference_local_var->name = name; + v1_cross_version_object_reference_local_var->_library_owned = 1; return v1_cross_version_object_reference_local_var; } +__attribute__((deprecated)) v1_cross_version_object_reference_t *v1_cross_version_object_reference_create( + char *api_version, + char *kind, + char *name + ) { + return v1_cross_version_object_reference_create_internal ( + api_version, + kind, + name + ); +} void v1_cross_version_object_reference_free(v1_cross_version_object_reference_t *v1_cross_version_object_reference) { if(NULL == v1_cross_version_object_reference){ return ; } + if(v1_cross_version_object_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_cross_version_object_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_cross_version_object_reference->api_version) { free(v1_cross_version_object_reference->api_version); @@ -84,6 +100,9 @@ v1_cross_version_object_reference_t *v1_cross_version_object_reference_parseFrom // v1_cross_version_object_reference->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cross_version_object_referenceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -93,6 +112,9 @@ v1_cross_version_object_reference_t *v1_cross_version_object_reference_parseFrom // v1_cross_version_object_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_cross_version_object_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -105,6 +127,9 @@ v1_cross_version_object_reference_t *v1_cross_version_object_reference_parseFrom // v1_cross_version_object_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_cross_version_object_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -116,7 +141,7 @@ v1_cross_version_object_reference_t *v1_cross_version_object_reference_parseFrom } - v1_cross_version_object_reference_local_var = v1_cross_version_object_reference_create ( + v1_cross_version_object_reference_local_var = v1_cross_version_object_reference_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, strdup(kind->valuestring), strdup(name->valuestring) diff --git a/kubernetes/model/v1_cross_version_object_reference.h b/kubernetes/model/v1_cross_version_object_reference.h index e8b93964..94855a28 100644 --- a/kubernetes/model/v1_cross_version_object_reference.h +++ b/kubernetes/model/v1_cross_version_object_reference.h @@ -23,9 +23,10 @@ typedef struct v1_cross_version_object_reference_t { char *kind; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_cross_version_object_reference_t; -v1_cross_version_object_reference_t *v1_cross_version_object_reference_create( +__attribute__((deprecated)) v1_cross_version_object_reference_t *v1_cross_version_object_reference_create( char *api_version, char *kind, char *name diff --git a/kubernetes/model/v1_csi_driver.c b/kubernetes/model/v1_csi_driver.c index 8bbc7cad..6a089c25 100644 --- a/kubernetes/model/v1_csi_driver.c +++ b/kubernetes/model/v1_csi_driver.c @@ -5,7 +5,7 @@ -v1_csi_driver_t *v1_csi_driver_create( +static v1_csi_driver_t *v1_csi_driver_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_csi_driver_t *v1_csi_driver_create( v1_csi_driver_local_var->metadata = metadata; v1_csi_driver_local_var->spec = spec; + v1_csi_driver_local_var->_library_owned = 1; return v1_csi_driver_local_var; } +__attribute__((deprecated)) v1_csi_driver_t *v1_csi_driver_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_csi_driver_spec_t *spec + ) { + return v1_csi_driver_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1_csi_driver_free(v1_csi_driver_t *v1_csi_driver) { if(NULL == v1_csi_driver){ return ; } + if(v1_csi_driver->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_driver_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_driver->api_version) { free(v1_csi_driver->api_version); @@ -113,6 +131,9 @@ v1_csi_driver_t *v1_csi_driver_parseFromJSON(cJSON *v1_csi_driverJSON){ // v1_csi_driver->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_csi_driverJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -122,6 +143,9 @@ v1_csi_driver_t *v1_csi_driver_parseFromJSON(cJSON *v1_csi_driverJSON){ // v1_csi_driver->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_csi_driverJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -131,12 +155,18 @@ v1_csi_driver_t *v1_csi_driver_parseFromJSON(cJSON *v1_csi_driverJSON){ // v1_csi_driver->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_csi_driverJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_csi_driver->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_csi_driverJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -145,7 +175,7 @@ v1_csi_driver_t *v1_csi_driver_parseFromJSON(cJSON *v1_csi_driverJSON){ spec_local_nonprim = v1_csi_driver_spec_parseFromJSON(spec); //nonprimitive - v1_csi_driver_local_var = v1_csi_driver_create ( + v1_csi_driver_local_var = v1_csi_driver_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_csi_driver.h b/kubernetes/model/v1_csi_driver.h index d2ad8fc1..75484bd4 100644 --- a/kubernetes/model/v1_csi_driver.h +++ b/kubernetes/model/v1_csi_driver.h @@ -26,9 +26,10 @@ typedef struct v1_csi_driver_t { struct v1_object_meta_t *metadata; //model struct v1_csi_driver_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_driver_t; -v1_csi_driver_t *v1_csi_driver_create( +__attribute__((deprecated)) v1_csi_driver_t *v1_csi_driver_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_csi_driver_list.c b/kubernetes/model/v1_csi_driver_list.c index a7f181b9..6199f810 100644 --- a/kubernetes/model/v1_csi_driver_list.c +++ b/kubernetes/model/v1_csi_driver_list.c @@ -5,7 +5,7 @@ -v1_csi_driver_list_t *v1_csi_driver_list_create( +static v1_csi_driver_list_t *v1_csi_driver_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_csi_driver_list_t *v1_csi_driver_list_create( v1_csi_driver_list_local_var->kind = kind; v1_csi_driver_list_local_var->metadata = metadata; + v1_csi_driver_list_local_var->_library_owned = 1; return v1_csi_driver_list_local_var; } +__attribute__((deprecated)) v1_csi_driver_list_t *v1_csi_driver_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_csi_driver_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_csi_driver_list_free(v1_csi_driver_list_t *v1_csi_driver_list) { if(NULL == v1_csi_driver_list){ return ; } + if(v1_csi_driver_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_driver_list_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_driver_list->api_version) { free(v1_csi_driver_list->api_version); @@ -123,6 +141,9 @@ v1_csi_driver_list_t *v1_csi_driver_list_parseFromJSON(cJSON *v1_csi_driver_list // v1_csi_driver_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_csi_driver_list_t *v1_csi_driver_list_parseFromJSON(cJSON *v1_csi_driver_list // v1_csi_driver_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_csi_driver_list_t *v1_csi_driver_list_parseFromJSON(cJSON *v1_csi_driver_list // v1_csi_driver_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_csi_driver_list_t *v1_csi_driver_list_parseFromJSON(cJSON *v1_csi_driver_list // v1_csi_driver_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_csi_driver_list_local_var = v1_csi_driver_list_create ( + v1_csi_driver_list_local_var = v1_csi_driver_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_csi_driver_list.h b/kubernetes/model/v1_csi_driver_list.h index adb084a1..6a9f8c0e 100644 --- a/kubernetes/model/v1_csi_driver_list.h +++ b/kubernetes/model/v1_csi_driver_list.h @@ -26,9 +26,10 @@ typedef struct v1_csi_driver_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_driver_list_t; -v1_csi_driver_list_t *v1_csi_driver_list_create( +__attribute__((deprecated)) v1_csi_driver_list_t *v1_csi_driver_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_csi_driver_spec.c b/kubernetes/model/v1_csi_driver_spec.c index 680352b4..eabf01fe 100644 --- a/kubernetes/model/v1_csi_driver_spec.c +++ b/kubernetes/model/v1_csi_driver_spec.c @@ -5,9 +5,10 @@ -v1_csi_driver_spec_t *v1_csi_driver_spec_create( +static v1_csi_driver_spec_t *v1_csi_driver_spec_create_internal( int attach_required, char *fs_group_policy, + long node_allocatable_update_period_seconds, int pod_info_on_mount, int requires_republish, int se_linux_mount, @@ -21,6 +22,7 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_create( } v1_csi_driver_spec_local_var->attach_required = attach_required; v1_csi_driver_spec_local_var->fs_group_policy = fs_group_policy; + v1_csi_driver_spec_local_var->node_allocatable_update_period_seconds = node_allocatable_update_period_seconds; v1_csi_driver_spec_local_var->pod_info_on_mount = pod_info_on_mount; v1_csi_driver_spec_local_var->requires_republish = requires_republish; v1_csi_driver_spec_local_var->se_linux_mount = se_linux_mount; @@ -28,14 +30,42 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_create( v1_csi_driver_spec_local_var->token_requests = token_requests; v1_csi_driver_spec_local_var->volume_lifecycle_modes = volume_lifecycle_modes; + v1_csi_driver_spec_local_var->_library_owned = 1; return v1_csi_driver_spec_local_var; } +__attribute__((deprecated)) v1_csi_driver_spec_t *v1_csi_driver_spec_create( + int attach_required, + char *fs_group_policy, + long node_allocatable_update_period_seconds, + int pod_info_on_mount, + int requires_republish, + int se_linux_mount, + int storage_capacity, + list_t *token_requests, + list_t *volume_lifecycle_modes + ) { + return v1_csi_driver_spec_create_internal ( + attach_required, + fs_group_policy, + node_allocatable_update_period_seconds, + pod_info_on_mount, + requires_republish, + se_linux_mount, + storage_capacity, + token_requests, + volume_lifecycle_modes + ); +} void v1_csi_driver_spec_free(v1_csi_driver_spec_t *v1_csi_driver_spec) { if(NULL == v1_csi_driver_spec){ return ; } + if(v1_csi_driver_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_driver_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_driver_spec->fs_group_policy) { free(v1_csi_driver_spec->fs_group_policy); @@ -77,6 +107,14 @@ cJSON *v1_csi_driver_spec_convertToJSON(v1_csi_driver_spec_t *v1_csi_driver_spec } + // v1_csi_driver_spec->node_allocatable_update_period_seconds + if(v1_csi_driver_spec->node_allocatable_update_period_seconds) { + if(cJSON_AddNumberToObject(item, "nodeAllocatableUpdatePeriodSeconds", v1_csi_driver_spec->node_allocatable_update_period_seconds) == NULL) { + goto fail; //Numeric + } + } + + // v1_csi_driver_spec->pod_info_on_mount if(v1_csi_driver_spec->pod_info_on_mount) { if(cJSON_AddBoolToObject(item, "podInfoOnMount", v1_csi_driver_spec->pod_info_on_mount) == NULL) { @@ -138,7 +176,7 @@ cJSON *v1_csi_driver_spec_convertToJSON(v1_csi_driver_spec_t *v1_csi_driver_spec listEntry_t *volume_lifecycle_modesListEntry; list_ForEach(volume_lifecycle_modesListEntry, v1_csi_driver_spec->volume_lifecycle_modes) { - if(cJSON_AddStringToObject(volume_lifecycle_modes, "", (char*)volume_lifecycle_modesListEntry->data) == NULL) + if(cJSON_AddStringToObject(volume_lifecycle_modes, "", volume_lifecycle_modesListEntry->data) == NULL) { goto fail; } @@ -165,6 +203,9 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->attach_required cJSON *attach_required = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "attachRequired"); + if (cJSON_IsNull(attach_required)) { + attach_required = NULL; + } if (attach_required) { if(!cJSON_IsBool(attach_required)) { @@ -174,6 +215,9 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->fs_group_policy cJSON *fs_group_policy = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "fsGroupPolicy"); + if (cJSON_IsNull(fs_group_policy)) { + fs_group_policy = NULL; + } if (fs_group_policy) { if(!cJSON_IsString(fs_group_policy) && !cJSON_IsNull(fs_group_policy)) { @@ -181,8 +225,23 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec } } + // v1_csi_driver_spec->node_allocatable_update_period_seconds + cJSON *node_allocatable_update_period_seconds = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "nodeAllocatableUpdatePeriodSeconds"); + if (cJSON_IsNull(node_allocatable_update_period_seconds)) { + node_allocatable_update_period_seconds = NULL; + } + if (node_allocatable_update_period_seconds) { + if(!cJSON_IsNumber(node_allocatable_update_period_seconds)) + { + goto end; //Numeric + } + } + // v1_csi_driver_spec->pod_info_on_mount cJSON *pod_info_on_mount = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "podInfoOnMount"); + if (cJSON_IsNull(pod_info_on_mount)) { + pod_info_on_mount = NULL; + } if (pod_info_on_mount) { if(!cJSON_IsBool(pod_info_on_mount)) { @@ -192,6 +251,9 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->requires_republish cJSON *requires_republish = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "requiresRepublish"); + if (cJSON_IsNull(requires_republish)) { + requires_republish = NULL; + } if (requires_republish) { if(!cJSON_IsBool(requires_republish)) { @@ -201,6 +263,9 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->se_linux_mount cJSON *se_linux_mount = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "seLinuxMount"); + if (cJSON_IsNull(se_linux_mount)) { + se_linux_mount = NULL; + } if (se_linux_mount) { if(!cJSON_IsBool(se_linux_mount)) { @@ -210,6 +275,9 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->storage_capacity cJSON *storage_capacity = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "storageCapacity"); + if (cJSON_IsNull(storage_capacity)) { + storage_capacity = NULL; + } if (storage_capacity) { if(!cJSON_IsBool(storage_capacity)) { @@ -219,6 +287,9 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->token_requests cJSON *token_requests = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "tokenRequests"); + if (cJSON_IsNull(token_requests)) { + token_requests = NULL; + } if (token_requests) { cJSON *token_requests_local_nonprimitive = NULL; if(!cJSON_IsArray(token_requests)){ @@ -240,6 +311,9 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->volume_lifecycle_modes cJSON *volume_lifecycle_modes = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "volumeLifecycleModes"); + if (cJSON_IsNull(volume_lifecycle_modes)) { + volume_lifecycle_modes = NULL; + } if (volume_lifecycle_modes) { cJSON *volume_lifecycle_modes_local = NULL; if(!cJSON_IsArray(volume_lifecycle_modes)) { @@ -258,9 +332,10 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec } - v1_csi_driver_spec_local_var = v1_csi_driver_spec_create ( + v1_csi_driver_spec_local_var = v1_csi_driver_spec_create_internal ( attach_required ? attach_required->valueint : 0, fs_group_policy && !cJSON_IsNull(fs_group_policy) ? strdup(fs_group_policy->valuestring) : NULL, + node_allocatable_update_period_seconds ? node_allocatable_update_period_seconds->valuedouble : 0, pod_info_on_mount ? pod_info_on_mount->valueint : 0, requires_republish ? requires_republish->valueint : 0, se_linux_mount ? se_linux_mount->valueint : 0, diff --git a/kubernetes/model/v1_csi_driver_spec.h b/kubernetes/model/v1_csi_driver_spec.h index a8d53bb6..3e16f64b 100644 --- a/kubernetes/model/v1_csi_driver_spec.h +++ b/kubernetes/model/v1_csi_driver_spec.h @@ -22,6 +22,7 @@ typedef struct v1_csi_driver_spec_t v1_csi_driver_spec_t; typedef struct v1_csi_driver_spec_t { int attach_required; //boolean char *fs_group_policy; // string + long node_allocatable_update_period_seconds; //numeric int pod_info_on_mount; //boolean int requires_republish; //boolean int se_linux_mount; //boolean @@ -29,11 +30,13 @@ typedef struct v1_csi_driver_spec_t { list_t *token_requests; //nonprimitive container list_t *volume_lifecycle_modes; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_driver_spec_t; -v1_csi_driver_spec_t *v1_csi_driver_spec_create( +__attribute__((deprecated)) v1_csi_driver_spec_t *v1_csi_driver_spec_create( int attach_required, char *fs_group_policy, + long node_allocatable_update_period_seconds, int pod_info_on_mount, int requires_republish, int se_linux_mount, diff --git a/kubernetes/model/v1_csi_node.c b/kubernetes/model/v1_csi_node.c index f82fc508..1960f5fe 100644 --- a/kubernetes/model/v1_csi_node.c +++ b/kubernetes/model/v1_csi_node.c @@ -5,7 +5,7 @@ -v1_csi_node_t *v1_csi_node_create( +static v1_csi_node_t *v1_csi_node_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_csi_node_t *v1_csi_node_create( v1_csi_node_local_var->metadata = metadata; v1_csi_node_local_var->spec = spec; + v1_csi_node_local_var->_library_owned = 1; return v1_csi_node_local_var; } +__attribute__((deprecated)) v1_csi_node_t *v1_csi_node_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_csi_node_spec_t *spec + ) { + return v1_csi_node_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1_csi_node_free(v1_csi_node_t *v1_csi_node) { if(NULL == v1_csi_node){ return ; } + if(v1_csi_node->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_node_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_node->api_version) { free(v1_csi_node->api_version); @@ -113,6 +131,9 @@ v1_csi_node_t *v1_csi_node_parseFromJSON(cJSON *v1_csi_nodeJSON){ // v1_csi_node->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_csi_nodeJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -122,6 +143,9 @@ v1_csi_node_t *v1_csi_node_parseFromJSON(cJSON *v1_csi_nodeJSON){ // v1_csi_node->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_csi_nodeJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -131,12 +155,18 @@ v1_csi_node_t *v1_csi_node_parseFromJSON(cJSON *v1_csi_nodeJSON){ // v1_csi_node->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_csi_nodeJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_csi_node->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_csi_nodeJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -145,7 +175,7 @@ v1_csi_node_t *v1_csi_node_parseFromJSON(cJSON *v1_csi_nodeJSON){ spec_local_nonprim = v1_csi_node_spec_parseFromJSON(spec); //nonprimitive - v1_csi_node_local_var = v1_csi_node_create ( + v1_csi_node_local_var = v1_csi_node_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_csi_node.h b/kubernetes/model/v1_csi_node.h index 70752816..fe77c2c4 100644 --- a/kubernetes/model/v1_csi_node.h +++ b/kubernetes/model/v1_csi_node.h @@ -26,9 +26,10 @@ typedef struct v1_csi_node_t { struct v1_object_meta_t *metadata; //model struct v1_csi_node_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_node_t; -v1_csi_node_t *v1_csi_node_create( +__attribute__((deprecated)) v1_csi_node_t *v1_csi_node_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_csi_node_driver.c b/kubernetes/model/v1_csi_node_driver.c index b1ddbc24..9dbebd42 100644 --- a/kubernetes/model/v1_csi_node_driver.c +++ b/kubernetes/model/v1_csi_node_driver.c @@ -5,7 +5,7 @@ -v1_csi_node_driver_t *v1_csi_node_driver_create( +static v1_csi_node_driver_t *v1_csi_node_driver_create_internal( v1_volume_node_resources_t *allocatable, char *name, char *node_id, @@ -20,14 +20,32 @@ v1_csi_node_driver_t *v1_csi_node_driver_create( v1_csi_node_driver_local_var->node_id = node_id; v1_csi_node_driver_local_var->topology_keys = topology_keys; + v1_csi_node_driver_local_var->_library_owned = 1; return v1_csi_node_driver_local_var; } +__attribute__((deprecated)) v1_csi_node_driver_t *v1_csi_node_driver_create( + v1_volume_node_resources_t *allocatable, + char *name, + char *node_id, + list_t *topology_keys + ) { + return v1_csi_node_driver_create_internal ( + allocatable, + name, + node_id, + topology_keys + ); +} void v1_csi_node_driver_free(v1_csi_node_driver_t *v1_csi_node_driver) { if(NULL == v1_csi_node_driver){ return ; } + if(v1_csi_node_driver->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_node_driver_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_node_driver->allocatable) { v1_volume_node_resources_free(v1_csi_node_driver->allocatable); @@ -94,7 +112,7 @@ cJSON *v1_csi_node_driver_convertToJSON(v1_csi_node_driver_t *v1_csi_node_driver listEntry_t *topology_keysListEntry; list_ForEach(topology_keysListEntry, v1_csi_node_driver->topology_keys) { - if(cJSON_AddStringToObject(topology_keys, "", (char*)topology_keysListEntry->data) == NULL) + if(cJSON_AddStringToObject(topology_keys, "", topology_keysListEntry->data) == NULL) { goto fail; } @@ -121,12 +139,18 @@ v1_csi_node_driver_t *v1_csi_node_driver_parseFromJSON(cJSON *v1_csi_node_driver // v1_csi_node_driver->allocatable cJSON *allocatable = cJSON_GetObjectItemCaseSensitive(v1_csi_node_driverJSON, "allocatable"); + if (cJSON_IsNull(allocatable)) { + allocatable = NULL; + } if (allocatable) { allocatable_local_nonprim = v1_volume_node_resources_parseFromJSON(allocatable); //nonprimitive } // v1_csi_node_driver->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_csi_node_driverJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -139,6 +163,9 @@ v1_csi_node_driver_t *v1_csi_node_driver_parseFromJSON(cJSON *v1_csi_node_driver // v1_csi_node_driver->node_id cJSON *node_id = cJSON_GetObjectItemCaseSensitive(v1_csi_node_driverJSON, "nodeID"); + if (cJSON_IsNull(node_id)) { + node_id = NULL; + } if (!node_id) { goto end; } @@ -151,6 +178,9 @@ v1_csi_node_driver_t *v1_csi_node_driver_parseFromJSON(cJSON *v1_csi_node_driver // v1_csi_node_driver->topology_keys cJSON *topology_keys = cJSON_GetObjectItemCaseSensitive(v1_csi_node_driverJSON, "topologyKeys"); + if (cJSON_IsNull(topology_keys)) { + topology_keys = NULL; + } if (topology_keys) { cJSON *topology_keys_local = NULL; if(!cJSON_IsArray(topology_keys)) { @@ -169,7 +199,7 @@ v1_csi_node_driver_t *v1_csi_node_driver_parseFromJSON(cJSON *v1_csi_node_driver } - v1_csi_node_driver_local_var = v1_csi_node_driver_create ( + v1_csi_node_driver_local_var = v1_csi_node_driver_create_internal ( allocatable ? allocatable_local_nonprim : NULL, strdup(name->valuestring), strdup(node_id->valuestring), diff --git a/kubernetes/model/v1_csi_node_driver.h b/kubernetes/model/v1_csi_node_driver.h index 557ce9db..daaafa15 100644 --- a/kubernetes/model/v1_csi_node_driver.h +++ b/kubernetes/model/v1_csi_node_driver.h @@ -25,9 +25,10 @@ typedef struct v1_csi_node_driver_t { char *node_id; // string list_t *topology_keys; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_node_driver_t; -v1_csi_node_driver_t *v1_csi_node_driver_create( +__attribute__((deprecated)) v1_csi_node_driver_t *v1_csi_node_driver_create( v1_volume_node_resources_t *allocatable, char *name, char *node_id, diff --git a/kubernetes/model/v1_csi_node_list.c b/kubernetes/model/v1_csi_node_list.c index 34a14eb6..6a04fbba 100644 --- a/kubernetes/model/v1_csi_node_list.c +++ b/kubernetes/model/v1_csi_node_list.c @@ -5,7 +5,7 @@ -v1_csi_node_list_t *v1_csi_node_list_create( +static v1_csi_node_list_t *v1_csi_node_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_csi_node_list_t *v1_csi_node_list_create( v1_csi_node_list_local_var->kind = kind; v1_csi_node_list_local_var->metadata = metadata; + v1_csi_node_list_local_var->_library_owned = 1; return v1_csi_node_list_local_var; } +__attribute__((deprecated)) v1_csi_node_list_t *v1_csi_node_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_csi_node_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_csi_node_list_free(v1_csi_node_list_t *v1_csi_node_list) { if(NULL == v1_csi_node_list){ return ; } + if(v1_csi_node_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_node_list_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_node_list->api_version) { free(v1_csi_node_list->api_version); @@ -123,6 +141,9 @@ v1_csi_node_list_t *v1_csi_node_list_parseFromJSON(cJSON *v1_csi_node_listJSON){ // v1_csi_node_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_csi_node_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_csi_node_list_t *v1_csi_node_list_parseFromJSON(cJSON *v1_csi_node_listJSON){ // v1_csi_node_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_csi_node_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_csi_node_list_t *v1_csi_node_list_parseFromJSON(cJSON *v1_csi_node_listJSON){ // v1_csi_node_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_csi_node_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_csi_node_list_t *v1_csi_node_list_parseFromJSON(cJSON *v1_csi_node_listJSON){ // v1_csi_node_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_csi_node_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_csi_node_list_local_var = v1_csi_node_list_create ( + v1_csi_node_list_local_var = v1_csi_node_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_csi_node_list.h b/kubernetes/model/v1_csi_node_list.h index 2f138b4b..cdba0310 100644 --- a/kubernetes/model/v1_csi_node_list.h +++ b/kubernetes/model/v1_csi_node_list.h @@ -26,9 +26,10 @@ typedef struct v1_csi_node_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_node_list_t; -v1_csi_node_list_t *v1_csi_node_list_create( +__attribute__((deprecated)) v1_csi_node_list_t *v1_csi_node_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_csi_node_spec.c b/kubernetes/model/v1_csi_node_spec.c index 68fa326b..63b97db2 100644 --- a/kubernetes/model/v1_csi_node_spec.c +++ b/kubernetes/model/v1_csi_node_spec.c @@ -5,7 +5,7 @@ -v1_csi_node_spec_t *v1_csi_node_spec_create( +static v1_csi_node_spec_t *v1_csi_node_spec_create_internal( list_t *drivers ) { v1_csi_node_spec_t *v1_csi_node_spec_local_var = malloc(sizeof(v1_csi_node_spec_t)); @@ -14,14 +14,26 @@ v1_csi_node_spec_t *v1_csi_node_spec_create( } v1_csi_node_spec_local_var->drivers = drivers; + v1_csi_node_spec_local_var->_library_owned = 1; return v1_csi_node_spec_local_var; } +__attribute__((deprecated)) v1_csi_node_spec_t *v1_csi_node_spec_create( + list_t *drivers + ) { + return v1_csi_node_spec_create_internal ( + drivers + ); +} void v1_csi_node_spec_free(v1_csi_node_spec_t *v1_csi_node_spec) { if(NULL == v1_csi_node_spec){ return ; } + if(v1_csi_node_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_node_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_node_spec->drivers) { list_ForEach(listEntry, v1_csi_node_spec->drivers) { @@ -73,6 +85,9 @@ v1_csi_node_spec_t *v1_csi_node_spec_parseFromJSON(cJSON *v1_csi_node_specJSON){ // v1_csi_node_spec->drivers cJSON *drivers = cJSON_GetObjectItemCaseSensitive(v1_csi_node_specJSON, "drivers"); + if (cJSON_IsNull(drivers)) { + drivers = NULL; + } if (!drivers) { goto end; } @@ -96,7 +111,7 @@ v1_csi_node_spec_t *v1_csi_node_spec_parseFromJSON(cJSON *v1_csi_node_specJSON){ } - v1_csi_node_spec_local_var = v1_csi_node_spec_create ( + v1_csi_node_spec_local_var = v1_csi_node_spec_create_internal ( driversList ); diff --git a/kubernetes/model/v1_csi_node_spec.h b/kubernetes/model/v1_csi_node_spec.h index 1663d800..9ab2bf91 100644 --- a/kubernetes/model/v1_csi_node_spec.h +++ b/kubernetes/model/v1_csi_node_spec.h @@ -22,9 +22,10 @@ typedef struct v1_csi_node_spec_t v1_csi_node_spec_t; typedef struct v1_csi_node_spec_t { list_t *drivers; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_node_spec_t; -v1_csi_node_spec_t *v1_csi_node_spec_create( +__attribute__((deprecated)) v1_csi_node_spec_t *v1_csi_node_spec_create( list_t *drivers ); diff --git a/kubernetes/model/v1_csi_persistent_volume_source.c b/kubernetes/model/v1_csi_persistent_volume_source.c index 9ff820e7..fb5e46a8 100644 --- a/kubernetes/model/v1_csi_persistent_volume_source.c +++ b/kubernetes/model/v1_csi_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_create( +static v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_create_internal( v1_secret_reference_t *controller_expand_secret_ref, v1_secret_reference_t *controller_publish_secret_ref, char *driver, @@ -32,14 +32,44 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_create( v1_csi_persistent_volume_source_local_var->volume_attributes = volume_attributes; v1_csi_persistent_volume_source_local_var->volume_handle = volume_handle; + v1_csi_persistent_volume_source_local_var->_library_owned = 1; return v1_csi_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_create( + v1_secret_reference_t *controller_expand_secret_ref, + v1_secret_reference_t *controller_publish_secret_ref, + char *driver, + char *fs_type, + v1_secret_reference_t *node_expand_secret_ref, + v1_secret_reference_t *node_publish_secret_ref, + v1_secret_reference_t *node_stage_secret_ref, + int read_only, + list_t* volume_attributes, + char *volume_handle + ) { + return v1_csi_persistent_volume_source_create_internal ( + controller_expand_secret_ref, + controller_publish_secret_ref, + driver, + fs_type, + node_expand_secret_ref, + node_publish_secret_ref, + node_stage_secret_ref, + read_only, + volume_attributes, + volume_handle + ); +} void v1_csi_persistent_volume_source_free(v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source) { if(NULL == v1_csi_persistent_volume_source){ return ; } + if(v1_csi_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_persistent_volume_source->controller_expand_secret_ref) { v1_secret_reference_free(v1_csi_persistent_volume_source->controller_expand_secret_ref); @@ -71,7 +101,7 @@ void v1_csi_persistent_volume_source_free(v1_csi_persistent_volume_source_t *v1_ } if (v1_csi_persistent_volume_source->volume_attributes) { list_ForEach(listEntry, v1_csi_persistent_volume_source->volume_attributes) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -189,8 +219,8 @@ cJSON *v1_csi_persistent_volume_source_convertToJSON(v1_csi_persistent_volume_so listEntry_t *volume_attributesListEntry; if (v1_csi_persistent_volume_source->volume_attributes) { list_ForEach(volume_attributesListEntry, v1_csi_persistent_volume_source->volume_attributes) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)volume_attributesListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = volume_attributesListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -239,18 +269,27 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON // v1_csi_persistent_volume_source->controller_expand_secret_ref cJSON *controller_expand_secret_ref = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "controllerExpandSecretRef"); + if (cJSON_IsNull(controller_expand_secret_ref)) { + controller_expand_secret_ref = NULL; + } if (controller_expand_secret_ref) { controller_expand_secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(controller_expand_secret_ref); //nonprimitive } // v1_csi_persistent_volume_source->controller_publish_secret_ref cJSON *controller_publish_secret_ref = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "controllerPublishSecretRef"); + if (cJSON_IsNull(controller_publish_secret_ref)) { + controller_publish_secret_ref = NULL; + } if (controller_publish_secret_ref) { controller_publish_secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(controller_publish_secret_ref); //nonprimitive } // v1_csi_persistent_volume_source->driver cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } if (!driver) { goto end; } @@ -263,6 +302,9 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON // v1_csi_persistent_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -272,24 +314,36 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON // v1_csi_persistent_volume_source->node_expand_secret_ref cJSON *node_expand_secret_ref = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "nodeExpandSecretRef"); + if (cJSON_IsNull(node_expand_secret_ref)) { + node_expand_secret_ref = NULL; + } if (node_expand_secret_ref) { node_expand_secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(node_expand_secret_ref); //nonprimitive } // v1_csi_persistent_volume_source->node_publish_secret_ref cJSON *node_publish_secret_ref = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "nodePublishSecretRef"); + if (cJSON_IsNull(node_publish_secret_ref)) { + node_publish_secret_ref = NULL; + } if (node_publish_secret_ref) { node_publish_secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(node_publish_secret_ref); //nonprimitive } // v1_csi_persistent_volume_source->node_stage_secret_ref cJSON *node_stage_secret_ref = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "nodeStageSecretRef"); + if (cJSON_IsNull(node_stage_secret_ref)) { + node_stage_secret_ref = NULL; + } if (node_stage_secret_ref) { node_stage_secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(node_stage_secret_ref); //nonprimitive } // v1_csi_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -299,6 +353,9 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON // v1_csi_persistent_volume_source->volume_attributes cJSON *volume_attributes = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "volumeAttributes"); + if (cJSON_IsNull(volume_attributes)) { + volume_attributes = NULL; + } if (volume_attributes) { cJSON *volume_attributes_local_map = NULL; if(!cJSON_IsObject(volume_attributes) && !cJSON_IsNull(volume_attributes)) @@ -324,6 +381,9 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON // v1_csi_persistent_volume_source->volume_handle cJSON *volume_handle = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "volumeHandle"); + if (cJSON_IsNull(volume_handle)) { + volume_handle = NULL; + } if (!volume_handle) { goto end; } @@ -335,7 +395,7 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON } - v1_csi_persistent_volume_source_local_var = v1_csi_persistent_volume_source_create ( + v1_csi_persistent_volume_source_local_var = v1_csi_persistent_volume_source_create_internal ( controller_expand_secret_ref ? controller_expand_secret_ref_local_nonprim : NULL, controller_publish_secret_ref ? controller_publish_secret_ref_local_nonprim : NULL, strdup(driver->valuestring), @@ -373,7 +433,7 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON if (volume_attributesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, volume_attributesList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_csi_persistent_volume_source.h b/kubernetes/model/v1_csi_persistent_volume_source.h index 32a67aa6..86d226e3 100644 --- a/kubernetes/model/v1_csi_persistent_volume_source.h +++ b/kubernetes/model/v1_csi_persistent_volume_source.h @@ -1,7 +1,7 @@ /* * v1_csi_persistent_volume_source.h * - * Represents storage that is managed by an external CSI volume driver (Beta feature) + * Represents storage that is managed by an external CSI volume driver */ #ifndef _v1_csi_persistent_volume_source_H_ @@ -31,9 +31,10 @@ typedef struct v1_csi_persistent_volume_source_t { list_t* volume_attributes; //map char *volume_handle; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_persistent_volume_source_t; -v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_create( +__attribute__((deprecated)) v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_create( v1_secret_reference_t *controller_expand_secret_ref, v1_secret_reference_t *controller_publish_secret_ref, char *driver, diff --git a/kubernetes/model/v1_csi_storage_capacity.c b/kubernetes/model/v1_csi_storage_capacity.c index c320361c..f9915b99 100644 --- a/kubernetes/model/v1_csi_storage_capacity.c +++ b/kubernetes/model/v1_csi_storage_capacity.c @@ -5,7 +5,7 @@ -v1_csi_storage_capacity_t *v1_csi_storage_capacity_create( +static v1_csi_storage_capacity_t *v1_csi_storage_capacity_create_internal( char *api_version, char *capacity, char *kind, @@ -26,14 +26,38 @@ v1_csi_storage_capacity_t *v1_csi_storage_capacity_create( v1_csi_storage_capacity_local_var->node_topology = node_topology; v1_csi_storage_capacity_local_var->storage_class_name = storage_class_name; + v1_csi_storage_capacity_local_var->_library_owned = 1; return v1_csi_storage_capacity_local_var; } +__attribute__((deprecated)) v1_csi_storage_capacity_t *v1_csi_storage_capacity_create( + char *api_version, + char *capacity, + char *kind, + char *maximum_volume_size, + v1_object_meta_t *metadata, + v1_label_selector_t *node_topology, + char *storage_class_name + ) { + return v1_csi_storage_capacity_create_internal ( + api_version, + capacity, + kind, + maximum_volume_size, + metadata, + node_topology, + storage_class_name + ); +} void v1_csi_storage_capacity_free(v1_csi_storage_capacity_t *v1_csi_storage_capacity) { if(NULL == v1_csi_storage_capacity){ return ; } + if(v1_csi_storage_capacity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_storage_capacity_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_storage_capacity->api_version) { free(v1_csi_storage_capacity->api_version); @@ -155,6 +179,9 @@ v1_csi_storage_capacity_t *v1_csi_storage_capacity_parseFromJSON(cJSON *v1_csi_s // v1_csi_storage_capacity->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacityJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -164,6 +191,9 @@ v1_csi_storage_capacity_t *v1_csi_storage_capacity_parseFromJSON(cJSON *v1_csi_s // v1_csi_storage_capacity->capacity cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacityJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } if (capacity) { if(!cJSON_IsString(capacity) && !cJSON_IsNull(capacity)) { @@ -173,6 +203,9 @@ v1_csi_storage_capacity_t *v1_csi_storage_capacity_parseFromJSON(cJSON *v1_csi_s // v1_csi_storage_capacity->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacityJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -182,6 +215,9 @@ v1_csi_storage_capacity_t *v1_csi_storage_capacity_parseFromJSON(cJSON *v1_csi_s // v1_csi_storage_capacity->maximum_volume_size cJSON *maximum_volume_size = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacityJSON, "maximumVolumeSize"); + if (cJSON_IsNull(maximum_volume_size)) { + maximum_volume_size = NULL; + } if (maximum_volume_size) { if(!cJSON_IsString(maximum_volume_size) && !cJSON_IsNull(maximum_volume_size)) { @@ -191,18 +227,27 @@ v1_csi_storage_capacity_t *v1_csi_storage_capacity_parseFromJSON(cJSON *v1_csi_s // v1_csi_storage_capacity->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacityJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_csi_storage_capacity->node_topology cJSON *node_topology = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacityJSON, "nodeTopology"); + if (cJSON_IsNull(node_topology)) { + node_topology = NULL; + } if (node_topology) { node_topology_local_nonprim = v1_label_selector_parseFromJSON(node_topology); //nonprimitive } // v1_csi_storage_capacity->storage_class_name cJSON *storage_class_name = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacityJSON, "storageClassName"); + if (cJSON_IsNull(storage_class_name)) { + storage_class_name = NULL; + } if (!storage_class_name) { goto end; } @@ -214,7 +259,7 @@ v1_csi_storage_capacity_t *v1_csi_storage_capacity_parseFromJSON(cJSON *v1_csi_s } - v1_csi_storage_capacity_local_var = v1_csi_storage_capacity_create ( + v1_csi_storage_capacity_local_var = v1_csi_storage_capacity_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, capacity && !cJSON_IsNull(capacity) ? strdup(capacity->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_csi_storage_capacity.h b/kubernetes/model/v1_csi_storage_capacity.h index c20e8cb9..c79dc874 100644 --- a/kubernetes/model/v1_csi_storage_capacity.h +++ b/kubernetes/model/v1_csi_storage_capacity.h @@ -29,9 +29,10 @@ typedef struct v1_csi_storage_capacity_t { struct v1_label_selector_t *node_topology; //model char *storage_class_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_storage_capacity_t; -v1_csi_storage_capacity_t *v1_csi_storage_capacity_create( +__attribute__((deprecated)) v1_csi_storage_capacity_t *v1_csi_storage_capacity_create( char *api_version, char *capacity, char *kind, diff --git a/kubernetes/model/v1_csi_storage_capacity_list.c b/kubernetes/model/v1_csi_storage_capacity_list.c index c17a8b3e..5dcdb11e 100644 --- a/kubernetes/model/v1_csi_storage_capacity_list.c +++ b/kubernetes/model/v1_csi_storage_capacity_list.c @@ -5,7 +5,7 @@ -v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_create( +static v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_create( v1_csi_storage_capacity_list_local_var->kind = kind; v1_csi_storage_capacity_list_local_var->metadata = metadata; + v1_csi_storage_capacity_list_local_var->_library_owned = 1; return v1_csi_storage_capacity_list_local_var; } +__attribute__((deprecated)) v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_csi_storage_capacity_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_csi_storage_capacity_list_free(v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list) { if(NULL == v1_csi_storage_capacity_list){ return ; } + if(v1_csi_storage_capacity_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_storage_capacity_list_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_storage_capacity_list->api_version) { free(v1_csi_storage_capacity_list->api_version); @@ -123,6 +141,9 @@ v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_parseFromJSON(cJSON // v1_csi_storage_capacity_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacity_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_parseFromJSON(cJSON // v1_csi_storage_capacity_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacity_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_parseFromJSON(cJSON // v1_csi_storage_capacity_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacity_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_parseFromJSON(cJSON // v1_csi_storage_capacity_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_csi_storage_capacity_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_csi_storage_capacity_list_local_var = v1_csi_storage_capacity_list_create ( + v1_csi_storage_capacity_list_local_var = v1_csi_storage_capacity_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_csi_storage_capacity_list.h b/kubernetes/model/v1_csi_storage_capacity_list.h index b8a00d46..0320c084 100644 --- a/kubernetes/model/v1_csi_storage_capacity_list.h +++ b/kubernetes/model/v1_csi_storage_capacity_list.h @@ -26,9 +26,10 @@ typedef struct v1_csi_storage_capacity_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_storage_capacity_list_t; -v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_create( +__attribute__((deprecated)) v1_csi_storage_capacity_list_t *v1_csi_storage_capacity_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_csi_volume_source.c b/kubernetes/model/v1_csi_volume_source.c index 171a46bc..a0c9a2a8 100644 --- a/kubernetes/model/v1_csi_volume_source.c +++ b/kubernetes/model/v1_csi_volume_source.c @@ -5,7 +5,7 @@ -v1_csi_volume_source_t *v1_csi_volume_source_create( +static v1_csi_volume_source_t *v1_csi_volume_source_create_internal( char *driver, char *fs_type, v1_local_object_reference_t *node_publish_secret_ref, @@ -22,14 +22,34 @@ v1_csi_volume_source_t *v1_csi_volume_source_create( v1_csi_volume_source_local_var->read_only = read_only; v1_csi_volume_source_local_var->volume_attributes = volume_attributes; + v1_csi_volume_source_local_var->_library_owned = 1; return v1_csi_volume_source_local_var; } +__attribute__((deprecated)) v1_csi_volume_source_t *v1_csi_volume_source_create( + char *driver, + char *fs_type, + v1_local_object_reference_t *node_publish_secret_ref, + int read_only, + list_t* volume_attributes + ) { + return v1_csi_volume_source_create_internal ( + driver, + fs_type, + node_publish_secret_ref, + read_only, + volume_attributes + ); +} void v1_csi_volume_source_free(v1_csi_volume_source_t *v1_csi_volume_source) { if(NULL == v1_csi_volume_source){ return ; } + if(v1_csi_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_csi_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_csi_volume_source->driver) { free(v1_csi_volume_source->driver); @@ -45,7 +65,7 @@ void v1_csi_volume_source_free(v1_csi_volume_source_t *v1_csi_volume_source) { } if (v1_csi_volume_source->volume_attributes) { list_ForEach(listEntry, v1_csi_volume_source->volume_attributes) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -107,8 +127,8 @@ cJSON *v1_csi_volume_source_convertToJSON(v1_csi_volume_source_t *v1_csi_volume_ listEntry_t *volume_attributesListEntry; if (v1_csi_volume_source->volume_attributes) { list_ForEach(volume_attributesListEntry, v1_csi_volume_source->volume_attributes) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)volume_attributesListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = volume_attributesListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -136,6 +156,9 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ // v1_csi_volume_source->driver cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } if (!driver) { goto end; } @@ -148,6 +171,9 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ // v1_csi_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -157,12 +183,18 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ // v1_csi_volume_source->node_publish_secret_ref cJSON *node_publish_secret_ref = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "nodePublishSecretRef"); + if (cJSON_IsNull(node_publish_secret_ref)) { + node_publish_secret_ref = NULL; + } if (node_publish_secret_ref) { node_publish_secret_ref_local_nonprim = v1_local_object_reference_parseFromJSON(node_publish_secret_ref); //nonprimitive } // v1_csi_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -172,6 +204,9 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ // v1_csi_volume_source->volume_attributes cJSON *volume_attributes = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "volumeAttributes"); + if (cJSON_IsNull(volume_attributes)) { + volume_attributes = NULL; + } if (volume_attributes) { cJSON *volume_attributes_local_map = NULL; if(!cJSON_IsObject(volume_attributes) && !cJSON_IsNull(volume_attributes)) @@ -196,7 +231,7 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ } - v1_csi_volume_source_local_var = v1_csi_volume_source_create ( + v1_csi_volume_source_local_var = v1_csi_volume_source_create_internal ( strdup(driver->valuestring), fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, node_publish_secret_ref ? node_publish_secret_ref_local_nonprim : NULL, @@ -213,7 +248,7 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ if (volume_attributesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, volume_attributesList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_csi_volume_source.h b/kubernetes/model/v1_csi_volume_source.h index 878f655a..d910089a 100644 --- a/kubernetes/model/v1_csi_volume_source.h +++ b/kubernetes/model/v1_csi_volume_source.h @@ -26,9 +26,10 @@ typedef struct v1_csi_volume_source_t { int read_only; //boolean list_t* volume_attributes; //map + int _library_owned; // Is the library responsible for freeing this object? } v1_csi_volume_source_t; -v1_csi_volume_source_t *v1_csi_volume_source_create( +__attribute__((deprecated)) v1_csi_volume_source_t *v1_csi_volume_source_create( char *driver, char *fs_type, v1_local_object_reference_t *node_publish_secret_ref, diff --git a/kubernetes/model/v1_custom_resource_column_definition.c b/kubernetes/model/v1_custom_resource_column_definition.c index b3e63b88..5d0e9772 100644 --- a/kubernetes/model/v1_custom_resource_column_definition.c +++ b/kubernetes/model/v1_custom_resource_column_definition.c @@ -5,7 +5,7 @@ -v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_create( +static v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_create_internal( char *description, char *format, char *json_path, @@ -24,14 +24,36 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_cre v1_custom_resource_column_definition_local_var->priority = priority; v1_custom_resource_column_definition_local_var->type = type; + v1_custom_resource_column_definition_local_var->_library_owned = 1; return v1_custom_resource_column_definition_local_var; } +__attribute__((deprecated)) v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_create( + char *description, + char *format, + char *json_path, + char *name, + int priority, + char *type + ) { + return v1_custom_resource_column_definition_create_internal ( + description, + format, + json_path, + name, + priority, + type + ); +} void v1_custom_resource_column_definition_free(v1_custom_resource_column_definition_t *v1_custom_resource_column_definition) { if(NULL == v1_custom_resource_column_definition){ return ; } + if(v1_custom_resource_column_definition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_column_definition_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_column_definition->description) { free(v1_custom_resource_column_definition->description); @@ -123,6 +145,9 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_par // v1_custom_resource_column_definition->description cJSON *description = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_column_definitionJSON, "description"); + if (cJSON_IsNull(description)) { + description = NULL; + } if (description) { if(!cJSON_IsString(description) && !cJSON_IsNull(description)) { @@ -132,6 +157,9 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_par // v1_custom_resource_column_definition->format cJSON *format = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_column_definitionJSON, "format"); + if (cJSON_IsNull(format)) { + format = NULL; + } if (format) { if(!cJSON_IsString(format) && !cJSON_IsNull(format)) { @@ -141,6 +169,9 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_par // v1_custom_resource_column_definition->json_path cJSON *json_path = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_column_definitionJSON, "jsonPath"); + if (cJSON_IsNull(json_path)) { + json_path = NULL; + } if (!json_path) { goto end; } @@ -153,6 +184,9 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_par // v1_custom_resource_column_definition->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_column_definitionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -165,6 +199,9 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_par // v1_custom_resource_column_definition->priority cJSON *priority = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_column_definitionJSON, "priority"); + if (cJSON_IsNull(priority)) { + priority = NULL; + } if (priority) { if(!cJSON_IsNumber(priority)) { @@ -174,6 +211,9 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_par // v1_custom_resource_column_definition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_column_definitionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -185,7 +225,7 @@ v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_par } - v1_custom_resource_column_definition_local_var = v1_custom_resource_column_definition_create ( + v1_custom_resource_column_definition_local_var = v1_custom_resource_column_definition_create_internal ( description && !cJSON_IsNull(description) ? strdup(description->valuestring) : NULL, format && !cJSON_IsNull(format) ? strdup(format->valuestring) : NULL, strdup(json_path->valuestring), diff --git a/kubernetes/model/v1_custom_resource_column_definition.h b/kubernetes/model/v1_custom_resource_column_definition.h index 0a9db3e6..c6b8233d 100644 --- a/kubernetes/model/v1_custom_resource_column_definition.h +++ b/kubernetes/model/v1_custom_resource_column_definition.h @@ -26,9 +26,10 @@ typedef struct v1_custom_resource_column_definition_t { int priority; //numeric char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_column_definition_t; -v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_create( +__attribute__((deprecated)) v1_custom_resource_column_definition_t *v1_custom_resource_column_definition_create( char *description, char *format, char *json_path, diff --git a/kubernetes/model/v1_custom_resource_conversion.c b/kubernetes/model/v1_custom_resource_conversion.c index 44945afd..27cf0f51 100644 --- a/kubernetes/model/v1_custom_resource_conversion.c +++ b/kubernetes/model/v1_custom_resource_conversion.c @@ -5,7 +5,7 @@ -v1_custom_resource_conversion_t *v1_custom_resource_conversion_create( +static v1_custom_resource_conversion_t *v1_custom_resource_conversion_create_internal( char *strategy, v1_webhook_conversion_t *webhook ) { @@ -16,14 +16,28 @@ v1_custom_resource_conversion_t *v1_custom_resource_conversion_create( v1_custom_resource_conversion_local_var->strategy = strategy; v1_custom_resource_conversion_local_var->webhook = webhook; + v1_custom_resource_conversion_local_var->_library_owned = 1; return v1_custom_resource_conversion_local_var; } +__attribute__((deprecated)) v1_custom_resource_conversion_t *v1_custom_resource_conversion_create( + char *strategy, + v1_webhook_conversion_t *webhook + ) { + return v1_custom_resource_conversion_create_internal ( + strategy, + webhook + ); +} void v1_custom_resource_conversion_free(v1_custom_resource_conversion_t *v1_custom_resource_conversion) { if(NULL == v1_custom_resource_conversion){ return ; } + if(v1_custom_resource_conversion->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_conversion_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_conversion->strategy) { free(v1_custom_resource_conversion->strategy); @@ -77,6 +91,9 @@ v1_custom_resource_conversion_t *v1_custom_resource_conversion_parseFromJSON(cJS // v1_custom_resource_conversion->strategy cJSON *strategy = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_conversionJSON, "strategy"); + if (cJSON_IsNull(strategy)) { + strategy = NULL; + } if (!strategy) { goto end; } @@ -89,12 +106,15 @@ v1_custom_resource_conversion_t *v1_custom_resource_conversion_parseFromJSON(cJS // v1_custom_resource_conversion->webhook cJSON *webhook = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_conversionJSON, "webhook"); + if (cJSON_IsNull(webhook)) { + webhook = NULL; + } if (webhook) { webhook_local_nonprim = v1_webhook_conversion_parseFromJSON(webhook); //nonprimitive } - v1_custom_resource_conversion_local_var = v1_custom_resource_conversion_create ( + v1_custom_resource_conversion_local_var = v1_custom_resource_conversion_create_internal ( strdup(strategy->valuestring), webhook ? webhook_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_custom_resource_conversion.h b/kubernetes/model/v1_custom_resource_conversion.h index bf6c1d31..621fa510 100644 --- a/kubernetes/model/v1_custom_resource_conversion.h +++ b/kubernetes/model/v1_custom_resource_conversion.h @@ -23,9 +23,10 @@ typedef struct v1_custom_resource_conversion_t { char *strategy; // string struct v1_webhook_conversion_t *webhook; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_conversion_t; -v1_custom_resource_conversion_t *v1_custom_resource_conversion_create( +__attribute__((deprecated)) v1_custom_resource_conversion_t *v1_custom_resource_conversion_create( char *strategy, v1_webhook_conversion_t *webhook ); diff --git a/kubernetes/model/v1_custom_resource_definition.c b/kubernetes/model/v1_custom_resource_definition.c index e5028e66..e02296fd 100644 --- a/kubernetes/model/v1_custom_resource_definition.c +++ b/kubernetes/model/v1_custom_resource_definition.c @@ -5,7 +5,7 @@ -v1_custom_resource_definition_t *v1_custom_resource_definition_create( +static v1_custom_resource_definition_t *v1_custom_resource_definition_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_custom_resource_definition_t *v1_custom_resource_definition_create( v1_custom_resource_definition_local_var->spec = spec; v1_custom_resource_definition_local_var->status = status; + v1_custom_resource_definition_local_var->_library_owned = 1; return v1_custom_resource_definition_local_var; } +__attribute__((deprecated)) v1_custom_resource_definition_t *v1_custom_resource_definition_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_custom_resource_definition_spec_t *spec, + v1_custom_resource_definition_status_t *status + ) { + return v1_custom_resource_definition_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_custom_resource_definition_free(v1_custom_resource_definition_t *v1_custom_resource_definition) { if(NULL == v1_custom_resource_definition){ return ; } + if(v1_custom_resource_definition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_definition_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_definition->api_version) { free(v1_custom_resource_definition->api_version); @@ -135,6 +155,9 @@ v1_custom_resource_definition_t *v1_custom_resource_definition_parseFromJSON(cJS // v1_custom_resource_definition->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definitionJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_custom_resource_definition_t *v1_custom_resource_definition_parseFromJSON(cJS // v1_custom_resource_definition->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definitionJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_custom_resource_definition_t *v1_custom_resource_definition_parseFromJSON(cJS // v1_custom_resource_definition->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definitionJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_custom_resource_definition->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definitionJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_custom_resource_definition_t *v1_custom_resource_definition_parseFromJSON(cJS // v1_custom_resource_definition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definitionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_custom_resource_definition_status_parseFromJSON(status); //nonprimitive } - v1_custom_resource_definition_local_var = v1_custom_resource_definition_create ( + v1_custom_resource_definition_local_var = v1_custom_resource_definition_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_custom_resource_definition.h b/kubernetes/model/v1_custom_resource_definition.h index 9e8b26d0..348ab947 100644 --- a/kubernetes/model/v1_custom_resource_definition.h +++ b/kubernetes/model/v1_custom_resource_definition.h @@ -28,9 +28,10 @@ typedef struct v1_custom_resource_definition_t { struct v1_custom_resource_definition_spec_t *spec; //model struct v1_custom_resource_definition_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_definition_t; -v1_custom_resource_definition_t *v1_custom_resource_definition_create( +__attribute__((deprecated)) v1_custom_resource_definition_t *v1_custom_resource_definition_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_custom_resource_definition_condition.c b/kubernetes/model/v1_custom_resource_definition_condition.c index 290a1839..fe0340b2 100644 --- a/kubernetes/model/v1_custom_resource_definition_condition.c +++ b/kubernetes/model/v1_custom_resource_definition_condition.c @@ -5,7 +5,7 @@ -v1_custom_resource_definition_condition_t *v1_custom_resource_definition_condition_create( +static v1_custom_resource_definition_condition_t *v1_custom_resource_definition_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_custom_resource_definition_condition_t *v1_custom_resource_definition_conditi v1_custom_resource_definition_condition_local_var->status = status; v1_custom_resource_definition_condition_local_var->type = type; + v1_custom_resource_definition_condition_local_var->_library_owned = 1; return v1_custom_resource_definition_condition_local_var; } +__attribute__((deprecated)) v1_custom_resource_definition_condition_t *v1_custom_resource_definition_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_custom_resource_definition_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_custom_resource_definition_condition_free(v1_custom_resource_definition_condition_t *v1_custom_resource_definition_condition) { if(NULL == v1_custom_resource_definition_condition){ return ; } + if(v1_custom_resource_definition_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_definition_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_definition_condition->last_transition_time) { free(v1_custom_resource_definition_condition->last_transition_time); @@ -112,6 +132,9 @@ v1_custom_resource_definition_condition_t *v1_custom_resource_definition_conditi // v1_custom_resource_definition_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v1_custom_resource_definition_condition_t *v1_custom_resource_definition_conditi // v1_custom_resource_definition_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1_custom_resource_definition_condition_t *v1_custom_resource_definition_conditi // v1_custom_resource_definition_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1_custom_resource_definition_condition_t *v1_custom_resource_definition_conditi // v1_custom_resource_definition_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1_custom_resource_definition_condition_t *v1_custom_resource_definition_conditi // v1_custom_resource_definition_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1_custom_resource_definition_condition_t *v1_custom_resource_definition_conditi } - v1_custom_resource_definition_condition_local_var = v1_custom_resource_definition_condition_create ( + v1_custom_resource_definition_condition_local_var = v1_custom_resource_definition_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_custom_resource_definition_condition.h b/kubernetes/model/v1_custom_resource_definition_condition.h index 369495b7..69b7a40b 100644 --- a/kubernetes/model/v1_custom_resource_definition_condition.h +++ b/kubernetes/model/v1_custom_resource_definition_condition.h @@ -25,9 +25,10 @@ typedef struct v1_custom_resource_definition_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_definition_condition_t; -v1_custom_resource_definition_condition_t *v1_custom_resource_definition_condition_create( +__attribute__((deprecated)) v1_custom_resource_definition_condition_t *v1_custom_resource_definition_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_custom_resource_definition_list.c b/kubernetes/model/v1_custom_resource_definition_list.c index aa95f5cf..e22ac7c6 100644 --- a/kubernetes/model/v1_custom_resource_definition_list.c +++ b/kubernetes/model/v1_custom_resource_definition_list.c @@ -5,7 +5,7 @@ -v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_create( +static v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_create( v1_custom_resource_definition_list_local_var->kind = kind; v1_custom_resource_definition_list_local_var->metadata = metadata; + v1_custom_resource_definition_list_local_var->_library_owned = 1; return v1_custom_resource_definition_list_local_var; } +__attribute__((deprecated)) v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_custom_resource_definition_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_custom_resource_definition_list_free(v1_custom_resource_definition_list_t *v1_custom_resource_definition_list) { if(NULL == v1_custom_resource_definition_list){ return ; } + if(v1_custom_resource_definition_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_definition_list_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_definition_list->api_version) { free(v1_custom_resource_definition_list->api_version); @@ -123,6 +141,9 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_parseFr // v1_custom_resource_definition_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_parseFr // v1_custom_resource_definition_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_parseFr // v1_custom_resource_definition_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_parseFr // v1_custom_resource_definition_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_custom_resource_definition_list_local_var = v1_custom_resource_definition_list_create ( + v1_custom_resource_definition_list_local_var = v1_custom_resource_definition_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_custom_resource_definition_list.h b/kubernetes/model/v1_custom_resource_definition_list.h index cc6e3ed4..da331cbc 100644 --- a/kubernetes/model/v1_custom_resource_definition_list.h +++ b/kubernetes/model/v1_custom_resource_definition_list.h @@ -26,9 +26,10 @@ typedef struct v1_custom_resource_definition_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_definition_list_t; -v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_create( +__attribute__((deprecated)) v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_custom_resource_definition_names.c b/kubernetes/model/v1_custom_resource_definition_names.c index 8a557fa4..a3913a95 100644 --- a/kubernetes/model/v1_custom_resource_definition_names.c +++ b/kubernetes/model/v1_custom_resource_definition_names.c @@ -5,7 +5,7 @@ -v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_create( +static v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_create_internal( list_t *categories, char *kind, char *list_kind, @@ -24,14 +24,36 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_creat v1_custom_resource_definition_names_local_var->short_names = short_names; v1_custom_resource_definition_names_local_var->singular = singular; + v1_custom_resource_definition_names_local_var->_library_owned = 1; return v1_custom_resource_definition_names_local_var; } +__attribute__((deprecated)) v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_create( + list_t *categories, + char *kind, + char *list_kind, + char *plural, + list_t *short_names, + char *singular + ) { + return v1_custom_resource_definition_names_create_internal ( + categories, + kind, + list_kind, + plural, + short_names, + singular + ); +} void v1_custom_resource_definition_names_free(v1_custom_resource_definition_names_t *v1_custom_resource_definition_names) { if(NULL == v1_custom_resource_definition_names){ return ; } + if(v1_custom_resource_definition_names->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_definition_names_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_definition_names->categories) { list_ForEach(listEntry, v1_custom_resource_definition_names->categories) { @@ -78,7 +100,7 @@ cJSON *v1_custom_resource_definition_names_convertToJSON(v1_custom_resource_defi listEntry_t *categoriesListEntry; list_ForEach(categoriesListEntry, v1_custom_resource_definition_names->categories) { - if(cJSON_AddStringToObject(categories, "", (char*)categoriesListEntry->data) == NULL) + if(cJSON_AddStringToObject(categories, "", categoriesListEntry->data) == NULL) { goto fail; } @@ -121,7 +143,7 @@ cJSON *v1_custom_resource_definition_names_convertToJSON(v1_custom_resource_defi listEntry_t *short_namesListEntry; list_ForEach(short_namesListEntry, v1_custom_resource_definition_names->short_names) { - if(cJSON_AddStringToObject(short_names, "", (char*)short_namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(short_names, "", short_namesListEntry->data) == NULL) { goto fail; } @@ -156,6 +178,9 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse // v1_custom_resource_definition_names->categories cJSON *categories = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "categories"); + if (cJSON_IsNull(categories)) { + categories = NULL; + } if (categories) { cJSON *categories_local = NULL; if(!cJSON_IsArray(categories)) { @@ -175,6 +200,9 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse // v1_custom_resource_definition_names->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -187,6 +215,9 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse // v1_custom_resource_definition_names->list_kind cJSON *list_kind = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "listKind"); + if (cJSON_IsNull(list_kind)) { + list_kind = NULL; + } if (list_kind) { if(!cJSON_IsString(list_kind) && !cJSON_IsNull(list_kind)) { @@ -196,6 +227,9 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse // v1_custom_resource_definition_names->plural cJSON *plural = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "plural"); + if (cJSON_IsNull(plural)) { + plural = NULL; + } if (!plural) { goto end; } @@ -208,6 +242,9 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse // v1_custom_resource_definition_names->short_names cJSON *short_names = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "shortNames"); + if (cJSON_IsNull(short_names)) { + short_names = NULL; + } if (short_names) { cJSON *short_names_local = NULL; if(!cJSON_IsArray(short_names)) { @@ -227,6 +264,9 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse // v1_custom_resource_definition_names->singular cJSON *singular = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "singular"); + if (cJSON_IsNull(singular)) { + singular = NULL; + } if (singular) { if(!cJSON_IsString(singular) && !cJSON_IsNull(singular)) { @@ -235,7 +275,7 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse } - v1_custom_resource_definition_names_local_var = v1_custom_resource_definition_names_create ( + v1_custom_resource_definition_names_local_var = v1_custom_resource_definition_names_create_internal ( categories ? categoriesList : NULL, strdup(kind->valuestring), list_kind && !cJSON_IsNull(list_kind) ? strdup(list_kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_custom_resource_definition_names.h b/kubernetes/model/v1_custom_resource_definition_names.h index 4ada8687..e73b6495 100644 --- a/kubernetes/model/v1_custom_resource_definition_names.h +++ b/kubernetes/model/v1_custom_resource_definition_names.h @@ -26,9 +26,10 @@ typedef struct v1_custom_resource_definition_names_t { list_t *short_names; //primitive container char *singular; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_definition_names_t; -v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_create( +__attribute__((deprecated)) v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_create( list_t *categories, char *kind, char *list_kind, diff --git a/kubernetes/model/v1_custom_resource_definition_spec.c b/kubernetes/model/v1_custom_resource_definition_spec.c index bbc8d0b2..30d30572 100644 --- a/kubernetes/model/v1_custom_resource_definition_spec.c +++ b/kubernetes/model/v1_custom_resource_definition_spec.c @@ -5,7 +5,7 @@ -v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_create( +static v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_create_internal( v1_custom_resource_conversion_t *conversion, char *group, v1_custom_resource_definition_names_t *names, @@ -24,14 +24,36 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_create( v1_custom_resource_definition_spec_local_var->scope = scope; v1_custom_resource_definition_spec_local_var->versions = versions; + v1_custom_resource_definition_spec_local_var->_library_owned = 1; return v1_custom_resource_definition_spec_local_var; } +__attribute__((deprecated)) v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_create( + v1_custom_resource_conversion_t *conversion, + char *group, + v1_custom_resource_definition_names_t *names, + int preserve_unknown_fields, + char *scope, + list_t *versions + ) { + return v1_custom_resource_definition_spec_create_internal ( + conversion, + group, + names, + preserve_unknown_fields, + scope, + versions + ); +} void v1_custom_resource_definition_spec_free(v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec) { if(NULL == v1_custom_resource_definition_spec){ return ; } + if(v1_custom_resource_definition_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_definition_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_definition_spec->conversion) { v1_custom_resource_conversion_free(v1_custom_resource_definition_spec->conversion); @@ -158,12 +180,18 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr // v1_custom_resource_definition_spec->conversion cJSON *conversion = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_specJSON, "conversion"); + if (cJSON_IsNull(conversion)) { + conversion = NULL; + } if (conversion) { conversion_local_nonprim = v1_custom_resource_conversion_parseFromJSON(conversion); //nonprimitive } // v1_custom_resource_definition_spec->group cJSON *group = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_specJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (!group) { goto end; } @@ -176,6 +204,9 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr // v1_custom_resource_definition_spec->names cJSON *names = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_specJSON, "names"); + if (cJSON_IsNull(names)) { + names = NULL; + } if (!names) { goto end; } @@ -185,6 +216,9 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr // v1_custom_resource_definition_spec->preserve_unknown_fields cJSON *preserve_unknown_fields = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_specJSON, "preserveUnknownFields"); + if (cJSON_IsNull(preserve_unknown_fields)) { + preserve_unknown_fields = NULL; + } if (preserve_unknown_fields) { if(!cJSON_IsBool(preserve_unknown_fields)) { @@ -194,6 +228,9 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr // v1_custom_resource_definition_spec->scope cJSON *scope = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_specJSON, "scope"); + if (cJSON_IsNull(scope)) { + scope = NULL; + } if (!scope) { goto end; } @@ -206,6 +243,9 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr // v1_custom_resource_definition_spec->versions cJSON *versions = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_specJSON, "versions"); + if (cJSON_IsNull(versions)) { + versions = NULL; + } if (!versions) { goto end; } @@ -229,7 +269,7 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr } - v1_custom_resource_definition_spec_local_var = v1_custom_resource_definition_spec_create ( + v1_custom_resource_definition_spec_local_var = v1_custom_resource_definition_spec_create_internal ( conversion ? conversion_local_nonprim : NULL, strdup(group->valuestring), names_local_nonprim, diff --git a/kubernetes/model/v1_custom_resource_definition_spec.h b/kubernetes/model/v1_custom_resource_definition_spec.h index 251a3d78..e3f87adf 100644 --- a/kubernetes/model/v1_custom_resource_definition_spec.h +++ b/kubernetes/model/v1_custom_resource_definition_spec.h @@ -29,9 +29,10 @@ typedef struct v1_custom_resource_definition_spec_t { char *scope; // string list_t *versions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_definition_spec_t; -v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_create( +__attribute__((deprecated)) v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_create( v1_custom_resource_conversion_t *conversion, char *group, v1_custom_resource_definition_names_t *names, diff --git a/kubernetes/model/v1_custom_resource_definition_status.c b/kubernetes/model/v1_custom_resource_definition_status.c index 19930842..47220e71 100644 --- a/kubernetes/model/v1_custom_resource_definition_status.c +++ b/kubernetes/model/v1_custom_resource_definition_status.c @@ -5,7 +5,7 @@ -v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_create( +static v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_create_internal( v1_custom_resource_definition_names_t *accepted_names, list_t *conditions, list_t *stored_versions @@ -18,14 +18,30 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_cre v1_custom_resource_definition_status_local_var->conditions = conditions; v1_custom_resource_definition_status_local_var->stored_versions = stored_versions; + v1_custom_resource_definition_status_local_var->_library_owned = 1; return v1_custom_resource_definition_status_local_var; } +__attribute__((deprecated)) v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_create( + v1_custom_resource_definition_names_t *accepted_names, + list_t *conditions, + list_t *stored_versions + ) { + return v1_custom_resource_definition_status_create_internal ( + accepted_names, + conditions, + stored_versions + ); +} void v1_custom_resource_definition_status_free(v1_custom_resource_definition_status_t *v1_custom_resource_definition_status) { if(NULL == v1_custom_resource_definition_status){ return ; } + if(v1_custom_resource_definition_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_definition_status_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_definition_status->accepted_names) { v1_custom_resource_definition_names_free(v1_custom_resource_definition_status->accepted_names); @@ -93,7 +109,7 @@ cJSON *v1_custom_resource_definition_status_convertToJSON(v1_custom_resource_def listEntry_t *stored_versionsListEntry; list_ForEach(stored_versionsListEntry, v1_custom_resource_definition_status->stored_versions) { - if(cJSON_AddStringToObject(stored_versions, "", (char*)stored_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(stored_versions, "", stored_versionsListEntry->data) == NULL) { goto fail; } @@ -123,12 +139,18 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_par // v1_custom_resource_definition_status->accepted_names cJSON *accepted_names = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_statusJSON, "acceptedNames"); + if (cJSON_IsNull(accepted_names)) { + accepted_names = NULL; + } if (accepted_names) { accepted_names_local_nonprim = v1_custom_resource_definition_names_parseFromJSON(accepted_names); //nonprimitive } // v1_custom_resource_definition_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -150,6 +172,9 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_par // v1_custom_resource_definition_status->stored_versions cJSON *stored_versions = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_statusJSON, "storedVersions"); + if (cJSON_IsNull(stored_versions)) { + stored_versions = NULL; + } if (stored_versions) { cJSON *stored_versions_local = NULL; if(!cJSON_IsArray(stored_versions)) { @@ -168,7 +193,7 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_par } - v1_custom_resource_definition_status_local_var = v1_custom_resource_definition_status_create ( + v1_custom_resource_definition_status_local_var = v1_custom_resource_definition_status_create_internal ( accepted_names ? accepted_names_local_nonprim : NULL, conditions ? conditionsList : NULL, stored_versions ? stored_versionsList : NULL diff --git a/kubernetes/model/v1_custom_resource_definition_status.h b/kubernetes/model/v1_custom_resource_definition_status.h index e8a318d9..d7734554 100644 --- a/kubernetes/model/v1_custom_resource_definition_status.h +++ b/kubernetes/model/v1_custom_resource_definition_status.h @@ -25,9 +25,10 @@ typedef struct v1_custom_resource_definition_status_t { list_t *conditions; //nonprimitive container list_t *stored_versions; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_definition_status_t; -v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_create( +__attribute__((deprecated)) v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_create( v1_custom_resource_definition_names_t *accepted_names, list_t *conditions, list_t *stored_versions diff --git a/kubernetes/model/v1_custom_resource_definition_version.c b/kubernetes/model/v1_custom_resource_definition_version.c index ce284155..1727bc78 100644 --- a/kubernetes/model/v1_custom_resource_definition_version.c +++ b/kubernetes/model/v1_custom_resource_definition_version.c @@ -5,7 +5,7 @@ -v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_create( +static v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_create_internal( list_t *additional_printer_columns, int deprecated, char *deprecation_warning, @@ -30,14 +30,42 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_c v1_custom_resource_definition_version_local_var->storage = storage; v1_custom_resource_definition_version_local_var->subresources = subresources; + v1_custom_resource_definition_version_local_var->_library_owned = 1; return v1_custom_resource_definition_version_local_var; } +__attribute__((deprecated)) v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_create( + list_t *additional_printer_columns, + int deprecated, + char *deprecation_warning, + char *name, + v1_custom_resource_validation_t *schema, + list_t *selectable_fields, + int served, + int storage, + v1_custom_resource_subresources_t *subresources + ) { + return v1_custom_resource_definition_version_create_internal ( + additional_printer_columns, + deprecated, + deprecation_warning, + name, + schema, + selectable_fields, + served, + storage, + subresources + ); +} void v1_custom_resource_definition_version_free(v1_custom_resource_definition_version_t *v1_custom_resource_definition_version) { if(NULL == v1_custom_resource_definition_version){ return ; } + if(v1_custom_resource_definition_version->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_definition_version_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_definition_version->additional_printer_columns) { list_ForEach(listEntry, v1_custom_resource_definition_version->additional_printer_columns) { @@ -209,6 +237,9 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->additional_printer_columns cJSON *additional_printer_columns = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "additionalPrinterColumns"); + if (cJSON_IsNull(additional_printer_columns)) { + additional_printer_columns = NULL; + } if (additional_printer_columns) { cJSON *additional_printer_columns_local_nonprimitive = NULL; if(!cJSON_IsArray(additional_printer_columns)){ @@ -230,6 +261,9 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->deprecated cJSON *deprecated = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "deprecated"); + if (cJSON_IsNull(deprecated)) { + deprecated = NULL; + } if (deprecated) { if(!cJSON_IsBool(deprecated)) { @@ -239,6 +273,9 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->deprecation_warning cJSON *deprecation_warning = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "deprecationWarning"); + if (cJSON_IsNull(deprecation_warning)) { + deprecation_warning = NULL; + } if (deprecation_warning) { if(!cJSON_IsString(deprecation_warning) && !cJSON_IsNull(deprecation_warning)) { @@ -248,6 +285,9 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -260,12 +300,18 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->schema cJSON *schema = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "schema"); + if (cJSON_IsNull(schema)) { + schema = NULL; + } if (schema) { schema_local_nonprim = v1_custom_resource_validation_parseFromJSON(schema); //nonprimitive } // v1_custom_resource_definition_version->selectable_fields cJSON *selectable_fields = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "selectableFields"); + if (cJSON_IsNull(selectable_fields)) { + selectable_fields = NULL; + } if (selectable_fields) { cJSON *selectable_fields_local_nonprimitive = NULL; if(!cJSON_IsArray(selectable_fields)){ @@ -287,6 +333,9 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->served cJSON *served = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "served"); + if (cJSON_IsNull(served)) { + served = NULL; + } if (!served) { goto end; } @@ -299,6 +348,9 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->storage cJSON *storage = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "storage"); + if (cJSON_IsNull(storage)) { + storage = NULL; + } if (!storage) { goto end; } @@ -311,12 +363,15 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->subresources cJSON *subresources = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "subresources"); + if (cJSON_IsNull(subresources)) { + subresources = NULL; + } if (subresources) { subresources_local_nonprim = v1_custom_resource_subresources_parseFromJSON(subresources); //nonprimitive } - v1_custom_resource_definition_version_local_var = v1_custom_resource_definition_version_create ( + v1_custom_resource_definition_version_local_var = v1_custom_resource_definition_version_create_internal ( additional_printer_columns ? additional_printer_columnsList : NULL, deprecated ? deprecated->valueint : 0, deprecation_warning && !cJSON_IsNull(deprecation_warning) ? strdup(deprecation_warning->valuestring) : NULL, diff --git a/kubernetes/model/v1_custom_resource_definition_version.h b/kubernetes/model/v1_custom_resource_definition_version.h index 8b2460c8..abdac4f5 100644 --- a/kubernetes/model/v1_custom_resource_definition_version.h +++ b/kubernetes/model/v1_custom_resource_definition_version.h @@ -33,9 +33,10 @@ typedef struct v1_custom_resource_definition_version_t { int storage; //boolean struct v1_custom_resource_subresources_t *subresources; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_definition_version_t; -v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_create( +__attribute__((deprecated)) v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_create( list_t *additional_printer_columns, int deprecated, char *deprecation_warning, diff --git a/kubernetes/model/v1_custom_resource_subresource_scale.c b/kubernetes/model/v1_custom_resource_subresource_scale.c index 227174e5..927b61f1 100644 --- a/kubernetes/model/v1_custom_resource_subresource_scale.c +++ b/kubernetes/model/v1_custom_resource_subresource_scale.c @@ -5,7 +5,7 @@ -v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_create( +static v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_create_internal( char *label_selector_path, char *spec_replicas_path, char *status_replicas_path @@ -18,14 +18,30 @@ v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_cre v1_custom_resource_subresource_scale_local_var->spec_replicas_path = spec_replicas_path; v1_custom_resource_subresource_scale_local_var->status_replicas_path = status_replicas_path; + v1_custom_resource_subresource_scale_local_var->_library_owned = 1; return v1_custom_resource_subresource_scale_local_var; } +__attribute__((deprecated)) v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_create( + char *label_selector_path, + char *spec_replicas_path, + char *status_replicas_path + ) { + return v1_custom_resource_subresource_scale_create_internal ( + label_selector_path, + spec_replicas_path, + status_replicas_path + ); +} void v1_custom_resource_subresource_scale_free(v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale) { if(NULL == v1_custom_resource_subresource_scale){ return ; } + if(v1_custom_resource_subresource_scale->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_subresource_scale_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_subresource_scale->label_selector_path) { free(v1_custom_resource_subresource_scale->label_selector_path); @@ -84,6 +100,9 @@ v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_par // v1_custom_resource_subresource_scale->label_selector_path cJSON *label_selector_path = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_subresource_scaleJSON, "labelSelectorPath"); + if (cJSON_IsNull(label_selector_path)) { + label_selector_path = NULL; + } if (label_selector_path) { if(!cJSON_IsString(label_selector_path) && !cJSON_IsNull(label_selector_path)) { @@ -93,6 +112,9 @@ v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_par // v1_custom_resource_subresource_scale->spec_replicas_path cJSON *spec_replicas_path = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_subresource_scaleJSON, "specReplicasPath"); + if (cJSON_IsNull(spec_replicas_path)) { + spec_replicas_path = NULL; + } if (!spec_replicas_path) { goto end; } @@ -105,6 +127,9 @@ v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_par // v1_custom_resource_subresource_scale->status_replicas_path cJSON *status_replicas_path = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_subresource_scaleJSON, "statusReplicasPath"); + if (cJSON_IsNull(status_replicas_path)) { + status_replicas_path = NULL; + } if (!status_replicas_path) { goto end; } @@ -116,7 +141,7 @@ v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_par } - v1_custom_resource_subresource_scale_local_var = v1_custom_resource_subresource_scale_create ( + v1_custom_resource_subresource_scale_local_var = v1_custom_resource_subresource_scale_create_internal ( label_selector_path && !cJSON_IsNull(label_selector_path) ? strdup(label_selector_path->valuestring) : NULL, strdup(spec_replicas_path->valuestring), strdup(status_replicas_path->valuestring) diff --git a/kubernetes/model/v1_custom_resource_subresource_scale.h b/kubernetes/model/v1_custom_resource_subresource_scale.h index 91bd549e..325b07ce 100644 --- a/kubernetes/model/v1_custom_resource_subresource_scale.h +++ b/kubernetes/model/v1_custom_resource_subresource_scale.h @@ -23,9 +23,10 @@ typedef struct v1_custom_resource_subresource_scale_t { char *spec_replicas_path; // string char *status_replicas_path; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_subresource_scale_t; -v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_create( +__attribute__((deprecated)) v1_custom_resource_subresource_scale_t *v1_custom_resource_subresource_scale_create( char *label_selector_path, char *spec_replicas_path, char *status_replicas_path diff --git a/kubernetes/model/v1_custom_resource_subresources.c b/kubernetes/model/v1_custom_resource_subresources.c index 05f30eae..887e10fb 100644 --- a/kubernetes/model/v1_custom_resource_subresources.c +++ b/kubernetes/model/v1_custom_resource_subresources.c @@ -5,7 +5,7 @@ -v1_custom_resource_subresources_t *v1_custom_resource_subresources_create( +static v1_custom_resource_subresources_t *v1_custom_resource_subresources_create_internal( v1_custom_resource_subresource_scale_t *scale, object_t *status ) { @@ -16,14 +16,28 @@ v1_custom_resource_subresources_t *v1_custom_resource_subresources_create( v1_custom_resource_subresources_local_var->scale = scale; v1_custom_resource_subresources_local_var->status = status; + v1_custom_resource_subresources_local_var->_library_owned = 1; return v1_custom_resource_subresources_local_var; } +__attribute__((deprecated)) v1_custom_resource_subresources_t *v1_custom_resource_subresources_create( + v1_custom_resource_subresource_scale_t *scale, + object_t *status + ) { + return v1_custom_resource_subresources_create_internal ( + scale, + status + ); +} void v1_custom_resource_subresources_free(v1_custom_resource_subresources_t *v1_custom_resource_subresources) { if(NULL == v1_custom_resource_subresources){ return ; } + if(v1_custom_resource_subresources->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_subresources_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_subresources->scale) { v1_custom_resource_subresource_scale_free(v1_custom_resource_subresources->scale); @@ -81,19 +95,25 @@ v1_custom_resource_subresources_t *v1_custom_resource_subresources_parseFromJSON // v1_custom_resource_subresources->scale cJSON *scale = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_subresourcesJSON, "scale"); + if (cJSON_IsNull(scale)) { + scale = NULL; + } if (scale) { scale_local_nonprim = v1_custom_resource_subresource_scale_parseFromJSON(scale); //nonprimitive } // v1_custom_resource_subresources->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_subresourcesJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } object_t *status_local_object = NULL; if (status) { status_local_object = object_parseFromJSON(status); //object } - v1_custom_resource_subresources_local_var = v1_custom_resource_subresources_create ( + v1_custom_resource_subresources_local_var = v1_custom_resource_subresources_create_internal ( scale ? scale_local_nonprim : NULL, status ? status_local_object : NULL ); diff --git a/kubernetes/model/v1_custom_resource_subresources.h b/kubernetes/model/v1_custom_resource_subresources.h index ee1d9acf..bca977e2 100644 --- a/kubernetes/model/v1_custom_resource_subresources.h +++ b/kubernetes/model/v1_custom_resource_subresources.h @@ -24,9 +24,10 @@ typedef struct v1_custom_resource_subresources_t { struct v1_custom_resource_subresource_scale_t *scale; //model object_t *status; //object + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_subresources_t; -v1_custom_resource_subresources_t *v1_custom_resource_subresources_create( +__attribute__((deprecated)) v1_custom_resource_subresources_t *v1_custom_resource_subresources_create( v1_custom_resource_subresource_scale_t *scale, object_t *status ); diff --git a/kubernetes/model/v1_custom_resource_validation.c b/kubernetes/model/v1_custom_resource_validation.c index ddf113a6..6c156014 100644 --- a/kubernetes/model/v1_custom_resource_validation.c +++ b/kubernetes/model/v1_custom_resource_validation.c @@ -5,7 +5,7 @@ -v1_custom_resource_validation_t *v1_custom_resource_validation_create( +static v1_custom_resource_validation_t *v1_custom_resource_validation_create_internal( v1_json_schema_props_t *open_apiv3_schema ) { v1_custom_resource_validation_t *v1_custom_resource_validation_local_var = malloc(sizeof(v1_custom_resource_validation_t)); @@ -14,14 +14,26 @@ v1_custom_resource_validation_t *v1_custom_resource_validation_create( } v1_custom_resource_validation_local_var->open_apiv3_schema = open_apiv3_schema; + v1_custom_resource_validation_local_var->_library_owned = 1; return v1_custom_resource_validation_local_var; } +__attribute__((deprecated)) v1_custom_resource_validation_t *v1_custom_resource_validation_create( + v1_json_schema_props_t *open_apiv3_schema + ) { + return v1_custom_resource_validation_create_internal ( + open_apiv3_schema + ); +} void v1_custom_resource_validation_free(v1_custom_resource_validation_t *v1_custom_resource_validation) { if(NULL == v1_custom_resource_validation){ return ; } + if(v1_custom_resource_validation->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_custom_resource_validation_free"); + return ; + } listEntry_t *listEntry; if (v1_custom_resource_validation->open_apiv3_schema) { v1_json_schema_props_free(v1_custom_resource_validation->open_apiv3_schema); @@ -62,12 +74,15 @@ v1_custom_resource_validation_t *v1_custom_resource_validation_parseFromJSON(cJS // v1_custom_resource_validation->open_apiv3_schema cJSON *open_apiv3_schema = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_validationJSON, "openAPIV3Schema"); + if (cJSON_IsNull(open_apiv3_schema)) { + open_apiv3_schema = NULL; + } if (open_apiv3_schema) { open_apiv3_schema_local_nonprim = v1_json_schema_props_parseFromJSON(open_apiv3_schema); //nonprimitive } - v1_custom_resource_validation_local_var = v1_custom_resource_validation_create ( + v1_custom_resource_validation_local_var = v1_custom_resource_validation_create_internal ( open_apiv3_schema ? open_apiv3_schema_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_custom_resource_validation.h b/kubernetes/model/v1_custom_resource_validation.h index 8701611b..c90539d9 100644 --- a/kubernetes/model/v1_custom_resource_validation.h +++ b/kubernetes/model/v1_custom_resource_validation.h @@ -22,9 +22,10 @@ typedef struct v1_custom_resource_validation_t v1_custom_resource_validation_t; typedef struct v1_custom_resource_validation_t { struct v1_json_schema_props_t *open_apiv3_schema; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_custom_resource_validation_t; -v1_custom_resource_validation_t *v1_custom_resource_validation_create( +__attribute__((deprecated)) v1_custom_resource_validation_t *v1_custom_resource_validation_create( v1_json_schema_props_t *open_apiv3_schema ); diff --git a/kubernetes/model/v1_daemon_endpoint.c b/kubernetes/model/v1_daemon_endpoint.c index 07ac71ff..343632d8 100644 --- a/kubernetes/model/v1_daemon_endpoint.c +++ b/kubernetes/model/v1_daemon_endpoint.c @@ -5,7 +5,7 @@ -v1_daemon_endpoint_t *v1_daemon_endpoint_create( +static v1_daemon_endpoint_t *v1_daemon_endpoint_create_internal( int port ) { v1_daemon_endpoint_t *v1_daemon_endpoint_local_var = malloc(sizeof(v1_daemon_endpoint_t)); @@ -14,14 +14,26 @@ v1_daemon_endpoint_t *v1_daemon_endpoint_create( } v1_daemon_endpoint_local_var->port = port; + v1_daemon_endpoint_local_var->_library_owned = 1; return v1_daemon_endpoint_local_var; } +__attribute__((deprecated)) v1_daemon_endpoint_t *v1_daemon_endpoint_create( + int port + ) { + return v1_daemon_endpoint_create_internal ( + port + ); +} void v1_daemon_endpoint_free(v1_daemon_endpoint_t *v1_daemon_endpoint) { if(NULL == v1_daemon_endpoint){ return ; } + if(v1_daemon_endpoint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_daemon_endpoint_free"); + return ; + } listEntry_t *listEntry; free(v1_daemon_endpoint); } @@ -51,6 +63,9 @@ v1_daemon_endpoint_t *v1_daemon_endpoint_parseFromJSON(cJSON *v1_daemon_endpoint // v1_daemon_endpoint->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_daemon_endpointJSON, "Port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -62,7 +77,7 @@ v1_daemon_endpoint_t *v1_daemon_endpoint_parseFromJSON(cJSON *v1_daemon_endpoint } - v1_daemon_endpoint_local_var = v1_daemon_endpoint_create ( + v1_daemon_endpoint_local_var = v1_daemon_endpoint_create_internal ( port->valuedouble ); diff --git a/kubernetes/model/v1_daemon_endpoint.h b/kubernetes/model/v1_daemon_endpoint.h index 5c88a426..71779801 100644 --- a/kubernetes/model/v1_daemon_endpoint.h +++ b/kubernetes/model/v1_daemon_endpoint.h @@ -21,9 +21,10 @@ typedef struct v1_daemon_endpoint_t v1_daemon_endpoint_t; typedef struct v1_daemon_endpoint_t { int port; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_daemon_endpoint_t; -v1_daemon_endpoint_t *v1_daemon_endpoint_create( +__attribute__((deprecated)) v1_daemon_endpoint_t *v1_daemon_endpoint_create( int port ); diff --git a/kubernetes/model/v1_daemon_set.c b/kubernetes/model/v1_daemon_set.c index 7b74f53c..d1af25ac 100644 --- a/kubernetes/model/v1_daemon_set.c +++ b/kubernetes/model/v1_daemon_set.c @@ -5,7 +5,7 @@ -v1_daemon_set_t *v1_daemon_set_create( +static v1_daemon_set_t *v1_daemon_set_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_daemon_set_t *v1_daemon_set_create( v1_daemon_set_local_var->spec = spec; v1_daemon_set_local_var->status = status; + v1_daemon_set_local_var->_library_owned = 1; return v1_daemon_set_local_var; } +__attribute__((deprecated)) v1_daemon_set_t *v1_daemon_set_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_daemon_set_spec_t *spec, + v1_daemon_set_status_t *status + ) { + return v1_daemon_set_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_daemon_set_free(v1_daemon_set_t *v1_daemon_set) { if(NULL == v1_daemon_set){ return ; } + if(v1_daemon_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_daemon_set_free"); + return ; + } listEntry_t *listEntry; if (v1_daemon_set->api_version) { free(v1_daemon_set->api_version); @@ -134,6 +154,9 @@ v1_daemon_set_t *v1_daemon_set_parseFromJSON(cJSON *v1_daemon_setJSON){ // v1_daemon_set->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_daemon_setJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_daemon_set_t *v1_daemon_set_parseFromJSON(cJSON *v1_daemon_setJSON){ // v1_daemon_set->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_daemon_setJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_daemon_set_t *v1_daemon_set_parseFromJSON(cJSON *v1_daemon_setJSON){ // v1_daemon_set->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_daemon_setJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_daemon_set->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_daemon_setJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_daemon_set_spec_parseFromJSON(spec); //nonprimitive } // v1_daemon_set->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_daemon_setJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_daemon_set_status_parseFromJSON(status); //nonprimitive } - v1_daemon_set_local_var = v1_daemon_set_create ( + v1_daemon_set_local_var = v1_daemon_set_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_daemon_set.h b/kubernetes/model/v1_daemon_set.h index 9b13092e..af3242f0 100644 --- a/kubernetes/model/v1_daemon_set.h +++ b/kubernetes/model/v1_daemon_set.h @@ -28,9 +28,10 @@ typedef struct v1_daemon_set_t { struct v1_daemon_set_spec_t *spec; //model struct v1_daemon_set_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_daemon_set_t; -v1_daemon_set_t *v1_daemon_set_create( +__attribute__((deprecated)) v1_daemon_set_t *v1_daemon_set_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_daemon_set_condition.c b/kubernetes/model/v1_daemon_set_condition.c index 0fa723b5..0d7ee854 100644 --- a/kubernetes/model/v1_daemon_set_condition.c +++ b/kubernetes/model/v1_daemon_set_condition.c @@ -5,7 +5,7 @@ -v1_daemon_set_condition_t *v1_daemon_set_condition_create( +static v1_daemon_set_condition_t *v1_daemon_set_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_daemon_set_condition_t *v1_daemon_set_condition_create( v1_daemon_set_condition_local_var->status = status; v1_daemon_set_condition_local_var->type = type; + v1_daemon_set_condition_local_var->_library_owned = 1; return v1_daemon_set_condition_local_var; } +__attribute__((deprecated)) v1_daemon_set_condition_t *v1_daemon_set_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_daemon_set_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_daemon_set_condition_free(v1_daemon_set_condition_t *v1_daemon_set_condition) { if(NULL == v1_daemon_set_condition){ return ; } + if(v1_daemon_set_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_daemon_set_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_daemon_set_condition->last_transition_time) { free(v1_daemon_set_condition->last_transition_time); @@ -112,6 +132,9 @@ v1_daemon_set_condition_t *v1_daemon_set_condition_parseFromJSON(cJSON *v1_daemo // v1_daemon_set_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v1_daemon_set_condition_t *v1_daemon_set_condition_parseFromJSON(cJSON *v1_daemo // v1_daemon_set_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1_daemon_set_condition_t *v1_daemon_set_condition_parseFromJSON(cJSON *v1_daemo // v1_daemon_set_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1_daemon_set_condition_t *v1_daemon_set_condition_parseFromJSON(cJSON *v1_daemo // v1_daemon_set_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1_daemon_set_condition_t *v1_daemon_set_condition_parseFromJSON(cJSON *v1_daemo // v1_daemon_set_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1_daemon_set_condition_t *v1_daemon_set_condition_parseFromJSON(cJSON *v1_daemo } - v1_daemon_set_condition_local_var = v1_daemon_set_condition_create ( + v1_daemon_set_condition_local_var = v1_daemon_set_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_daemon_set_condition.h b/kubernetes/model/v1_daemon_set_condition.h index b6eee177..efb45488 100644 --- a/kubernetes/model/v1_daemon_set_condition.h +++ b/kubernetes/model/v1_daemon_set_condition.h @@ -25,9 +25,10 @@ typedef struct v1_daemon_set_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_daemon_set_condition_t; -v1_daemon_set_condition_t *v1_daemon_set_condition_create( +__attribute__((deprecated)) v1_daemon_set_condition_t *v1_daemon_set_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_daemon_set_list.c b/kubernetes/model/v1_daemon_set_list.c index 0b43b4fc..2a2350e9 100644 --- a/kubernetes/model/v1_daemon_set_list.c +++ b/kubernetes/model/v1_daemon_set_list.c @@ -5,7 +5,7 @@ -v1_daemon_set_list_t *v1_daemon_set_list_create( +static v1_daemon_set_list_t *v1_daemon_set_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_daemon_set_list_t *v1_daemon_set_list_create( v1_daemon_set_list_local_var->kind = kind; v1_daemon_set_list_local_var->metadata = metadata; + v1_daemon_set_list_local_var->_library_owned = 1; return v1_daemon_set_list_local_var; } +__attribute__((deprecated)) v1_daemon_set_list_t *v1_daemon_set_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_daemon_set_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_daemon_set_list_free(v1_daemon_set_list_t *v1_daemon_set_list) { if(NULL == v1_daemon_set_list){ return ; } + if(v1_daemon_set_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_daemon_set_list_free"); + return ; + } listEntry_t *listEntry; if (v1_daemon_set_list->api_version) { free(v1_daemon_set_list->api_version); @@ -123,6 +141,9 @@ v1_daemon_set_list_t *v1_daemon_set_list_parseFromJSON(cJSON *v1_daemon_set_list // v1_daemon_set_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_daemon_set_list_t *v1_daemon_set_list_parseFromJSON(cJSON *v1_daemon_set_list // v1_daemon_set_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_daemon_set_list_t *v1_daemon_set_list_parseFromJSON(cJSON *v1_daemon_set_list // v1_daemon_set_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_daemon_set_list_t *v1_daemon_set_list_parseFromJSON(cJSON *v1_daemon_set_list // v1_daemon_set_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_daemon_set_list_local_var = v1_daemon_set_list_create ( + v1_daemon_set_list_local_var = v1_daemon_set_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_daemon_set_list.h b/kubernetes/model/v1_daemon_set_list.h index af594964..451aabb2 100644 --- a/kubernetes/model/v1_daemon_set_list.h +++ b/kubernetes/model/v1_daemon_set_list.h @@ -26,9 +26,10 @@ typedef struct v1_daemon_set_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_daemon_set_list_t; -v1_daemon_set_list_t *v1_daemon_set_list_create( +__attribute__((deprecated)) v1_daemon_set_list_t *v1_daemon_set_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_daemon_set_spec.c b/kubernetes/model/v1_daemon_set_spec.c index 0ba89a8b..44d42c1d 100644 --- a/kubernetes/model/v1_daemon_set_spec.c +++ b/kubernetes/model/v1_daemon_set_spec.c @@ -5,7 +5,7 @@ -v1_daemon_set_spec_t *v1_daemon_set_spec_create( +static v1_daemon_set_spec_t *v1_daemon_set_spec_create_internal( int min_ready_seconds, int revision_history_limit, v1_label_selector_t *selector, @@ -22,14 +22,34 @@ v1_daemon_set_spec_t *v1_daemon_set_spec_create( v1_daemon_set_spec_local_var->_template = _template; v1_daemon_set_spec_local_var->update_strategy = update_strategy; + v1_daemon_set_spec_local_var->_library_owned = 1; return v1_daemon_set_spec_local_var; } +__attribute__((deprecated)) v1_daemon_set_spec_t *v1_daemon_set_spec_create( + int min_ready_seconds, + int revision_history_limit, + v1_label_selector_t *selector, + v1_pod_template_spec_t *_template, + v1_daemon_set_update_strategy_t *update_strategy + ) { + return v1_daemon_set_spec_create_internal ( + min_ready_seconds, + revision_history_limit, + selector, + _template, + update_strategy + ); +} void v1_daemon_set_spec_free(v1_daemon_set_spec_t *v1_daemon_set_spec) { if(NULL == v1_daemon_set_spec){ return ; } + if(v1_daemon_set_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_daemon_set_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_daemon_set_spec->selector) { v1_label_selector_free(v1_daemon_set_spec->selector); @@ -128,6 +148,9 @@ v1_daemon_set_spec_t *v1_daemon_set_spec_parseFromJSON(cJSON *v1_daemon_set_spec // v1_daemon_set_spec->min_ready_seconds cJSON *min_ready_seconds = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_specJSON, "minReadySeconds"); + if (cJSON_IsNull(min_ready_seconds)) { + min_ready_seconds = NULL; + } if (min_ready_seconds) { if(!cJSON_IsNumber(min_ready_seconds)) { @@ -137,6 +160,9 @@ v1_daemon_set_spec_t *v1_daemon_set_spec_parseFromJSON(cJSON *v1_daemon_set_spec // v1_daemon_set_spec->revision_history_limit cJSON *revision_history_limit = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_specJSON, "revisionHistoryLimit"); + if (cJSON_IsNull(revision_history_limit)) { + revision_history_limit = NULL; + } if (revision_history_limit) { if(!cJSON_IsNumber(revision_history_limit)) { @@ -146,6 +172,9 @@ v1_daemon_set_spec_t *v1_daemon_set_spec_parseFromJSON(cJSON *v1_daemon_set_spec // v1_daemon_set_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (!selector) { goto end; } @@ -155,6 +184,9 @@ v1_daemon_set_spec_t *v1_daemon_set_spec_parseFromJSON(cJSON *v1_daemon_set_spec // v1_daemon_set_spec->_template cJSON *_template = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_specJSON, "template"); + if (cJSON_IsNull(_template)) { + _template = NULL; + } if (!_template) { goto end; } @@ -164,12 +196,15 @@ v1_daemon_set_spec_t *v1_daemon_set_spec_parseFromJSON(cJSON *v1_daemon_set_spec // v1_daemon_set_spec->update_strategy cJSON *update_strategy = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_specJSON, "updateStrategy"); + if (cJSON_IsNull(update_strategy)) { + update_strategy = NULL; + } if (update_strategy) { update_strategy_local_nonprim = v1_daemon_set_update_strategy_parseFromJSON(update_strategy); //nonprimitive } - v1_daemon_set_spec_local_var = v1_daemon_set_spec_create ( + v1_daemon_set_spec_local_var = v1_daemon_set_spec_create_internal ( min_ready_seconds ? min_ready_seconds->valuedouble : 0, revision_history_limit ? revision_history_limit->valuedouble : 0, selector_local_nonprim, diff --git a/kubernetes/model/v1_daemon_set_spec.h b/kubernetes/model/v1_daemon_set_spec.h index 339b8a41..d8833b99 100644 --- a/kubernetes/model/v1_daemon_set_spec.h +++ b/kubernetes/model/v1_daemon_set_spec.h @@ -28,9 +28,10 @@ typedef struct v1_daemon_set_spec_t { struct v1_pod_template_spec_t *_template; //model struct v1_daemon_set_update_strategy_t *update_strategy; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_daemon_set_spec_t; -v1_daemon_set_spec_t *v1_daemon_set_spec_create( +__attribute__((deprecated)) v1_daemon_set_spec_t *v1_daemon_set_spec_create( int min_ready_seconds, int revision_history_limit, v1_label_selector_t *selector, diff --git a/kubernetes/model/v1_daemon_set_status.c b/kubernetes/model/v1_daemon_set_status.c index 84b469c5..c7116961 100644 --- a/kubernetes/model/v1_daemon_set_status.c +++ b/kubernetes/model/v1_daemon_set_status.c @@ -5,7 +5,7 @@ -v1_daemon_set_status_t *v1_daemon_set_status_create( +static v1_daemon_set_status_t *v1_daemon_set_status_create_internal( int collision_count, list_t *conditions, int current_number_scheduled, @@ -32,14 +32,44 @@ v1_daemon_set_status_t *v1_daemon_set_status_create( v1_daemon_set_status_local_var->observed_generation = observed_generation; v1_daemon_set_status_local_var->updated_number_scheduled = updated_number_scheduled; + v1_daemon_set_status_local_var->_library_owned = 1; return v1_daemon_set_status_local_var; } +__attribute__((deprecated)) v1_daemon_set_status_t *v1_daemon_set_status_create( + int collision_count, + list_t *conditions, + int current_number_scheduled, + int desired_number_scheduled, + int number_available, + int number_misscheduled, + int number_ready, + int number_unavailable, + long observed_generation, + int updated_number_scheduled + ) { + return v1_daemon_set_status_create_internal ( + collision_count, + conditions, + current_number_scheduled, + desired_number_scheduled, + number_available, + number_misscheduled, + number_ready, + number_unavailable, + observed_generation, + updated_number_scheduled + ); +} void v1_daemon_set_status_free(v1_daemon_set_status_t *v1_daemon_set_status) { if(NULL == v1_daemon_set_status){ return ; } + if(v1_daemon_set_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_daemon_set_status_free"); + return ; + } listEntry_t *listEntry; if (v1_daemon_set_status->conditions) { list_ForEach(listEntry, v1_daemon_set_status->conditions) { @@ -166,6 +196,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->collision_count cJSON *collision_count = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "collisionCount"); + if (cJSON_IsNull(collision_count)) { + collision_count = NULL; + } if (collision_count) { if(!cJSON_IsNumber(collision_count)) { @@ -175,6 +208,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -196,6 +232,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->current_number_scheduled cJSON *current_number_scheduled = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "currentNumberScheduled"); + if (cJSON_IsNull(current_number_scheduled)) { + current_number_scheduled = NULL; + } if (!current_number_scheduled) { goto end; } @@ -208,6 +247,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->desired_number_scheduled cJSON *desired_number_scheduled = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "desiredNumberScheduled"); + if (cJSON_IsNull(desired_number_scheduled)) { + desired_number_scheduled = NULL; + } if (!desired_number_scheduled) { goto end; } @@ -220,6 +262,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->number_available cJSON *number_available = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "numberAvailable"); + if (cJSON_IsNull(number_available)) { + number_available = NULL; + } if (number_available) { if(!cJSON_IsNumber(number_available)) { @@ -229,6 +274,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->number_misscheduled cJSON *number_misscheduled = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "numberMisscheduled"); + if (cJSON_IsNull(number_misscheduled)) { + number_misscheduled = NULL; + } if (!number_misscheduled) { goto end; } @@ -241,6 +289,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->number_ready cJSON *number_ready = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "numberReady"); + if (cJSON_IsNull(number_ready)) { + number_ready = NULL; + } if (!number_ready) { goto end; } @@ -253,6 +304,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->number_unavailable cJSON *number_unavailable = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "numberUnavailable"); + if (cJSON_IsNull(number_unavailable)) { + number_unavailable = NULL; + } if (number_unavailable) { if(!cJSON_IsNumber(number_unavailable)) { @@ -262,6 +316,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -271,6 +328,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->updated_number_scheduled cJSON *updated_number_scheduled = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "updatedNumberScheduled"); + if (cJSON_IsNull(updated_number_scheduled)) { + updated_number_scheduled = NULL; + } if (updated_number_scheduled) { if(!cJSON_IsNumber(updated_number_scheduled)) { @@ -279,7 +339,7 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ } - v1_daemon_set_status_local_var = v1_daemon_set_status_create ( + v1_daemon_set_status_local_var = v1_daemon_set_status_create_internal ( collision_count ? collision_count->valuedouble : 0, conditions ? conditionsList : NULL, current_number_scheduled->valuedouble, diff --git a/kubernetes/model/v1_daemon_set_status.h b/kubernetes/model/v1_daemon_set_status.h index e53b0a67..3a54e754 100644 --- a/kubernetes/model/v1_daemon_set_status.h +++ b/kubernetes/model/v1_daemon_set_status.h @@ -31,9 +31,10 @@ typedef struct v1_daemon_set_status_t { long observed_generation; //numeric int updated_number_scheduled; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_daemon_set_status_t; -v1_daemon_set_status_t *v1_daemon_set_status_create( +__attribute__((deprecated)) v1_daemon_set_status_t *v1_daemon_set_status_create( int collision_count, list_t *conditions, int current_number_scheduled, diff --git a/kubernetes/model/v1_daemon_set_update_strategy.c b/kubernetes/model/v1_daemon_set_update_strategy.c index 22e54f50..b3a3efdb 100644 --- a/kubernetes/model/v1_daemon_set_update_strategy.c +++ b/kubernetes/model/v1_daemon_set_update_strategy.c @@ -5,7 +5,7 @@ -v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_create( +static v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_create_internal( v1_rolling_update_daemon_set_t *rolling_update, char *type ) { @@ -16,14 +16,28 @@ v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_create( v1_daemon_set_update_strategy_local_var->rolling_update = rolling_update; v1_daemon_set_update_strategy_local_var->type = type; + v1_daemon_set_update_strategy_local_var->_library_owned = 1; return v1_daemon_set_update_strategy_local_var; } +__attribute__((deprecated)) v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_create( + v1_rolling_update_daemon_set_t *rolling_update, + char *type + ) { + return v1_daemon_set_update_strategy_create_internal ( + rolling_update, + type + ); +} void v1_daemon_set_update_strategy_free(v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy) { if(NULL == v1_daemon_set_update_strategy){ return ; } + if(v1_daemon_set_update_strategy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_daemon_set_update_strategy_free"); + return ; + } listEntry_t *listEntry; if (v1_daemon_set_update_strategy->rolling_update) { v1_rolling_update_daemon_set_free(v1_daemon_set_update_strategy->rolling_update); @@ -76,12 +90,18 @@ v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_parseFromJSON(cJS // v1_daemon_set_update_strategy->rolling_update cJSON *rolling_update = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_update_strategyJSON, "rollingUpdate"); + if (cJSON_IsNull(rolling_update)) { + rolling_update = NULL; + } if (rolling_update) { rolling_update_local_nonprim = v1_rolling_update_daemon_set_parseFromJSON(rolling_update); //nonprimitive } // v1_daemon_set_update_strategy->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_update_strategyJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -90,7 +110,7 @@ v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_parseFromJSON(cJS } - v1_daemon_set_update_strategy_local_var = v1_daemon_set_update_strategy_create ( + v1_daemon_set_update_strategy_local_var = v1_daemon_set_update_strategy_create_internal ( rolling_update ? rolling_update_local_nonprim : NULL, type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL ); diff --git a/kubernetes/model/v1_daemon_set_update_strategy.h b/kubernetes/model/v1_daemon_set_update_strategy.h index 3fa6c847..3496d2a9 100644 --- a/kubernetes/model/v1_daemon_set_update_strategy.h +++ b/kubernetes/model/v1_daemon_set_update_strategy.h @@ -23,9 +23,10 @@ typedef struct v1_daemon_set_update_strategy_t { struct v1_rolling_update_daemon_set_t *rolling_update; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_daemon_set_update_strategy_t; -v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_create( +__attribute__((deprecated)) v1_daemon_set_update_strategy_t *v1_daemon_set_update_strategy_create( v1_rolling_update_daemon_set_t *rolling_update, char *type ); diff --git a/kubernetes/model/v1_delete_options.c b/kubernetes/model/v1_delete_options.c index 7d6e6910..1aa1205c 100644 --- a/kubernetes/model/v1_delete_options.c +++ b/kubernetes/model/v1_delete_options.c @@ -5,10 +5,11 @@ -v1_delete_options_t *v1_delete_options_create( +static v1_delete_options_t *v1_delete_options_create_internal( char *api_version, list_t *dry_run, long grace_period_seconds, + int ignore_store_read_error_with_cluster_breaking_potential, char *kind, int orphan_dependents, v1_preconditions_t *preconditions, @@ -21,19 +22,46 @@ v1_delete_options_t *v1_delete_options_create( v1_delete_options_local_var->api_version = api_version; v1_delete_options_local_var->dry_run = dry_run; v1_delete_options_local_var->grace_period_seconds = grace_period_seconds; + v1_delete_options_local_var->ignore_store_read_error_with_cluster_breaking_potential = ignore_store_read_error_with_cluster_breaking_potential; v1_delete_options_local_var->kind = kind; v1_delete_options_local_var->orphan_dependents = orphan_dependents; v1_delete_options_local_var->preconditions = preconditions; v1_delete_options_local_var->propagation_policy = propagation_policy; + v1_delete_options_local_var->_library_owned = 1; return v1_delete_options_local_var; } +__attribute__((deprecated)) v1_delete_options_t *v1_delete_options_create( + char *api_version, + list_t *dry_run, + long grace_period_seconds, + int ignore_store_read_error_with_cluster_breaking_potential, + char *kind, + int orphan_dependents, + v1_preconditions_t *preconditions, + char *propagation_policy + ) { + return v1_delete_options_create_internal ( + api_version, + dry_run, + grace_period_seconds, + ignore_store_read_error_with_cluster_breaking_potential, + kind, + orphan_dependents, + preconditions, + propagation_policy + ); +} void v1_delete_options_free(v1_delete_options_t *v1_delete_options) { if(NULL == v1_delete_options){ return ; } + if(v1_delete_options->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_delete_options_free"); + return ; + } listEntry_t *listEntry; if (v1_delete_options->api_version) { free(v1_delete_options->api_version); @@ -81,7 +109,7 @@ cJSON *v1_delete_options_convertToJSON(v1_delete_options_t *v1_delete_options) { listEntry_t *dry_runListEntry; list_ForEach(dry_runListEntry, v1_delete_options->dry_run) { - if(cJSON_AddStringToObject(dry_run, "", (char*)dry_runListEntry->data) == NULL) + if(cJSON_AddStringToObject(dry_run, "", dry_runListEntry->data) == NULL) { goto fail; } @@ -97,6 +125,14 @@ cJSON *v1_delete_options_convertToJSON(v1_delete_options_t *v1_delete_options) { } + // v1_delete_options->ignore_store_read_error_with_cluster_breaking_potential + if(v1_delete_options->ignore_store_read_error_with_cluster_breaking_potential) { + if(cJSON_AddBoolToObject(item, "ignoreStoreReadErrorWithClusterBreakingPotential", v1_delete_options->ignore_store_read_error_with_cluster_breaking_potential) == NULL) { + goto fail; //Bool + } + } + + // v1_delete_options->kind if(v1_delete_options->kind) { if(cJSON_AddStringToObject(item, "kind", v1_delete_options->kind) == NULL) { @@ -153,6 +189,9 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO // v1_delete_options->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -162,6 +201,9 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO // v1_delete_options->dry_run cJSON *dry_run = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "dryRun"); + if (cJSON_IsNull(dry_run)) { + dry_run = NULL; + } if (dry_run) { cJSON *dry_run_local = NULL; if(!cJSON_IsArray(dry_run)) { @@ -181,6 +223,9 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO // v1_delete_options->grace_period_seconds cJSON *grace_period_seconds = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "gracePeriodSeconds"); + if (cJSON_IsNull(grace_period_seconds)) { + grace_period_seconds = NULL; + } if (grace_period_seconds) { if(!cJSON_IsNumber(grace_period_seconds)) { @@ -188,8 +233,23 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO } } + // v1_delete_options->ignore_store_read_error_with_cluster_breaking_potential + cJSON *ignore_store_read_error_with_cluster_breaking_potential = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "ignoreStoreReadErrorWithClusterBreakingPotential"); + if (cJSON_IsNull(ignore_store_read_error_with_cluster_breaking_potential)) { + ignore_store_read_error_with_cluster_breaking_potential = NULL; + } + if (ignore_store_read_error_with_cluster_breaking_potential) { + if(!cJSON_IsBool(ignore_store_read_error_with_cluster_breaking_potential)) + { + goto end; //Bool + } + } + // v1_delete_options->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -199,6 +259,9 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO // v1_delete_options->orphan_dependents cJSON *orphan_dependents = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "orphanDependents"); + if (cJSON_IsNull(orphan_dependents)) { + orphan_dependents = NULL; + } if (orphan_dependents) { if(!cJSON_IsBool(orphan_dependents)) { @@ -208,12 +271,18 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO // v1_delete_options->preconditions cJSON *preconditions = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "preconditions"); + if (cJSON_IsNull(preconditions)) { + preconditions = NULL; + } if (preconditions) { preconditions_local_nonprim = v1_preconditions_parseFromJSON(preconditions); //nonprimitive } // v1_delete_options->propagation_policy cJSON *propagation_policy = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "propagationPolicy"); + if (cJSON_IsNull(propagation_policy)) { + propagation_policy = NULL; + } if (propagation_policy) { if(!cJSON_IsString(propagation_policy) && !cJSON_IsNull(propagation_policy)) { @@ -222,10 +291,11 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO } - v1_delete_options_local_var = v1_delete_options_create ( + v1_delete_options_local_var = v1_delete_options_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, dry_run ? dry_runList : NULL, grace_period_seconds ? grace_period_seconds->valuedouble : 0, + ignore_store_read_error_with_cluster_breaking_potential ? ignore_store_read_error_with_cluster_breaking_potential->valueint : 0, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, orphan_dependents ? orphan_dependents->valueint : 0, preconditions ? preconditions_local_nonprim : NULL, diff --git a/kubernetes/model/v1_delete_options.h b/kubernetes/model/v1_delete_options.h index 04e06a86..8ceec981 100644 --- a/kubernetes/model/v1_delete_options.h +++ b/kubernetes/model/v1_delete_options.h @@ -23,17 +23,20 @@ typedef struct v1_delete_options_t { char *api_version; // string list_t *dry_run; //primitive container long grace_period_seconds; //numeric + int ignore_store_read_error_with_cluster_breaking_potential; //boolean char *kind; // string int orphan_dependents; //boolean struct v1_preconditions_t *preconditions; //model char *propagation_policy; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_delete_options_t; -v1_delete_options_t *v1_delete_options_create( +__attribute__((deprecated)) v1_delete_options_t *v1_delete_options_create( char *api_version, list_t *dry_run, long grace_period_seconds, + int ignore_store_read_error_with_cluster_breaking_potential, char *kind, int orphan_dependents, v1_preconditions_t *preconditions, diff --git a/kubernetes/model/v1_deployment.c b/kubernetes/model/v1_deployment.c index 9523acb8..2ad2f2f5 100644 --- a/kubernetes/model/v1_deployment.c +++ b/kubernetes/model/v1_deployment.c @@ -5,7 +5,7 @@ -v1_deployment_t *v1_deployment_create( +static v1_deployment_t *v1_deployment_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_deployment_t *v1_deployment_create( v1_deployment_local_var->spec = spec; v1_deployment_local_var->status = status; + v1_deployment_local_var->_library_owned = 1; return v1_deployment_local_var; } +__attribute__((deprecated)) v1_deployment_t *v1_deployment_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_deployment_spec_t *spec, + v1_deployment_status_t *status + ) { + return v1_deployment_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_deployment_free(v1_deployment_t *v1_deployment) { if(NULL == v1_deployment){ return ; } + if(v1_deployment->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_deployment_free"); + return ; + } listEntry_t *listEntry; if (v1_deployment->api_version) { free(v1_deployment->api_version); @@ -134,6 +154,9 @@ v1_deployment_t *v1_deployment_parseFromJSON(cJSON *v1_deploymentJSON){ // v1_deployment->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_deploymentJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_deployment_t *v1_deployment_parseFromJSON(cJSON *v1_deploymentJSON){ // v1_deployment->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_deploymentJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_deployment_t *v1_deployment_parseFromJSON(cJSON *v1_deploymentJSON){ // v1_deployment->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_deploymentJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_deployment->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_deploymentJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_deployment_spec_parseFromJSON(spec); //nonprimitive } // v1_deployment->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_deploymentJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_deployment_status_parseFromJSON(status); //nonprimitive } - v1_deployment_local_var = v1_deployment_create ( + v1_deployment_local_var = v1_deployment_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_deployment.h b/kubernetes/model/v1_deployment.h index 9d8ace50..b185890e 100644 --- a/kubernetes/model/v1_deployment.h +++ b/kubernetes/model/v1_deployment.h @@ -28,9 +28,10 @@ typedef struct v1_deployment_t { struct v1_deployment_spec_t *spec; //model struct v1_deployment_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_deployment_t; -v1_deployment_t *v1_deployment_create( +__attribute__((deprecated)) v1_deployment_t *v1_deployment_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_deployment_condition.c b/kubernetes/model/v1_deployment_condition.c index 29ef5ca6..a6cf6351 100644 --- a/kubernetes/model/v1_deployment_condition.c +++ b/kubernetes/model/v1_deployment_condition.c @@ -5,7 +5,7 @@ -v1_deployment_condition_t *v1_deployment_condition_create( +static v1_deployment_condition_t *v1_deployment_condition_create_internal( char *last_transition_time, char *last_update_time, char *message, @@ -24,14 +24,36 @@ v1_deployment_condition_t *v1_deployment_condition_create( v1_deployment_condition_local_var->status = status; v1_deployment_condition_local_var->type = type; + v1_deployment_condition_local_var->_library_owned = 1; return v1_deployment_condition_local_var; } +__attribute__((deprecated)) v1_deployment_condition_t *v1_deployment_condition_create( + char *last_transition_time, + char *last_update_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_deployment_condition_create_internal ( + last_transition_time, + last_update_time, + message, + reason, + status, + type + ); +} void v1_deployment_condition_free(v1_deployment_condition_t *v1_deployment_condition) { if(NULL == v1_deployment_condition){ return ; } + if(v1_deployment_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_deployment_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_deployment_condition->last_transition_time) { free(v1_deployment_condition->last_transition_time); @@ -126,6 +148,9 @@ v1_deployment_condition_t *v1_deployment_condition_parseFromJSON(cJSON *v1_deplo // v1_deployment_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_deployment_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -135,6 +160,9 @@ v1_deployment_condition_t *v1_deployment_condition_parseFromJSON(cJSON *v1_deplo // v1_deployment_condition->last_update_time cJSON *last_update_time = cJSON_GetObjectItemCaseSensitive(v1_deployment_conditionJSON, "lastUpdateTime"); + if (cJSON_IsNull(last_update_time)) { + last_update_time = NULL; + } if (last_update_time) { if(!cJSON_IsString(last_update_time) && !cJSON_IsNull(last_update_time)) { @@ -144,6 +172,9 @@ v1_deployment_condition_t *v1_deployment_condition_parseFromJSON(cJSON *v1_deplo // v1_deployment_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_deployment_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -153,6 +184,9 @@ v1_deployment_condition_t *v1_deployment_condition_parseFromJSON(cJSON *v1_deplo // v1_deployment_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_deployment_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -162,6 +196,9 @@ v1_deployment_condition_t *v1_deployment_condition_parseFromJSON(cJSON *v1_deplo // v1_deployment_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_deployment_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -174,6 +211,9 @@ v1_deployment_condition_t *v1_deployment_condition_parseFromJSON(cJSON *v1_deplo // v1_deployment_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_deployment_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -185,7 +225,7 @@ v1_deployment_condition_t *v1_deployment_condition_parseFromJSON(cJSON *v1_deplo } - v1_deployment_condition_local_var = v1_deployment_condition_create ( + v1_deployment_condition_local_var = v1_deployment_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, last_update_time && !cJSON_IsNull(last_update_time) ? strdup(last_update_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, diff --git a/kubernetes/model/v1_deployment_condition.h b/kubernetes/model/v1_deployment_condition.h index 1d79b7e9..82f4caa5 100644 --- a/kubernetes/model/v1_deployment_condition.h +++ b/kubernetes/model/v1_deployment_condition.h @@ -26,9 +26,10 @@ typedef struct v1_deployment_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_deployment_condition_t; -v1_deployment_condition_t *v1_deployment_condition_create( +__attribute__((deprecated)) v1_deployment_condition_t *v1_deployment_condition_create( char *last_transition_time, char *last_update_time, char *message, diff --git a/kubernetes/model/v1_deployment_list.c b/kubernetes/model/v1_deployment_list.c index f5770943..eec59c67 100644 --- a/kubernetes/model/v1_deployment_list.c +++ b/kubernetes/model/v1_deployment_list.c @@ -5,7 +5,7 @@ -v1_deployment_list_t *v1_deployment_list_create( +static v1_deployment_list_t *v1_deployment_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_deployment_list_t *v1_deployment_list_create( v1_deployment_list_local_var->kind = kind; v1_deployment_list_local_var->metadata = metadata; + v1_deployment_list_local_var->_library_owned = 1; return v1_deployment_list_local_var; } +__attribute__((deprecated)) v1_deployment_list_t *v1_deployment_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_deployment_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_deployment_list_free(v1_deployment_list_t *v1_deployment_list) { if(NULL == v1_deployment_list){ return ; } + if(v1_deployment_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_deployment_list_free"); + return ; + } listEntry_t *listEntry; if (v1_deployment_list->api_version) { free(v1_deployment_list->api_version); @@ -123,6 +141,9 @@ v1_deployment_list_t *v1_deployment_list_parseFromJSON(cJSON *v1_deployment_list // v1_deployment_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_deployment_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_deployment_list_t *v1_deployment_list_parseFromJSON(cJSON *v1_deployment_list // v1_deployment_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_deployment_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_deployment_list_t *v1_deployment_list_parseFromJSON(cJSON *v1_deployment_list // v1_deployment_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_deployment_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_deployment_list_t *v1_deployment_list_parseFromJSON(cJSON *v1_deployment_list // v1_deployment_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_deployment_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_deployment_list_local_var = v1_deployment_list_create ( + v1_deployment_list_local_var = v1_deployment_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_deployment_list.h b/kubernetes/model/v1_deployment_list.h index 9e8c47db..a46a4faf 100644 --- a/kubernetes/model/v1_deployment_list.h +++ b/kubernetes/model/v1_deployment_list.h @@ -26,9 +26,10 @@ typedef struct v1_deployment_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_deployment_list_t; -v1_deployment_list_t *v1_deployment_list_create( +__attribute__((deprecated)) v1_deployment_list_t *v1_deployment_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_deployment_spec.c b/kubernetes/model/v1_deployment_spec.c index 23219148..0b5eb6fe 100644 --- a/kubernetes/model/v1_deployment_spec.c +++ b/kubernetes/model/v1_deployment_spec.c @@ -5,7 +5,7 @@ -v1_deployment_spec_t *v1_deployment_spec_create( +static v1_deployment_spec_t *v1_deployment_spec_create_internal( int min_ready_seconds, int paused, int progress_deadline_seconds, @@ -28,14 +28,40 @@ v1_deployment_spec_t *v1_deployment_spec_create( v1_deployment_spec_local_var->strategy = strategy; v1_deployment_spec_local_var->_template = _template; + v1_deployment_spec_local_var->_library_owned = 1; return v1_deployment_spec_local_var; } +__attribute__((deprecated)) v1_deployment_spec_t *v1_deployment_spec_create( + int min_ready_seconds, + int paused, + int progress_deadline_seconds, + int replicas, + int revision_history_limit, + v1_label_selector_t *selector, + v1_deployment_strategy_t *strategy, + v1_pod_template_spec_t *_template + ) { + return v1_deployment_spec_create_internal ( + min_ready_seconds, + paused, + progress_deadline_seconds, + replicas, + revision_history_limit, + selector, + strategy, + _template + ); +} void v1_deployment_spec_free(v1_deployment_spec_t *v1_deployment_spec) { if(NULL == v1_deployment_spec){ return ; } + if(v1_deployment_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_deployment_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_deployment_spec->selector) { v1_label_selector_free(v1_deployment_spec->selector); @@ -158,6 +184,9 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec // v1_deployment_spec->min_ready_seconds cJSON *min_ready_seconds = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "minReadySeconds"); + if (cJSON_IsNull(min_ready_seconds)) { + min_ready_seconds = NULL; + } if (min_ready_seconds) { if(!cJSON_IsNumber(min_ready_seconds)) { @@ -167,6 +196,9 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec // v1_deployment_spec->paused cJSON *paused = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "paused"); + if (cJSON_IsNull(paused)) { + paused = NULL; + } if (paused) { if(!cJSON_IsBool(paused)) { @@ -176,6 +208,9 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec // v1_deployment_spec->progress_deadline_seconds cJSON *progress_deadline_seconds = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "progressDeadlineSeconds"); + if (cJSON_IsNull(progress_deadline_seconds)) { + progress_deadline_seconds = NULL; + } if (progress_deadline_seconds) { if(!cJSON_IsNumber(progress_deadline_seconds)) { @@ -185,6 +220,9 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec // v1_deployment_spec->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (replicas) { if(!cJSON_IsNumber(replicas)) { @@ -194,6 +232,9 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec // v1_deployment_spec->revision_history_limit cJSON *revision_history_limit = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "revisionHistoryLimit"); + if (cJSON_IsNull(revision_history_limit)) { + revision_history_limit = NULL; + } if (revision_history_limit) { if(!cJSON_IsNumber(revision_history_limit)) { @@ -203,6 +244,9 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec // v1_deployment_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (!selector) { goto end; } @@ -212,12 +256,18 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec // v1_deployment_spec->strategy cJSON *strategy = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "strategy"); + if (cJSON_IsNull(strategy)) { + strategy = NULL; + } if (strategy) { strategy_local_nonprim = v1_deployment_strategy_parseFromJSON(strategy); //nonprimitive } // v1_deployment_spec->_template cJSON *_template = cJSON_GetObjectItemCaseSensitive(v1_deployment_specJSON, "template"); + if (cJSON_IsNull(_template)) { + _template = NULL; + } if (!_template) { goto end; } @@ -226,7 +276,7 @@ v1_deployment_spec_t *v1_deployment_spec_parseFromJSON(cJSON *v1_deployment_spec _template_local_nonprim = v1_pod_template_spec_parseFromJSON(_template); //nonprimitive - v1_deployment_spec_local_var = v1_deployment_spec_create ( + v1_deployment_spec_local_var = v1_deployment_spec_create_internal ( min_ready_seconds ? min_ready_seconds->valuedouble : 0, paused ? paused->valueint : 0, progress_deadline_seconds ? progress_deadline_seconds->valuedouble : 0, diff --git a/kubernetes/model/v1_deployment_spec.h b/kubernetes/model/v1_deployment_spec.h index a1016f04..d4a25ea4 100644 --- a/kubernetes/model/v1_deployment_spec.h +++ b/kubernetes/model/v1_deployment_spec.h @@ -31,9 +31,10 @@ typedef struct v1_deployment_spec_t { struct v1_deployment_strategy_t *strategy; //model struct v1_pod_template_spec_t *_template; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_deployment_spec_t; -v1_deployment_spec_t *v1_deployment_spec_create( +__attribute__((deprecated)) v1_deployment_spec_t *v1_deployment_spec_create( int min_ready_seconds, int paused, int progress_deadline_seconds, diff --git a/kubernetes/model/v1_deployment_status.c b/kubernetes/model/v1_deployment_status.c index 7ce620f9..75276cce 100644 --- a/kubernetes/model/v1_deployment_status.c +++ b/kubernetes/model/v1_deployment_status.c @@ -5,13 +5,14 @@ -v1_deployment_status_t *v1_deployment_status_create( +static v1_deployment_status_t *v1_deployment_status_create_internal( int available_replicas, int collision_count, list_t *conditions, long observed_generation, int ready_replicas, int replicas, + int terminating_replicas, int unavailable_replicas, int updated_replicas ) { @@ -25,17 +26,46 @@ v1_deployment_status_t *v1_deployment_status_create( v1_deployment_status_local_var->observed_generation = observed_generation; v1_deployment_status_local_var->ready_replicas = ready_replicas; v1_deployment_status_local_var->replicas = replicas; + v1_deployment_status_local_var->terminating_replicas = terminating_replicas; v1_deployment_status_local_var->unavailable_replicas = unavailable_replicas; v1_deployment_status_local_var->updated_replicas = updated_replicas; + v1_deployment_status_local_var->_library_owned = 1; return v1_deployment_status_local_var; } +__attribute__((deprecated)) v1_deployment_status_t *v1_deployment_status_create( + int available_replicas, + int collision_count, + list_t *conditions, + long observed_generation, + int ready_replicas, + int replicas, + int terminating_replicas, + int unavailable_replicas, + int updated_replicas + ) { + return v1_deployment_status_create_internal ( + available_replicas, + collision_count, + conditions, + observed_generation, + ready_replicas, + replicas, + terminating_replicas, + unavailable_replicas, + updated_replicas + ); +} void v1_deployment_status_free(v1_deployment_status_t *v1_deployment_status) { if(NULL == v1_deployment_status){ return ; } + if(v1_deployment_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_deployment_status_free"); + return ; + } listEntry_t *listEntry; if (v1_deployment_status->conditions) { list_ForEach(listEntry, v1_deployment_status->conditions) { @@ -110,6 +140,14 @@ cJSON *v1_deployment_status_convertToJSON(v1_deployment_status_t *v1_deployment_ } + // v1_deployment_status->terminating_replicas + if(v1_deployment_status->terminating_replicas) { + if(cJSON_AddNumberToObject(item, "terminatingReplicas", v1_deployment_status->terminating_replicas) == NULL) { + goto fail; //Numeric + } + } + + // v1_deployment_status->unavailable_replicas if(v1_deployment_status->unavailable_replicas) { if(cJSON_AddNumberToObject(item, "unavailableReplicas", v1_deployment_status->unavailable_replicas) == NULL) { @@ -142,6 +180,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "availableReplicas"); + if (cJSON_IsNull(available_replicas)) { + available_replicas = NULL; + } if (available_replicas) { if(!cJSON_IsNumber(available_replicas)) { @@ -151,6 +192,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->collision_count cJSON *collision_count = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "collisionCount"); + if (cJSON_IsNull(collision_count)) { + collision_count = NULL; + } if (collision_count) { if(!cJSON_IsNumber(collision_count)) { @@ -160,6 +204,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -181,6 +228,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -190,6 +240,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->ready_replicas cJSON *ready_replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "readyReplicas"); + if (cJSON_IsNull(ready_replicas)) { + ready_replicas = NULL; + } if (ready_replicas) { if(!cJSON_IsNumber(ready_replicas)) { @@ -199,6 +252,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (replicas) { if(!cJSON_IsNumber(replicas)) { @@ -206,8 +262,23 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ } } + // v1_deployment_status->terminating_replicas + cJSON *terminating_replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "terminatingReplicas"); + if (cJSON_IsNull(terminating_replicas)) { + terminating_replicas = NULL; + } + if (terminating_replicas) { + if(!cJSON_IsNumber(terminating_replicas)) + { + goto end; //Numeric + } + } + // v1_deployment_status->unavailable_replicas cJSON *unavailable_replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "unavailableReplicas"); + if (cJSON_IsNull(unavailable_replicas)) { + unavailable_replicas = NULL; + } if (unavailable_replicas) { if(!cJSON_IsNumber(unavailable_replicas)) { @@ -217,6 +288,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->updated_replicas cJSON *updated_replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "updatedReplicas"); + if (cJSON_IsNull(updated_replicas)) { + updated_replicas = NULL; + } if (updated_replicas) { if(!cJSON_IsNumber(updated_replicas)) { @@ -225,13 +299,14 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ } - v1_deployment_status_local_var = v1_deployment_status_create ( + v1_deployment_status_local_var = v1_deployment_status_create_internal ( available_replicas ? available_replicas->valuedouble : 0, collision_count ? collision_count->valuedouble : 0, conditions ? conditionsList : NULL, observed_generation ? observed_generation->valuedouble : 0, ready_replicas ? ready_replicas->valuedouble : 0, replicas ? replicas->valuedouble : 0, + terminating_replicas ? terminating_replicas->valuedouble : 0, unavailable_replicas ? unavailable_replicas->valuedouble : 0, updated_replicas ? updated_replicas->valuedouble : 0 ); diff --git a/kubernetes/model/v1_deployment_status.h b/kubernetes/model/v1_deployment_status.h index 3de54496..b69aa432 100644 --- a/kubernetes/model/v1_deployment_status.h +++ b/kubernetes/model/v1_deployment_status.h @@ -26,18 +26,21 @@ typedef struct v1_deployment_status_t { long observed_generation; //numeric int ready_replicas; //numeric int replicas; //numeric + int terminating_replicas; //numeric int unavailable_replicas; //numeric int updated_replicas; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_deployment_status_t; -v1_deployment_status_t *v1_deployment_status_create( +__attribute__((deprecated)) v1_deployment_status_t *v1_deployment_status_create( int available_replicas, int collision_count, list_t *conditions, long observed_generation, int ready_replicas, int replicas, + int terminating_replicas, int unavailable_replicas, int updated_replicas ); diff --git a/kubernetes/model/v1_deployment_strategy.c b/kubernetes/model/v1_deployment_strategy.c index e0668567..36f9380f 100644 --- a/kubernetes/model/v1_deployment_strategy.c +++ b/kubernetes/model/v1_deployment_strategy.c @@ -5,7 +5,7 @@ -v1_deployment_strategy_t *v1_deployment_strategy_create( +static v1_deployment_strategy_t *v1_deployment_strategy_create_internal( v1_rolling_update_deployment_t *rolling_update, char *type ) { @@ -16,14 +16,28 @@ v1_deployment_strategy_t *v1_deployment_strategy_create( v1_deployment_strategy_local_var->rolling_update = rolling_update; v1_deployment_strategy_local_var->type = type; + v1_deployment_strategy_local_var->_library_owned = 1; return v1_deployment_strategy_local_var; } +__attribute__((deprecated)) v1_deployment_strategy_t *v1_deployment_strategy_create( + v1_rolling_update_deployment_t *rolling_update, + char *type + ) { + return v1_deployment_strategy_create_internal ( + rolling_update, + type + ); +} void v1_deployment_strategy_free(v1_deployment_strategy_t *v1_deployment_strategy) { if(NULL == v1_deployment_strategy){ return ; } + if(v1_deployment_strategy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_deployment_strategy_free"); + return ; + } listEntry_t *listEntry; if (v1_deployment_strategy->rolling_update) { v1_rolling_update_deployment_free(v1_deployment_strategy->rolling_update); @@ -76,12 +90,18 @@ v1_deployment_strategy_t *v1_deployment_strategy_parseFromJSON(cJSON *v1_deploym // v1_deployment_strategy->rolling_update cJSON *rolling_update = cJSON_GetObjectItemCaseSensitive(v1_deployment_strategyJSON, "rollingUpdate"); + if (cJSON_IsNull(rolling_update)) { + rolling_update = NULL; + } if (rolling_update) { rolling_update_local_nonprim = v1_rolling_update_deployment_parseFromJSON(rolling_update); //nonprimitive } // v1_deployment_strategy->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_deployment_strategyJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -90,7 +110,7 @@ v1_deployment_strategy_t *v1_deployment_strategy_parseFromJSON(cJSON *v1_deploym } - v1_deployment_strategy_local_var = v1_deployment_strategy_create ( + v1_deployment_strategy_local_var = v1_deployment_strategy_create_internal ( rolling_update ? rolling_update_local_nonprim : NULL, type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL ); diff --git a/kubernetes/model/v1_deployment_strategy.h b/kubernetes/model/v1_deployment_strategy.h index a1f54df2..6d87e90e 100644 --- a/kubernetes/model/v1_deployment_strategy.h +++ b/kubernetes/model/v1_deployment_strategy.h @@ -23,9 +23,10 @@ typedef struct v1_deployment_strategy_t { struct v1_rolling_update_deployment_t *rolling_update; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_deployment_strategy_t; -v1_deployment_strategy_t *v1_deployment_strategy_create( +__attribute__((deprecated)) v1_deployment_strategy_t *v1_deployment_strategy_create( v1_rolling_update_deployment_t *rolling_update, char *type ); diff --git a/kubernetes/model/v1_device.c b/kubernetes/model/v1_device.c new file mode 100644 index 00000000..ed0599b2 --- /dev/null +++ b/kubernetes/model/v1_device.c @@ -0,0 +1,592 @@ +#include +#include +#include +#include "v1_device.h" + + + +static v1_device_t *v1_device_create_internal( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *name, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints + ) { + v1_device_t *v1_device_local_var = malloc(sizeof(v1_device_t)); + if (!v1_device_local_var) { + return NULL; + } + v1_device_local_var->all_nodes = all_nodes; + v1_device_local_var->allow_multiple_allocations = allow_multiple_allocations; + v1_device_local_var->attributes = attributes; + v1_device_local_var->binding_conditions = binding_conditions; + v1_device_local_var->binding_failure_conditions = binding_failure_conditions; + v1_device_local_var->binds_to_node = binds_to_node; + v1_device_local_var->capacity = capacity; + v1_device_local_var->consumes_counters = consumes_counters; + v1_device_local_var->name = name; + v1_device_local_var->node_name = node_name; + v1_device_local_var->node_selector = node_selector; + v1_device_local_var->taints = taints; + + v1_device_local_var->_library_owned = 1; + return v1_device_local_var; +} + +__attribute__((deprecated)) v1_device_t *v1_device_create( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *name, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints + ) { + return v1_device_create_internal ( + all_nodes, + allow_multiple_allocations, + attributes, + binding_conditions, + binding_failure_conditions, + binds_to_node, + capacity, + consumes_counters, + name, + node_name, + node_selector, + taints + ); +} + +void v1_device_free(v1_device_t *v1_device) { + if(NULL == v1_device){ + return ; + } + if(v1_device->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device->attributes) { + list_ForEach(listEntry, v1_device->attributes) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1_device->attributes); + v1_device->attributes = NULL; + } + if (v1_device->binding_conditions) { + list_ForEach(listEntry, v1_device->binding_conditions) { + free(listEntry->data); + } + list_freeList(v1_device->binding_conditions); + v1_device->binding_conditions = NULL; + } + if (v1_device->binding_failure_conditions) { + list_ForEach(listEntry, v1_device->binding_failure_conditions) { + free(listEntry->data); + } + list_freeList(v1_device->binding_failure_conditions); + v1_device->binding_failure_conditions = NULL; + } + if (v1_device->capacity) { + list_ForEach(listEntry, v1_device->capacity) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1_device->capacity); + v1_device->capacity = NULL; + } + if (v1_device->consumes_counters) { + list_ForEach(listEntry, v1_device->consumes_counters) { + v1_device_counter_consumption_free(listEntry->data); + } + list_freeList(v1_device->consumes_counters); + v1_device->consumes_counters = NULL; + } + if (v1_device->name) { + free(v1_device->name); + v1_device->name = NULL; + } + if (v1_device->node_name) { + free(v1_device->node_name); + v1_device->node_name = NULL; + } + if (v1_device->node_selector) { + v1_node_selector_free(v1_device->node_selector); + v1_device->node_selector = NULL; + } + if (v1_device->taints) { + list_ForEach(listEntry, v1_device->taints) { + v1_device_taint_free(listEntry->data); + } + list_freeList(v1_device->taints); + v1_device->taints = NULL; + } + free(v1_device); +} + +cJSON *v1_device_convertToJSON(v1_device_t *v1_device) { + cJSON *item = cJSON_CreateObject(); + + // v1_device->all_nodes + if(v1_device->all_nodes) { + if(cJSON_AddBoolToObject(item, "allNodes", v1_device->all_nodes) == NULL) { + goto fail; //Bool + } + } + + + // v1_device->allow_multiple_allocations + if(v1_device->allow_multiple_allocations) { + if(cJSON_AddBoolToObject(item, "allowMultipleAllocations", v1_device->allow_multiple_allocations) == NULL) { + goto fail; //Bool + } + } + + + // v1_device->attributes + if(v1_device->attributes) { + cJSON *attributes = cJSON_AddObjectToObject(item, "attributes"); + if(attributes == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = attributes; + listEntry_t *attributesListEntry; + if (v1_device->attributes) { + list_ForEach(attributesListEntry, v1_device->attributes) { + keyValuePair_t *localKeyValue = attributesListEntry->data; + } + } + } + + + // v1_device->binding_conditions + if(v1_device->binding_conditions) { + cJSON *binding_conditions = cJSON_AddArrayToObject(item, "bindingConditions"); + if(binding_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_conditionsListEntry; + list_ForEach(binding_conditionsListEntry, v1_device->binding_conditions) { + if(cJSON_AddStringToObject(binding_conditions, "", binding_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1_device->binding_failure_conditions + if(v1_device->binding_failure_conditions) { + cJSON *binding_failure_conditions = cJSON_AddArrayToObject(item, "bindingFailureConditions"); + if(binding_failure_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_failure_conditionsListEntry; + list_ForEach(binding_failure_conditionsListEntry, v1_device->binding_failure_conditions) { + if(cJSON_AddStringToObject(binding_failure_conditions, "", binding_failure_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1_device->binds_to_node + if(v1_device->binds_to_node) { + if(cJSON_AddBoolToObject(item, "bindsToNode", v1_device->binds_to_node) == NULL) { + goto fail; //Bool + } + } + + + // v1_device->capacity + if(v1_device->capacity) { + cJSON *capacity = cJSON_AddObjectToObject(item, "capacity"); + if(capacity == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = capacity; + listEntry_t *capacityListEntry; + if (v1_device->capacity) { + list_ForEach(capacityListEntry, v1_device->capacity) { + keyValuePair_t *localKeyValue = capacityListEntry->data; + } + } + } + + + // v1_device->consumes_counters + if(v1_device->consumes_counters) { + cJSON *consumes_counters = cJSON_AddArrayToObject(item, "consumesCounters"); + if(consumes_counters == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *consumes_countersListEntry; + if (v1_device->consumes_counters) { + list_ForEach(consumes_countersListEntry, v1_device->consumes_counters) { + cJSON *itemLocal = v1_device_counter_consumption_convertToJSON(consumes_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(consumes_counters, itemLocal); + } + } + } + + + // v1_device->name + if (!v1_device->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_device->name) == NULL) { + goto fail; //String + } + + + // v1_device->node_name + if(v1_device->node_name) { + if(cJSON_AddStringToObject(item, "nodeName", v1_device->node_name) == NULL) { + goto fail; //String + } + } + + + // v1_device->node_selector + if(v1_device->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1_device->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_device->taints + if(v1_device->taints) { + cJSON *taints = cJSON_AddArrayToObject(item, "taints"); + if(taints == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *taintsListEntry; + if (v1_device->taints) { + list_ForEach(taintsListEntry, v1_device->taints) { + cJSON *itemLocal = v1_device_taint_convertToJSON(taintsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(taints, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_t *v1_device_parseFromJSON(cJSON *v1_deviceJSON){ + + v1_device_t *v1_device_local_var = NULL; + + // define the local map for v1_device->attributes + list_t *attributesList = NULL; + + // define the local list for v1_device->binding_conditions + list_t *binding_conditionsList = NULL; + + // define the local list for v1_device->binding_failure_conditions + list_t *binding_failure_conditionsList = NULL; + + // define the local map for v1_device->capacity + list_t *capacityList = NULL; + + // define the local list for v1_device->consumes_counters + list_t *consumes_countersList = NULL; + + // define the local variable for v1_device->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // define the local list for v1_device->taints + list_t *taintsList = NULL; + + // v1_device->all_nodes + cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "allNodes"); + if (cJSON_IsNull(all_nodes)) { + all_nodes = NULL; + } + if (all_nodes) { + if(!cJSON_IsBool(all_nodes)) + { + goto end; //Bool + } + } + + // v1_device->allow_multiple_allocations + cJSON *allow_multiple_allocations = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "allowMultipleAllocations"); + if (cJSON_IsNull(allow_multiple_allocations)) { + allow_multiple_allocations = NULL; + } + if (allow_multiple_allocations) { + if(!cJSON_IsBool(allow_multiple_allocations)) + { + goto end; //Bool + } + } + + // v1_device->attributes + cJSON *attributes = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "attributes"); + if (cJSON_IsNull(attributes)) { + attributes = NULL; + } + if (attributes) { + + // The data type of the elements in v1_device->attributes is currently not supported. + + } + + // v1_device->binding_conditions + cJSON *binding_conditions = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "bindingConditions"); + if (cJSON_IsNull(binding_conditions)) { + binding_conditions = NULL; + } + if (binding_conditions) { + cJSON *binding_conditions_local = NULL; + if(!cJSON_IsArray(binding_conditions)) { + goto end;//primitive container + } + binding_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_conditions_local, binding_conditions) + { + if(!cJSON_IsString(binding_conditions_local)) + { + goto end; + } + list_addElement(binding_conditionsList , strdup(binding_conditions_local->valuestring)); + } + } + + // v1_device->binding_failure_conditions + cJSON *binding_failure_conditions = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "bindingFailureConditions"); + if (cJSON_IsNull(binding_failure_conditions)) { + binding_failure_conditions = NULL; + } + if (binding_failure_conditions) { + cJSON *binding_failure_conditions_local = NULL; + if(!cJSON_IsArray(binding_failure_conditions)) { + goto end;//primitive container + } + binding_failure_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_failure_conditions_local, binding_failure_conditions) + { + if(!cJSON_IsString(binding_failure_conditions_local)) + { + goto end; + } + list_addElement(binding_failure_conditionsList , strdup(binding_failure_conditions_local->valuestring)); + } + } + + // v1_device->binds_to_node + cJSON *binds_to_node = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "bindsToNode"); + if (cJSON_IsNull(binds_to_node)) { + binds_to_node = NULL; + } + if (binds_to_node) { + if(!cJSON_IsBool(binds_to_node)) + { + goto end; //Bool + } + } + + // v1_device->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + + // The data type of the elements in v1_device->capacity is currently not supported. + + } + + // v1_device->consumes_counters + cJSON *consumes_counters = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "consumesCounters"); + if (cJSON_IsNull(consumes_counters)) { + consumes_counters = NULL; + } + if (consumes_counters) { + cJSON *consumes_counters_local_nonprimitive = NULL; + if(!cJSON_IsArray(consumes_counters)){ + goto end; //nonprimitive container + } + + consumes_countersList = list_createList(); + + cJSON_ArrayForEach(consumes_counters_local_nonprimitive,consumes_counters ) + { + if(!cJSON_IsObject(consumes_counters_local_nonprimitive)){ + goto end; + } + v1_device_counter_consumption_t *consumes_countersItem = v1_device_counter_consumption_parseFromJSON(consumes_counters_local_nonprimitive); + + list_addElement(consumes_countersList, consumes_countersItem); + } + } + + // v1_device->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1_device->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } + if (node_name) { + if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) + { + goto end; //String + } + } + + // v1_device->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + // v1_device->taints + cJSON *taints = cJSON_GetObjectItemCaseSensitive(v1_deviceJSON, "taints"); + if (cJSON_IsNull(taints)) { + taints = NULL; + } + if (taints) { + cJSON *taints_local_nonprimitive = NULL; + if(!cJSON_IsArray(taints)){ + goto end; //nonprimitive container + } + + taintsList = list_createList(); + + cJSON_ArrayForEach(taints_local_nonprimitive,taints ) + { + if(!cJSON_IsObject(taints_local_nonprimitive)){ + goto end; + } + v1_device_taint_t *taintsItem = v1_device_taint_parseFromJSON(taints_local_nonprimitive); + + list_addElement(taintsList, taintsItem); + } + } + + + v1_device_local_var = v1_device_create_internal ( + all_nodes ? all_nodes->valueint : 0, + allow_multiple_allocations ? allow_multiple_allocations->valueint : 0, + attributes ? attributesList : NULL, + binding_conditions ? binding_conditionsList : NULL, + binding_failure_conditions ? binding_failure_conditionsList : NULL, + binds_to_node ? binds_to_node->valueint : 0, + capacity ? capacityList : NULL, + consumes_counters ? consumes_countersList : NULL, + strdup(name->valuestring), + node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, + node_selector ? node_selector_local_nonprim : NULL, + taints ? taintsList : NULL + ); + + return v1_device_local_var; +end: + + // The data type of the elements in v1_device->attributes is currently not supported. + + if (binding_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_conditionsList); + binding_conditionsList = NULL; + } + if (binding_failure_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_failure_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_failure_conditionsList); + binding_failure_conditionsList = NULL; + } + + // The data type of the elements in v1_device->capacity is currently not supported. + + if (consumes_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, consumes_countersList) { + v1_device_counter_consumption_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(consumes_countersList); + consumes_countersList = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + if (taintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, taintsList) { + v1_device_taint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(taintsList); + taintsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device.h b/kubernetes/model/v1_device.h new file mode 100644 index 00000000..624918e6 --- /dev/null +++ b/kubernetes/model/v1_device.h @@ -0,0 +1,65 @@ +/* + * v1_device.h + * + * Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set. + */ + +#ifndef _v1_device_H_ +#define _v1_device_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_t v1_device_t; + +#include "v1_device_attribute.h" +#include "v1_device_capacity.h" +#include "v1_device_counter_consumption.h" +#include "v1_device_taint.h" +#include "v1_node_selector.h" + + + +typedef struct v1_device_t { + int all_nodes; //boolean + int allow_multiple_allocations; //boolean + list_t* attributes; //map + list_t *binding_conditions; //primitive container + list_t *binding_failure_conditions; //primitive container + int binds_to_node; //boolean + list_t* capacity; //map + list_t *consumes_counters; //nonprimitive container + char *name; // string + char *node_name; // string + struct v1_node_selector_t *node_selector; //model + list_t *taints; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_t; + +__attribute__((deprecated)) v1_device_t *v1_device_create( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *name, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints +); + +void v1_device_free(v1_device_t *v1_device); + +v1_device_t *v1_device_parseFromJSON(cJSON *v1_deviceJSON); + +cJSON *v1_device_convertToJSON(v1_device_t *v1_device); + +#endif /* _v1_device_H_ */ + diff --git a/kubernetes/model/v1_device_allocation_configuration.c b/kubernetes/model/v1_device_allocation_configuration.c new file mode 100644 index 00000000..536448d1 --- /dev/null +++ b/kubernetes/model/v1_device_allocation_configuration.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1_device_allocation_configuration.h" + + + +static v1_device_allocation_configuration_t *v1_device_allocation_configuration_create_internal( + v1_opaque_device_configuration_t *opaque, + list_t *requests, + char *source + ) { + v1_device_allocation_configuration_t *v1_device_allocation_configuration_local_var = malloc(sizeof(v1_device_allocation_configuration_t)); + if (!v1_device_allocation_configuration_local_var) { + return NULL; + } + v1_device_allocation_configuration_local_var->opaque = opaque; + v1_device_allocation_configuration_local_var->requests = requests; + v1_device_allocation_configuration_local_var->source = source; + + v1_device_allocation_configuration_local_var->_library_owned = 1; + return v1_device_allocation_configuration_local_var; +} + +__attribute__((deprecated)) v1_device_allocation_configuration_t *v1_device_allocation_configuration_create( + v1_opaque_device_configuration_t *opaque, + list_t *requests, + char *source + ) { + return v1_device_allocation_configuration_create_internal ( + opaque, + requests, + source + ); +} + +void v1_device_allocation_configuration_free(v1_device_allocation_configuration_t *v1_device_allocation_configuration) { + if(NULL == v1_device_allocation_configuration){ + return ; + } + if(v1_device_allocation_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_allocation_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_allocation_configuration->opaque) { + v1_opaque_device_configuration_free(v1_device_allocation_configuration->opaque); + v1_device_allocation_configuration->opaque = NULL; + } + if (v1_device_allocation_configuration->requests) { + list_ForEach(listEntry, v1_device_allocation_configuration->requests) { + free(listEntry->data); + } + list_freeList(v1_device_allocation_configuration->requests); + v1_device_allocation_configuration->requests = NULL; + } + if (v1_device_allocation_configuration->source) { + free(v1_device_allocation_configuration->source); + v1_device_allocation_configuration->source = NULL; + } + free(v1_device_allocation_configuration); +} + +cJSON *v1_device_allocation_configuration_convertToJSON(v1_device_allocation_configuration_t *v1_device_allocation_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_allocation_configuration->opaque + if(v1_device_allocation_configuration->opaque) { + cJSON *opaque_local_JSON = v1_opaque_device_configuration_convertToJSON(v1_device_allocation_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_device_allocation_configuration->requests + if(v1_device_allocation_configuration->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1_device_allocation_configuration->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1_device_allocation_configuration->source + if (!v1_device_allocation_configuration->source) { + goto fail; + } + if(cJSON_AddStringToObject(item, "source", v1_device_allocation_configuration->source) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_allocation_configuration_t *v1_device_allocation_configuration_parseFromJSON(cJSON *v1_device_allocation_configurationJSON){ + + v1_device_allocation_configuration_t *v1_device_allocation_configuration_local_var = NULL; + + // define the local variable for v1_device_allocation_configuration->opaque + v1_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // define the local list for v1_device_allocation_configuration->requests + list_t *requestsList = NULL; + + // v1_device_allocation_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1_device_allocation_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + // v1_device_allocation_configuration->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_device_allocation_configurationJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + // v1_device_allocation_configuration->source + cJSON *source = cJSON_GetObjectItemCaseSensitive(v1_device_allocation_configurationJSON, "source"); + if (cJSON_IsNull(source)) { + source = NULL; + } + if (!source) { + goto end; + } + + + if(!cJSON_IsString(source)) + { + goto end; //String + } + + + v1_device_allocation_configuration_local_var = v1_device_allocation_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL, + requests ? requestsList : NULL, + strdup(source->valuestring) + ); + + return v1_device_allocation_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_allocation_configuration.h b/kubernetes/model/v1_device_allocation_configuration.h new file mode 100644 index 00000000..148f2a58 --- /dev/null +++ b/kubernetes/model/v1_device_allocation_configuration.h @@ -0,0 +1,43 @@ +/* + * v1_device_allocation_configuration.h + * + * DeviceAllocationConfiguration gets embedded in an AllocationResult. + */ + +#ifndef _v1_device_allocation_configuration_H_ +#define _v1_device_allocation_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_allocation_configuration_t v1_device_allocation_configuration_t; + +#include "v1_opaque_device_configuration.h" + + + +typedef struct v1_device_allocation_configuration_t { + struct v1_opaque_device_configuration_t *opaque; //model + list_t *requests; //primitive container + char *source; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_allocation_configuration_t; + +__attribute__((deprecated)) v1_device_allocation_configuration_t *v1_device_allocation_configuration_create( + v1_opaque_device_configuration_t *opaque, + list_t *requests, + char *source +); + +void v1_device_allocation_configuration_free(v1_device_allocation_configuration_t *v1_device_allocation_configuration); + +v1_device_allocation_configuration_t *v1_device_allocation_configuration_parseFromJSON(cJSON *v1_device_allocation_configurationJSON); + +cJSON *v1_device_allocation_configuration_convertToJSON(v1_device_allocation_configuration_t *v1_device_allocation_configuration); + +#endif /* _v1_device_allocation_configuration_H_ */ + diff --git a/kubernetes/model/v1_device_allocation_result.c b/kubernetes/model/v1_device_allocation_result.c new file mode 100644 index 00000000..13fe631b --- /dev/null +++ b/kubernetes/model/v1_device_allocation_result.c @@ -0,0 +1,195 @@ +#include +#include +#include +#include "v1_device_allocation_result.h" + + + +static v1_device_allocation_result_t *v1_device_allocation_result_create_internal( + list_t *config, + list_t *results + ) { + v1_device_allocation_result_t *v1_device_allocation_result_local_var = malloc(sizeof(v1_device_allocation_result_t)); + if (!v1_device_allocation_result_local_var) { + return NULL; + } + v1_device_allocation_result_local_var->config = config; + v1_device_allocation_result_local_var->results = results; + + v1_device_allocation_result_local_var->_library_owned = 1; + return v1_device_allocation_result_local_var; +} + +__attribute__((deprecated)) v1_device_allocation_result_t *v1_device_allocation_result_create( + list_t *config, + list_t *results + ) { + return v1_device_allocation_result_create_internal ( + config, + results + ); +} + +void v1_device_allocation_result_free(v1_device_allocation_result_t *v1_device_allocation_result) { + if(NULL == v1_device_allocation_result){ + return ; + } + if(v1_device_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_allocation_result->config) { + list_ForEach(listEntry, v1_device_allocation_result->config) { + v1_device_allocation_configuration_free(listEntry->data); + } + list_freeList(v1_device_allocation_result->config); + v1_device_allocation_result->config = NULL; + } + if (v1_device_allocation_result->results) { + list_ForEach(listEntry, v1_device_allocation_result->results) { + v1_device_request_allocation_result_free(listEntry->data); + } + list_freeList(v1_device_allocation_result->results); + v1_device_allocation_result->results = NULL; + } + free(v1_device_allocation_result); +} + +cJSON *v1_device_allocation_result_convertToJSON(v1_device_allocation_result_t *v1_device_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_allocation_result->config + if(v1_device_allocation_result->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1_device_allocation_result->config) { + list_ForEach(configListEntry, v1_device_allocation_result->config) { + cJSON *itemLocal = v1_device_allocation_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1_device_allocation_result->results + if(v1_device_allocation_result->results) { + cJSON *results = cJSON_AddArrayToObject(item, "results"); + if(results == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *resultsListEntry; + if (v1_device_allocation_result->results) { + list_ForEach(resultsListEntry, v1_device_allocation_result->results) { + cJSON *itemLocal = v1_device_request_allocation_result_convertToJSON(resultsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(results, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_allocation_result_t *v1_device_allocation_result_parseFromJSON(cJSON *v1_device_allocation_resultJSON){ + + v1_device_allocation_result_t *v1_device_allocation_result_local_var = NULL; + + // define the local list for v1_device_allocation_result->config + list_t *configList = NULL; + + // define the local list for v1_device_allocation_result->results + list_t *resultsList = NULL; + + // v1_device_allocation_result->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1_device_allocation_resultJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1_device_allocation_configuration_t *configItem = v1_device_allocation_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1_device_allocation_result->results + cJSON *results = cJSON_GetObjectItemCaseSensitive(v1_device_allocation_resultJSON, "results"); + if (cJSON_IsNull(results)) { + results = NULL; + } + if (results) { + cJSON *results_local_nonprimitive = NULL; + if(!cJSON_IsArray(results)){ + goto end; //nonprimitive container + } + + resultsList = list_createList(); + + cJSON_ArrayForEach(results_local_nonprimitive,results ) + { + if(!cJSON_IsObject(results_local_nonprimitive)){ + goto end; + } + v1_device_request_allocation_result_t *resultsItem = v1_device_request_allocation_result_parseFromJSON(results_local_nonprimitive); + + list_addElement(resultsList, resultsItem); + } + } + + + v1_device_allocation_result_local_var = v1_device_allocation_result_create_internal ( + config ? configList : NULL, + results ? resultsList : NULL + ); + + return v1_device_allocation_result_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1_device_allocation_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (resultsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resultsList) { + v1_device_request_allocation_result_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resultsList); + resultsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_allocation_result.h b/kubernetes/model/v1_device_allocation_result.h new file mode 100644 index 00000000..89b0af3f --- /dev/null +++ b/kubernetes/model/v1_device_allocation_result.h @@ -0,0 +1,42 @@ +/* + * v1_device_allocation_result.h + * + * DeviceAllocationResult is the result of allocating devices. + */ + +#ifndef _v1_device_allocation_result_H_ +#define _v1_device_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_allocation_result_t v1_device_allocation_result_t; + +#include "v1_device_allocation_configuration.h" +#include "v1_device_request_allocation_result.h" + + + +typedef struct v1_device_allocation_result_t { + list_t *config; //nonprimitive container + list_t *results; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_allocation_result_t; + +__attribute__((deprecated)) v1_device_allocation_result_t *v1_device_allocation_result_create( + list_t *config, + list_t *results +); + +void v1_device_allocation_result_free(v1_device_allocation_result_t *v1_device_allocation_result); + +v1_device_allocation_result_t *v1_device_allocation_result_parseFromJSON(cJSON *v1_device_allocation_resultJSON); + +cJSON *v1_device_allocation_result_convertToJSON(v1_device_allocation_result_t *v1_device_allocation_result); + +#endif /* _v1_device_allocation_result_H_ */ + diff --git a/kubernetes/model/v1_device_attribute.c b/kubernetes/model/v1_device_attribute.c new file mode 100644 index 00000000..7927ad47 --- /dev/null +++ b/kubernetes/model/v1_device_attribute.c @@ -0,0 +1,167 @@ +#include +#include +#include +#include "v1_device_attribute.h" + + + +static v1_device_attribute_t *v1_device_attribute_create_internal( + int _bool, + long _int, + char *string, + char *version + ) { + v1_device_attribute_t *v1_device_attribute_local_var = malloc(sizeof(v1_device_attribute_t)); + if (!v1_device_attribute_local_var) { + return NULL; + } + v1_device_attribute_local_var->_bool = _bool; + v1_device_attribute_local_var->_int = _int; + v1_device_attribute_local_var->string = string; + v1_device_attribute_local_var->version = version; + + v1_device_attribute_local_var->_library_owned = 1; + return v1_device_attribute_local_var; +} + +__attribute__((deprecated)) v1_device_attribute_t *v1_device_attribute_create( + int _bool, + long _int, + char *string, + char *version + ) { + return v1_device_attribute_create_internal ( + _bool, + _int, + string, + version + ); +} + +void v1_device_attribute_free(v1_device_attribute_t *v1_device_attribute) { + if(NULL == v1_device_attribute){ + return ; + } + if(v1_device_attribute->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_attribute_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_attribute->string) { + free(v1_device_attribute->string); + v1_device_attribute->string = NULL; + } + if (v1_device_attribute->version) { + free(v1_device_attribute->version); + v1_device_attribute->version = NULL; + } + free(v1_device_attribute); +} + +cJSON *v1_device_attribute_convertToJSON(v1_device_attribute_t *v1_device_attribute) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_attribute->_bool + if(v1_device_attribute->_bool) { + if(cJSON_AddBoolToObject(item, "bool", v1_device_attribute->_bool) == NULL) { + goto fail; //Bool + } + } + + + // v1_device_attribute->_int + if(v1_device_attribute->_int) { + if(cJSON_AddNumberToObject(item, "int", v1_device_attribute->_int) == NULL) { + goto fail; //Numeric + } + } + + + // v1_device_attribute->string + if(v1_device_attribute->string) { + if(cJSON_AddStringToObject(item, "string", v1_device_attribute->string) == NULL) { + goto fail; //String + } + } + + + // v1_device_attribute->version + if(v1_device_attribute->version) { + if(cJSON_AddStringToObject(item, "version", v1_device_attribute->version) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_attribute_t *v1_device_attribute_parseFromJSON(cJSON *v1_device_attributeJSON){ + + v1_device_attribute_t *v1_device_attribute_local_var = NULL; + + // v1_device_attribute->_bool + cJSON *_bool = cJSON_GetObjectItemCaseSensitive(v1_device_attributeJSON, "bool"); + if (cJSON_IsNull(_bool)) { + _bool = NULL; + } + if (_bool) { + if(!cJSON_IsBool(_bool)) + { + goto end; //Bool + } + } + + // v1_device_attribute->_int + cJSON *_int = cJSON_GetObjectItemCaseSensitive(v1_device_attributeJSON, "int"); + if (cJSON_IsNull(_int)) { + _int = NULL; + } + if (_int) { + if(!cJSON_IsNumber(_int)) + { + goto end; //Numeric + } + } + + // v1_device_attribute->string + cJSON *string = cJSON_GetObjectItemCaseSensitive(v1_device_attributeJSON, "string"); + if (cJSON_IsNull(string)) { + string = NULL; + } + if (string) { + if(!cJSON_IsString(string) && !cJSON_IsNull(string)) + { + goto end; //String + } + } + + // v1_device_attribute->version + cJSON *version = cJSON_GetObjectItemCaseSensitive(v1_device_attributeJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } + if (version) { + if(!cJSON_IsString(version) && !cJSON_IsNull(version)) + { + goto end; //String + } + } + + + v1_device_attribute_local_var = v1_device_attribute_create_internal ( + _bool ? _bool->valueint : 0, + _int ? _int->valuedouble : 0, + string && !cJSON_IsNull(string) ? strdup(string->valuestring) : NULL, + version && !cJSON_IsNull(version) ? strdup(version->valuestring) : NULL + ); + + return v1_device_attribute_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_device_attribute.h b/kubernetes/model/v1_device_attribute.h new file mode 100644 index 00000000..ce42948d --- /dev/null +++ b/kubernetes/model/v1_device_attribute.h @@ -0,0 +1,44 @@ +/* + * v1_device_attribute.h + * + * DeviceAttribute must have exactly one field set. + */ + +#ifndef _v1_device_attribute_H_ +#define _v1_device_attribute_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_attribute_t v1_device_attribute_t; + + + + +typedef struct v1_device_attribute_t { + int _bool; //boolean + long _int; //numeric + char *string; // string + char *version; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_attribute_t; + +__attribute__((deprecated)) v1_device_attribute_t *v1_device_attribute_create( + int _bool, + long _int, + char *string, + char *version +); + +void v1_device_attribute_free(v1_device_attribute_t *v1_device_attribute); + +v1_device_attribute_t *v1_device_attribute_parseFromJSON(cJSON *v1_device_attributeJSON); + +cJSON *v1_device_attribute_convertToJSON(v1_device_attribute_t *v1_device_attribute); + +#endif /* _v1_device_attribute_H_ */ + diff --git a/kubernetes/model/v1_device_capacity.c b/kubernetes/model/v1_device_capacity.c new file mode 100644 index 00000000..00e4f9da --- /dev/null +++ b/kubernetes/model/v1_device_capacity.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include "v1_device_capacity.h" + + + +static v1_device_capacity_t *v1_device_capacity_create_internal( + v1_capacity_request_policy_t *request_policy, + char *value + ) { + v1_device_capacity_t *v1_device_capacity_local_var = malloc(sizeof(v1_device_capacity_t)); + if (!v1_device_capacity_local_var) { + return NULL; + } + v1_device_capacity_local_var->request_policy = request_policy; + v1_device_capacity_local_var->value = value; + + v1_device_capacity_local_var->_library_owned = 1; + return v1_device_capacity_local_var; +} + +__attribute__((deprecated)) v1_device_capacity_t *v1_device_capacity_create( + v1_capacity_request_policy_t *request_policy, + char *value + ) { + return v1_device_capacity_create_internal ( + request_policy, + value + ); +} + +void v1_device_capacity_free(v1_device_capacity_t *v1_device_capacity) { + if(NULL == v1_device_capacity){ + return ; + } + if(v1_device_capacity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_capacity_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_capacity->request_policy) { + v1_capacity_request_policy_free(v1_device_capacity->request_policy); + v1_device_capacity->request_policy = NULL; + } + if (v1_device_capacity->value) { + free(v1_device_capacity->value); + v1_device_capacity->value = NULL; + } + free(v1_device_capacity); +} + +cJSON *v1_device_capacity_convertToJSON(v1_device_capacity_t *v1_device_capacity) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_capacity->request_policy + if(v1_device_capacity->request_policy) { + cJSON *request_policy_local_JSON = v1_capacity_request_policy_convertToJSON(v1_device_capacity->request_policy); + if(request_policy_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "requestPolicy", request_policy_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_device_capacity->value + if (!v1_device_capacity->value) { + goto fail; + } + if(cJSON_AddStringToObject(item, "value", v1_device_capacity->value) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_capacity_t *v1_device_capacity_parseFromJSON(cJSON *v1_device_capacityJSON){ + + v1_device_capacity_t *v1_device_capacity_local_var = NULL; + + // define the local variable for v1_device_capacity->request_policy + v1_capacity_request_policy_t *request_policy_local_nonprim = NULL; + + // v1_device_capacity->request_policy + cJSON *request_policy = cJSON_GetObjectItemCaseSensitive(v1_device_capacityJSON, "requestPolicy"); + if (cJSON_IsNull(request_policy)) { + request_policy = NULL; + } + if (request_policy) { + request_policy_local_nonprim = v1_capacity_request_policy_parseFromJSON(request_policy); //nonprimitive + } + + // v1_device_capacity->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_device_capacityJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (!value) { + goto end; + } + + + if(!cJSON_IsString(value)) + { + goto end; //String + } + + + v1_device_capacity_local_var = v1_device_capacity_create_internal ( + request_policy ? request_policy_local_nonprim : NULL, + strdup(value->valuestring) + ); + + return v1_device_capacity_local_var; +end: + if (request_policy_local_nonprim) { + v1_capacity_request_policy_free(request_policy_local_nonprim); + request_policy_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_capacity.h b/kubernetes/model/v1_device_capacity.h new file mode 100644 index 00000000..59fe924e --- /dev/null +++ b/kubernetes/model/v1_device_capacity.h @@ -0,0 +1,41 @@ +/* + * v1_device_capacity.h + * + * DeviceCapacity describes a quantity associated with a device. + */ + +#ifndef _v1_device_capacity_H_ +#define _v1_device_capacity_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_capacity_t v1_device_capacity_t; + +#include "v1_capacity_request_policy.h" + + + +typedef struct v1_device_capacity_t { + struct v1_capacity_request_policy_t *request_policy; //model + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_capacity_t; + +__attribute__((deprecated)) v1_device_capacity_t *v1_device_capacity_create( + v1_capacity_request_policy_t *request_policy, + char *value +); + +void v1_device_capacity_free(v1_device_capacity_t *v1_device_capacity); + +v1_device_capacity_t *v1_device_capacity_parseFromJSON(cJSON *v1_device_capacityJSON); + +cJSON *v1_device_capacity_convertToJSON(v1_device_capacity_t *v1_device_capacity); + +#endif /* _v1_device_capacity_H_ */ + diff --git a/kubernetes/model/v1_device_claim.c b/kubernetes/model/v1_device_claim.c new file mode 100644 index 00000000..d009f26a --- /dev/null +++ b/kubernetes/model/v1_device_claim.c @@ -0,0 +1,263 @@ +#include +#include +#include +#include "v1_device_claim.h" + + + +static v1_device_claim_t *v1_device_claim_create_internal( + list_t *config, + list_t *constraints, + list_t *requests + ) { + v1_device_claim_t *v1_device_claim_local_var = malloc(sizeof(v1_device_claim_t)); + if (!v1_device_claim_local_var) { + return NULL; + } + v1_device_claim_local_var->config = config; + v1_device_claim_local_var->constraints = constraints; + v1_device_claim_local_var->requests = requests; + + v1_device_claim_local_var->_library_owned = 1; + return v1_device_claim_local_var; +} + +__attribute__((deprecated)) v1_device_claim_t *v1_device_claim_create( + list_t *config, + list_t *constraints, + list_t *requests + ) { + return v1_device_claim_create_internal ( + config, + constraints, + requests + ); +} + +void v1_device_claim_free(v1_device_claim_t *v1_device_claim) { + if(NULL == v1_device_claim){ + return ; + } + if(v1_device_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_claim_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_claim->config) { + list_ForEach(listEntry, v1_device_claim->config) { + v1_device_claim_configuration_free(listEntry->data); + } + list_freeList(v1_device_claim->config); + v1_device_claim->config = NULL; + } + if (v1_device_claim->constraints) { + list_ForEach(listEntry, v1_device_claim->constraints) { + v1_device_constraint_free(listEntry->data); + } + list_freeList(v1_device_claim->constraints); + v1_device_claim->constraints = NULL; + } + if (v1_device_claim->requests) { + list_ForEach(listEntry, v1_device_claim->requests) { + v1_device_request_free(listEntry->data); + } + list_freeList(v1_device_claim->requests); + v1_device_claim->requests = NULL; + } + free(v1_device_claim); +} + +cJSON *v1_device_claim_convertToJSON(v1_device_claim_t *v1_device_claim) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_claim->config + if(v1_device_claim->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1_device_claim->config) { + list_ForEach(configListEntry, v1_device_claim->config) { + cJSON *itemLocal = v1_device_claim_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1_device_claim->constraints + if(v1_device_claim->constraints) { + cJSON *constraints = cJSON_AddArrayToObject(item, "constraints"); + if(constraints == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *constraintsListEntry; + if (v1_device_claim->constraints) { + list_ForEach(constraintsListEntry, v1_device_claim->constraints) { + cJSON *itemLocal = v1_device_constraint_convertToJSON(constraintsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(constraints, itemLocal); + } + } + } + + + // v1_device_claim->requests + if(v1_device_claim->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *requestsListEntry; + if (v1_device_claim->requests) { + list_ForEach(requestsListEntry, v1_device_claim->requests) { + cJSON *itemLocal = v1_device_request_convertToJSON(requestsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(requests, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_claim_t *v1_device_claim_parseFromJSON(cJSON *v1_device_claimJSON){ + + v1_device_claim_t *v1_device_claim_local_var = NULL; + + // define the local list for v1_device_claim->config + list_t *configList = NULL; + + // define the local list for v1_device_claim->constraints + list_t *constraintsList = NULL; + + // define the local list for v1_device_claim->requests + list_t *requestsList = NULL; + + // v1_device_claim->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1_device_claimJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1_device_claim_configuration_t *configItem = v1_device_claim_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1_device_claim->constraints + cJSON *constraints = cJSON_GetObjectItemCaseSensitive(v1_device_claimJSON, "constraints"); + if (cJSON_IsNull(constraints)) { + constraints = NULL; + } + if (constraints) { + cJSON *constraints_local_nonprimitive = NULL; + if(!cJSON_IsArray(constraints)){ + goto end; //nonprimitive container + } + + constraintsList = list_createList(); + + cJSON_ArrayForEach(constraints_local_nonprimitive,constraints ) + { + if(!cJSON_IsObject(constraints_local_nonprimitive)){ + goto end; + } + v1_device_constraint_t *constraintsItem = v1_device_constraint_parseFromJSON(constraints_local_nonprimitive); + + list_addElement(constraintsList, constraintsItem); + } + } + + // v1_device_claim->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_device_claimJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local_nonprimitive = NULL; + if(!cJSON_IsArray(requests)){ + goto end; //nonprimitive container + } + + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local_nonprimitive,requests ) + { + if(!cJSON_IsObject(requests_local_nonprimitive)){ + goto end; + } + v1_device_request_t *requestsItem = v1_device_request_parseFromJSON(requests_local_nonprimitive); + + list_addElement(requestsList, requestsItem); + } + } + + + v1_device_claim_local_var = v1_device_claim_create_internal ( + config ? configList : NULL, + constraints ? constraintsList : NULL, + requests ? requestsList : NULL + ); + + return v1_device_claim_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1_device_claim_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (constraintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, constraintsList) { + v1_device_constraint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(constraintsList); + constraintsList = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + v1_device_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_claim.h b/kubernetes/model/v1_device_claim.h new file mode 100644 index 00000000..c72d96fe --- /dev/null +++ b/kubernetes/model/v1_device_claim.h @@ -0,0 +1,45 @@ +/* + * v1_device_claim.h + * + * DeviceClaim defines how to request devices with a ResourceClaim. + */ + +#ifndef _v1_device_claim_H_ +#define _v1_device_claim_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_claim_t v1_device_claim_t; + +#include "v1_device_claim_configuration.h" +#include "v1_device_constraint.h" +#include "v1_device_request.h" + + + +typedef struct v1_device_claim_t { + list_t *config; //nonprimitive container + list_t *constraints; //nonprimitive container + list_t *requests; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_claim_t; + +__attribute__((deprecated)) v1_device_claim_t *v1_device_claim_create( + list_t *config, + list_t *constraints, + list_t *requests +); + +void v1_device_claim_free(v1_device_claim_t *v1_device_claim); + +v1_device_claim_t *v1_device_claim_parseFromJSON(cJSON *v1_device_claimJSON); + +cJSON *v1_device_claim_convertToJSON(v1_device_claim_t *v1_device_claim); + +#endif /* _v1_device_claim_H_ */ + diff --git a/kubernetes/model/v1_device_claim_configuration.c b/kubernetes/model/v1_device_claim_configuration.c new file mode 100644 index 00000000..35709d6b --- /dev/null +++ b/kubernetes/model/v1_device_claim_configuration.c @@ -0,0 +1,160 @@ +#include +#include +#include +#include "v1_device_claim_configuration.h" + + + +static v1_device_claim_configuration_t *v1_device_claim_configuration_create_internal( + v1_opaque_device_configuration_t *opaque, + list_t *requests + ) { + v1_device_claim_configuration_t *v1_device_claim_configuration_local_var = malloc(sizeof(v1_device_claim_configuration_t)); + if (!v1_device_claim_configuration_local_var) { + return NULL; + } + v1_device_claim_configuration_local_var->opaque = opaque; + v1_device_claim_configuration_local_var->requests = requests; + + v1_device_claim_configuration_local_var->_library_owned = 1; + return v1_device_claim_configuration_local_var; +} + +__attribute__((deprecated)) v1_device_claim_configuration_t *v1_device_claim_configuration_create( + v1_opaque_device_configuration_t *opaque, + list_t *requests + ) { + return v1_device_claim_configuration_create_internal ( + opaque, + requests + ); +} + +void v1_device_claim_configuration_free(v1_device_claim_configuration_t *v1_device_claim_configuration) { + if(NULL == v1_device_claim_configuration){ + return ; + } + if(v1_device_claim_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_claim_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_claim_configuration->opaque) { + v1_opaque_device_configuration_free(v1_device_claim_configuration->opaque); + v1_device_claim_configuration->opaque = NULL; + } + if (v1_device_claim_configuration->requests) { + list_ForEach(listEntry, v1_device_claim_configuration->requests) { + free(listEntry->data); + } + list_freeList(v1_device_claim_configuration->requests); + v1_device_claim_configuration->requests = NULL; + } + free(v1_device_claim_configuration); +} + +cJSON *v1_device_claim_configuration_convertToJSON(v1_device_claim_configuration_t *v1_device_claim_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_claim_configuration->opaque + if(v1_device_claim_configuration->opaque) { + cJSON *opaque_local_JSON = v1_opaque_device_configuration_convertToJSON(v1_device_claim_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_device_claim_configuration->requests + if(v1_device_claim_configuration->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1_device_claim_configuration->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_claim_configuration_t *v1_device_claim_configuration_parseFromJSON(cJSON *v1_device_claim_configurationJSON){ + + v1_device_claim_configuration_t *v1_device_claim_configuration_local_var = NULL; + + // define the local variable for v1_device_claim_configuration->opaque + v1_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // define the local list for v1_device_claim_configuration->requests + list_t *requestsList = NULL; + + // v1_device_claim_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1_device_claim_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + // v1_device_claim_configuration->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_device_claim_configurationJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + + v1_device_claim_configuration_local_var = v1_device_claim_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL, + requests ? requestsList : NULL + ); + + return v1_device_claim_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_claim_configuration.h b/kubernetes/model/v1_device_claim_configuration.h new file mode 100644 index 00000000..9378626e --- /dev/null +++ b/kubernetes/model/v1_device_claim_configuration.h @@ -0,0 +1,41 @@ +/* + * v1_device_claim_configuration.h + * + * DeviceClaimConfiguration is used for configuration parameters in DeviceClaim. + */ + +#ifndef _v1_device_claim_configuration_H_ +#define _v1_device_claim_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_claim_configuration_t v1_device_claim_configuration_t; + +#include "v1_opaque_device_configuration.h" + + + +typedef struct v1_device_claim_configuration_t { + struct v1_opaque_device_configuration_t *opaque; //model + list_t *requests; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_claim_configuration_t; + +__attribute__((deprecated)) v1_device_claim_configuration_t *v1_device_claim_configuration_create( + v1_opaque_device_configuration_t *opaque, + list_t *requests +); + +void v1_device_claim_configuration_free(v1_device_claim_configuration_t *v1_device_claim_configuration); + +v1_device_claim_configuration_t *v1_device_claim_configuration_parseFromJSON(cJSON *v1_device_claim_configurationJSON); + +cJSON *v1_device_claim_configuration_convertToJSON(v1_device_claim_configuration_t *v1_device_claim_configuration); + +#endif /* _v1_device_claim_configuration_H_ */ + diff --git a/kubernetes/model/v1_device_class.c b/kubernetes/model/v1_device_class.c new file mode 100644 index 00000000..bfac8c6d --- /dev/null +++ b/kubernetes/model/v1_device_class.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1_device_class.h" + + + +static v1_device_class_t *v1_device_class_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_device_class_spec_t *spec + ) { + v1_device_class_t *v1_device_class_local_var = malloc(sizeof(v1_device_class_t)); + if (!v1_device_class_local_var) { + return NULL; + } + v1_device_class_local_var->api_version = api_version; + v1_device_class_local_var->kind = kind; + v1_device_class_local_var->metadata = metadata; + v1_device_class_local_var->spec = spec; + + v1_device_class_local_var->_library_owned = 1; + return v1_device_class_local_var; +} + +__attribute__((deprecated)) v1_device_class_t *v1_device_class_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_device_class_spec_t *spec + ) { + return v1_device_class_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1_device_class_free(v1_device_class_t *v1_device_class) { + if(NULL == v1_device_class){ + return ; + } + if(v1_device_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_class_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_class->api_version) { + free(v1_device_class->api_version); + v1_device_class->api_version = NULL; + } + if (v1_device_class->kind) { + free(v1_device_class->kind); + v1_device_class->kind = NULL; + } + if (v1_device_class->metadata) { + v1_object_meta_free(v1_device_class->metadata); + v1_device_class->metadata = NULL; + } + if (v1_device_class->spec) { + v1_device_class_spec_free(v1_device_class->spec); + v1_device_class->spec = NULL; + } + free(v1_device_class); +} + +cJSON *v1_device_class_convertToJSON(v1_device_class_t *v1_device_class) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_class->api_version + if(v1_device_class->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_device_class->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_device_class->kind + if(v1_device_class->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_device_class->kind) == NULL) { + goto fail; //String + } + } + + + // v1_device_class->metadata + if(v1_device_class->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1_device_class->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_device_class->spec + if (!v1_device_class->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1_device_class_spec_convertToJSON(v1_device_class->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_class_t *v1_device_class_parseFromJSON(cJSON *v1_device_classJSON){ + + v1_device_class_t *v1_device_class_local_var = NULL; + + // define the local variable for v1_device_class->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1_device_class->spec + v1_device_class_spec_t *spec_local_nonprim = NULL; + + // v1_device_class->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_device_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_device_class->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_device_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_device_class->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_device_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1_device_class->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_device_classJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1_device_class_spec_parseFromJSON(spec); //nonprimitive + + + v1_device_class_local_var = v1_device_class_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1_device_class_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1_device_class_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_class.h b/kubernetes/model/v1_device_class.h new file mode 100644 index 00000000..2a806f22 --- /dev/null +++ b/kubernetes/model/v1_device_class.h @@ -0,0 +1,46 @@ +/* + * v1_device_class.h + * + * DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1_device_class_H_ +#define _v1_device_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_class_t v1_device_class_t; + +#include "v1_device_class_spec.h" +#include "v1_object_meta.h" + + + +typedef struct v1_device_class_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1_device_class_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_class_t; + +__attribute__((deprecated)) v1_device_class_t *v1_device_class_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_device_class_spec_t *spec +); + +void v1_device_class_free(v1_device_class_t *v1_device_class); + +v1_device_class_t *v1_device_class_parseFromJSON(cJSON *v1_device_classJSON); + +cJSON *v1_device_class_convertToJSON(v1_device_class_t *v1_device_class); + +#endif /* _v1_device_class_H_ */ + diff --git a/kubernetes/model/v1_device_class_configuration.c b/kubernetes/model/v1_device_class_configuration.c new file mode 100644 index 00000000..f190ada0 --- /dev/null +++ b/kubernetes/model/v1_device_class_configuration.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1_device_class_configuration.h" + + + +static v1_device_class_configuration_t *v1_device_class_configuration_create_internal( + v1_opaque_device_configuration_t *opaque + ) { + v1_device_class_configuration_t *v1_device_class_configuration_local_var = malloc(sizeof(v1_device_class_configuration_t)); + if (!v1_device_class_configuration_local_var) { + return NULL; + } + v1_device_class_configuration_local_var->opaque = opaque; + + v1_device_class_configuration_local_var->_library_owned = 1; + return v1_device_class_configuration_local_var; +} + +__attribute__((deprecated)) v1_device_class_configuration_t *v1_device_class_configuration_create( + v1_opaque_device_configuration_t *opaque + ) { + return v1_device_class_configuration_create_internal ( + opaque + ); +} + +void v1_device_class_configuration_free(v1_device_class_configuration_t *v1_device_class_configuration) { + if(NULL == v1_device_class_configuration){ + return ; + } + if(v1_device_class_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_class_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_class_configuration->opaque) { + v1_opaque_device_configuration_free(v1_device_class_configuration->opaque); + v1_device_class_configuration->opaque = NULL; + } + free(v1_device_class_configuration); +} + +cJSON *v1_device_class_configuration_convertToJSON(v1_device_class_configuration_t *v1_device_class_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_class_configuration->opaque + if(v1_device_class_configuration->opaque) { + cJSON *opaque_local_JSON = v1_opaque_device_configuration_convertToJSON(v1_device_class_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_class_configuration_t *v1_device_class_configuration_parseFromJSON(cJSON *v1_device_class_configurationJSON){ + + v1_device_class_configuration_t *v1_device_class_configuration_local_var = NULL; + + // define the local variable for v1_device_class_configuration->opaque + v1_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // v1_device_class_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1_device_class_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + + v1_device_class_configuration_local_var = v1_device_class_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL + ); + + return v1_device_class_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_class_configuration.h b/kubernetes/model/v1_device_class_configuration.h new file mode 100644 index 00000000..db97b08b --- /dev/null +++ b/kubernetes/model/v1_device_class_configuration.h @@ -0,0 +1,39 @@ +/* + * v1_device_class_configuration.h + * + * DeviceClassConfiguration is used in DeviceClass. + */ + +#ifndef _v1_device_class_configuration_H_ +#define _v1_device_class_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_class_configuration_t v1_device_class_configuration_t; + +#include "v1_opaque_device_configuration.h" + + + +typedef struct v1_device_class_configuration_t { + struct v1_opaque_device_configuration_t *opaque; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_class_configuration_t; + +__attribute__((deprecated)) v1_device_class_configuration_t *v1_device_class_configuration_create( + v1_opaque_device_configuration_t *opaque +); + +void v1_device_class_configuration_free(v1_device_class_configuration_t *v1_device_class_configuration); + +v1_device_class_configuration_t *v1_device_class_configuration_parseFromJSON(cJSON *v1_device_class_configurationJSON); + +cJSON *v1_device_class_configuration_convertToJSON(v1_device_class_configuration_t *v1_device_class_configuration); + +#endif /* _v1_device_class_configuration_H_ */ + diff --git a/kubernetes/model/v1_device_class_list.c b/kubernetes/model/v1_device_class_list.c new file mode 100644 index 00000000..c6706d44 --- /dev/null +++ b/kubernetes/model/v1_device_class_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1_device_class_list.h" + + + +static v1_device_class_list_t *v1_device_class_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1_device_class_list_t *v1_device_class_list_local_var = malloc(sizeof(v1_device_class_list_t)); + if (!v1_device_class_list_local_var) { + return NULL; + } + v1_device_class_list_local_var->api_version = api_version; + v1_device_class_list_local_var->items = items; + v1_device_class_list_local_var->kind = kind; + v1_device_class_list_local_var->metadata = metadata; + + v1_device_class_list_local_var->_library_owned = 1; + return v1_device_class_list_local_var; +} + +__attribute__((deprecated)) v1_device_class_list_t *v1_device_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_device_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1_device_class_list_free(v1_device_class_list_t *v1_device_class_list) { + if(NULL == v1_device_class_list){ + return ; + } + if(v1_device_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_class_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_class_list->api_version) { + free(v1_device_class_list->api_version); + v1_device_class_list->api_version = NULL; + } + if (v1_device_class_list->items) { + list_ForEach(listEntry, v1_device_class_list->items) { + v1_device_class_free(listEntry->data); + } + list_freeList(v1_device_class_list->items); + v1_device_class_list->items = NULL; + } + if (v1_device_class_list->kind) { + free(v1_device_class_list->kind); + v1_device_class_list->kind = NULL; + } + if (v1_device_class_list->metadata) { + v1_list_meta_free(v1_device_class_list->metadata); + v1_device_class_list->metadata = NULL; + } + free(v1_device_class_list); +} + +cJSON *v1_device_class_list_convertToJSON(v1_device_class_list_t *v1_device_class_list) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_class_list->api_version + if(v1_device_class_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_device_class_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_device_class_list->items + if (!v1_device_class_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1_device_class_list->items) { + list_ForEach(itemsListEntry, v1_device_class_list->items) { + cJSON *itemLocal = v1_device_class_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1_device_class_list->kind + if(v1_device_class_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_device_class_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1_device_class_list->metadata + if(v1_device_class_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1_device_class_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_class_list_t *v1_device_class_list_parseFromJSON(cJSON *v1_device_class_listJSON){ + + v1_device_class_list_t *v1_device_class_list_local_var = NULL; + + // define the local list for v1_device_class_list->items + list_t *itemsList = NULL; + + // define the local variable for v1_device_class_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1_device_class_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_device_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_device_class_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_device_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1_device_class_t *itemsItem = v1_device_class_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1_device_class_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_device_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_device_class_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_device_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1_device_class_list_local_var = v1_device_class_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1_device_class_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_device_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_class_list.h b/kubernetes/model/v1_device_class_list.h new file mode 100644 index 00000000..f21d2709 --- /dev/null +++ b/kubernetes/model/v1_device_class_list.h @@ -0,0 +1,46 @@ +/* + * v1_device_class_list.h + * + * DeviceClassList is a collection of classes. + */ + +#ifndef _v1_device_class_list_H_ +#define _v1_device_class_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_class_list_t v1_device_class_list_t; + +#include "v1_device_class.h" +#include "v1_list_meta.h" + + + +typedef struct v1_device_class_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_class_list_t; + +__attribute__((deprecated)) v1_device_class_list_t *v1_device_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1_device_class_list_free(v1_device_class_list_t *v1_device_class_list); + +v1_device_class_list_t *v1_device_class_list_parseFromJSON(cJSON *v1_device_class_listJSON); + +cJSON *v1_device_class_list_convertToJSON(v1_device_class_list_t *v1_device_class_list); + +#endif /* _v1_device_class_list_H_ */ + diff --git a/kubernetes/model/v1_device_class_spec.c b/kubernetes/model/v1_device_class_spec.c new file mode 100644 index 00000000..b9e7a0d3 --- /dev/null +++ b/kubernetes/model/v1_device_class_spec.c @@ -0,0 +1,224 @@ +#include +#include +#include +#include "v1_device_class_spec.h" + + + +static v1_device_class_spec_t *v1_device_class_spec_create_internal( + list_t *config, + char *extended_resource_name, + list_t *selectors + ) { + v1_device_class_spec_t *v1_device_class_spec_local_var = malloc(sizeof(v1_device_class_spec_t)); + if (!v1_device_class_spec_local_var) { + return NULL; + } + v1_device_class_spec_local_var->config = config; + v1_device_class_spec_local_var->extended_resource_name = extended_resource_name; + v1_device_class_spec_local_var->selectors = selectors; + + v1_device_class_spec_local_var->_library_owned = 1; + return v1_device_class_spec_local_var; +} + +__attribute__((deprecated)) v1_device_class_spec_t *v1_device_class_spec_create( + list_t *config, + char *extended_resource_name, + list_t *selectors + ) { + return v1_device_class_spec_create_internal ( + config, + extended_resource_name, + selectors + ); +} + +void v1_device_class_spec_free(v1_device_class_spec_t *v1_device_class_spec) { + if(NULL == v1_device_class_spec){ + return ; + } + if(v1_device_class_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_class_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_class_spec->config) { + list_ForEach(listEntry, v1_device_class_spec->config) { + v1_device_class_configuration_free(listEntry->data); + } + list_freeList(v1_device_class_spec->config); + v1_device_class_spec->config = NULL; + } + if (v1_device_class_spec->extended_resource_name) { + free(v1_device_class_spec->extended_resource_name); + v1_device_class_spec->extended_resource_name = NULL; + } + if (v1_device_class_spec->selectors) { + list_ForEach(listEntry, v1_device_class_spec->selectors) { + v1_device_selector_free(listEntry->data); + } + list_freeList(v1_device_class_spec->selectors); + v1_device_class_spec->selectors = NULL; + } + free(v1_device_class_spec); +} + +cJSON *v1_device_class_spec_convertToJSON(v1_device_class_spec_t *v1_device_class_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_class_spec->config + if(v1_device_class_spec->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1_device_class_spec->config) { + list_ForEach(configListEntry, v1_device_class_spec->config) { + cJSON *itemLocal = v1_device_class_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1_device_class_spec->extended_resource_name + if(v1_device_class_spec->extended_resource_name) { + if(cJSON_AddStringToObject(item, "extendedResourceName", v1_device_class_spec->extended_resource_name) == NULL) { + goto fail; //String + } + } + + + // v1_device_class_spec->selectors + if(v1_device_class_spec->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1_device_class_spec->selectors) { + list_ForEach(selectorsListEntry, v1_device_class_spec->selectors) { + cJSON *itemLocal = v1_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_class_spec_t *v1_device_class_spec_parseFromJSON(cJSON *v1_device_class_specJSON){ + + v1_device_class_spec_t *v1_device_class_spec_local_var = NULL; + + // define the local list for v1_device_class_spec->config + list_t *configList = NULL; + + // define the local list for v1_device_class_spec->selectors + list_t *selectorsList = NULL; + + // v1_device_class_spec->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1_device_class_specJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1_device_class_configuration_t *configItem = v1_device_class_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1_device_class_spec->extended_resource_name + cJSON *extended_resource_name = cJSON_GetObjectItemCaseSensitive(v1_device_class_specJSON, "extendedResourceName"); + if (cJSON_IsNull(extended_resource_name)) { + extended_resource_name = NULL; + } + if (extended_resource_name) { + if(!cJSON_IsString(extended_resource_name) && !cJSON_IsNull(extended_resource_name)) + { + goto end; //String + } + } + + // v1_device_class_spec->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1_device_class_specJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1_device_selector_t *selectorsItem = v1_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + + v1_device_class_spec_local_var = v1_device_class_spec_create_internal ( + config ? configList : NULL, + extended_resource_name && !cJSON_IsNull(extended_resource_name) ? strdup(extended_resource_name->valuestring) : NULL, + selectors ? selectorsList : NULL + ); + + return v1_device_class_spec_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1_device_class_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_class_spec.h b/kubernetes/model/v1_device_class_spec.h new file mode 100644 index 00000000..e63b9521 --- /dev/null +++ b/kubernetes/model/v1_device_class_spec.h @@ -0,0 +1,44 @@ +/* + * v1_device_class_spec.h + * + * DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it. + */ + +#ifndef _v1_device_class_spec_H_ +#define _v1_device_class_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_class_spec_t v1_device_class_spec_t; + +#include "v1_device_class_configuration.h" +#include "v1_device_selector.h" + + + +typedef struct v1_device_class_spec_t { + list_t *config; //nonprimitive container + char *extended_resource_name; // string + list_t *selectors; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_class_spec_t; + +__attribute__((deprecated)) v1_device_class_spec_t *v1_device_class_spec_create( + list_t *config, + char *extended_resource_name, + list_t *selectors +); + +void v1_device_class_spec_free(v1_device_class_spec_t *v1_device_class_spec); + +v1_device_class_spec_t *v1_device_class_spec_parseFromJSON(cJSON *v1_device_class_specJSON); + +cJSON *v1_device_class_spec_convertToJSON(v1_device_class_spec_t *v1_device_class_spec); + +#endif /* _v1_device_class_spec_H_ */ + diff --git a/kubernetes/model/v1_device_constraint.c b/kubernetes/model/v1_device_constraint.c new file mode 100644 index 00000000..67538b56 --- /dev/null +++ b/kubernetes/model/v1_device_constraint.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include "v1_device_constraint.h" + + + +static v1_device_constraint_t *v1_device_constraint_create_internal( + char *distinct_attribute, + char *match_attribute, + list_t *requests + ) { + v1_device_constraint_t *v1_device_constraint_local_var = malloc(sizeof(v1_device_constraint_t)); + if (!v1_device_constraint_local_var) { + return NULL; + } + v1_device_constraint_local_var->distinct_attribute = distinct_attribute; + v1_device_constraint_local_var->match_attribute = match_attribute; + v1_device_constraint_local_var->requests = requests; + + v1_device_constraint_local_var->_library_owned = 1; + return v1_device_constraint_local_var; +} + +__attribute__((deprecated)) v1_device_constraint_t *v1_device_constraint_create( + char *distinct_attribute, + char *match_attribute, + list_t *requests + ) { + return v1_device_constraint_create_internal ( + distinct_attribute, + match_attribute, + requests + ); +} + +void v1_device_constraint_free(v1_device_constraint_t *v1_device_constraint) { + if(NULL == v1_device_constraint){ + return ; + } + if(v1_device_constraint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_constraint_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_constraint->distinct_attribute) { + free(v1_device_constraint->distinct_attribute); + v1_device_constraint->distinct_attribute = NULL; + } + if (v1_device_constraint->match_attribute) { + free(v1_device_constraint->match_attribute); + v1_device_constraint->match_attribute = NULL; + } + if (v1_device_constraint->requests) { + list_ForEach(listEntry, v1_device_constraint->requests) { + free(listEntry->data); + } + list_freeList(v1_device_constraint->requests); + v1_device_constraint->requests = NULL; + } + free(v1_device_constraint); +} + +cJSON *v1_device_constraint_convertToJSON(v1_device_constraint_t *v1_device_constraint) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_constraint->distinct_attribute + if(v1_device_constraint->distinct_attribute) { + if(cJSON_AddStringToObject(item, "distinctAttribute", v1_device_constraint->distinct_attribute) == NULL) { + goto fail; //String + } + } + + + // v1_device_constraint->match_attribute + if(v1_device_constraint->match_attribute) { + if(cJSON_AddStringToObject(item, "matchAttribute", v1_device_constraint->match_attribute) == NULL) { + goto fail; //String + } + } + + + // v1_device_constraint->requests + if(v1_device_constraint->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1_device_constraint->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_constraint_t *v1_device_constraint_parseFromJSON(cJSON *v1_device_constraintJSON){ + + v1_device_constraint_t *v1_device_constraint_local_var = NULL; + + // define the local list for v1_device_constraint->requests + list_t *requestsList = NULL; + + // v1_device_constraint->distinct_attribute + cJSON *distinct_attribute = cJSON_GetObjectItemCaseSensitive(v1_device_constraintJSON, "distinctAttribute"); + if (cJSON_IsNull(distinct_attribute)) { + distinct_attribute = NULL; + } + if (distinct_attribute) { + if(!cJSON_IsString(distinct_attribute) && !cJSON_IsNull(distinct_attribute)) + { + goto end; //String + } + } + + // v1_device_constraint->match_attribute + cJSON *match_attribute = cJSON_GetObjectItemCaseSensitive(v1_device_constraintJSON, "matchAttribute"); + if (cJSON_IsNull(match_attribute)) { + match_attribute = NULL; + } + if (match_attribute) { + if(!cJSON_IsString(match_attribute) && !cJSON_IsNull(match_attribute)) + { + goto end; //String + } + } + + // v1_device_constraint->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_device_constraintJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + + v1_device_constraint_local_var = v1_device_constraint_create_internal ( + distinct_attribute && !cJSON_IsNull(distinct_attribute) ? strdup(distinct_attribute->valuestring) : NULL, + match_attribute && !cJSON_IsNull(match_attribute) ? strdup(match_attribute->valuestring) : NULL, + requests ? requestsList : NULL + ); + + return v1_device_constraint_local_var; +end: + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_constraint.h b/kubernetes/model/v1_device_constraint.h new file mode 100644 index 00000000..0686022f --- /dev/null +++ b/kubernetes/model/v1_device_constraint.h @@ -0,0 +1,42 @@ +/* + * v1_device_constraint.h + * + * DeviceConstraint must have exactly one field set besides Requests. + */ + +#ifndef _v1_device_constraint_H_ +#define _v1_device_constraint_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_constraint_t v1_device_constraint_t; + + + + +typedef struct v1_device_constraint_t { + char *distinct_attribute; // string + char *match_attribute; // string + list_t *requests; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_constraint_t; + +__attribute__((deprecated)) v1_device_constraint_t *v1_device_constraint_create( + char *distinct_attribute, + char *match_attribute, + list_t *requests +); + +void v1_device_constraint_free(v1_device_constraint_t *v1_device_constraint); + +v1_device_constraint_t *v1_device_constraint_parseFromJSON(cJSON *v1_device_constraintJSON); + +cJSON *v1_device_constraint_convertToJSON(v1_device_constraint_t *v1_device_constraint); + +#endif /* _v1_device_constraint_H_ */ + diff --git a/kubernetes/model/v1_device_counter_consumption.c b/kubernetes/model/v1_device_counter_consumption.c new file mode 100644 index 00000000..7c1fea81 --- /dev/null +++ b/kubernetes/model/v1_device_counter_consumption.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1_device_counter_consumption.h" + + + +static v1_device_counter_consumption_t *v1_device_counter_consumption_create_internal( + char *counter_set, + list_t* counters + ) { + v1_device_counter_consumption_t *v1_device_counter_consumption_local_var = malloc(sizeof(v1_device_counter_consumption_t)); + if (!v1_device_counter_consumption_local_var) { + return NULL; + } + v1_device_counter_consumption_local_var->counter_set = counter_set; + v1_device_counter_consumption_local_var->counters = counters; + + v1_device_counter_consumption_local_var->_library_owned = 1; + return v1_device_counter_consumption_local_var; +} + +__attribute__((deprecated)) v1_device_counter_consumption_t *v1_device_counter_consumption_create( + char *counter_set, + list_t* counters + ) { + return v1_device_counter_consumption_create_internal ( + counter_set, + counters + ); +} + +void v1_device_counter_consumption_free(v1_device_counter_consumption_t *v1_device_counter_consumption) { + if(NULL == v1_device_counter_consumption){ + return ; + } + if(v1_device_counter_consumption->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_counter_consumption_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_counter_consumption->counter_set) { + free(v1_device_counter_consumption->counter_set); + v1_device_counter_consumption->counter_set = NULL; + } + if (v1_device_counter_consumption->counters) { + list_ForEach(listEntry, v1_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1_device_counter_consumption->counters); + v1_device_counter_consumption->counters = NULL; + } + free(v1_device_counter_consumption); +} + +cJSON *v1_device_counter_consumption_convertToJSON(v1_device_counter_consumption_t *v1_device_counter_consumption) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_counter_consumption->counter_set + if (!v1_device_counter_consumption->counter_set) { + goto fail; + } + if(cJSON_AddStringToObject(item, "counterSet", v1_device_counter_consumption->counter_set) == NULL) { + goto fail; //String + } + + + // v1_device_counter_consumption->counters + if (!v1_device_counter_consumption->counters) { + goto fail; + } + cJSON *counters = cJSON_AddObjectToObject(item, "counters"); + if(counters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = counters; + listEntry_t *countersListEntry; + if (v1_device_counter_consumption->counters) { + list_ForEach(countersListEntry, v1_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_counter_consumption_t *v1_device_counter_consumption_parseFromJSON(cJSON *v1_device_counter_consumptionJSON){ + + v1_device_counter_consumption_t *v1_device_counter_consumption_local_var = NULL; + + // define the local map for v1_device_counter_consumption->counters + list_t *countersList = NULL; + + // v1_device_counter_consumption->counter_set + cJSON *counter_set = cJSON_GetObjectItemCaseSensitive(v1_device_counter_consumptionJSON, "counterSet"); + if (cJSON_IsNull(counter_set)) { + counter_set = NULL; + } + if (!counter_set) { + goto end; + } + + + if(!cJSON_IsString(counter_set)) + { + goto end; //String + } + + // v1_device_counter_consumption->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1_device_counter_consumptionJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1_device_counter_consumption->counters is currently not supported. + + + + v1_device_counter_consumption_local_var = v1_device_counter_consumption_create_internal ( + strdup(counter_set->valuestring), + countersList + ); + + return v1_device_counter_consumption_local_var; +end: + + // The data type of the elements in v1_device_counter_consumption->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1_device_counter_consumption.h b/kubernetes/model/v1_device_counter_consumption.h new file mode 100644 index 00000000..da9691a4 --- /dev/null +++ b/kubernetes/model/v1_device_counter_consumption.h @@ -0,0 +1,41 @@ +/* + * v1_device_counter_consumption.h + * + * DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet. + */ + +#ifndef _v1_device_counter_consumption_H_ +#define _v1_device_counter_consumption_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_counter_consumption_t v1_device_counter_consumption_t; + +#include "v1_counter.h" + + + +typedef struct v1_device_counter_consumption_t { + char *counter_set; // string + list_t* counters; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_counter_consumption_t; + +__attribute__((deprecated)) v1_device_counter_consumption_t *v1_device_counter_consumption_create( + char *counter_set, + list_t* counters +); + +void v1_device_counter_consumption_free(v1_device_counter_consumption_t *v1_device_counter_consumption); + +v1_device_counter_consumption_t *v1_device_counter_consumption_parseFromJSON(cJSON *v1_device_counter_consumptionJSON); + +cJSON *v1_device_counter_consumption_convertToJSON(v1_device_counter_consumption_t *v1_device_counter_consumption); + +#endif /* _v1_device_counter_consumption_H_ */ + diff --git a/kubernetes/model/v1_device_request.c b/kubernetes/model/v1_device_request.c new file mode 100644 index 00000000..d39e3273 --- /dev/null +++ b/kubernetes/model/v1_device_request.c @@ -0,0 +1,198 @@ +#include +#include +#include +#include "v1_device_request.h" + + + +static v1_device_request_t *v1_device_request_create_internal( + v1_exact_device_request_t *exactly, + list_t *first_available, + char *name + ) { + v1_device_request_t *v1_device_request_local_var = malloc(sizeof(v1_device_request_t)); + if (!v1_device_request_local_var) { + return NULL; + } + v1_device_request_local_var->exactly = exactly; + v1_device_request_local_var->first_available = first_available; + v1_device_request_local_var->name = name; + + v1_device_request_local_var->_library_owned = 1; + return v1_device_request_local_var; +} + +__attribute__((deprecated)) v1_device_request_t *v1_device_request_create( + v1_exact_device_request_t *exactly, + list_t *first_available, + char *name + ) { + return v1_device_request_create_internal ( + exactly, + first_available, + name + ); +} + +void v1_device_request_free(v1_device_request_t *v1_device_request) { + if(NULL == v1_device_request){ + return ; + } + if(v1_device_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_request->exactly) { + v1_exact_device_request_free(v1_device_request->exactly); + v1_device_request->exactly = NULL; + } + if (v1_device_request->first_available) { + list_ForEach(listEntry, v1_device_request->first_available) { + v1_device_sub_request_free(listEntry->data); + } + list_freeList(v1_device_request->first_available); + v1_device_request->first_available = NULL; + } + if (v1_device_request->name) { + free(v1_device_request->name); + v1_device_request->name = NULL; + } + free(v1_device_request); +} + +cJSON *v1_device_request_convertToJSON(v1_device_request_t *v1_device_request) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_request->exactly + if(v1_device_request->exactly) { + cJSON *exactly_local_JSON = v1_exact_device_request_convertToJSON(v1_device_request->exactly); + if(exactly_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "exactly", exactly_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_device_request->first_available + if(v1_device_request->first_available) { + cJSON *first_available = cJSON_AddArrayToObject(item, "firstAvailable"); + if(first_available == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *first_availableListEntry; + if (v1_device_request->first_available) { + list_ForEach(first_availableListEntry, v1_device_request->first_available) { + cJSON *itemLocal = v1_device_sub_request_convertToJSON(first_availableListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(first_available, itemLocal); + } + } + } + + + // v1_device_request->name + if (!v1_device_request->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_device_request->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_request_t *v1_device_request_parseFromJSON(cJSON *v1_device_requestJSON){ + + v1_device_request_t *v1_device_request_local_var = NULL; + + // define the local variable for v1_device_request->exactly + v1_exact_device_request_t *exactly_local_nonprim = NULL; + + // define the local list for v1_device_request->first_available + list_t *first_availableList = NULL; + + // v1_device_request->exactly + cJSON *exactly = cJSON_GetObjectItemCaseSensitive(v1_device_requestJSON, "exactly"); + if (cJSON_IsNull(exactly)) { + exactly = NULL; + } + if (exactly) { + exactly_local_nonprim = v1_exact_device_request_parseFromJSON(exactly); //nonprimitive + } + + // v1_device_request->first_available + cJSON *first_available = cJSON_GetObjectItemCaseSensitive(v1_device_requestJSON, "firstAvailable"); + if (cJSON_IsNull(first_available)) { + first_available = NULL; + } + if (first_available) { + cJSON *first_available_local_nonprimitive = NULL; + if(!cJSON_IsArray(first_available)){ + goto end; //nonprimitive container + } + + first_availableList = list_createList(); + + cJSON_ArrayForEach(first_available_local_nonprimitive,first_available ) + { + if(!cJSON_IsObject(first_available_local_nonprimitive)){ + goto end; + } + v1_device_sub_request_t *first_availableItem = v1_device_sub_request_parseFromJSON(first_available_local_nonprimitive); + + list_addElement(first_availableList, first_availableItem); + } + } + + // v1_device_request->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_device_requestJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1_device_request_local_var = v1_device_request_create_internal ( + exactly ? exactly_local_nonprim : NULL, + first_available ? first_availableList : NULL, + strdup(name->valuestring) + ); + + return v1_device_request_local_var; +end: + if (exactly_local_nonprim) { + v1_exact_device_request_free(exactly_local_nonprim); + exactly_local_nonprim = NULL; + } + if (first_availableList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, first_availableList) { + v1_device_sub_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(first_availableList); + first_availableList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_request.h b/kubernetes/model/v1_device_request.h new file mode 100644 index 00000000..97b3c797 --- /dev/null +++ b/kubernetes/model/v1_device_request.h @@ -0,0 +1,44 @@ +/* + * v1_device_request.h + * + * DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices. With FirstAvailable it is also possible to provide a prioritized list of requests. + */ + +#ifndef _v1_device_request_H_ +#define _v1_device_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_request_t v1_device_request_t; + +#include "v1_device_sub_request.h" +#include "v1_exact_device_request.h" + + + +typedef struct v1_device_request_t { + struct v1_exact_device_request_t *exactly; //model + list_t *first_available; //nonprimitive container + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_request_t; + +__attribute__((deprecated)) v1_device_request_t *v1_device_request_create( + v1_exact_device_request_t *exactly, + list_t *first_available, + char *name +); + +void v1_device_request_free(v1_device_request_t *v1_device_request); + +v1_device_request_t *v1_device_request_parseFromJSON(cJSON *v1_device_requestJSON); + +cJSON *v1_device_request_convertToJSON(v1_device_request_t *v1_device_request); + +#endif /* _v1_device_request_H_ */ + diff --git a/kubernetes/model/v1_device_request_allocation_result.c b/kubernetes/model/v1_device_request_allocation_result.c new file mode 100644 index 00000000..7d0c7f6b --- /dev/null +++ b/kubernetes/model/v1_device_request_allocation_result.c @@ -0,0 +1,519 @@ +#include +#include +#include +#include "v1_device_request_allocation_result.h" + + + +static v1_device_request_allocation_result_t *v1_device_request_allocation_result_create_internal( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations + ) { + v1_device_request_allocation_result_t *v1_device_request_allocation_result_local_var = malloc(sizeof(v1_device_request_allocation_result_t)); + if (!v1_device_request_allocation_result_local_var) { + return NULL; + } + v1_device_request_allocation_result_local_var->admin_access = admin_access; + v1_device_request_allocation_result_local_var->binding_conditions = binding_conditions; + v1_device_request_allocation_result_local_var->binding_failure_conditions = binding_failure_conditions; + v1_device_request_allocation_result_local_var->consumed_capacity = consumed_capacity; + v1_device_request_allocation_result_local_var->device = device; + v1_device_request_allocation_result_local_var->driver = driver; + v1_device_request_allocation_result_local_var->pool = pool; + v1_device_request_allocation_result_local_var->request = request; + v1_device_request_allocation_result_local_var->share_id = share_id; + v1_device_request_allocation_result_local_var->tolerations = tolerations; + + v1_device_request_allocation_result_local_var->_library_owned = 1; + return v1_device_request_allocation_result_local_var; +} + +__attribute__((deprecated)) v1_device_request_allocation_result_t *v1_device_request_allocation_result_create( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations + ) { + return v1_device_request_allocation_result_create_internal ( + admin_access, + binding_conditions, + binding_failure_conditions, + consumed_capacity, + device, + driver, + pool, + request, + share_id, + tolerations + ); +} + +void v1_device_request_allocation_result_free(v1_device_request_allocation_result_t *v1_device_request_allocation_result) { + if(NULL == v1_device_request_allocation_result){ + return ; + } + if(v1_device_request_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_request_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_request_allocation_result->binding_conditions) { + list_ForEach(listEntry, v1_device_request_allocation_result->binding_conditions) { + free(listEntry->data); + } + list_freeList(v1_device_request_allocation_result->binding_conditions); + v1_device_request_allocation_result->binding_conditions = NULL; + } + if (v1_device_request_allocation_result->binding_failure_conditions) { + list_ForEach(listEntry, v1_device_request_allocation_result->binding_failure_conditions) { + free(listEntry->data); + } + list_freeList(v1_device_request_allocation_result->binding_failure_conditions); + v1_device_request_allocation_result->binding_failure_conditions = NULL; + } + if (v1_device_request_allocation_result->consumed_capacity) { + list_ForEach(listEntry, v1_device_request_allocation_result->consumed_capacity) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1_device_request_allocation_result->consumed_capacity); + v1_device_request_allocation_result->consumed_capacity = NULL; + } + if (v1_device_request_allocation_result->device) { + free(v1_device_request_allocation_result->device); + v1_device_request_allocation_result->device = NULL; + } + if (v1_device_request_allocation_result->driver) { + free(v1_device_request_allocation_result->driver); + v1_device_request_allocation_result->driver = NULL; + } + if (v1_device_request_allocation_result->pool) { + free(v1_device_request_allocation_result->pool); + v1_device_request_allocation_result->pool = NULL; + } + if (v1_device_request_allocation_result->request) { + free(v1_device_request_allocation_result->request); + v1_device_request_allocation_result->request = NULL; + } + if (v1_device_request_allocation_result->share_id) { + free(v1_device_request_allocation_result->share_id); + v1_device_request_allocation_result->share_id = NULL; + } + if (v1_device_request_allocation_result->tolerations) { + list_ForEach(listEntry, v1_device_request_allocation_result->tolerations) { + v1_device_toleration_free(listEntry->data); + } + list_freeList(v1_device_request_allocation_result->tolerations); + v1_device_request_allocation_result->tolerations = NULL; + } + free(v1_device_request_allocation_result); +} + +cJSON *v1_device_request_allocation_result_convertToJSON(v1_device_request_allocation_result_t *v1_device_request_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_request_allocation_result->admin_access + if(v1_device_request_allocation_result->admin_access) { + if(cJSON_AddBoolToObject(item, "adminAccess", v1_device_request_allocation_result->admin_access) == NULL) { + goto fail; //Bool + } + } + + + // v1_device_request_allocation_result->binding_conditions + if(v1_device_request_allocation_result->binding_conditions) { + cJSON *binding_conditions = cJSON_AddArrayToObject(item, "bindingConditions"); + if(binding_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_conditionsListEntry; + list_ForEach(binding_conditionsListEntry, v1_device_request_allocation_result->binding_conditions) { + if(cJSON_AddStringToObject(binding_conditions, "", binding_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1_device_request_allocation_result->binding_failure_conditions + if(v1_device_request_allocation_result->binding_failure_conditions) { + cJSON *binding_failure_conditions = cJSON_AddArrayToObject(item, "bindingFailureConditions"); + if(binding_failure_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_failure_conditionsListEntry; + list_ForEach(binding_failure_conditionsListEntry, v1_device_request_allocation_result->binding_failure_conditions) { + if(cJSON_AddStringToObject(binding_failure_conditions, "", binding_failure_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1_device_request_allocation_result->consumed_capacity + if(v1_device_request_allocation_result->consumed_capacity) { + cJSON *consumed_capacity = cJSON_AddObjectToObject(item, "consumedCapacity"); + if(consumed_capacity == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = consumed_capacity; + listEntry_t *consumed_capacityListEntry; + if (v1_device_request_allocation_result->consumed_capacity) { + list_ForEach(consumed_capacityListEntry, v1_device_request_allocation_result->consumed_capacity) { + keyValuePair_t *localKeyValue = consumed_capacityListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + + // v1_device_request_allocation_result->device + if (!v1_device_request_allocation_result->device) { + goto fail; + } + if(cJSON_AddStringToObject(item, "device", v1_device_request_allocation_result->device) == NULL) { + goto fail; //String + } + + + // v1_device_request_allocation_result->driver + if (!v1_device_request_allocation_result->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1_device_request_allocation_result->driver) == NULL) { + goto fail; //String + } + + + // v1_device_request_allocation_result->pool + if (!v1_device_request_allocation_result->pool) { + goto fail; + } + if(cJSON_AddStringToObject(item, "pool", v1_device_request_allocation_result->pool) == NULL) { + goto fail; //String + } + + + // v1_device_request_allocation_result->request + if (!v1_device_request_allocation_result->request) { + goto fail; + } + if(cJSON_AddStringToObject(item, "request", v1_device_request_allocation_result->request) == NULL) { + goto fail; //String + } + + + // v1_device_request_allocation_result->share_id + if(v1_device_request_allocation_result->share_id) { + if(cJSON_AddStringToObject(item, "shareID", v1_device_request_allocation_result->share_id) == NULL) { + goto fail; //String + } + } + + + // v1_device_request_allocation_result->tolerations + if(v1_device_request_allocation_result->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1_device_request_allocation_result->tolerations) { + list_ForEach(tolerationsListEntry, v1_device_request_allocation_result->tolerations) { + cJSON *itemLocal = v1_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_request_allocation_result_t *v1_device_request_allocation_result_parseFromJSON(cJSON *v1_device_request_allocation_resultJSON){ + + v1_device_request_allocation_result_t *v1_device_request_allocation_result_local_var = NULL; + + // define the local list for v1_device_request_allocation_result->binding_conditions + list_t *binding_conditionsList = NULL; + + // define the local list for v1_device_request_allocation_result->binding_failure_conditions + list_t *binding_failure_conditionsList = NULL; + + // define the local map for v1_device_request_allocation_result->consumed_capacity + list_t *consumed_capacityList = NULL; + + // define the local list for v1_device_request_allocation_result->tolerations + list_t *tolerationsList = NULL; + + // v1_device_request_allocation_result->admin_access + cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "adminAccess"); + if (cJSON_IsNull(admin_access)) { + admin_access = NULL; + } + if (admin_access) { + if(!cJSON_IsBool(admin_access)) + { + goto end; //Bool + } + } + + // v1_device_request_allocation_result->binding_conditions + cJSON *binding_conditions = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "bindingConditions"); + if (cJSON_IsNull(binding_conditions)) { + binding_conditions = NULL; + } + if (binding_conditions) { + cJSON *binding_conditions_local = NULL; + if(!cJSON_IsArray(binding_conditions)) { + goto end;//primitive container + } + binding_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_conditions_local, binding_conditions) + { + if(!cJSON_IsString(binding_conditions_local)) + { + goto end; + } + list_addElement(binding_conditionsList , strdup(binding_conditions_local->valuestring)); + } + } + + // v1_device_request_allocation_result->binding_failure_conditions + cJSON *binding_failure_conditions = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "bindingFailureConditions"); + if (cJSON_IsNull(binding_failure_conditions)) { + binding_failure_conditions = NULL; + } + if (binding_failure_conditions) { + cJSON *binding_failure_conditions_local = NULL; + if(!cJSON_IsArray(binding_failure_conditions)) { + goto end;//primitive container + } + binding_failure_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_failure_conditions_local, binding_failure_conditions) + { + if(!cJSON_IsString(binding_failure_conditions_local)) + { + goto end; + } + list_addElement(binding_failure_conditionsList , strdup(binding_failure_conditions_local->valuestring)); + } + } + + // v1_device_request_allocation_result->consumed_capacity + cJSON *consumed_capacity = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "consumedCapacity"); + if (cJSON_IsNull(consumed_capacity)) { + consumed_capacity = NULL; + } + if (consumed_capacity) { + cJSON *consumed_capacity_local_map = NULL; + if(!cJSON_IsObject(consumed_capacity) && !cJSON_IsNull(consumed_capacity)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(consumed_capacity)) + { + consumed_capacityList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(consumed_capacity_local_map, consumed_capacity) + { + cJSON *localMapObject = consumed_capacity_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(consumed_capacityList , localMapKeyPair); + } + } + } + + // v1_device_request_allocation_result->device + cJSON *device = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "device"); + if (cJSON_IsNull(device)) { + device = NULL; + } + if (!device) { + goto end; + } + + + if(!cJSON_IsString(device)) + { + goto end; //String + } + + // v1_device_request_allocation_result->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1_device_request_allocation_result->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + if(!cJSON_IsString(pool)) + { + goto end; //String + } + + // v1_device_request_allocation_result->request + cJSON *request = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "request"); + if (cJSON_IsNull(request)) { + request = NULL; + } + if (!request) { + goto end; + } + + + if(!cJSON_IsString(request)) + { + goto end; //String + } + + // v1_device_request_allocation_result->share_id + cJSON *share_id = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "shareID"); + if (cJSON_IsNull(share_id)) { + share_id = NULL; + } + if (share_id) { + if(!cJSON_IsString(share_id) && !cJSON_IsNull(share_id)) + { + goto end; //String + } + } + + // v1_device_request_allocation_result->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1_device_request_allocation_resultJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1_device_toleration_t *tolerationsItem = v1_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1_device_request_allocation_result_local_var = v1_device_request_allocation_result_create_internal ( + admin_access ? admin_access->valueint : 0, + binding_conditions ? binding_conditionsList : NULL, + binding_failure_conditions ? binding_failure_conditionsList : NULL, + consumed_capacity ? consumed_capacityList : NULL, + strdup(device->valuestring), + strdup(driver->valuestring), + strdup(pool->valuestring), + strdup(request->valuestring), + share_id && !cJSON_IsNull(share_id) ? strdup(share_id->valuestring) : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1_device_request_allocation_result_local_var; +end: + if (binding_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_conditionsList); + binding_conditionsList = NULL; + } + if (binding_failure_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_failure_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_failure_conditionsList); + binding_failure_conditionsList = NULL; + } + if (consumed_capacityList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, consumed_capacityList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(consumed_capacityList); + consumed_capacityList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_request_allocation_result.h b/kubernetes/model/v1_device_request_allocation_result.h new file mode 100644 index 00000000..a0ec69e5 --- /dev/null +++ b/kubernetes/model/v1_device_request_allocation_result.h @@ -0,0 +1,57 @@ +/* + * v1_device_request_allocation_result.h + * + * DeviceRequestAllocationResult contains the allocation result for one request. + */ + +#ifndef _v1_device_request_allocation_result_H_ +#define _v1_device_request_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_request_allocation_result_t v1_device_request_allocation_result_t; + +#include "v1_device_toleration.h" + + + +typedef struct v1_device_request_allocation_result_t { + int admin_access; //boolean + list_t *binding_conditions; //primitive container + list_t *binding_failure_conditions; //primitive container + list_t* consumed_capacity; //map + char *device; // string + char *driver; // string + char *pool; // string + char *request; // string + char *share_id; // string + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_request_allocation_result_t; + +__attribute__((deprecated)) v1_device_request_allocation_result_t *v1_device_request_allocation_result_create( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations +); + +void v1_device_request_allocation_result_free(v1_device_request_allocation_result_t *v1_device_request_allocation_result); + +v1_device_request_allocation_result_t *v1_device_request_allocation_result_parseFromJSON(cJSON *v1_device_request_allocation_resultJSON); + +cJSON *v1_device_request_allocation_result_convertToJSON(v1_device_request_allocation_result_t *v1_device_request_allocation_result); + +#endif /* _v1_device_request_allocation_result_H_ */ + diff --git a/kubernetes/model/v1_device_selector.c b/kubernetes/model/v1_device_selector.c new file mode 100644 index 00000000..55e402f6 --- /dev/null +++ b/kubernetes/model/v1_device_selector.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1_device_selector.h" + + + +static v1_device_selector_t *v1_device_selector_create_internal( + v1_cel_device_selector_t *cel + ) { + v1_device_selector_t *v1_device_selector_local_var = malloc(sizeof(v1_device_selector_t)); + if (!v1_device_selector_local_var) { + return NULL; + } + v1_device_selector_local_var->cel = cel; + + v1_device_selector_local_var->_library_owned = 1; + return v1_device_selector_local_var; +} + +__attribute__((deprecated)) v1_device_selector_t *v1_device_selector_create( + v1_cel_device_selector_t *cel + ) { + return v1_device_selector_create_internal ( + cel + ); +} + +void v1_device_selector_free(v1_device_selector_t *v1_device_selector) { + if(NULL == v1_device_selector){ + return ; + } + if(v1_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_selector->cel) { + v1_cel_device_selector_free(v1_device_selector->cel); + v1_device_selector->cel = NULL; + } + free(v1_device_selector); +} + +cJSON *v1_device_selector_convertToJSON(v1_device_selector_t *v1_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_selector->cel + if(v1_device_selector->cel) { + cJSON *cel_local_JSON = v1_cel_device_selector_convertToJSON(v1_device_selector->cel); + if(cel_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "cel", cel_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_selector_t *v1_device_selector_parseFromJSON(cJSON *v1_device_selectorJSON){ + + v1_device_selector_t *v1_device_selector_local_var = NULL; + + // define the local variable for v1_device_selector->cel + v1_cel_device_selector_t *cel_local_nonprim = NULL; + + // v1_device_selector->cel + cJSON *cel = cJSON_GetObjectItemCaseSensitive(v1_device_selectorJSON, "cel"); + if (cJSON_IsNull(cel)) { + cel = NULL; + } + if (cel) { + cel_local_nonprim = v1_cel_device_selector_parseFromJSON(cel); //nonprimitive + } + + + v1_device_selector_local_var = v1_device_selector_create_internal ( + cel ? cel_local_nonprim : NULL + ); + + return v1_device_selector_local_var; +end: + if (cel_local_nonprim) { + v1_cel_device_selector_free(cel_local_nonprim); + cel_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_selector.h b/kubernetes/model/v1_device_selector.h new file mode 100644 index 00000000..fcd24a70 --- /dev/null +++ b/kubernetes/model/v1_device_selector.h @@ -0,0 +1,39 @@ +/* + * v1_device_selector.h + * + * DeviceSelector must have exactly one field set. + */ + +#ifndef _v1_device_selector_H_ +#define _v1_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_selector_t v1_device_selector_t; + +#include "v1_cel_device_selector.h" + + + +typedef struct v1_device_selector_t { + struct v1_cel_device_selector_t *cel; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_selector_t; + +__attribute__((deprecated)) v1_device_selector_t *v1_device_selector_create( + v1_cel_device_selector_t *cel +); + +void v1_device_selector_free(v1_device_selector_t *v1_device_selector); + +v1_device_selector_t *v1_device_selector_parseFromJSON(cJSON *v1_device_selectorJSON); + +cJSON *v1_device_selector_convertToJSON(v1_device_selector_t *v1_device_selector); + +#endif /* _v1_device_selector_H_ */ + diff --git a/kubernetes/model/v1_device_sub_request.c b/kubernetes/model/v1_device_sub_request.c new file mode 100644 index 00000000..5dc681e3 --- /dev/null +++ b/kubernetes/model/v1_device_sub_request.c @@ -0,0 +1,353 @@ +#include +#include +#include +#include "v1_device_sub_request.h" + + + +static v1_device_sub_request_t *v1_device_sub_request_create_internal( + char *allocation_mode, + v1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + v1_device_sub_request_t *v1_device_sub_request_local_var = malloc(sizeof(v1_device_sub_request_t)); + if (!v1_device_sub_request_local_var) { + return NULL; + } + v1_device_sub_request_local_var->allocation_mode = allocation_mode; + v1_device_sub_request_local_var->capacity = capacity; + v1_device_sub_request_local_var->count = count; + v1_device_sub_request_local_var->device_class_name = device_class_name; + v1_device_sub_request_local_var->name = name; + v1_device_sub_request_local_var->selectors = selectors; + v1_device_sub_request_local_var->tolerations = tolerations; + + v1_device_sub_request_local_var->_library_owned = 1; + return v1_device_sub_request_local_var; +} + +__attribute__((deprecated)) v1_device_sub_request_t *v1_device_sub_request_create( + char *allocation_mode, + v1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + return v1_device_sub_request_create_internal ( + allocation_mode, + capacity, + count, + device_class_name, + name, + selectors, + tolerations + ); +} + +void v1_device_sub_request_free(v1_device_sub_request_t *v1_device_sub_request) { + if(NULL == v1_device_sub_request){ + return ; + } + if(v1_device_sub_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_sub_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_sub_request->allocation_mode) { + free(v1_device_sub_request->allocation_mode); + v1_device_sub_request->allocation_mode = NULL; + } + if (v1_device_sub_request->capacity) { + v1_capacity_requirements_free(v1_device_sub_request->capacity); + v1_device_sub_request->capacity = NULL; + } + if (v1_device_sub_request->device_class_name) { + free(v1_device_sub_request->device_class_name); + v1_device_sub_request->device_class_name = NULL; + } + if (v1_device_sub_request->name) { + free(v1_device_sub_request->name); + v1_device_sub_request->name = NULL; + } + if (v1_device_sub_request->selectors) { + list_ForEach(listEntry, v1_device_sub_request->selectors) { + v1_device_selector_free(listEntry->data); + } + list_freeList(v1_device_sub_request->selectors); + v1_device_sub_request->selectors = NULL; + } + if (v1_device_sub_request->tolerations) { + list_ForEach(listEntry, v1_device_sub_request->tolerations) { + v1_device_toleration_free(listEntry->data); + } + list_freeList(v1_device_sub_request->tolerations); + v1_device_sub_request->tolerations = NULL; + } + free(v1_device_sub_request); +} + +cJSON *v1_device_sub_request_convertToJSON(v1_device_sub_request_t *v1_device_sub_request) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_sub_request->allocation_mode + if(v1_device_sub_request->allocation_mode) { + if(cJSON_AddStringToObject(item, "allocationMode", v1_device_sub_request->allocation_mode) == NULL) { + goto fail; //String + } + } + + + // v1_device_sub_request->capacity + if(v1_device_sub_request->capacity) { + cJSON *capacity_local_JSON = v1_capacity_requirements_convertToJSON(v1_device_sub_request->capacity); + if(capacity_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "capacity", capacity_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_device_sub_request->count + if(v1_device_sub_request->count) { + if(cJSON_AddNumberToObject(item, "count", v1_device_sub_request->count) == NULL) { + goto fail; //Numeric + } + } + + + // v1_device_sub_request->device_class_name + if (!v1_device_sub_request->device_class_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "deviceClassName", v1_device_sub_request->device_class_name) == NULL) { + goto fail; //String + } + + + // v1_device_sub_request->name + if (!v1_device_sub_request->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_device_sub_request->name) == NULL) { + goto fail; //String + } + + + // v1_device_sub_request->selectors + if(v1_device_sub_request->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1_device_sub_request->selectors) { + list_ForEach(selectorsListEntry, v1_device_sub_request->selectors) { + cJSON *itemLocal = v1_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + + // v1_device_sub_request->tolerations + if(v1_device_sub_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1_device_sub_request->tolerations) { + list_ForEach(tolerationsListEntry, v1_device_sub_request->tolerations) { + cJSON *itemLocal = v1_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_sub_request_t *v1_device_sub_request_parseFromJSON(cJSON *v1_device_sub_requestJSON){ + + v1_device_sub_request_t *v1_device_sub_request_local_var = NULL; + + // define the local variable for v1_device_sub_request->capacity + v1_capacity_requirements_t *capacity_local_nonprim = NULL; + + // define the local list for v1_device_sub_request->selectors + list_t *selectorsList = NULL; + + // define the local list for v1_device_sub_request->tolerations + list_t *tolerationsList = NULL; + + // v1_device_sub_request->allocation_mode + cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1_device_sub_requestJSON, "allocationMode"); + if (cJSON_IsNull(allocation_mode)) { + allocation_mode = NULL; + } + if (allocation_mode) { + if(!cJSON_IsString(allocation_mode) && !cJSON_IsNull(allocation_mode)) + { + goto end; //String + } + } + + // v1_device_sub_request->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_device_sub_requestJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + capacity_local_nonprim = v1_capacity_requirements_parseFromJSON(capacity); //nonprimitive + } + + // v1_device_sub_request->count + cJSON *count = cJSON_GetObjectItemCaseSensitive(v1_device_sub_requestJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } + if (count) { + if(!cJSON_IsNumber(count)) + { + goto end; //Numeric + } + } + + // v1_device_sub_request->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1_device_sub_requestJSON, "deviceClassName"); + if (cJSON_IsNull(device_class_name)) { + device_class_name = NULL; + } + if (!device_class_name) { + goto end; + } + + + if(!cJSON_IsString(device_class_name)) + { + goto end; //String + } + + // v1_device_sub_request->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_device_sub_requestJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1_device_sub_request->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1_device_sub_requestJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1_device_selector_t *selectorsItem = v1_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + // v1_device_sub_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1_device_sub_requestJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1_device_toleration_t *tolerationsItem = v1_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1_device_sub_request_local_var = v1_device_sub_request_create_internal ( + allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, + capacity ? capacity_local_nonprim : NULL, + count ? count->valuedouble : 0, + strdup(device_class_name->valuestring), + strdup(name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1_device_sub_request_local_var; +end: + if (capacity_local_nonprim) { + v1_capacity_requirements_free(capacity_local_nonprim); + capacity_local_nonprim = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_device_sub_request.h b/kubernetes/model/v1_device_sub_request.h new file mode 100644 index 00000000..16197b3d --- /dev/null +++ b/kubernetes/model/v1_device_sub_request.h @@ -0,0 +1,53 @@ +/* + * v1_device_sub_request.h + * + * DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices. DeviceSubRequest is similar to ExactDeviceRequest, but doesn't expose the AdminAccess field as that one is only supported when requesting a specific device. + */ + +#ifndef _v1_device_sub_request_H_ +#define _v1_device_sub_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_sub_request_t v1_device_sub_request_t; + +#include "v1_capacity_requirements.h" +#include "v1_device_selector.h" +#include "v1_device_toleration.h" + + + +typedef struct v1_device_sub_request_t { + char *allocation_mode; // string + struct v1_capacity_requirements_t *capacity; //model + long count; //numeric + char *device_class_name; // string + char *name; // string + list_t *selectors; //nonprimitive container + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_sub_request_t; + +__attribute__((deprecated)) v1_device_sub_request_t *v1_device_sub_request_create( + char *allocation_mode, + v1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations +); + +void v1_device_sub_request_free(v1_device_sub_request_t *v1_device_sub_request); + +v1_device_sub_request_t *v1_device_sub_request_parseFromJSON(cJSON *v1_device_sub_requestJSON); + +cJSON *v1_device_sub_request_convertToJSON(v1_device_sub_request_t *v1_device_sub_request); + +#endif /* _v1_device_sub_request_H_ */ + diff --git a/kubernetes/model/v1_device_taint.c b/kubernetes/model/v1_device_taint.c new file mode 100644 index 00000000..dab220fc --- /dev/null +++ b/kubernetes/model/v1_device_taint.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include "v1_device_taint.h" + + + +static v1_device_taint_t *v1_device_taint_create_internal( + char *effect, + char *key, + char *time_added, + char *value + ) { + v1_device_taint_t *v1_device_taint_local_var = malloc(sizeof(v1_device_taint_t)); + if (!v1_device_taint_local_var) { + return NULL; + } + v1_device_taint_local_var->effect = effect; + v1_device_taint_local_var->key = key; + v1_device_taint_local_var->time_added = time_added; + v1_device_taint_local_var->value = value; + + v1_device_taint_local_var->_library_owned = 1; + return v1_device_taint_local_var; +} + +__attribute__((deprecated)) v1_device_taint_t *v1_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value + ) { + return v1_device_taint_create_internal ( + effect, + key, + time_added, + value + ); +} + +void v1_device_taint_free(v1_device_taint_t *v1_device_taint) { + if(NULL == v1_device_taint){ + return ; + } + if(v1_device_taint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_taint_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_taint->effect) { + free(v1_device_taint->effect); + v1_device_taint->effect = NULL; + } + if (v1_device_taint->key) { + free(v1_device_taint->key); + v1_device_taint->key = NULL; + } + if (v1_device_taint->time_added) { + free(v1_device_taint->time_added); + v1_device_taint->time_added = NULL; + } + if (v1_device_taint->value) { + free(v1_device_taint->value); + v1_device_taint->value = NULL; + } + free(v1_device_taint); +} + +cJSON *v1_device_taint_convertToJSON(v1_device_taint_t *v1_device_taint) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_taint->effect + if (!v1_device_taint->effect) { + goto fail; + } + if(cJSON_AddStringToObject(item, "effect", v1_device_taint->effect) == NULL) { + goto fail; //String + } + + + // v1_device_taint->key + if (!v1_device_taint->key) { + goto fail; + } + if(cJSON_AddStringToObject(item, "key", v1_device_taint->key) == NULL) { + goto fail; //String + } + + + // v1_device_taint->time_added + if(v1_device_taint->time_added) { + if(cJSON_AddStringToObject(item, "timeAdded", v1_device_taint->time_added) == NULL) { + goto fail; //Date-Time + } + } + + + // v1_device_taint->value + if(v1_device_taint->value) { + if(cJSON_AddStringToObject(item, "value", v1_device_taint->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_taint_t *v1_device_taint_parseFromJSON(cJSON *v1_device_taintJSON){ + + v1_device_taint_t *v1_device_taint_local_var = NULL; + + // v1_device_taint->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1_device_taintJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (!effect) { + goto end; + } + + + if(!cJSON_IsString(effect)) + { + goto end; //String + } + + // v1_device_taint->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_device_taintJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (!key) { + goto end; + } + + + if(!cJSON_IsString(key)) + { + goto end; //String + } + + // v1_device_taint->time_added + cJSON *time_added = cJSON_GetObjectItemCaseSensitive(v1_device_taintJSON, "timeAdded"); + if (cJSON_IsNull(time_added)) { + time_added = NULL; + } + if (time_added) { + if(!cJSON_IsString(time_added) && !cJSON_IsNull(time_added)) + { + goto end; //DateTime + } + } + + // v1_device_taint->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_device_taintJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1_device_taint_local_var = v1_device_taint_create_internal ( + strdup(effect->valuestring), + strdup(key->valuestring), + time_added && !cJSON_IsNull(time_added) ? strdup(time_added->valuestring) : NULL, + value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL + ); + + return v1_device_taint_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_device_taint.h b/kubernetes/model/v1_device_taint.h new file mode 100644 index 00000000..5d49d5cf --- /dev/null +++ b/kubernetes/model/v1_device_taint.h @@ -0,0 +1,44 @@ +/* + * v1_device_taint.h + * + * The device this taint is attached to has the \"effect\" on any claim which does not tolerate the taint and, through the claim, to pods using the claim. + */ + +#ifndef _v1_device_taint_H_ +#define _v1_device_taint_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_taint_t v1_device_taint_t; + + + + +typedef struct v1_device_taint_t { + char *effect; // string + char *key; // string + char *time_added; //date time + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_taint_t; + +__attribute__((deprecated)) v1_device_taint_t *v1_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value +); + +void v1_device_taint_free(v1_device_taint_t *v1_device_taint); + +v1_device_taint_t *v1_device_taint_parseFromJSON(cJSON *v1_device_taintJSON); + +cJSON *v1_device_taint_convertToJSON(v1_device_taint_t *v1_device_taint); + +#endif /* _v1_device_taint_H_ */ + diff --git a/kubernetes/model/v1_device_toleration.c b/kubernetes/model/v1_device_toleration.c new file mode 100644 index 00000000..a0caf1fa --- /dev/null +++ b/kubernetes/model/v1_device_toleration.c @@ -0,0 +1,200 @@ +#include +#include +#include +#include "v1_device_toleration.h" + + + +static v1_device_toleration_t *v1_device_toleration_create_internal( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + v1_device_toleration_t *v1_device_toleration_local_var = malloc(sizeof(v1_device_toleration_t)); + if (!v1_device_toleration_local_var) { + return NULL; + } + v1_device_toleration_local_var->effect = effect; + v1_device_toleration_local_var->key = key; + v1_device_toleration_local_var->_operator = _operator; + v1_device_toleration_local_var->toleration_seconds = toleration_seconds; + v1_device_toleration_local_var->value = value; + + v1_device_toleration_local_var->_library_owned = 1; + return v1_device_toleration_local_var; +} + +__attribute__((deprecated)) v1_device_toleration_t *v1_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + return v1_device_toleration_create_internal ( + effect, + key, + _operator, + toleration_seconds, + value + ); +} + +void v1_device_toleration_free(v1_device_toleration_t *v1_device_toleration) { + if(NULL == v1_device_toleration){ + return ; + } + if(v1_device_toleration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_device_toleration_free"); + return ; + } + listEntry_t *listEntry; + if (v1_device_toleration->effect) { + free(v1_device_toleration->effect); + v1_device_toleration->effect = NULL; + } + if (v1_device_toleration->key) { + free(v1_device_toleration->key); + v1_device_toleration->key = NULL; + } + if (v1_device_toleration->_operator) { + free(v1_device_toleration->_operator); + v1_device_toleration->_operator = NULL; + } + if (v1_device_toleration->value) { + free(v1_device_toleration->value); + v1_device_toleration->value = NULL; + } + free(v1_device_toleration); +} + +cJSON *v1_device_toleration_convertToJSON(v1_device_toleration_t *v1_device_toleration) { + cJSON *item = cJSON_CreateObject(); + + // v1_device_toleration->effect + if(v1_device_toleration->effect) { + if(cJSON_AddStringToObject(item, "effect", v1_device_toleration->effect) == NULL) { + goto fail; //String + } + } + + + // v1_device_toleration->key + if(v1_device_toleration->key) { + if(cJSON_AddStringToObject(item, "key", v1_device_toleration->key) == NULL) { + goto fail; //String + } + } + + + // v1_device_toleration->_operator + if(v1_device_toleration->_operator) { + if(cJSON_AddStringToObject(item, "operator", v1_device_toleration->_operator) == NULL) { + goto fail; //String + } + } + + + // v1_device_toleration->toleration_seconds + if(v1_device_toleration->toleration_seconds) { + if(cJSON_AddNumberToObject(item, "tolerationSeconds", v1_device_toleration->toleration_seconds) == NULL) { + goto fail; //Numeric + } + } + + + // v1_device_toleration->value + if(v1_device_toleration->value) { + if(cJSON_AddStringToObject(item, "value", v1_device_toleration->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_device_toleration_t *v1_device_toleration_parseFromJSON(cJSON *v1_device_tolerationJSON){ + + v1_device_toleration_t *v1_device_toleration_local_var = NULL; + + // v1_device_toleration->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1_device_tolerationJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (effect) { + if(!cJSON_IsString(effect) && !cJSON_IsNull(effect)) + { + goto end; //String + } + } + + // v1_device_toleration->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_device_tolerationJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (key) { + if(!cJSON_IsString(key) && !cJSON_IsNull(key)) + { + goto end; //String + } + } + + // v1_device_toleration->_operator + cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_device_tolerationJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } + if (_operator) { + if(!cJSON_IsString(_operator) && !cJSON_IsNull(_operator)) + { + goto end; //String + } + } + + // v1_device_toleration->toleration_seconds + cJSON *toleration_seconds = cJSON_GetObjectItemCaseSensitive(v1_device_tolerationJSON, "tolerationSeconds"); + if (cJSON_IsNull(toleration_seconds)) { + toleration_seconds = NULL; + } + if (toleration_seconds) { + if(!cJSON_IsNumber(toleration_seconds)) + { + goto end; //Numeric + } + } + + // v1_device_toleration->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_device_tolerationJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1_device_toleration_local_var = v1_device_toleration_create_internal ( + effect && !cJSON_IsNull(effect) ? strdup(effect->valuestring) : NULL, + key && !cJSON_IsNull(key) ? strdup(key->valuestring) : NULL, + _operator && !cJSON_IsNull(_operator) ? strdup(_operator->valuestring) : NULL, + toleration_seconds ? toleration_seconds->valuedouble : 0, + value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL + ); + + return v1_device_toleration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_device_toleration.h b/kubernetes/model/v1_device_toleration.h new file mode 100644 index 00000000..d0791bde --- /dev/null +++ b/kubernetes/model/v1_device_toleration.h @@ -0,0 +1,46 @@ +/* + * v1_device_toleration.h + * + * The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>. + */ + +#ifndef _v1_device_toleration_H_ +#define _v1_device_toleration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_device_toleration_t v1_device_toleration_t; + + + + +typedef struct v1_device_toleration_t { + char *effect; // string + char *key; // string + char *_operator; // string + long toleration_seconds; //numeric + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_device_toleration_t; + +__attribute__((deprecated)) v1_device_toleration_t *v1_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value +); + +void v1_device_toleration_free(v1_device_toleration_t *v1_device_toleration); + +v1_device_toleration_t *v1_device_toleration_parseFromJSON(cJSON *v1_device_tolerationJSON); + +cJSON *v1_device_toleration_convertToJSON(v1_device_toleration_t *v1_device_toleration); + +#endif /* _v1_device_toleration_H_ */ + diff --git a/kubernetes/model/v1_downward_api_projection.c b/kubernetes/model/v1_downward_api_projection.c index f6efa645..eebdf3b4 100644 --- a/kubernetes/model/v1_downward_api_projection.c +++ b/kubernetes/model/v1_downward_api_projection.c @@ -5,7 +5,7 @@ -v1_downward_api_projection_t *v1_downward_api_projection_create( +static v1_downward_api_projection_t *v1_downward_api_projection_create_internal( list_t *items ) { v1_downward_api_projection_t *v1_downward_api_projection_local_var = malloc(sizeof(v1_downward_api_projection_t)); @@ -14,14 +14,26 @@ v1_downward_api_projection_t *v1_downward_api_projection_create( } v1_downward_api_projection_local_var->items = items; + v1_downward_api_projection_local_var->_library_owned = 1; return v1_downward_api_projection_local_var; } +__attribute__((deprecated)) v1_downward_api_projection_t *v1_downward_api_projection_create( + list_t *items + ) { + return v1_downward_api_projection_create_internal ( + items + ); +} void v1_downward_api_projection_free(v1_downward_api_projection_t *v1_downward_api_projection) { if(NULL == v1_downward_api_projection){ return ; } + if(v1_downward_api_projection->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_downward_api_projection_free"); + return ; + } listEntry_t *listEntry; if (v1_downward_api_projection->items) { list_ForEach(listEntry, v1_downward_api_projection->items) { @@ -72,6 +84,9 @@ v1_downward_api_projection_t *v1_downward_api_projection_parseFromJSON(cJSON *v1 // v1_downward_api_projection->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_downward_api_projectionJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (items) { cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ @@ -92,7 +107,7 @@ v1_downward_api_projection_t *v1_downward_api_projection_parseFromJSON(cJSON *v1 } - v1_downward_api_projection_local_var = v1_downward_api_projection_create ( + v1_downward_api_projection_local_var = v1_downward_api_projection_create_internal ( items ? itemsList : NULL ); diff --git a/kubernetes/model/v1_downward_api_projection.h b/kubernetes/model/v1_downward_api_projection.h index 8a495539..31731150 100644 --- a/kubernetes/model/v1_downward_api_projection.h +++ b/kubernetes/model/v1_downward_api_projection.h @@ -22,9 +22,10 @@ typedef struct v1_downward_api_projection_t v1_downward_api_projection_t; typedef struct v1_downward_api_projection_t { list_t *items; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_downward_api_projection_t; -v1_downward_api_projection_t *v1_downward_api_projection_create( +__attribute__((deprecated)) v1_downward_api_projection_t *v1_downward_api_projection_create( list_t *items ); diff --git a/kubernetes/model/v1_downward_api_volume_file.c b/kubernetes/model/v1_downward_api_volume_file.c index 99a4477d..5a8efe92 100644 --- a/kubernetes/model/v1_downward_api_volume_file.c +++ b/kubernetes/model/v1_downward_api_volume_file.c @@ -5,7 +5,7 @@ -v1_downward_api_volume_file_t *v1_downward_api_volume_file_create( +static v1_downward_api_volume_file_t *v1_downward_api_volume_file_create_internal( v1_object_field_selector_t *field_ref, int mode, char *path, @@ -20,14 +20,32 @@ v1_downward_api_volume_file_t *v1_downward_api_volume_file_create( v1_downward_api_volume_file_local_var->path = path; v1_downward_api_volume_file_local_var->resource_field_ref = resource_field_ref; + v1_downward_api_volume_file_local_var->_library_owned = 1; return v1_downward_api_volume_file_local_var; } +__attribute__((deprecated)) v1_downward_api_volume_file_t *v1_downward_api_volume_file_create( + v1_object_field_selector_t *field_ref, + int mode, + char *path, + v1_resource_field_selector_t *resource_field_ref + ) { + return v1_downward_api_volume_file_create_internal ( + field_ref, + mode, + path, + resource_field_ref + ); +} void v1_downward_api_volume_file_free(v1_downward_api_volume_file_t *v1_downward_api_volume_file) { if(NULL == v1_downward_api_volume_file){ return ; } + if(v1_downward_api_volume_file->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_downward_api_volume_file_free"); + return ; + } listEntry_t *listEntry; if (v1_downward_api_volume_file->field_ref) { v1_object_field_selector_free(v1_downward_api_volume_file->field_ref); @@ -109,12 +127,18 @@ v1_downward_api_volume_file_t *v1_downward_api_volume_file_parseFromJSON(cJSON * // v1_downward_api_volume_file->field_ref cJSON *field_ref = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_fileJSON, "fieldRef"); + if (cJSON_IsNull(field_ref)) { + field_ref = NULL; + } if (field_ref) { field_ref_local_nonprim = v1_object_field_selector_parseFromJSON(field_ref); //nonprimitive } // v1_downward_api_volume_file->mode cJSON *mode = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_fileJSON, "mode"); + if (cJSON_IsNull(mode)) { + mode = NULL; + } if (mode) { if(!cJSON_IsNumber(mode)) { @@ -124,6 +148,9 @@ v1_downward_api_volume_file_t *v1_downward_api_volume_file_parseFromJSON(cJSON * // v1_downward_api_volume_file->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_fileJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -136,12 +163,15 @@ v1_downward_api_volume_file_t *v1_downward_api_volume_file_parseFromJSON(cJSON * // v1_downward_api_volume_file->resource_field_ref cJSON *resource_field_ref = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_fileJSON, "resourceFieldRef"); + if (cJSON_IsNull(resource_field_ref)) { + resource_field_ref = NULL; + } if (resource_field_ref) { resource_field_ref_local_nonprim = v1_resource_field_selector_parseFromJSON(resource_field_ref); //nonprimitive } - v1_downward_api_volume_file_local_var = v1_downward_api_volume_file_create ( + v1_downward_api_volume_file_local_var = v1_downward_api_volume_file_create_internal ( field_ref ? field_ref_local_nonprim : NULL, mode ? mode->valuedouble : 0, strdup(path->valuestring), diff --git a/kubernetes/model/v1_downward_api_volume_file.h b/kubernetes/model/v1_downward_api_volume_file.h index 8360c569..6ca62af1 100644 --- a/kubernetes/model/v1_downward_api_volume_file.h +++ b/kubernetes/model/v1_downward_api_volume_file.h @@ -26,9 +26,10 @@ typedef struct v1_downward_api_volume_file_t { char *path; // string struct v1_resource_field_selector_t *resource_field_ref; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_downward_api_volume_file_t; -v1_downward_api_volume_file_t *v1_downward_api_volume_file_create( +__attribute__((deprecated)) v1_downward_api_volume_file_t *v1_downward_api_volume_file_create( v1_object_field_selector_t *field_ref, int mode, char *path, diff --git a/kubernetes/model/v1_downward_api_volume_source.c b/kubernetes/model/v1_downward_api_volume_source.c index 2b813805..4195af19 100644 --- a/kubernetes/model/v1_downward_api_volume_source.c +++ b/kubernetes/model/v1_downward_api_volume_source.c @@ -5,7 +5,7 @@ -v1_downward_api_volume_source_t *v1_downward_api_volume_source_create( +static v1_downward_api_volume_source_t *v1_downward_api_volume_source_create_internal( int default_mode, list_t *items ) { @@ -16,14 +16,28 @@ v1_downward_api_volume_source_t *v1_downward_api_volume_source_create( v1_downward_api_volume_source_local_var->default_mode = default_mode; v1_downward_api_volume_source_local_var->items = items; + v1_downward_api_volume_source_local_var->_library_owned = 1; return v1_downward_api_volume_source_local_var; } +__attribute__((deprecated)) v1_downward_api_volume_source_t *v1_downward_api_volume_source_create( + int default_mode, + list_t *items + ) { + return v1_downward_api_volume_source_create_internal ( + default_mode, + items + ); +} void v1_downward_api_volume_source_free(v1_downward_api_volume_source_t *v1_downward_api_volume_source) { if(NULL == v1_downward_api_volume_source){ return ; } + if(v1_downward_api_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_downward_api_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_downward_api_volume_source->items) { list_ForEach(listEntry, v1_downward_api_volume_source->items) { @@ -82,6 +96,9 @@ v1_downward_api_volume_source_t *v1_downward_api_volume_source_parseFromJSON(cJS // v1_downward_api_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_sourceJSON, "defaultMode"); + if (cJSON_IsNull(default_mode)) { + default_mode = NULL; + } if (default_mode) { if(!cJSON_IsNumber(default_mode)) { @@ -91,6 +108,9 @@ v1_downward_api_volume_source_t *v1_downward_api_volume_source_parseFromJSON(cJS // v1_downward_api_volume_source->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_sourceJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (items) { cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ @@ -111,7 +131,7 @@ v1_downward_api_volume_source_t *v1_downward_api_volume_source_parseFromJSON(cJS } - v1_downward_api_volume_source_local_var = v1_downward_api_volume_source_create ( + v1_downward_api_volume_source_local_var = v1_downward_api_volume_source_create_internal ( default_mode ? default_mode->valuedouble : 0, items ? itemsList : NULL ); diff --git a/kubernetes/model/v1_downward_api_volume_source.h b/kubernetes/model/v1_downward_api_volume_source.h index d7ea8be0..208f51d6 100644 --- a/kubernetes/model/v1_downward_api_volume_source.h +++ b/kubernetes/model/v1_downward_api_volume_source.h @@ -23,9 +23,10 @@ typedef struct v1_downward_api_volume_source_t { int default_mode; //numeric list_t *items; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_downward_api_volume_source_t; -v1_downward_api_volume_source_t *v1_downward_api_volume_source_create( +__attribute__((deprecated)) v1_downward_api_volume_source_t *v1_downward_api_volume_source_create( int default_mode, list_t *items ); diff --git a/kubernetes/model/v1_empty_dir_volume_source.c b/kubernetes/model/v1_empty_dir_volume_source.c index 3050c39c..2832ac82 100644 --- a/kubernetes/model/v1_empty_dir_volume_source.c +++ b/kubernetes/model/v1_empty_dir_volume_source.c @@ -5,7 +5,7 @@ -v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_create( +static v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_create_internal( char *medium, char *size_limit ) { @@ -16,14 +16,28 @@ v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_create( v1_empty_dir_volume_source_local_var->medium = medium; v1_empty_dir_volume_source_local_var->size_limit = size_limit; + v1_empty_dir_volume_source_local_var->_library_owned = 1; return v1_empty_dir_volume_source_local_var; } +__attribute__((deprecated)) v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_create( + char *medium, + char *size_limit + ) { + return v1_empty_dir_volume_source_create_internal ( + medium, + size_limit + ); +} void v1_empty_dir_volume_source_free(v1_empty_dir_volume_source_t *v1_empty_dir_volume_source) { if(NULL == v1_empty_dir_volume_source){ return ; } + if(v1_empty_dir_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_empty_dir_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_empty_dir_volume_source->medium) { free(v1_empty_dir_volume_source->medium); @@ -68,6 +82,9 @@ v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_parseFromJSON(cJSON *v1 // v1_empty_dir_volume_source->medium cJSON *medium = cJSON_GetObjectItemCaseSensitive(v1_empty_dir_volume_sourceJSON, "medium"); + if (cJSON_IsNull(medium)) { + medium = NULL; + } if (medium) { if(!cJSON_IsString(medium) && !cJSON_IsNull(medium)) { @@ -77,6 +94,9 @@ v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_parseFromJSON(cJSON *v1 // v1_empty_dir_volume_source->size_limit cJSON *size_limit = cJSON_GetObjectItemCaseSensitive(v1_empty_dir_volume_sourceJSON, "sizeLimit"); + if (cJSON_IsNull(size_limit)) { + size_limit = NULL; + } if (size_limit) { if(!cJSON_IsString(size_limit) && !cJSON_IsNull(size_limit)) { @@ -85,7 +105,7 @@ v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_parseFromJSON(cJSON *v1 } - v1_empty_dir_volume_source_local_var = v1_empty_dir_volume_source_create ( + v1_empty_dir_volume_source_local_var = v1_empty_dir_volume_source_create_internal ( medium && !cJSON_IsNull(medium) ? strdup(medium->valuestring) : NULL, size_limit && !cJSON_IsNull(size_limit) ? strdup(size_limit->valuestring) : NULL ); diff --git a/kubernetes/model/v1_empty_dir_volume_source.h b/kubernetes/model/v1_empty_dir_volume_source.h index 10357296..13a6d867 100644 --- a/kubernetes/model/v1_empty_dir_volume_source.h +++ b/kubernetes/model/v1_empty_dir_volume_source.h @@ -22,9 +22,10 @@ typedef struct v1_empty_dir_volume_source_t { char *medium; // string char *size_limit; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_empty_dir_volume_source_t; -v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_create( +__attribute__((deprecated)) v1_empty_dir_volume_source_t *v1_empty_dir_volume_source_create( char *medium, char *size_limit ); diff --git a/kubernetes/model/v1_endpoint.c b/kubernetes/model/v1_endpoint.c index 098157cc..166c1df5 100644 --- a/kubernetes/model/v1_endpoint.c +++ b/kubernetes/model/v1_endpoint.c @@ -5,7 +5,7 @@ -v1_endpoint_t *v1_endpoint_create( +static v1_endpoint_t *v1_endpoint_create_internal( list_t *addresses, v1_endpoint_conditions_t *conditions, list_t* deprecated_topology, @@ -28,14 +28,40 @@ v1_endpoint_t *v1_endpoint_create( v1_endpoint_local_var->target_ref = target_ref; v1_endpoint_local_var->zone = zone; + v1_endpoint_local_var->_library_owned = 1; return v1_endpoint_local_var; } +__attribute__((deprecated)) v1_endpoint_t *v1_endpoint_create( + list_t *addresses, + v1_endpoint_conditions_t *conditions, + list_t* deprecated_topology, + v1_endpoint_hints_t *hints, + char *hostname, + char *node_name, + v1_object_reference_t *target_ref, + char *zone + ) { + return v1_endpoint_create_internal ( + addresses, + conditions, + deprecated_topology, + hints, + hostname, + node_name, + target_ref, + zone + ); +} void v1_endpoint_free(v1_endpoint_t *v1_endpoint) { if(NULL == v1_endpoint){ return ; } + if(v1_endpoint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoint_free"); + return ; + } listEntry_t *listEntry; if (v1_endpoint->addresses) { list_ForEach(listEntry, v1_endpoint->addresses) { @@ -50,7 +76,7 @@ void v1_endpoint_free(v1_endpoint_t *v1_endpoint) { } if (v1_endpoint->deprecated_topology) { list_ForEach(listEntry, v1_endpoint->deprecated_topology) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -95,7 +121,7 @@ cJSON *v1_endpoint_convertToJSON(v1_endpoint_t *v1_endpoint) { listEntry_t *addressesListEntry; list_ForEach(addressesListEntry, v1_endpoint->addresses) { - if(cJSON_AddStringToObject(addresses, "", (char*)addressesListEntry->data) == NULL) + if(cJSON_AddStringToObject(addresses, "", addressesListEntry->data) == NULL) { goto fail; } @@ -125,8 +151,8 @@ cJSON *v1_endpoint_convertToJSON(v1_endpoint_t *v1_endpoint) { listEntry_t *deprecated_topologyListEntry; if (v1_endpoint->deprecated_topology) { list_ForEach(deprecated_topologyListEntry, v1_endpoint->deprecated_topology) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)deprecated_topologyListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = deprecated_topologyListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -213,6 +239,9 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ // v1_endpoint->addresses cJSON *addresses = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "addresses"); + if (cJSON_IsNull(addresses)) { + addresses = NULL; + } if (!addresses) { goto end; } @@ -235,12 +264,18 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ // v1_endpoint->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { conditions_local_nonprim = v1_endpoint_conditions_parseFromJSON(conditions); //nonprimitive } // v1_endpoint->deprecated_topology cJSON *deprecated_topology = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "deprecatedTopology"); + if (cJSON_IsNull(deprecated_topology)) { + deprecated_topology = NULL; + } if (deprecated_topology) { cJSON *deprecated_topology_local_map = NULL; if(!cJSON_IsObject(deprecated_topology) && !cJSON_IsNull(deprecated_topology)) @@ -266,12 +301,18 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ // v1_endpoint->hints cJSON *hints = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "hints"); + if (cJSON_IsNull(hints)) { + hints = NULL; + } if (hints) { hints_local_nonprim = v1_endpoint_hints_parseFromJSON(hints); //nonprimitive } // v1_endpoint->hostname cJSON *hostname = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "hostname"); + if (cJSON_IsNull(hostname)) { + hostname = NULL; + } if (hostname) { if(!cJSON_IsString(hostname) && !cJSON_IsNull(hostname)) { @@ -281,6 +322,9 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ // v1_endpoint->node_name cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } if (node_name) { if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) { @@ -290,12 +334,18 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ // v1_endpoint->target_ref cJSON *target_ref = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "targetRef"); + if (cJSON_IsNull(target_ref)) { + target_ref = NULL; + } if (target_ref) { target_ref_local_nonprim = v1_object_reference_parseFromJSON(target_ref); //nonprimitive } // v1_endpoint->zone cJSON *zone = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "zone"); + if (cJSON_IsNull(zone)) { + zone = NULL; + } if (zone) { if(!cJSON_IsString(zone) && !cJSON_IsNull(zone)) { @@ -304,7 +354,7 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ } - v1_endpoint_local_var = v1_endpoint_create ( + v1_endpoint_local_var = v1_endpoint_create_internal ( addressesList, conditions ? conditions_local_nonprim : NULL, deprecated_topology ? deprecated_topologyList : NULL, @@ -333,7 +383,7 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ if (deprecated_topologyList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, deprecated_topologyList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_endpoint.h b/kubernetes/model/v1_endpoint.h index a1062dc2..75ad7378 100644 --- a/kubernetes/model/v1_endpoint.h +++ b/kubernetes/model/v1_endpoint.h @@ -31,9 +31,10 @@ typedef struct v1_endpoint_t { struct v1_object_reference_t *target_ref; //model char *zone; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoint_t; -v1_endpoint_t *v1_endpoint_create( +__attribute__((deprecated)) v1_endpoint_t *v1_endpoint_create( list_t *addresses, v1_endpoint_conditions_t *conditions, list_t* deprecated_topology, diff --git a/kubernetes/model/v1_endpoint_address.c b/kubernetes/model/v1_endpoint_address.c index cfb5e263..87f0a396 100644 --- a/kubernetes/model/v1_endpoint_address.c +++ b/kubernetes/model/v1_endpoint_address.c @@ -5,7 +5,7 @@ -v1_endpoint_address_t *v1_endpoint_address_create( +static v1_endpoint_address_t *v1_endpoint_address_create_internal( char *hostname, char *ip, char *node_name, @@ -20,14 +20,32 @@ v1_endpoint_address_t *v1_endpoint_address_create( v1_endpoint_address_local_var->node_name = node_name; v1_endpoint_address_local_var->target_ref = target_ref; + v1_endpoint_address_local_var->_library_owned = 1; return v1_endpoint_address_local_var; } +__attribute__((deprecated)) v1_endpoint_address_t *v1_endpoint_address_create( + char *hostname, + char *ip, + char *node_name, + v1_object_reference_t *target_ref + ) { + return v1_endpoint_address_create_internal ( + hostname, + ip, + node_name, + target_ref + ); +} void v1_endpoint_address_free(v1_endpoint_address_t *v1_endpoint_address) { if(NULL == v1_endpoint_address){ return ; } + if(v1_endpoint_address->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoint_address_free"); + return ; + } listEntry_t *listEntry; if (v1_endpoint_address->hostname) { free(v1_endpoint_address->hostname); @@ -105,6 +123,9 @@ v1_endpoint_address_t *v1_endpoint_address_parseFromJSON(cJSON *v1_endpoint_addr // v1_endpoint_address->hostname cJSON *hostname = cJSON_GetObjectItemCaseSensitive(v1_endpoint_addressJSON, "hostname"); + if (cJSON_IsNull(hostname)) { + hostname = NULL; + } if (hostname) { if(!cJSON_IsString(hostname) && !cJSON_IsNull(hostname)) { @@ -114,6 +135,9 @@ v1_endpoint_address_t *v1_endpoint_address_parseFromJSON(cJSON *v1_endpoint_addr // v1_endpoint_address->ip cJSON *ip = cJSON_GetObjectItemCaseSensitive(v1_endpoint_addressJSON, "ip"); + if (cJSON_IsNull(ip)) { + ip = NULL; + } if (!ip) { goto end; } @@ -126,6 +150,9 @@ v1_endpoint_address_t *v1_endpoint_address_parseFromJSON(cJSON *v1_endpoint_addr // v1_endpoint_address->node_name cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1_endpoint_addressJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } if (node_name) { if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) { @@ -135,12 +162,15 @@ v1_endpoint_address_t *v1_endpoint_address_parseFromJSON(cJSON *v1_endpoint_addr // v1_endpoint_address->target_ref cJSON *target_ref = cJSON_GetObjectItemCaseSensitive(v1_endpoint_addressJSON, "targetRef"); + if (cJSON_IsNull(target_ref)) { + target_ref = NULL; + } if (target_ref) { target_ref_local_nonprim = v1_object_reference_parseFromJSON(target_ref); //nonprimitive } - v1_endpoint_address_local_var = v1_endpoint_address_create ( + v1_endpoint_address_local_var = v1_endpoint_address_create_internal ( hostname && !cJSON_IsNull(hostname) ? strdup(hostname->valuestring) : NULL, strdup(ip->valuestring), node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, diff --git a/kubernetes/model/v1_endpoint_address.h b/kubernetes/model/v1_endpoint_address.h index 574e4886..6deaa7f0 100644 --- a/kubernetes/model/v1_endpoint_address.h +++ b/kubernetes/model/v1_endpoint_address.h @@ -1,7 +1,7 @@ /* * v1_endpoint_address.h * - * EndpointAddress is a tuple that describes single IP address. + * EndpointAddress is a tuple that describes single IP address. Deprecated: This API is deprecated in v1.33+. */ #ifndef _v1_endpoint_address_H_ @@ -25,9 +25,10 @@ typedef struct v1_endpoint_address_t { char *node_name; // string struct v1_object_reference_t *target_ref; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoint_address_t; -v1_endpoint_address_t *v1_endpoint_address_create( +__attribute__((deprecated)) v1_endpoint_address_t *v1_endpoint_address_create( char *hostname, char *ip, char *node_name, diff --git a/kubernetes/model/v1_endpoint_conditions.c b/kubernetes/model/v1_endpoint_conditions.c index 3e6ca74a..aaf2246b 100644 --- a/kubernetes/model/v1_endpoint_conditions.c +++ b/kubernetes/model/v1_endpoint_conditions.c @@ -5,7 +5,7 @@ -v1_endpoint_conditions_t *v1_endpoint_conditions_create( +static v1_endpoint_conditions_t *v1_endpoint_conditions_create_internal( int ready, int serving, int terminating @@ -18,14 +18,30 @@ v1_endpoint_conditions_t *v1_endpoint_conditions_create( v1_endpoint_conditions_local_var->serving = serving; v1_endpoint_conditions_local_var->terminating = terminating; + v1_endpoint_conditions_local_var->_library_owned = 1; return v1_endpoint_conditions_local_var; } +__attribute__((deprecated)) v1_endpoint_conditions_t *v1_endpoint_conditions_create( + int ready, + int serving, + int terminating + ) { + return v1_endpoint_conditions_create_internal ( + ready, + serving, + terminating + ); +} void v1_endpoint_conditions_free(v1_endpoint_conditions_t *v1_endpoint_conditions) { if(NULL == v1_endpoint_conditions){ return ; } + if(v1_endpoint_conditions->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoint_conditions_free"); + return ; + } listEntry_t *listEntry; free(v1_endpoint_conditions); } @@ -70,6 +86,9 @@ v1_endpoint_conditions_t *v1_endpoint_conditions_parseFromJSON(cJSON *v1_endpoin // v1_endpoint_conditions->ready cJSON *ready = cJSON_GetObjectItemCaseSensitive(v1_endpoint_conditionsJSON, "ready"); + if (cJSON_IsNull(ready)) { + ready = NULL; + } if (ready) { if(!cJSON_IsBool(ready)) { @@ -79,6 +98,9 @@ v1_endpoint_conditions_t *v1_endpoint_conditions_parseFromJSON(cJSON *v1_endpoin // v1_endpoint_conditions->serving cJSON *serving = cJSON_GetObjectItemCaseSensitive(v1_endpoint_conditionsJSON, "serving"); + if (cJSON_IsNull(serving)) { + serving = NULL; + } if (serving) { if(!cJSON_IsBool(serving)) { @@ -88,6 +110,9 @@ v1_endpoint_conditions_t *v1_endpoint_conditions_parseFromJSON(cJSON *v1_endpoin // v1_endpoint_conditions->terminating cJSON *terminating = cJSON_GetObjectItemCaseSensitive(v1_endpoint_conditionsJSON, "terminating"); + if (cJSON_IsNull(terminating)) { + terminating = NULL; + } if (terminating) { if(!cJSON_IsBool(terminating)) { @@ -96,7 +121,7 @@ v1_endpoint_conditions_t *v1_endpoint_conditions_parseFromJSON(cJSON *v1_endpoin } - v1_endpoint_conditions_local_var = v1_endpoint_conditions_create ( + v1_endpoint_conditions_local_var = v1_endpoint_conditions_create_internal ( ready ? ready->valueint : 0, serving ? serving->valueint : 0, terminating ? terminating->valueint : 0 diff --git a/kubernetes/model/v1_endpoint_conditions.h b/kubernetes/model/v1_endpoint_conditions.h index 7390d92d..b5305b20 100644 --- a/kubernetes/model/v1_endpoint_conditions.h +++ b/kubernetes/model/v1_endpoint_conditions.h @@ -23,9 +23,10 @@ typedef struct v1_endpoint_conditions_t { int serving; //boolean int terminating; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoint_conditions_t; -v1_endpoint_conditions_t *v1_endpoint_conditions_create( +__attribute__((deprecated)) v1_endpoint_conditions_t *v1_endpoint_conditions_create( int ready, int serving, int terminating diff --git a/kubernetes/model/v1_endpoint_hints.c b/kubernetes/model/v1_endpoint_hints.c index 4e7724be..8e74e470 100644 --- a/kubernetes/model/v1_endpoint_hints.c +++ b/kubernetes/model/v1_endpoint_hints.c @@ -5,24 +5,47 @@ -v1_endpoint_hints_t *v1_endpoint_hints_create( +static v1_endpoint_hints_t *v1_endpoint_hints_create_internal( + list_t *for_nodes, list_t *for_zones ) { v1_endpoint_hints_t *v1_endpoint_hints_local_var = malloc(sizeof(v1_endpoint_hints_t)); if (!v1_endpoint_hints_local_var) { return NULL; } + v1_endpoint_hints_local_var->for_nodes = for_nodes; v1_endpoint_hints_local_var->for_zones = for_zones; + v1_endpoint_hints_local_var->_library_owned = 1; return v1_endpoint_hints_local_var; } +__attribute__((deprecated)) v1_endpoint_hints_t *v1_endpoint_hints_create( + list_t *for_nodes, + list_t *for_zones + ) { + return v1_endpoint_hints_create_internal ( + for_nodes, + for_zones + ); +} void v1_endpoint_hints_free(v1_endpoint_hints_t *v1_endpoint_hints) { if(NULL == v1_endpoint_hints){ return ; } + if(v1_endpoint_hints->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoint_hints_free"); + return ; + } listEntry_t *listEntry; + if (v1_endpoint_hints->for_nodes) { + list_ForEach(listEntry, v1_endpoint_hints->for_nodes) { + v1_for_node_free(listEntry->data); + } + list_freeList(v1_endpoint_hints->for_nodes); + v1_endpoint_hints->for_nodes = NULL; + } if (v1_endpoint_hints->for_zones) { list_ForEach(listEntry, v1_endpoint_hints->for_zones) { v1_for_zone_free(listEntry->data); @@ -36,6 +59,26 @@ void v1_endpoint_hints_free(v1_endpoint_hints_t *v1_endpoint_hints) { cJSON *v1_endpoint_hints_convertToJSON(v1_endpoint_hints_t *v1_endpoint_hints) { cJSON *item = cJSON_CreateObject(); + // v1_endpoint_hints->for_nodes + if(v1_endpoint_hints->for_nodes) { + cJSON *for_nodes = cJSON_AddArrayToObject(item, "forNodes"); + if(for_nodes == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *for_nodesListEntry; + if (v1_endpoint_hints->for_nodes) { + list_ForEach(for_nodesListEntry, v1_endpoint_hints->for_nodes) { + cJSON *itemLocal = v1_for_node_convertToJSON(for_nodesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(for_nodes, itemLocal); + } + } + } + + // v1_endpoint_hints->for_zones if(v1_endpoint_hints->for_zones) { cJSON *for_zones = cJSON_AddArrayToObject(item, "forZones"); @@ -67,11 +110,41 @@ v1_endpoint_hints_t *v1_endpoint_hints_parseFromJSON(cJSON *v1_endpoint_hintsJSO v1_endpoint_hints_t *v1_endpoint_hints_local_var = NULL; + // define the local list for v1_endpoint_hints->for_nodes + list_t *for_nodesList = NULL; + // define the local list for v1_endpoint_hints->for_zones list_t *for_zonesList = NULL; + // v1_endpoint_hints->for_nodes + cJSON *for_nodes = cJSON_GetObjectItemCaseSensitive(v1_endpoint_hintsJSON, "forNodes"); + if (cJSON_IsNull(for_nodes)) { + for_nodes = NULL; + } + if (for_nodes) { + cJSON *for_nodes_local_nonprimitive = NULL; + if(!cJSON_IsArray(for_nodes)){ + goto end; //nonprimitive container + } + + for_nodesList = list_createList(); + + cJSON_ArrayForEach(for_nodes_local_nonprimitive,for_nodes ) + { + if(!cJSON_IsObject(for_nodes_local_nonprimitive)){ + goto end; + } + v1_for_node_t *for_nodesItem = v1_for_node_parseFromJSON(for_nodes_local_nonprimitive); + + list_addElement(for_nodesList, for_nodesItem); + } + } + // v1_endpoint_hints->for_zones cJSON *for_zones = cJSON_GetObjectItemCaseSensitive(v1_endpoint_hintsJSON, "forZones"); + if (cJSON_IsNull(for_zones)) { + for_zones = NULL; + } if (for_zones) { cJSON *for_zones_local_nonprimitive = NULL; if(!cJSON_IsArray(for_zones)){ @@ -92,12 +165,22 @@ v1_endpoint_hints_t *v1_endpoint_hints_parseFromJSON(cJSON *v1_endpoint_hintsJSO } - v1_endpoint_hints_local_var = v1_endpoint_hints_create ( + v1_endpoint_hints_local_var = v1_endpoint_hints_create_internal ( + for_nodes ? for_nodesList : NULL, for_zones ? for_zonesList : NULL ); return v1_endpoint_hints_local_var; end: + if (for_nodesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, for_nodesList) { + v1_for_node_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(for_nodesList); + for_nodesList = NULL; + } if (for_zonesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, for_zonesList) { diff --git a/kubernetes/model/v1_endpoint_hints.h b/kubernetes/model/v1_endpoint_hints.h index 0559e1d4..3c3e0f86 100644 --- a/kubernetes/model/v1_endpoint_hints.h +++ b/kubernetes/model/v1_endpoint_hints.h @@ -15,16 +15,20 @@ typedef struct v1_endpoint_hints_t v1_endpoint_hints_t; +#include "v1_for_node.h" #include "v1_for_zone.h" typedef struct v1_endpoint_hints_t { + list_t *for_nodes; //nonprimitive container list_t *for_zones; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoint_hints_t; -v1_endpoint_hints_t *v1_endpoint_hints_create( +__attribute__((deprecated)) v1_endpoint_hints_t *v1_endpoint_hints_create( + list_t *for_nodes, list_t *for_zones ); diff --git a/kubernetes/model/v1_endpoint_slice.c b/kubernetes/model/v1_endpoint_slice.c index 4d7e7704..1a596932 100644 --- a/kubernetes/model/v1_endpoint_slice.c +++ b/kubernetes/model/v1_endpoint_slice.c @@ -5,7 +5,7 @@ -v1_endpoint_slice_t *v1_endpoint_slice_create( +static v1_endpoint_slice_t *v1_endpoint_slice_create_internal( char *address_type, char *api_version, list_t *endpoints, @@ -24,14 +24,36 @@ v1_endpoint_slice_t *v1_endpoint_slice_create( v1_endpoint_slice_local_var->metadata = metadata; v1_endpoint_slice_local_var->ports = ports; + v1_endpoint_slice_local_var->_library_owned = 1; return v1_endpoint_slice_local_var; } +__attribute__((deprecated)) v1_endpoint_slice_t *v1_endpoint_slice_create( + char *address_type, + char *api_version, + list_t *endpoints, + char *kind, + v1_object_meta_t *metadata, + list_t *ports + ) { + return v1_endpoint_slice_create_internal ( + address_type, + api_version, + endpoints, + kind, + metadata, + ports + ); +} void v1_endpoint_slice_free(v1_endpoint_slice_t *v1_endpoint_slice) { if(NULL == v1_endpoint_slice){ return ; } + if(v1_endpoint_slice->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoint_slice_free"); + return ; + } listEntry_t *listEntry; if (v1_endpoint_slice->address_type) { free(v1_endpoint_slice->address_type); @@ -170,6 +192,9 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO // v1_endpoint_slice->address_type cJSON *address_type = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "addressType"); + if (cJSON_IsNull(address_type)) { + address_type = NULL; + } if (!address_type) { goto end; } @@ -182,6 +207,9 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO // v1_endpoint_slice->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -191,6 +219,9 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO // v1_endpoint_slice->endpoints cJSON *endpoints = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "endpoints"); + if (cJSON_IsNull(endpoints)) { + endpoints = NULL; + } if (!endpoints) { goto end; } @@ -215,6 +246,9 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO // v1_endpoint_slice->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -224,12 +258,18 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO // v1_endpoint_slice->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_endpoint_slice->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -250,7 +290,7 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO } - v1_endpoint_slice_local_var = v1_endpoint_slice_create ( + v1_endpoint_slice_local_var = v1_endpoint_slice_create_internal ( strdup(address_type->valuestring), api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, endpointsList, diff --git a/kubernetes/model/v1_endpoint_slice.h b/kubernetes/model/v1_endpoint_slice.h index 61815acc..6b4c0961 100644 --- a/kubernetes/model/v1_endpoint_slice.h +++ b/kubernetes/model/v1_endpoint_slice.h @@ -1,7 +1,7 @@ /* * v1_endpoint_slice.h * - * EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints. + * EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name. */ #ifndef _v1_endpoint_slice_H_ @@ -29,9 +29,10 @@ typedef struct v1_endpoint_slice_t { struct v1_object_meta_t *metadata; //model list_t *ports; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoint_slice_t; -v1_endpoint_slice_t *v1_endpoint_slice_create( +__attribute__((deprecated)) v1_endpoint_slice_t *v1_endpoint_slice_create( char *address_type, char *api_version, list_t *endpoints, diff --git a/kubernetes/model/v1_endpoint_slice_list.c b/kubernetes/model/v1_endpoint_slice_list.c index 50070287..32685c18 100644 --- a/kubernetes/model/v1_endpoint_slice_list.c +++ b/kubernetes/model/v1_endpoint_slice_list.c @@ -5,7 +5,7 @@ -v1_endpoint_slice_list_t *v1_endpoint_slice_list_create( +static v1_endpoint_slice_list_t *v1_endpoint_slice_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_create( v1_endpoint_slice_list_local_var->kind = kind; v1_endpoint_slice_list_local_var->metadata = metadata; + v1_endpoint_slice_list_local_var->_library_owned = 1; return v1_endpoint_slice_list_local_var; } +__attribute__((deprecated)) v1_endpoint_slice_list_t *v1_endpoint_slice_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_endpoint_slice_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_endpoint_slice_list_free(v1_endpoint_slice_list_t *v1_endpoint_slice_list) { if(NULL == v1_endpoint_slice_list){ return ; } + if(v1_endpoint_slice_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoint_slice_list_free"); + return ; + } listEntry_t *listEntry; if (v1_endpoint_slice_list->api_version) { free(v1_endpoint_slice_list->api_version); @@ -123,6 +141,9 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_parseFromJSON(cJSON *v1_endpoin // v1_endpoint_slice_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_endpoint_slice_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_parseFromJSON(cJSON *v1_endpoin // v1_endpoint_slice_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_endpoint_slice_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_parseFromJSON(cJSON *v1_endpoin // v1_endpoint_slice_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_endpoint_slice_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_parseFromJSON(cJSON *v1_endpoin // v1_endpoint_slice_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_endpoint_slice_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_endpoint_slice_list_local_var = v1_endpoint_slice_list_create ( + v1_endpoint_slice_list_local_var = v1_endpoint_slice_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_endpoint_slice_list.h b/kubernetes/model/v1_endpoint_slice_list.h index e1c01d55..9c05e945 100644 --- a/kubernetes/model/v1_endpoint_slice_list.h +++ b/kubernetes/model/v1_endpoint_slice_list.h @@ -26,9 +26,10 @@ typedef struct v1_endpoint_slice_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoint_slice_list_t; -v1_endpoint_slice_list_t *v1_endpoint_slice_list_create( +__attribute__((deprecated)) v1_endpoint_slice_list_t *v1_endpoint_slice_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_endpoint_subset.c b/kubernetes/model/v1_endpoint_subset.c index 1f000e68..acbf4b23 100644 --- a/kubernetes/model/v1_endpoint_subset.c +++ b/kubernetes/model/v1_endpoint_subset.c @@ -5,7 +5,7 @@ -v1_endpoint_subset_t *v1_endpoint_subset_create( +static v1_endpoint_subset_t *v1_endpoint_subset_create_internal( list_t *addresses, list_t *not_ready_addresses, list_t *ports @@ -18,14 +18,30 @@ v1_endpoint_subset_t *v1_endpoint_subset_create( v1_endpoint_subset_local_var->not_ready_addresses = not_ready_addresses; v1_endpoint_subset_local_var->ports = ports; + v1_endpoint_subset_local_var->_library_owned = 1; return v1_endpoint_subset_local_var; } +__attribute__((deprecated)) v1_endpoint_subset_t *v1_endpoint_subset_create( + list_t *addresses, + list_t *not_ready_addresses, + list_t *ports + ) { + return v1_endpoint_subset_create_internal ( + addresses, + not_ready_addresses, + ports + ); +} void v1_endpoint_subset_free(v1_endpoint_subset_t *v1_endpoint_subset) { if(NULL == v1_endpoint_subset){ return ; } + if(v1_endpoint_subset->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoint_subset_free"); + return ; + } listEntry_t *listEntry; if (v1_endpoint_subset->addresses) { list_ForEach(listEntry, v1_endpoint_subset->addresses) { @@ -136,6 +152,9 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset // v1_endpoint_subset->addresses cJSON *addresses = cJSON_GetObjectItemCaseSensitive(v1_endpoint_subsetJSON, "addresses"); + if (cJSON_IsNull(addresses)) { + addresses = NULL; + } if (addresses) { cJSON *addresses_local_nonprimitive = NULL; if(!cJSON_IsArray(addresses)){ @@ -157,6 +176,9 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset // v1_endpoint_subset->not_ready_addresses cJSON *not_ready_addresses = cJSON_GetObjectItemCaseSensitive(v1_endpoint_subsetJSON, "notReadyAddresses"); + if (cJSON_IsNull(not_ready_addresses)) { + not_ready_addresses = NULL; + } if (not_ready_addresses) { cJSON *not_ready_addresses_local_nonprimitive = NULL; if(!cJSON_IsArray(not_ready_addresses)){ @@ -178,6 +200,9 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset // v1_endpoint_subset->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_endpoint_subsetJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -198,7 +223,7 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset } - v1_endpoint_subset_local_var = v1_endpoint_subset_create ( + v1_endpoint_subset_local_var = v1_endpoint_subset_create_internal ( addresses ? addressesList : NULL, not_ready_addresses ? not_ready_addressesList : NULL, ports ? portsList : NULL diff --git a/kubernetes/model/v1_endpoint_subset.h b/kubernetes/model/v1_endpoint_subset.h index 8ff76a24..65275f5f 100644 --- a/kubernetes/model/v1_endpoint_subset.h +++ b/kubernetes/model/v1_endpoint_subset.h @@ -1,7 +1,7 @@ /* * v1_endpoint_subset.h * - * EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given: { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] } The resulting set of endpoints can be viewed as: a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], b: [ 10.10.1.1:309, 10.10.2.2:309 ] + * EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given: { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] } The resulting set of endpoints can be viewed as: a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], b: [ 10.10.1.1:309, 10.10.2.2:309 ] Deprecated: This API is deprecated in v1.33+. */ #ifndef _v1_endpoint_subset_H_ @@ -25,9 +25,10 @@ typedef struct v1_endpoint_subset_t { list_t *not_ready_addresses; //nonprimitive container list_t *ports; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoint_subset_t; -v1_endpoint_subset_t *v1_endpoint_subset_create( +__attribute__((deprecated)) v1_endpoint_subset_t *v1_endpoint_subset_create( list_t *addresses, list_t *not_ready_addresses, list_t *ports diff --git a/kubernetes/model/v1_endpoints.c b/kubernetes/model/v1_endpoints.c index fa69094b..0436ee34 100644 --- a/kubernetes/model/v1_endpoints.c +++ b/kubernetes/model/v1_endpoints.c @@ -5,7 +5,7 @@ -v1_endpoints_t *v1_endpoints_create( +static v1_endpoints_t *v1_endpoints_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_endpoints_t *v1_endpoints_create( v1_endpoints_local_var->metadata = metadata; v1_endpoints_local_var->subsets = subsets; + v1_endpoints_local_var->_library_owned = 1; return v1_endpoints_local_var; } +__attribute__((deprecated)) v1_endpoints_t *v1_endpoints_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + list_t *subsets + ) { + return v1_endpoints_create_internal ( + api_version, + kind, + metadata, + subsets + ); +} void v1_endpoints_free(v1_endpoints_t *v1_endpoints) { if(NULL == v1_endpoints){ return ; } + if(v1_endpoints->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoints_free"); + return ; + } listEntry_t *listEntry; if (v1_endpoints->api_version) { free(v1_endpoints->api_version); @@ -122,6 +140,9 @@ v1_endpoints_t *v1_endpoints_parseFromJSON(cJSON *v1_endpointsJSON){ // v1_endpoints->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_endpointsJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -131,6 +152,9 @@ v1_endpoints_t *v1_endpoints_parseFromJSON(cJSON *v1_endpointsJSON){ // v1_endpoints->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_endpointsJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -140,12 +164,18 @@ v1_endpoints_t *v1_endpoints_parseFromJSON(cJSON *v1_endpointsJSON){ // v1_endpoints->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_endpointsJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_endpoints->subsets cJSON *subsets = cJSON_GetObjectItemCaseSensitive(v1_endpointsJSON, "subsets"); + if (cJSON_IsNull(subsets)) { + subsets = NULL; + } if (subsets) { cJSON *subsets_local_nonprimitive = NULL; if(!cJSON_IsArray(subsets)){ @@ -166,7 +196,7 @@ v1_endpoints_t *v1_endpoints_parseFromJSON(cJSON *v1_endpointsJSON){ } - v1_endpoints_local_var = v1_endpoints_create ( + v1_endpoints_local_var = v1_endpoints_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_endpoints.h b/kubernetes/model/v1_endpoints.h index 1c19b158..102083ba 100644 --- a/kubernetes/model/v1_endpoints.h +++ b/kubernetes/model/v1_endpoints.h @@ -1,7 +1,7 @@ /* * v1_endpoints.h * - * Endpoints is a collection of endpoints that implement the actual service. Example: Name: \"mysvc\", Subsets: [ { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] }, { Addresses: [{\"ip\": \"10.10.3.3\"}], Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}] }, ] + * Endpoints is a collection of endpoints that implement the actual service. Example: Name: \"mysvc\", Subsets: [ { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] }, { Addresses: [{\"ip\": \"10.10.3.3\"}], Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}] }, ] Endpoints is a legacy API and does not contain information about all Service features. Use discoveryv1.EndpointSlice for complete information about Service endpoints. Deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. */ #ifndef _v1_endpoints_H_ @@ -26,9 +26,10 @@ typedef struct v1_endpoints_t { struct v1_object_meta_t *metadata; //model list_t *subsets; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoints_t; -v1_endpoints_t *v1_endpoints_create( +__attribute__((deprecated)) v1_endpoints_t *v1_endpoints_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_endpoints_list.c b/kubernetes/model/v1_endpoints_list.c index 471b09ee..234e5be9 100644 --- a/kubernetes/model/v1_endpoints_list.c +++ b/kubernetes/model/v1_endpoints_list.c @@ -5,7 +5,7 @@ -v1_endpoints_list_t *v1_endpoints_list_create( +static v1_endpoints_list_t *v1_endpoints_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_endpoints_list_t *v1_endpoints_list_create( v1_endpoints_list_local_var->kind = kind; v1_endpoints_list_local_var->metadata = metadata; + v1_endpoints_list_local_var->_library_owned = 1; return v1_endpoints_list_local_var; } +__attribute__((deprecated)) v1_endpoints_list_t *v1_endpoints_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_endpoints_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_endpoints_list_free(v1_endpoints_list_t *v1_endpoints_list) { if(NULL == v1_endpoints_list){ return ; } + if(v1_endpoints_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_endpoints_list_free"); + return ; + } listEntry_t *listEntry; if (v1_endpoints_list->api_version) { free(v1_endpoints_list->api_version); @@ -123,6 +141,9 @@ v1_endpoints_list_t *v1_endpoints_list_parseFromJSON(cJSON *v1_endpoints_listJSO // v1_endpoints_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_endpoints_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_endpoints_list_t *v1_endpoints_list_parseFromJSON(cJSON *v1_endpoints_listJSO // v1_endpoints_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_endpoints_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_endpoints_list_t *v1_endpoints_list_parseFromJSON(cJSON *v1_endpoints_listJSO // v1_endpoints_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_endpoints_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_endpoints_list_t *v1_endpoints_list_parseFromJSON(cJSON *v1_endpoints_listJSO // v1_endpoints_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_endpoints_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_endpoints_list_local_var = v1_endpoints_list_create ( + v1_endpoints_list_local_var = v1_endpoints_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_endpoints_list.h b/kubernetes/model/v1_endpoints_list.h index 69c6fb3b..f104c288 100644 --- a/kubernetes/model/v1_endpoints_list.h +++ b/kubernetes/model/v1_endpoints_list.h @@ -1,7 +1,7 @@ /* * v1_endpoints_list.h * - * EndpointsList is a list of endpoints. + * EndpointsList is a list of endpoints. Deprecated: This API is deprecated in v1.33+. */ #ifndef _v1_endpoints_list_H_ @@ -26,9 +26,10 @@ typedef struct v1_endpoints_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_endpoints_list_t; -v1_endpoints_list_t *v1_endpoints_list_create( +__attribute__((deprecated)) v1_endpoints_list_t *v1_endpoints_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_env_from_source.c b/kubernetes/model/v1_env_from_source.c index f31fb7aa..bea2f31a 100644 --- a/kubernetes/model/v1_env_from_source.c +++ b/kubernetes/model/v1_env_from_source.c @@ -5,7 +5,7 @@ -v1_env_from_source_t *v1_env_from_source_create( +static v1_env_from_source_t *v1_env_from_source_create_internal( v1_config_map_env_source_t *config_map_ref, char *prefix, v1_secret_env_source_t *secret_ref @@ -18,14 +18,30 @@ v1_env_from_source_t *v1_env_from_source_create( v1_env_from_source_local_var->prefix = prefix; v1_env_from_source_local_var->secret_ref = secret_ref; + v1_env_from_source_local_var->_library_owned = 1; return v1_env_from_source_local_var; } +__attribute__((deprecated)) v1_env_from_source_t *v1_env_from_source_create( + v1_config_map_env_source_t *config_map_ref, + char *prefix, + v1_secret_env_source_t *secret_ref + ) { + return v1_env_from_source_create_internal ( + config_map_ref, + prefix, + secret_ref + ); +} void v1_env_from_source_free(v1_env_from_source_t *v1_env_from_source) { if(NULL == v1_env_from_source){ return ; } + if(v1_env_from_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_env_from_source_free"); + return ; + } listEntry_t *listEntry; if (v1_env_from_source->config_map_ref) { v1_config_map_env_source_free(v1_env_from_source->config_map_ref); @@ -98,12 +114,18 @@ v1_env_from_source_t *v1_env_from_source_parseFromJSON(cJSON *v1_env_from_source // v1_env_from_source->config_map_ref cJSON *config_map_ref = cJSON_GetObjectItemCaseSensitive(v1_env_from_sourceJSON, "configMapRef"); + if (cJSON_IsNull(config_map_ref)) { + config_map_ref = NULL; + } if (config_map_ref) { config_map_ref_local_nonprim = v1_config_map_env_source_parseFromJSON(config_map_ref); //nonprimitive } // v1_env_from_source->prefix cJSON *prefix = cJSON_GetObjectItemCaseSensitive(v1_env_from_sourceJSON, "prefix"); + if (cJSON_IsNull(prefix)) { + prefix = NULL; + } if (prefix) { if(!cJSON_IsString(prefix) && !cJSON_IsNull(prefix)) { @@ -113,12 +135,15 @@ v1_env_from_source_t *v1_env_from_source_parseFromJSON(cJSON *v1_env_from_source // v1_env_from_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_env_from_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_secret_env_source_parseFromJSON(secret_ref); //nonprimitive } - v1_env_from_source_local_var = v1_env_from_source_create ( + v1_env_from_source_local_var = v1_env_from_source_create_internal ( config_map_ref ? config_map_ref_local_nonprim : NULL, prefix && !cJSON_IsNull(prefix) ? strdup(prefix->valuestring) : NULL, secret_ref ? secret_ref_local_nonprim : NULL diff --git a/kubernetes/model/v1_env_from_source.h b/kubernetes/model/v1_env_from_source.h index bad9d947..4d664410 100644 --- a/kubernetes/model/v1_env_from_source.h +++ b/kubernetes/model/v1_env_from_source.h @@ -1,7 +1,7 @@ /* * v1_env_from_source.h * - * EnvFromSource represents the source of a set of ConfigMaps + * EnvFromSource represents the source of a set of ConfigMaps or Secrets */ #ifndef _v1_env_from_source_H_ @@ -25,9 +25,10 @@ typedef struct v1_env_from_source_t { char *prefix; // string struct v1_secret_env_source_t *secret_ref; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_env_from_source_t; -v1_env_from_source_t *v1_env_from_source_create( +__attribute__((deprecated)) v1_env_from_source_t *v1_env_from_source_create( v1_config_map_env_source_t *config_map_ref, char *prefix, v1_secret_env_source_t *secret_ref diff --git a/kubernetes/model/v1_env_var.c b/kubernetes/model/v1_env_var.c index dd382299..ade1eab4 100644 --- a/kubernetes/model/v1_env_var.c +++ b/kubernetes/model/v1_env_var.c @@ -5,7 +5,7 @@ -v1_env_var_t *v1_env_var_create( +static v1_env_var_t *v1_env_var_create_internal( char *name, char *value, v1_env_var_source_t *value_from @@ -18,14 +18,30 @@ v1_env_var_t *v1_env_var_create( v1_env_var_local_var->value = value; v1_env_var_local_var->value_from = value_from; + v1_env_var_local_var->_library_owned = 1; return v1_env_var_local_var; } +__attribute__((deprecated)) v1_env_var_t *v1_env_var_create( + char *name, + char *value, + v1_env_var_source_t *value_from + ) { + return v1_env_var_create_internal ( + name, + value, + value_from + ); +} void v1_env_var_free(v1_env_var_t *v1_env_var) { if(NULL == v1_env_var){ return ; } + if(v1_env_var->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_env_var_free"); + return ; + } listEntry_t *listEntry; if (v1_env_var->name) { free(v1_env_var->name); @@ -91,6 +107,9 @@ v1_env_var_t *v1_env_var_parseFromJSON(cJSON *v1_env_varJSON){ // v1_env_var->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_env_varJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -103,6 +122,9 @@ v1_env_var_t *v1_env_var_parseFromJSON(cJSON *v1_env_varJSON){ // v1_env_var->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_env_varJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (value) { if(!cJSON_IsString(value) && !cJSON_IsNull(value)) { @@ -112,12 +134,15 @@ v1_env_var_t *v1_env_var_parseFromJSON(cJSON *v1_env_varJSON){ // v1_env_var->value_from cJSON *value_from = cJSON_GetObjectItemCaseSensitive(v1_env_varJSON, "valueFrom"); + if (cJSON_IsNull(value_from)) { + value_from = NULL; + } if (value_from) { value_from_local_nonprim = v1_env_var_source_parseFromJSON(value_from); //nonprimitive } - v1_env_var_local_var = v1_env_var_create ( + v1_env_var_local_var = v1_env_var_create_internal ( strdup(name->valuestring), value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL, value_from ? value_from_local_nonprim : NULL diff --git a/kubernetes/model/v1_env_var.h b/kubernetes/model/v1_env_var.h index 7290930e..9df1c190 100644 --- a/kubernetes/model/v1_env_var.h +++ b/kubernetes/model/v1_env_var.h @@ -24,9 +24,10 @@ typedef struct v1_env_var_t { char *value; // string struct v1_env_var_source_t *value_from; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_env_var_t; -v1_env_var_t *v1_env_var_create( +__attribute__((deprecated)) v1_env_var_t *v1_env_var_create( char *name, char *value, v1_env_var_source_t *value_from diff --git a/kubernetes/model/v1_env_var_source.c b/kubernetes/model/v1_env_var_source.c index 10a3373a..ed83c51b 100644 --- a/kubernetes/model/v1_env_var_source.c +++ b/kubernetes/model/v1_env_var_source.c @@ -5,9 +5,10 @@ -v1_env_var_source_t *v1_env_var_source_create( +static v1_env_var_source_t *v1_env_var_source_create_internal( v1_config_map_key_selector_t *config_map_key_ref, v1_object_field_selector_t *field_ref, + v1_file_key_selector_t *file_key_ref, v1_resource_field_selector_t *resource_field_ref, v1_secret_key_selector_t *secret_key_ref ) { @@ -17,17 +18,38 @@ v1_env_var_source_t *v1_env_var_source_create( } v1_env_var_source_local_var->config_map_key_ref = config_map_key_ref; v1_env_var_source_local_var->field_ref = field_ref; + v1_env_var_source_local_var->file_key_ref = file_key_ref; v1_env_var_source_local_var->resource_field_ref = resource_field_ref; v1_env_var_source_local_var->secret_key_ref = secret_key_ref; + v1_env_var_source_local_var->_library_owned = 1; return v1_env_var_source_local_var; } +__attribute__((deprecated)) v1_env_var_source_t *v1_env_var_source_create( + v1_config_map_key_selector_t *config_map_key_ref, + v1_object_field_selector_t *field_ref, + v1_file_key_selector_t *file_key_ref, + v1_resource_field_selector_t *resource_field_ref, + v1_secret_key_selector_t *secret_key_ref + ) { + return v1_env_var_source_create_internal ( + config_map_key_ref, + field_ref, + file_key_ref, + resource_field_ref, + secret_key_ref + ); +} void v1_env_var_source_free(v1_env_var_source_t *v1_env_var_source) { if(NULL == v1_env_var_source){ return ; } + if(v1_env_var_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_env_var_source_free"); + return ; + } listEntry_t *listEntry; if (v1_env_var_source->config_map_key_ref) { v1_config_map_key_selector_free(v1_env_var_source->config_map_key_ref); @@ -37,6 +59,10 @@ void v1_env_var_source_free(v1_env_var_source_t *v1_env_var_source) { v1_object_field_selector_free(v1_env_var_source->field_ref); v1_env_var_source->field_ref = NULL; } + if (v1_env_var_source->file_key_ref) { + v1_file_key_selector_free(v1_env_var_source->file_key_ref); + v1_env_var_source->file_key_ref = NULL; + } if (v1_env_var_source->resource_field_ref) { v1_resource_field_selector_free(v1_env_var_source->resource_field_ref); v1_env_var_source->resource_field_ref = NULL; @@ -77,6 +103,19 @@ cJSON *v1_env_var_source_convertToJSON(v1_env_var_source_t *v1_env_var_source) { } + // v1_env_var_source->file_key_ref + if(v1_env_var_source->file_key_ref) { + cJSON *file_key_ref_local_JSON = v1_file_key_selector_convertToJSON(v1_env_var_source->file_key_ref); + if(file_key_ref_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "fileKeyRef", file_key_ref_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_env_var_source->resource_field_ref if(v1_env_var_source->resource_field_ref) { cJSON *resource_field_ref_local_JSON = v1_resource_field_selector_convertToJSON(v1_env_var_source->resource_field_ref); @@ -120,6 +159,9 @@ v1_env_var_source_t *v1_env_var_source_parseFromJSON(cJSON *v1_env_var_sourceJSO // define the local variable for v1_env_var_source->field_ref v1_object_field_selector_t *field_ref_local_nonprim = NULL; + // define the local variable for v1_env_var_source->file_key_ref + v1_file_key_selector_t *file_key_ref_local_nonprim = NULL; + // define the local variable for v1_env_var_source->resource_field_ref v1_resource_field_selector_t *resource_field_ref_local_nonprim = NULL; @@ -128,32 +170,54 @@ v1_env_var_source_t *v1_env_var_source_parseFromJSON(cJSON *v1_env_var_sourceJSO // v1_env_var_source->config_map_key_ref cJSON *config_map_key_ref = cJSON_GetObjectItemCaseSensitive(v1_env_var_sourceJSON, "configMapKeyRef"); + if (cJSON_IsNull(config_map_key_ref)) { + config_map_key_ref = NULL; + } if (config_map_key_ref) { config_map_key_ref_local_nonprim = v1_config_map_key_selector_parseFromJSON(config_map_key_ref); //nonprimitive } // v1_env_var_source->field_ref cJSON *field_ref = cJSON_GetObjectItemCaseSensitive(v1_env_var_sourceJSON, "fieldRef"); + if (cJSON_IsNull(field_ref)) { + field_ref = NULL; + } if (field_ref) { field_ref_local_nonprim = v1_object_field_selector_parseFromJSON(field_ref); //nonprimitive } + // v1_env_var_source->file_key_ref + cJSON *file_key_ref = cJSON_GetObjectItemCaseSensitive(v1_env_var_sourceJSON, "fileKeyRef"); + if (cJSON_IsNull(file_key_ref)) { + file_key_ref = NULL; + } + if (file_key_ref) { + file_key_ref_local_nonprim = v1_file_key_selector_parseFromJSON(file_key_ref); //nonprimitive + } + // v1_env_var_source->resource_field_ref cJSON *resource_field_ref = cJSON_GetObjectItemCaseSensitive(v1_env_var_sourceJSON, "resourceFieldRef"); + if (cJSON_IsNull(resource_field_ref)) { + resource_field_ref = NULL; + } if (resource_field_ref) { resource_field_ref_local_nonprim = v1_resource_field_selector_parseFromJSON(resource_field_ref); //nonprimitive } // v1_env_var_source->secret_key_ref cJSON *secret_key_ref = cJSON_GetObjectItemCaseSensitive(v1_env_var_sourceJSON, "secretKeyRef"); + if (cJSON_IsNull(secret_key_ref)) { + secret_key_ref = NULL; + } if (secret_key_ref) { secret_key_ref_local_nonprim = v1_secret_key_selector_parseFromJSON(secret_key_ref); //nonprimitive } - v1_env_var_source_local_var = v1_env_var_source_create ( + v1_env_var_source_local_var = v1_env_var_source_create_internal ( config_map_key_ref ? config_map_key_ref_local_nonprim : NULL, field_ref ? field_ref_local_nonprim : NULL, + file_key_ref ? file_key_ref_local_nonprim : NULL, resource_field_ref ? resource_field_ref_local_nonprim : NULL, secret_key_ref ? secret_key_ref_local_nonprim : NULL ); @@ -168,6 +232,10 @@ v1_env_var_source_t *v1_env_var_source_parseFromJSON(cJSON *v1_env_var_sourceJSO v1_object_field_selector_free(field_ref_local_nonprim); field_ref_local_nonprim = NULL; } + if (file_key_ref_local_nonprim) { + v1_file_key_selector_free(file_key_ref_local_nonprim); + file_key_ref_local_nonprim = NULL; + } if (resource_field_ref_local_nonprim) { v1_resource_field_selector_free(resource_field_ref_local_nonprim); resource_field_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_env_var_source.h b/kubernetes/model/v1_env_var_source.h index d5e2c524..3d9ac764 100644 --- a/kubernetes/model/v1_env_var_source.h +++ b/kubernetes/model/v1_env_var_source.h @@ -16,6 +16,7 @@ typedef struct v1_env_var_source_t v1_env_var_source_t; #include "v1_config_map_key_selector.h" +#include "v1_file_key_selector.h" #include "v1_object_field_selector.h" #include "v1_resource_field_selector.h" #include "v1_secret_key_selector.h" @@ -25,14 +26,17 @@ typedef struct v1_env_var_source_t v1_env_var_source_t; typedef struct v1_env_var_source_t { struct v1_config_map_key_selector_t *config_map_key_ref; //model struct v1_object_field_selector_t *field_ref; //model + struct v1_file_key_selector_t *file_key_ref; //model struct v1_resource_field_selector_t *resource_field_ref; //model struct v1_secret_key_selector_t *secret_key_ref; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_env_var_source_t; -v1_env_var_source_t *v1_env_var_source_create( +__attribute__((deprecated)) v1_env_var_source_t *v1_env_var_source_create( v1_config_map_key_selector_t *config_map_key_ref, v1_object_field_selector_t *field_ref, + v1_file_key_selector_t *file_key_ref, v1_resource_field_selector_t *resource_field_ref, v1_secret_key_selector_t *secret_key_ref ); diff --git a/kubernetes/model/v1_ephemeral_container.c b/kubernetes/model/v1_ephemeral_container.c index 8e563c9e..482ecc39 100644 --- a/kubernetes/model/v1_ephemeral_container.c +++ b/kubernetes/model/v1_ephemeral_container.c @@ -5,7 +5,7 @@ -v1_ephemeral_container_t *v1_ephemeral_container_create( +static v1_ephemeral_container_t *v1_ephemeral_container_create_internal( list_t *args, list_t *command, list_t *env, @@ -20,6 +20,7 @@ v1_ephemeral_container_t *v1_ephemeral_container_create( list_t *resize_policy, v1_resource_requirements_t *resources, char *restart_policy, + list_t *restart_policy_rules, v1_security_context_t *security_context, v1_probe_t *startup_probe, int _stdin, @@ -50,6 +51,7 @@ v1_ephemeral_container_t *v1_ephemeral_container_create( v1_ephemeral_container_local_var->resize_policy = resize_policy; v1_ephemeral_container_local_var->resources = resources; v1_ephemeral_container_local_var->restart_policy = restart_policy; + v1_ephemeral_container_local_var->restart_policy_rules = restart_policy_rules; v1_ephemeral_container_local_var->security_context = security_context; v1_ephemeral_container_local_var->startup_probe = startup_probe; v1_ephemeral_container_local_var->_stdin = _stdin; @@ -62,14 +64,76 @@ v1_ephemeral_container_t *v1_ephemeral_container_create( v1_ephemeral_container_local_var->volume_mounts = volume_mounts; v1_ephemeral_container_local_var->working_dir = working_dir; + v1_ephemeral_container_local_var->_library_owned = 1; return v1_ephemeral_container_local_var; } +__attribute__((deprecated)) v1_ephemeral_container_t *v1_ephemeral_container_create( + list_t *args, + list_t *command, + list_t *env, + list_t *env_from, + char *image, + char *image_pull_policy, + v1_lifecycle_t *lifecycle, + v1_probe_t *liveness_probe, + char *name, + list_t *ports, + v1_probe_t *readiness_probe, + list_t *resize_policy, + v1_resource_requirements_t *resources, + char *restart_policy, + list_t *restart_policy_rules, + v1_security_context_t *security_context, + v1_probe_t *startup_probe, + int _stdin, + int stdin_once, + char *target_container_name, + char *termination_message_path, + char *termination_message_policy, + int tty, + list_t *volume_devices, + list_t *volume_mounts, + char *working_dir + ) { + return v1_ephemeral_container_create_internal ( + args, + command, + env, + env_from, + image, + image_pull_policy, + lifecycle, + liveness_probe, + name, + ports, + readiness_probe, + resize_policy, + resources, + restart_policy, + restart_policy_rules, + security_context, + startup_probe, + _stdin, + stdin_once, + target_container_name, + termination_message_path, + termination_message_policy, + tty, + volume_devices, + volume_mounts, + working_dir + ); +} void v1_ephemeral_container_free(v1_ephemeral_container_t *v1_ephemeral_container) { if(NULL == v1_ephemeral_container){ return ; } + if(v1_ephemeral_container->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ephemeral_container_free"); + return ; + } listEntry_t *listEntry; if (v1_ephemeral_container->args) { list_ForEach(listEntry, v1_ephemeral_container->args) { @@ -145,6 +209,13 @@ void v1_ephemeral_container_free(v1_ephemeral_container_t *v1_ephemeral_containe free(v1_ephemeral_container->restart_policy); v1_ephemeral_container->restart_policy = NULL; } + if (v1_ephemeral_container->restart_policy_rules) { + list_ForEach(listEntry, v1_ephemeral_container->restart_policy_rules) { + v1_container_restart_rule_free(listEntry->data); + } + list_freeList(v1_ephemeral_container->restart_policy_rules); + v1_ephemeral_container->restart_policy_rules = NULL; + } if (v1_ephemeral_container->security_context) { v1_security_context_free(v1_ephemeral_container->security_context); v1_ephemeral_container->security_context = NULL; @@ -198,7 +269,7 @@ cJSON *v1_ephemeral_container_convertToJSON(v1_ephemeral_container_t *v1_ephemer listEntry_t *argsListEntry; list_ForEach(argsListEntry, v1_ephemeral_container->args) { - if(cJSON_AddStringToObject(args, "", (char*)argsListEntry->data) == NULL) + if(cJSON_AddStringToObject(args, "", argsListEntry->data) == NULL) { goto fail; } @@ -215,7 +286,7 @@ cJSON *v1_ephemeral_container_convertToJSON(v1_ephemeral_container_t *v1_ephemer listEntry_t *commandListEntry; list_ForEach(commandListEntry, v1_ephemeral_container->command) { - if(cJSON_AddStringToObject(command, "", (char*)commandListEntry->data) == NULL) + if(cJSON_AddStringToObject(command, "", commandListEntry->data) == NULL) { goto fail; } @@ -388,6 +459,26 @@ cJSON *v1_ephemeral_container_convertToJSON(v1_ephemeral_container_t *v1_ephemer } + // v1_ephemeral_container->restart_policy_rules + if(v1_ephemeral_container->restart_policy_rules) { + cJSON *restart_policy_rules = cJSON_AddArrayToObject(item, "restartPolicyRules"); + if(restart_policy_rules == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *restart_policy_rulesListEntry; + if (v1_ephemeral_container->restart_policy_rules) { + list_ForEach(restart_policy_rulesListEntry, v1_ephemeral_container->restart_policy_rules) { + cJSON *itemLocal = v1_container_restart_rule_convertToJSON(restart_policy_rulesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(restart_policy_rules, itemLocal); + } + } + } + + // v1_ephemeral_container->security_context if(v1_ephemeral_container->security_context) { cJSON *security_context_local_JSON = v1_security_context_convertToJSON(v1_ephemeral_container->security_context); @@ -551,6 +642,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // define the local variable for v1_ephemeral_container->resources v1_resource_requirements_t *resources_local_nonprim = NULL; + // define the local list for v1_ephemeral_container->restart_policy_rules + list_t *restart_policy_rulesList = NULL; + // define the local variable for v1_ephemeral_container->security_context v1_security_context_t *security_context_local_nonprim = NULL; @@ -565,6 +659,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->args cJSON *args = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "args"); + if (cJSON_IsNull(args)) { + args = NULL; + } if (args) { cJSON *args_local = NULL; if(!cJSON_IsArray(args)) { @@ -584,6 +681,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->command cJSON *command = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "command"); + if (cJSON_IsNull(command)) { + command = NULL; + } if (command) { cJSON *command_local = NULL; if(!cJSON_IsArray(command)) { @@ -603,6 +703,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->env cJSON *env = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "env"); + if (cJSON_IsNull(env)) { + env = NULL; + } if (env) { cJSON *env_local_nonprimitive = NULL; if(!cJSON_IsArray(env)){ @@ -624,6 +727,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->env_from cJSON *env_from = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "envFrom"); + if (cJSON_IsNull(env_from)) { + env_from = NULL; + } if (env_from) { cJSON *env_from_local_nonprimitive = NULL; if(!cJSON_IsArray(env_from)){ @@ -645,6 +751,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->image cJSON *image = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "image"); + if (cJSON_IsNull(image)) { + image = NULL; + } if (image) { if(!cJSON_IsString(image) && !cJSON_IsNull(image)) { @@ -654,6 +763,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->image_pull_policy cJSON *image_pull_policy = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "imagePullPolicy"); + if (cJSON_IsNull(image_pull_policy)) { + image_pull_policy = NULL; + } if (image_pull_policy) { if(!cJSON_IsString(image_pull_policy) && !cJSON_IsNull(image_pull_policy)) { @@ -663,18 +775,27 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->lifecycle cJSON *lifecycle = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "lifecycle"); + if (cJSON_IsNull(lifecycle)) { + lifecycle = NULL; + } if (lifecycle) { lifecycle_local_nonprim = v1_lifecycle_parseFromJSON(lifecycle); //nonprimitive } // v1_ephemeral_container->liveness_probe cJSON *liveness_probe = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "livenessProbe"); + if (cJSON_IsNull(liveness_probe)) { + liveness_probe = NULL; + } if (liveness_probe) { liveness_probe_local_nonprim = v1_probe_parseFromJSON(liveness_probe); //nonprimitive } // v1_ephemeral_container->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -687,6 +808,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -708,12 +832,18 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->readiness_probe cJSON *readiness_probe = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "readinessProbe"); + if (cJSON_IsNull(readiness_probe)) { + readiness_probe = NULL; + } if (readiness_probe) { readiness_probe_local_nonprim = v1_probe_parseFromJSON(readiness_probe); //nonprimitive } // v1_ephemeral_container->resize_policy cJSON *resize_policy = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "resizePolicy"); + if (cJSON_IsNull(resize_policy)) { + resize_policy = NULL; + } if (resize_policy) { cJSON *resize_policy_local_nonprimitive = NULL; if(!cJSON_IsArray(resize_policy)){ @@ -735,12 +865,18 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { resources_local_nonprim = v1_resource_requirements_parseFromJSON(resources); //nonprimitive } // v1_ephemeral_container->restart_policy cJSON *restart_policy = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "restartPolicy"); + if (cJSON_IsNull(restart_policy)) { + restart_policy = NULL; + } if (restart_policy) { if(!cJSON_IsString(restart_policy) && !cJSON_IsNull(restart_policy)) { @@ -748,20 +884,53 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer } } + // v1_ephemeral_container->restart_policy_rules + cJSON *restart_policy_rules = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "restartPolicyRules"); + if (cJSON_IsNull(restart_policy_rules)) { + restart_policy_rules = NULL; + } + if (restart_policy_rules) { + cJSON *restart_policy_rules_local_nonprimitive = NULL; + if(!cJSON_IsArray(restart_policy_rules)){ + goto end; //nonprimitive container + } + + restart_policy_rulesList = list_createList(); + + cJSON_ArrayForEach(restart_policy_rules_local_nonprimitive,restart_policy_rules ) + { + if(!cJSON_IsObject(restart_policy_rules_local_nonprimitive)){ + goto end; + } + v1_container_restart_rule_t *restart_policy_rulesItem = v1_container_restart_rule_parseFromJSON(restart_policy_rules_local_nonprimitive); + + list_addElement(restart_policy_rulesList, restart_policy_rulesItem); + } + } + // v1_ephemeral_container->security_context cJSON *security_context = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "securityContext"); + if (cJSON_IsNull(security_context)) { + security_context = NULL; + } if (security_context) { security_context_local_nonprim = v1_security_context_parseFromJSON(security_context); //nonprimitive } // v1_ephemeral_container->startup_probe cJSON *startup_probe = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "startupProbe"); + if (cJSON_IsNull(startup_probe)) { + startup_probe = NULL; + } if (startup_probe) { startup_probe_local_nonprim = v1_probe_parseFromJSON(startup_probe); //nonprimitive } // v1_ephemeral_container->_stdin cJSON *_stdin = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "stdin"); + if (cJSON_IsNull(_stdin)) { + _stdin = NULL; + } if (_stdin) { if(!cJSON_IsBool(_stdin)) { @@ -771,6 +940,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->stdin_once cJSON *stdin_once = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "stdinOnce"); + if (cJSON_IsNull(stdin_once)) { + stdin_once = NULL; + } if (stdin_once) { if(!cJSON_IsBool(stdin_once)) { @@ -780,6 +952,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->target_container_name cJSON *target_container_name = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "targetContainerName"); + if (cJSON_IsNull(target_container_name)) { + target_container_name = NULL; + } if (target_container_name) { if(!cJSON_IsString(target_container_name) && !cJSON_IsNull(target_container_name)) { @@ -789,6 +964,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->termination_message_path cJSON *termination_message_path = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "terminationMessagePath"); + if (cJSON_IsNull(termination_message_path)) { + termination_message_path = NULL; + } if (termination_message_path) { if(!cJSON_IsString(termination_message_path) && !cJSON_IsNull(termination_message_path)) { @@ -798,6 +976,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->termination_message_policy cJSON *termination_message_policy = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "terminationMessagePolicy"); + if (cJSON_IsNull(termination_message_policy)) { + termination_message_policy = NULL; + } if (termination_message_policy) { if(!cJSON_IsString(termination_message_policy) && !cJSON_IsNull(termination_message_policy)) { @@ -807,6 +988,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->tty cJSON *tty = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "tty"); + if (cJSON_IsNull(tty)) { + tty = NULL; + } if (tty) { if(!cJSON_IsBool(tty)) { @@ -816,6 +1000,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->volume_devices cJSON *volume_devices = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "volumeDevices"); + if (cJSON_IsNull(volume_devices)) { + volume_devices = NULL; + } if (volume_devices) { cJSON *volume_devices_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_devices)){ @@ -837,6 +1024,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->volume_mounts cJSON *volume_mounts = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "volumeMounts"); + if (cJSON_IsNull(volume_mounts)) { + volume_mounts = NULL; + } if (volume_mounts) { cJSON *volume_mounts_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_mounts)){ @@ -858,6 +1048,9 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->working_dir cJSON *working_dir = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "workingDir"); + if (cJSON_IsNull(working_dir)) { + working_dir = NULL; + } if (working_dir) { if(!cJSON_IsString(working_dir) && !cJSON_IsNull(working_dir)) { @@ -866,7 +1059,7 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer } - v1_ephemeral_container_local_var = v1_ephemeral_container_create ( + v1_ephemeral_container_local_var = v1_ephemeral_container_create_internal ( args ? argsList : NULL, command ? commandList : NULL, env ? envList : NULL, @@ -881,6 +1074,7 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer resize_policy ? resize_policyList : NULL, resources ? resources_local_nonprim : NULL, restart_policy && !cJSON_IsNull(restart_policy) ? strdup(restart_policy->valuestring) : NULL, + restart_policy_rules ? restart_policy_rulesList : NULL, security_context ? security_context_local_nonprim : NULL, startup_probe ? startup_probe_local_nonprim : NULL, _stdin ? _stdin->valueint : 0, @@ -966,6 +1160,15 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer v1_resource_requirements_free(resources_local_nonprim); resources_local_nonprim = NULL; } + if (restart_policy_rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, restart_policy_rulesList) { + v1_container_restart_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(restart_policy_rulesList); + restart_policy_rulesList = NULL; + } if (security_context_local_nonprim) { v1_security_context_free(security_context_local_nonprim); security_context_local_nonprim = NULL; diff --git a/kubernetes/model/v1_ephemeral_container.h b/kubernetes/model/v1_ephemeral_container.h index 5b6444c7..e1665cc9 100644 --- a/kubernetes/model/v1_ephemeral_container.h +++ b/kubernetes/model/v1_ephemeral_container.h @@ -17,6 +17,7 @@ typedef struct v1_ephemeral_container_t v1_ephemeral_container_t; #include "v1_container_port.h" #include "v1_container_resize_policy.h" +#include "v1_container_restart_rule.h" #include "v1_env_from_source.h" #include "v1_env_var.h" #include "v1_lifecycle.h" @@ -43,6 +44,7 @@ typedef struct v1_ephemeral_container_t { list_t *resize_policy; //nonprimitive container struct v1_resource_requirements_t *resources; //model char *restart_policy; // string + list_t *restart_policy_rules; //nonprimitive container struct v1_security_context_t *security_context; //model struct v1_probe_t *startup_probe; //model int _stdin; //boolean @@ -55,9 +57,10 @@ typedef struct v1_ephemeral_container_t { list_t *volume_mounts; //nonprimitive container char *working_dir; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_ephemeral_container_t; -v1_ephemeral_container_t *v1_ephemeral_container_create( +__attribute__((deprecated)) v1_ephemeral_container_t *v1_ephemeral_container_create( list_t *args, list_t *command, list_t *env, @@ -72,6 +75,7 @@ v1_ephemeral_container_t *v1_ephemeral_container_create( list_t *resize_policy, v1_resource_requirements_t *resources, char *restart_policy, + list_t *restart_policy_rules, v1_security_context_t *security_context, v1_probe_t *startup_probe, int _stdin, diff --git a/kubernetes/model/v1_ephemeral_volume_source.c b/kubernetes/model/v1_ephemeral_volume_source.c index 53473c83..57368662 100644 --- a/kubernetes/model/v1_ephemeral_volume_source.c +++ b/kubernetes/model/v1_ephemeral_volume_source.c @@ -5,7 +5,7 @@ -v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_create( +static v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_create_internal( v1_persistent_volume_claim_template_t *volume_claim_template ) { v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_local_var = malloc(sizeof(v1_ephemeral_volume_source_t)); @@ -14,14 +14,26 @@ v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_create( } v1_ephemeral_volume_source_local_var->volume_claim_template = volume_claim_template; + v1_ephemeral_volume_source_local_var->_library_owned = 1; return v1_ephemeral_volume_source_local_var; } +__attribute__((deprecated)) v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_create( + v1_persistent_volume_claim_template_t *volume_claim_template + ) { + return v1_ephemeral_volume_source_create_internal ( + volume_claim_template + ); +} void v1_ephemeral_volume_source_free(v1_ephemeral_volume_source_t *v1_ephemeral_volume_source) { if(NULL == v1_ephemeral_volume_source){ return ; } + if(v1_ephemeral_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ephemeral_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_ephemeral_volume_source->volume_claim_template) { v1_persistent_volume_claim_template_free(v1_ephemeral_volume_source->volume_claim_template); @@ -62,12 +74,15 @@ v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_parseFromJSON(cJSON *v1 // v1_ephemeral_volume_source->volume_claim_template cJSON *volume_claim_template = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_volume_sourceJSON, "volumeClaimTemplate"); + if (cJSON_IsNull(volume_claim_template)) { + volume_claim_template = NULL; + } if (volume_claim_template) { volume_claim_template_local_nonprim = v1_persistent_volume_claim_template_parseFromJSON(volume_claim_template); //nonprimitive } - v1_ephemeral_volume_source_local_var = v1_ephemeral_volume_source_create ( + v1_ephemeral_volume_source_local_var = v1_ephemeral_volume_source_create_internal ( volume_claim_template ? volume_claim_template_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_ephemeral_volume_source.h b/kubernetes/model/v1_ephemeral_volume_source.h index e06d3e2b..98fb633b 100644 --- a/kubernetes/model/v1_ephemeral_volume_source.h +++ b/kubernetes/model/v1_ephemeral_volume_source.h @@ -22,9 +22,10 @@ typedef struct v1_ephemeral_volume_source_t v1_ephemeral_volume_source_t; typedef struct v1_ephemeral_volume_source_t { struct v1_persistent_volume_claim_template_t *volume_claim_template; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ephemeral_volume_source_t; -v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_create( +__attribute__((deprecated)) v1_ephemeral_volume_source_t *v1_ephemeral_volume_source_create( v1_persistent_volume_claim_template_t *volume_claim_template ); diff --git a/kubernetes/model/v1_event_source.c b/kubernetes/model/v1_event_source.c index dd8c056a..54281ac9 100644 --- a/kubernetes/model/v1_event_source.c +++ b/kubernetes/model/v1_event_source.c @@ -5,7 +5,7 @@ -v1_event_source_t *v1_event_source_create( +static v1_event_source_t *v1_event_source_create_internal( char *component, char *host ) { @@ -16,14 +16,28 @@ v1_event_source_t *v1_event_source_create( v1_event_source_local_var->component = component; v1_event_source_local_var->host = host; + v1_event_source_local_var->_library_owned = 1; return v1_event_source_local_var; } +__attribute__((deprecated)) v1_event_source_t *v1_event_source_create( + char *component, + char *host + ) { + return v1_event_source_create_internal ( + component, + host + ); +} void v1_event_source_free(v1_event_source_t *v1_event_source) { if(NULL == v1_event_source){ return ; } + if(v1_event_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_event_source_free"); + return ; + } listEntry_t *listEntry; if (v1_event_source->component) { free(v1_event_source->component); @@ -68,6 +82,9 @@ v1_event_source_t *v1_event_source_parseFromJSON(cJSON *v1_event_sourceJSON){ // v1_event_source->component cJSON *component = cJSON_GetObjectItemCaseSensitive(v1_event_sourceJSON, "component"); + if (cJSON_IsNull(component)) { + component = NULL; + } if (component) { if(!cJSON_IsString(component) && !cJSON_IsNull(component)) { @@ -77,6 +94,9 @@ v1_event_source_t *v1_event_source_parseFromJSON(cJSON *v1_event_sourceJSON){ // v1_event_source->host cJSON *host = cJSON_GetObjectItemCaseSensitive(v1_event_sourceJSON, "host"); + if (cJSON_IsNull(host)) { + host = NULL; + } if (host) { if(!cJSON_IsString(host) && !cJSON_IsNull(host)) { @@ -85,7 +105,7 @@ v1_event_source_t *v1_event_source_parseFromJSON(cJSON *v1_event_sourceJSON){ } - v1_event_source_local_var = v1_event_source_create ( + v1_event_source_local_var = v1_event_source_create_internal ( component && !cJSON_IsNull(component) ? strdup(component->valuestring) : NULL, host && !cJSON_IsNull(host) ? strdup(host->valuestring) : NULL ); diff --git a/kubernetes/model/v1_event_source.h b/kubernetes/model/v1_event_source.h index f34cfe11..7825a67e 100644 --- a/kubernetes/model/v1_event_source.h +++ b/kubernetes/model/v1_event_source.h @@ -22,9 +22,10 @@ typedef struct v1_event_source_t { char *component; // string char *host; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_event_source_t; -v1_event_source_t *v1_event_source_create( +__attribute__((deprecated)) v1_event_source_t *v1_event_source_create( char *component, char *host ); diff --git a/kubernetes/model/v1_eviction.c b/kubernetes/model/v1_eviction.c index 65a25b77..e5e73584 100644 --- a/kubernetes/model/v1_eviction.c +++ b/kubernetes/model/v1_eviction.c @@ -5,7 +5,7 @@ -v1_eviction_t *v1_eviction_create( +static v1_eviction_t *v1_eviction_create_internal( char *api_version, v1_delete_options_t *delete_options, char *kind, @@ -20,14 +20,32 @@ v1_eviction_t *v1_eviction_create( v1_eviction_local_var->kind = kind; v1_eviction_local_var->metadata = metadata; + v1_eviction_local_var->_library_owned = 1; return v1_eviction_local_var; } +__attribute__((deprecated)) v1_eviction_t *v1_eviction_create( + char *api_version, + v1_delete_options_t *delete_options, + char *kind, + v1_object_meta_t *metadata + ) { + return v1_eviction_create_internal ( + api_version, + delete_options, + kind, + metadata + ); +} void v1_eviction_free(v1_eviction_t *v1_eviction) { if(NULL == v1_eviction){ return ; } + if(v1_eviction->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_eviction_free"); + return ; + } listEntry_t *listEntry; if (v1_eviction->api_version) { free(v1_eviction->api_version); @@ -112,6 +130,9 @@ v1_eviction_t *v1_eviction_parseFromJSON(cJSON *v1_evictionJSON){ // v1_eviction->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_evictionJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,12 +142,18 @@ v1_eviction_t *v1_eviction_parseFromJSON(cJSON *v1_evictionJSON){ // v1_eviction->delete_options cJSON *delete_options = cJSON_GetObjectItemCaseSensitive(v1_evictionJSON, "deleteOptions"); + if (cJSON_IsNull(delete_options)) { + delete_options = NULL; + } if (delete_options) { delete_options_local_nonprim = v1_delete_options_parseFromJSON(delete_options); //nonprimitive } // v1_eviction->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_evictionJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -136,12 +163,15 @@ v1_eviction_t *v1_eviction_parseFromJSON(cJSON *v1_evictionJSON){ // v1_eviction->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_evictionJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } - v1_eviction_local_var = v1_eviction_create ( + v1_eviction_local_var = v1_eviction_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, delete_options ? delete_options_local_nonprim : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_eviction.h b/kubernetes/model/v1_eviction.h index f83f8ece..edd8b567 100644 --- a/kubernetes/model/v1_eviction.h +++ b/kubernetes/model/v1_eviction.h @@ -26,9 +26,10 @@ typedef struct v1_eviction_t { char *kind; // string struct v1_object_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_eviction_t; -v1_eviction_t *v1_eviction_create( +__attribute__((deprecated)) v1_eviction_t *v1_eviction_create( char *api_version, v1_delete_options_t *delete_options, char *kind, diff --git a/kubernetes/model/v1_exact_device_request.c b/kubernetes/model/v1_exact_device_request.c new file mode 100644 index 00000000..66f433e7 --- /dev/null +++ b/kubernetes/model/v1_exact_device_request.c @@ -0,0 +1,345 @@ +#include +#include +#include +#include "v1_exact_device_request.h" + + + +static v1_exact_device_request_t *v1_exact_device_request_create_internal( + int admin_access, + char *allocation_mode, + v1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *selectors, + list_t *tolerations + ) { + v1_exact_device_request_t *v1_exact_device_request_local_var = malloc(sizeof(v1_exact_device_request_t)); + if (!v1_exact_device_request_local_var) { + return NULL; + } + v1_exact_device_request_local_var->admin_access = admin_access; + v1_exact_device_request_local_var->allocation_mode = allocation_mode; + v1_exact_device_request_local_var->capacity = capacity; + v1_exact_device_request_local_var->count = count; + v1_exact_device_request_local_var->device_class_name = device_class_name; + v1_exact_device_request_local_var->selectors = selectors; + v1_exact_device_request_local_var->tolerations = tolerations; + + v1_exact_device_request_local_var->_library_owned = 1; + return v1_exact_device_request_local_var; +} + +__attribute__((deprecated)) v1_exact_device_request_t *v1_exact_device_request_create( + int admin_access, + char *allocation_mode, + v1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *selectors, + list_t *tolerations + ) { + return v1_exact_device_request_create_internal ( + admin_access, + allocation_mode, + capacity, + count, + device_class_name, + selectors, + tolerations + ); +} + +void v1_exact_device_request_free(v1_exact_device_request_t *v1_exact_device_request) { + if(NULL == v1_exact_device_request){ + return ; + } + if(v1_exact_device_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_exact_device_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1_exact_device_request->allocation_mode) { + free(v1_exact_device_request->allocation_mode); + v1_exact_device_request->allocation_mode = NULL; + } + if (v1_exact_device_request->capacity) { + v1_capacity_requirements_free(v1_exact_device_request->capacity); + v1_exact_device_request->capacity = NULL; + } + if (v1_exact_device_request->device_class_name) { + free(v1_exact_device_request->device_class_name); + v1_exact_device_request->device_class_name = NULL; + } + if (v1_exact_device_request->selectors) { + list_ForEach(listEntry, v1_exact_device_request->selectors) { + v1_device_selector_free(listEntry->data); + } + list_freeList(v1_exact_device_request->selectors); + v1_exact_device_request->selectors = NULL; + } + if (v1_exact_device_request->tolerations) { + list_ForEach(listEntry, v1_exact_device_request->tolerations) { + v1_device_toleration_free(listEntry->data); + } + list_freeList(v1_exact_device_request->tolerations); + v1_exact_device_request->tolerations = NULL; + } + free(v1_exact_device_request); +} + +cJSON *v1_exact_device_request_convertToJSON(v1_exact_device_request_t *v1_exact_device_request) { + cJSON *item = cJSON_CreateObject(); + + // v1_exact_device_request->admin_access + if(v1_exact_device_request->admin_access) { + if(cJSON_AddBoolToObject(item, "adminAccess", v1_exact_device_request->admin_access) == NULL) { + goto fail; //Bool + } + } + + + // v1_exact_device_request->allocation_mode + if(v1_exact_device_request->allocation_mode) { + if(cJSON_AddStringToObject(item, "allocationMode", v1_exact_device_request->allocation_mode) == NULL) { + goto fail; //String + } + } + + + // v1_exact_device_request->capacity + if(v1_exact_device_request->capacity) { + cJSON *capacity_local_JSON = v1_capacity_requirements_convertToJSON(v1_exact_device_request->capacity); + if(capacity_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "capacity", capacity_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_exact_device_request->count + if(v1_exact_device_request->count) { + if(cJSON_AddNumberToObject(item, "count", v1_exact_device_request->count) == NULL) { + goto fail; //Numeric + } + } + + + // v1_exact_device_request->device_class_name + if (!v1_exact_device_request->device_class_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "deviceClassName", v1_exact_device_request->device_class_name) == NULL) { + goto fail; //String + } + + + // v1_exact_device_request->selectors + if(v1_exact_device_request->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1_exact_device_request->selectors) { + list_ForEach(selectorsListEntry, v1_exact_device_request->selectors) { + cJSON *itemLocal = v1_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + + // v1_exact_device_request->tolerations + if(v1_exact_device_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1_exact_device_request->tolerations) { + list_ForEach(tolerationsListEntry, v1_exact_device_request->tolerations) { + cJSON *itemLocal = v1_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_exact_device_request_t *v1_exact_device_request_parseFromJSON(cJSON *v1_exact_device_requestJSON){ + + v1_exact_device_request_t *v1_exact_device_request_local_var = NULL; + + // define the local variable for v1_exact_device_request->capacity + v1_capacity_requirements_t *capacity_local_nonprim = NULL; + + // define the local list for v1_exact_device_request->selectors + list_t *selectorsList = NULL; + + // define the local list for v1_exact_device_request->tolerations + list_t *tolerationsList = NULL; + + // v1_exact_device_request->admin_access + cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1_exact_device_requestJSON, "adminAccess"); + if (cJSON_IsNull(admin_access)) { + admin_access = NULL; + } + if (admin_access) { + if(!cJSON_IsBool(admin_access)) + { + goto end; //Bool + } + } + + // v1_exact_device_request->allocation_mode + cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1_exact_device_requestJSON, "allocationMode"); + if (cJSON_IsNull(allocation_mode)) { + allocation_mode = NULL; + } + if (allocation_mode) { + if(!cJSON_IsString(allocation_mode) && !cJSON_IsNull(allocation_mode)) + { + goto end; //String + } + } + + // v1_exact_device_request->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_exact_device_requestJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + capacity_local_nonprim = v1_capacity_requirements_parseFromJSON(capacity); //nonprimitive + } + + // v1_exact_device_request->count + cJSON *count = cJSON_GetObjectItemCaseSensitive(v1_exact_device_requestJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } + if (count) { + if(!cJSON_IsNumber(count)) + { + goto end; //Numeric + } + } + + // v1_exact_device_request->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1_exact_device_requestJSON, "deviceClassName"); + if (cJSON_IsNull(device_class_name)) { + device_class_name = NULL; + } + if (!device_class_name) { + goto end; + } + + + if(!cJSON_IsString(device_class_name)) + { + goto end; //String + } + + // v1_exact_device_request->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1_exact_device_requestJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1_device_selector_t *selectorsItem = v1_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + // v1_exact_device_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1_exact_device_requestJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1_device_toleration_t *tolerationsItem = v1_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1_exact_device_request_local_var = v1_exact_device_request_create_internal ( + admin_access ? admin_access->valueint : 0, + allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, + capacity ? capacity_local_nonprim : NULL, + count ? count->valuedouble : 0, + strdup(device_class_name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1_exact_device_request_local_var; +end: + if (capacity_local_nonprim) { + v1_capacity_requirements_free(capacity_local_nonprim); + capacity_local_nonprim = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_exact_device_request.h b/kubernetes/model/v1_exact_device_request.h new file mode 100644 index 00000000..dd677b0a --- /dev/null +++ b/kubernetes/model/v1_exact_device_request.h @@ -0,0 +1,53 @@ +/* + * v1_exact_device_request.h + * + * ExactDeviceRequest is a request for one or more identical devices. + */ + +#ifndef _v1_exact_device_request_H_ +#define _v1_exact_device_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_exact_device_request_t v1_exact_device_request_t; + +#include "v1_capacity_requirements.h" +#include "v1_device_selector.h" +#include "v1_device_toleration.h" + + + +typedef struct v1_exact_device_request_t { + int admin_access; //boolean + char *allocation_mode; // string + struct v1_capacity_requirements_t *capacity; //model + long count; //numeric + char *device_class_name; // string + list_t *selectors; //nonprimitive container + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_exact_device_request_t; + +__attribute__((deprecated)) v1_exact_device_request_t *v1_exact_device_request_create( + int admin_access, + char *allocation_mode, + v1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *selectors, + list_t *tolerations +); + +void v1_exact_device_request_free(v1_exact_device_request_t *v1_exact_device_request); + +v1_exact_device_request_t *v1_exact_device_request_parseFromJSON(cJSON *v1_exact_device_requestJSON); + +cJSON *v1_exact_device_request_convertToJSON(v1_exact_device_request_t *v1_exact_device_request); + +#endif /* _v1_exact_device_request_H_ */ + diff --git a/kubernetes/model/v1_exec_action.c b/kubernetes/model/v1_exec_action.c index 3a67c33a..bda8d5f0 100644 --- a/kubernetes/model/v1_exec_action.c +++ b/kubernetes/model/v1_exec_action.c @@ -5,7 +5,7 @@ -v1_exec_action_t *v1_exec_action_create( +static v1_exec_action_t *v1_exec_action_create_internal( list_t *command ) { v1_exec_action_t *v1_exec_action_local_var = malloc(sizeof(v1_exec_action_t)); @@ -14,14 +14,26 @@ v1_exec_action_t *v1_exec_action_create( } v1_exec_action_local_var->command = command; + v1_exec_action_local_var->_library_owned = 1; return v1_exec_action_local_var; } +__attribute__((deprecated)) v1_exec_action_t *v1_exec_action_create( + list_t *command + ) { + return v1_exec_action_create_internal ( + command + ); +} void v1_exec_action_free(v1_exec_action_t *v1_exec_action) { if(NULL == v1_exec_action){ return ; } + if(v1_exec_action->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_exec_action_free"); + return ; + } listEntry_t *listEntry; if (v1_exec_action->command) { list_ForEach(listEntry, v1_exec_action->command) { @@ -45,7 +57,7 @@ cJSON *v1_exec_action_convertToJSON(v1_exec_action_t *v1_exec_action) { listEntry_t *commandListEntry; list_ForEach(commandListEntry, v1_exec_action->command) { - if(cJSON_AddStringToObject(command, "", (char*)commandListEntry->data) == NULL) + if(cJSON_AddStringToObject(command, "", commandListEntry->data) == NULL) { goto fail; } @@ -69,6 +81,9 @@ v1_exec_action_t *v1_exec_action_parseFromJSON(cJSON *v1_exec_actionJSON){ // v1_exec_action->command cJSON *command = cJSON_GetObjectItemCaseSensitive(v1_exec_actionJSON, "command"); + if (cJSON_IsNull(command)) { + command = NULL; + } if (command) { cJSON *command_local = NULL; if(!cJSON_IsArray(command)) { @@ -87,7 +102,7 @@ v1_exec_action_t *v1_exec_action_parseFromJSON(cJSON *v1_exec_actionJSON){ } - v1_exec_action_local_var = v1_exec_action_create ( + v1_exec_action_local_var = v1_exec_action_create_internal ( command ? commandList : NULL ); diff --git a/kubernetes/model/v1_exec_action.h b/kubernetes/model/v1_exec_action.h index 4460982a..0bfd7c1f 100644 --- a/kubernetes/model/v1_exec_action.h +++ b/kubernetes/model/v1_exec_action.h @@ -21,9 +21,10 @@ typedef struct v1_exec_action_t v1_exec_action_t; typedef struct v1_exec_action_t { list_t *command; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_exec_action_t; -v1_exec_action_t *v1_exec_action_create( +__attribute__((deprecated)) v1_exec_action_t *v1_exec_action_create( list_t *command ); diff --git a/kubernetes/model/v1_exempt_priority_level_configuration.c b/kubernetes/model/v1_exempt_priority_level_configuration.c index e04ae5b2..767d280f 100644 --- a/kubernetes/model/v1_exempt_priority_level_configuration.c +++ b/kubernetes/model/v1_exempt_priority_level_configuration.c @@ -5,7 +5,7 @@ -v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration_create( +static v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration_create_internal( int lendable_percent, int nominal_concurrency_shares ) { @@ -16,14 +16,28 @@ v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration v1_exempt_priority_level_configuration_local_var->lendable_percent = lendable_percent; v1_exempt_priority_level_configuration_local_var->nominal_concurrency_shares = nominal_concurrency_shares; + v1_exempt_priority_level_configuration_local_var->_library_owned = 1; return v1_exempt_priority_level_configuration_local_var; } +__attribute__((deprecated)) v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration_create( + int lendable_percent, + int nominal_concurrency_shares + ) { + return v1_exempt_priority_level_configuration_create_internal ( + lendable_percent, + nominal_concurrency_shares + ); +} void v1_exempt_priority_level_configuration_free(v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration) { if(NULL == v1_exempt_priority_level_configuration){ return ; } + if(v1_exempt_priority_level_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_exempt_priority_level_configuration_free"); + return ; + } listEntry_t *listEntry; free(v1_exempt_priority_level_configuration); } @@ -60,6 +74,9 @@ v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration // v1_exempt_priority_level_configuration->lendable_percent cJSON *lendable_percent = cJSON_GetObjectItemCaseSensitive(v1_exempt_priority_level_configurationJSON, "lendablePercent"); + if (cJSON_IsNull(lendable_percent)) { + lendable_percent = NULL; + } if (lendable_percent) { if(!cJSON_IsNumber(lendable_percent)) { @@ -69,6 +86,9 @@ v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration // v1_exempt_priority_level_configuration->nominal_concurrency_shares cJSON *nominal_concurrency_shares = cJSON_GetObjectItemCaseSensitive(v1_exempt_priority_level_configurationJSON, "nominalConcurrencyShares"); + if (cJSON_IsNull(nominal_concurrency_shares)) { + nominal_concurrency_shares = NULL; + } if (nominal_concurrency_shares) { if(!cJSON_IsNumber(nominal_concurrency_shares)) { @@ -77,7 +97,7 @@ v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration } - v1_exempt_priority_level_configuration_local_var = v1_exempt_priority_level_configuration_create ( + v1_exempt_priority_level_configuration_local_var = v1_exempt_priority_level_configuration_create_internal ( lendable_percent ? lendable_percent->valuedouble : 0, nominal_concurrency_shares ? nominal_concurrency_shares->valuedouble : 0 ); diff --git a/kubernetes/model/v1_exempt_priority_level_configuration.h b/kubernetes/model/v1_exempt_priority_level_configuration.h index 866f4eea..57b962b3 100644 --- a/kubernetes/model/v1_exempt_priority_level_configuration.h +++ b/kubernetes/model/v1_exempt_priority_level_configuration.h @@ -22,9 +22,10 @@ typedef struct v1_exempt_priority_level_configuration_t { int lendable_percent; //numeric int nominal_concurrency_shares; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_exempt_priority_level_configuration_t; -v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration_create( +__attribute__((deprecated)) v1_exempt_priority_level_configuration_t *v1_exempt_priority_level_configuration_create( int lendable_percent, int nominal_concurrency_shares ); diff --git a/kubernetes/model/v1_expression_warning.c b/kubernetes/model/v1_expression_warning.c index 7cc0f1e5..a799c236 100644 --- a/kubernetes/model/v1_expression_warning.c +++ b/kubernetes/model/v1_expression_warning.c @@ -5,7 +5,7 @@ -v1_expression_warning_t *v1_expression_warning_create( +static v1_expression_warning_t *v1_expression_warning_create_internal( char *field_ref, char *warning ) { @@ -16,14 +16,28 @@ v1_expression_warning_t *v1_expression_warning_create( v1_expression_warning_local_var->field_ref = field_ref; v1_expression_warning_local_var->warning = warning; + v1_expression_warning_local_var->_library_owned = 1; return v1_expression_warning_local_var; } +__attribute__((deprecated)) v1_expression_warning_t *v1_expression_warning_create( + char *field_ref, + char *warning + ) { + return v1_expression_warning_create_internal ( + field_ref, + warning + ); +} void v1_expression_warning_free(v1_expression_warning_t *v1_expression_warning) { if(NULL == v1_expression_warning){ return ; } + if(v1_expression_warning->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_expression_warning_free"); + return ; + } listEntry_t *listEntry; if (v1_expression_warning->field_ref) { free(v1_expression_warning->field_ref); @@ -70,6 +84,9 @@ v1_expression_warning_t *v1_expression_warning_parseFromJSON(cJSON *v1_expressio // v1_expression_warning->field_ref cJSON *field_ref = cJSON_GetObjectItemCaseSensitive(v1_expression_warningJSON, "fieldRef"); + if (cJSON_IsNull(field_ref)) { + field_ref = NULL; + } if (!field_ref) { goto end; } @@ -82,6 +99,9 @@ v1_expression_warning_t *v1_expression_warning_parseFromJSON(cJSON *v1_expressio // v1_expression_warning->warning cJSON *warning = cJSON_GetObjectItemCaseSensitive(v1_expression_warningJSON, "warning"); + if (cJSON_IsNull(warning)) { + warning = NULL; + } if (!warning) { goto end; } @@ -93,7 +113,7 @@ v1_expression_warning_t *v1_expression_warning_parseFromJSON(cJSON *v1_expressio } - v1_expression_warning_local_var = v1_expression_warning_create ( + v1_expression_warning_local_var = v1_expression_warning_create_internal ( strdup(field_ref->valuestring), strdup(warning->valuestring) ); diff --git a/kubernetes/model/v1_expression_warning.h b/kubernetes/model/v1_expression_warning.h index ec8cb4d5..11e0fe8c 100644 --- a/kubernetes/model/v1_expression_warning.h +++ b/kubernetes/model/v1_expression_warning.h @@ -22,9 +22,10 @@ typedef struct v1_expression_warning_t { char *field_ref; // string char *warning; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_expression_warning_t; -v1_expression_warning_t *v1_expression_warning_create( +__attribute__((deprecated)) v1_expression_warning_t *v1_expression_warning_create( char *field_ref, char *warning ); diff --git a/kubernetes/model/v1_external_documentation.c b/kubernetes/model/v1_external_documentation.c index 12a82ad8..d170406b 100644 --- a/kubernetes/model/v1_external_documentation.c +++ b/kubernetes/model/v1_external_documentation.c @@ -5,7 +5,7 @@ -v1_external_documentation_t *v1_external_documentation_create( +static v1_external_documentation_t *v1_external_documentation_create_internal( char *description, char *url ) { @@ -16,14 +16,28 @@ v1_external_documentation_t *v1_external_documentation_create( v1_external_documentation_local_var->description = description; v1_external_documentation_local_var->url = url; + v1_external_documentation_local_var->_library_owned = 1; return v1_external_documentation_local_var; } +__attribute__((deprecated)) v1_external_documentation_t *v1_external_documentation_create( + char *description, + char *url + ) { + return v1_external_documentation_create_internal ( + description, + url + ); +} void v1_external_documentation_free(v1_external_documentation_t *v1_external_documentation) { if(NULL == v1_external_documentation){ return ; } + if(v1_external_documentation->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_external_documentation_free"); + return ; + } listEntry_t *listEntry; if (v1_external_documentation->description) { free(v1_external_documentation->description); @@ -68,6 +82,9 @@ v1_external_documentation_t *v1_external_documentation_parseFromJSON(cJSON *v1_e // v1_external_documentation->description cJSON *description = cJSON_GetObjectItemCaseSensitive(v1_external_documentationJSON, "description"); + if (cJSON_IsNull(description)) { + description = NULL; + } if (description) { if(!cJSON_IsString(description) && !cJSON_IsNull(description)) { @@ -77,6 +94,9 @@ v1_external_documentation_t *v1_external_documentation_parseFromJSON(cJSON *v1_e // v1_external_documentation->url cJSON *url = cJSON_GetObjectItemCaseSensitive(v1_external_documentationJSON, "url"); + if (cJSON_IsNull(url)) { + url = NULL; + } if (url) { if(!cJSON_IsString(url) && !cJSON_IsNull(url)) { @@ -85,7 +105,7 @@ v1_external_documentation_t *v1_external_documentation_parseFromJSON(cJSON *v1_e } - v1_external_documentation_local_var = v1_external_documentation_create ( + v1_external_documentation_local_var = v1_external_documentation_create_internal ( description && !cJSON_IsNull(description) ? strdup(description->valuestring) : NULL, url && !cJSON_IsNull(url) ? strdup(url->valuestring) : NULL ); diff --git a/kubernetes/model/v1_external_documentation.h b/kubernetes/model/v1_external_documentation.h index b27c8538..a029b00b 100644 --- a/kubernetes/model/v1_external_documentation.h +++ b/kubernetes/model/v1_external_documentation.h @@ -22,9 +22,10 @@ typedef struct v1_external_documentation_t { char *description; // string char *url; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_external_documentation_t; -v1_external_documentation_t *v1_external_documentation_create( +__attribute__((deprecated)) v1_external_documentation_t *v1_external_documentation_create( char *description, char *url ); diff --git a/kubernetes/model/v1_fc_volume_source.c b/kubernetes/model/v1_fc_volume_source.c index f5213c4d..b4245830 100644 --- a/kubernetes/model/v1_fc_volume_source.c +++ b/kubernetes/model/v1_fc_volume_source.c @@ -5,7 +5,7 @@ -v1_fc_volume_source_t *v1_fc_volume_source_create( +static v1_fc_volume_source_t *v1_fc_volume_source_create_internal( char *fs_type, int lun, int read_only, @@ -22,14 +22,34 @@ v1_fc_volume_source_t *v1_fc_volume_source_create( v1_fc_volume_source_local_var->target_wwns = target_wwns; v1_fc_volume_source_local_var->wwids = wwids; + v1_fc_volume_source_local_var->_library_owned = 1; return v1_fc_volume_source_local_var; } +__attribute__((deprecated)) v1_fc_volume_source_t *v1_fc_volume_source_create( + char *fs_type, + int lun, + int read_only, + list_t *target_wwns, + list_t *wwids + ) { + return v1_fc_volume_source_create_internal ( + fs_type, + lun, + read_only, + target_wwns, + wwids + ); +} void v1_fc_volume_source_free(v1_fc_volume_source_t *v1_fc_volume_source) { if(NULL == v1_fc_volume_source){ return ; } + if(v1_fc_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_fc_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_fc_volume_source->fs_type) { free(v1_fc_volume_source->fs_type); @@ -88,7 +108,7 @@ cJSON *v1_fc_volume_source_convertToJSON(v1_fc_volume_source_t *v1_fc_volume_sou listEntry_t *target_wwnsListEntry; list_ForEach(target_wwnsListEntry, v1_fc_volume_source->target_wwns) { - if(cJSON_AddStringToObject(target_wwns, "", (char*)target_wwnsListEntry->data) == NULL) + if(cJSON_AddStringToObject(target_wwns, "", target_wwnsListEntry->data) == NULL) { goto fail; } @@ -105,7 +125,7 @@ cJSON *v1_fc_volume_source_convertToJSON(v1_fc_volume_source_t *v1_fc_volume_sou listEntry_t *wwidsListEntry; list_ForEach(wwidsListEntry, v1_fc_volume_source->wwids) { - if(cJSON_AddStringToObject(wwids, "", (char*)wwidsListEntry->data) == NULL) + if(cJSON_AddStringToObject(wwids, "", wwidsListEntry->data) == NULL) { goto fail; } @@ -132,6 +152,9 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou // v1_fc_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -141,6 +164,9 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou // v1_fc_volume_source->lun cJSON *lun = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "lun"); + if (cJSON_IsNull(lun)) { + lun = NULL; + } if (lun) { if(!cJSON_IsNumber(lun)) { @@ -150,6 +176,9 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou // v1_fc_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -159,6 +188,9 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou // v1_fc_volume_source->target_wwns cJSON *target_wwns = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "targetWWNs"); + if (cJSON_IsNull(target_wwns)) { + target_wwns = NULL; + } if (target_wwns) { cJSON *target_wwns_local = NULL; if(!cJSON_IsArray(target_wwns)) { @@ -178,6 +210,9 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou // v1_fc_volume_source->wwids cJSON *wwids = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "wwids"); + if (cJSON_IsNull(wwids)) { + wwids = NULL; + } if (wwids) { cJSON *wwids_local = NULL; if(!cJSON_IsArray(wwids)) { @@ -196,7 +231,7 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou } - v1_fc_volume_source_local_var = v1_fc_volume_source_create ( + v1_fc_volume_source_local_var = v1_fc_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, lun ? lun->valuedouble : 0, read_only ? read_only->valueint : 0, diff --git a/kubernetes/model/v1_fc_volume_source.h b/kubernetes/model/v1_fc_volume_source.h index 5ec537cb..650d30d8 100644 --- a/kubernetes/model/v1_fc_volume_source.h +++ b/kubernetes/model/v1_fc_volume_source.h @@ -25,9 +25,10 @@ typedef struct v1_fc_volume_source_t { list_t *target_wwns; //primitive container list_t *wwids; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_fc_volume_source_t; -v1_fc_volume_source_t *v1_fc_volume_source_create( +__attribute__((deprecated)) v1_fc_volume_source_t *v1_fc_volume_source_create( char *fs_type, int lun, int read_only, diff --git a/kubernetes/model/v1_field_selector_attributes.c b/kubernetes/model/v1_field_selector_attributes.c new file mode 100644 index 00000000..eb63378c --- /dev/null +++ b/kubernetes/model/v1_field_selector_attributes.c @@ -0,0 +1,156 @@ +#include +#include +#include +#include "v1_field_selector_attributes.h" + + + +static v1_field_selector_attributes_t *v1_field_selector_attributes_create_internal( + char *raw_selector, + list_t *requirements + ) { + v1_field_selector_attributes_t *v1_field_selector_attributes_local_var = malloc(sizeof(v1_field_selector_attributes_t)); + if (!v1_field_selector_attributes_local_var) { + return NULL; + } + v1_field_selector_attributes_local_var->raw_selector = raw_selector; + v1_field_selector_attributes_local_var->requirements = requirements; + + v1_field_selector_attributes_local_var->_library_owned = 1; + return v1_field_selector_attributes_local_var; +} + +__attribute__((deprecated)) v1_field_selector_attributes_t *v1_field_selector_attributes_create( + char *raw_selector, + list_t *requirements + ) { + return v1_field_selector_attributes_create_internal ( + raw_selector, + requirements + ); +} + +void v1_field_selector_attributes_free(v1_field_selector_attributes_t *v1_field_selector_attributes) { + if(NULL == v1_field_selector_attributes){ + return ; + } + if(v1_field_selector_attributes->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_field_selector_attributes_free"); + return ; + } + listEntry_t *listEntry; + if (v1_field_selector_attributes->raw_selector) { + free(v1_field_selector_attributes->raw_selector); + v1_field_selector_attributes->raw_selector = NULL; + } + if (v1_field_selector_attributes->requirements) { + list_ForEach(listEntry, v1_field_selector_attributes->requirements) { + v1_field_selector_requirement_free(listEntry->data); + } + list_freeList(v1_field_selector_attributes->requirements); + v1_field_selector_attributes->requirements = NULL; + } + free(v1_field_selector_attributes); +} + +cJSON *v1_field_selector_attributes_convertToJSON(v1_field_selector_attributes_t *v1_field_selector_attributes) { + cJSON *item = cJSON_CreateObject(); + + // v1_field_selector_attributes->raw_selector + if(v1_field_selector_attributes->raw_selector) { + if(cJSON_AddStringToObject(item, "rawSelector", v1_field_selector_attributes->raw_selector) == NULL) { + goto fail; //String + } + } + + + // v1_field_selector_attributes->requirements + if(v1_field_selector_attributes->requirements) { + cJSON *requirements = cJSON_AddArrayToObject(item, "requirements"); + if(requirements == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *requirementsListEntry; + if (v1_field_selector_attributes->requirements) { + list_ForEach(requirementsListEntry, v1_field_selector_attributes->requirements) { + cJSON *itemLocal = v1_field_selector_requirement_convertToJSON(requirementsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(requirements, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_field_selector_attributes_t *v1_field_selector_attributes_parseFromJSON(cJSON *v1_field_selector_attributesJSON){ + + v1_field_selector_attributes_t *v1_field_selector_attributes_local_var = NULL; + + // define the local list for v1_field_selector_attributes->requirements + list_t *requirementsList = NULL; + + // v1_field_selector_attributes->raw_selector + cJSON *raw_selector = cJSON_GetObjectItemCaseSensitive(v1_field_selector_attributesJSON, "rawSelector"); + if (cJSON_IsNull(raw_selector)) { + raw_selector = NULL; + } + if (raw_selector) { + if(!cJSON_IsString(raw_selector) && !cJSON_IsNull(raw_selector)) + { + goto end; //String + } + } + + // v1_field_selector_attributes->requirements + cJSON *requirements = cJSON_GetObjectItemCaseSensitive(v1_field_selector_attributesJSON, "requirements"); + if (cJSON_IsNull(requirements)) { + requirements = NULL; + } + if (requirements) { + cJSON *requirements_local_nonprimitive = NULL; + if(!cJSON_IsArray(requirements)){ + goto end; //nonprimitive container + } + + requirementsList = list_createList(); + + cJSON_ArrayForEach(requirements_local_nonprimitive,requirements ) + { + if(!cJSON_IsObject(requirements_local_nonprimitive)){ + goto end; + } + v1_field_selector_requirement_t *requirementsItem = v1_field_selector_requirement_parseFromJSON(requirements_local_nonprimitive); + + list_addElement(requirementsList, requirementsItem); + } + } + + + v1_field_selector_attributes_local_var = v1_field_selector_attributes_create_internal ( + raw_selector && !cJSON_IsNull(raw_selector) ? strdup(raw_selector->valuestring) : NULL, + requirements ? requirementsList : NULL + ); + + return v1_field_selector_attributes_local_var; +end: + if (requirementsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requirementsList) { + v1_field_selector_requirement_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requirementsList); + requirementsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_field_selector_attributes.h b/kubernetes/model/v1_field_selector_attributes.h new file mode 100644 index 00000000..5ca2acac --- /dev/null +++ b/kubernetes/model/v1_field_selector_attributes.h @@ -0,0 +1,41 @@ +/* + * v1_field_selector_attributes.h + * + * FieldSelectorAttributes indicates a field limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid. + */ + +#ifndef _v1_field_selector_attributes_H_ +#define _v1_field_selector_attributes_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_field_selector_attributes_t v1_field_selector_attributes_t; + +#include "v1_field_selector_requirement.h" + + + +typedef struct v1_field_selector_attributes_t { + char *raw_selector; // string + list_t *requirements; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_field_selector_attributes_t; + +__attribute__((deprecated)) v1_field_selector_attributes_t *v1_field_selector_attributes_create( + char *raw_selector, + list_t *requirements +); + +void v1_field_selector_attributes_free(v1_field_selector_attributes_t *v1_field_selector_attributes); + +v1_field_selector_attributes_t *v1_field_selector_attributes_parseFromJSON(cJSON *v1_field_selector_attributesJSON); + +cJSON *v1_field_selector_attributes_convertToJSON(v1_field_selector_attributes_t *v1_field_selector_attributes); + +#endif /* _v1_field_selector_attributes_H_ */ + diff --git a/kubernetes/model/v1_field_selector_requirement.c b/kubernetes/model/v1_field_selector_requirement.c new file mode 100644 index 00000000..2c80b92b --- /dev/null +++ b/kubernetes/model/v1_field_selector_requirement.c @@ -0,0 +1,188 @@ +#include +#include +#include +#include "v1_field_selector_requirement.h" + + + +static v1_field_selector_requirement_t *v1_field_selector_requirement_create_internal( + char *key, + char *_operator, + list_t *values + ) { + v1_field_selector_requirement_t *v1_field_selector_requirement_local_var = malloc(sizeof(v1_field_selector_requirement_t)); + if (!v1_field_selector_requirement_local_var) { + return NULL; + } + v1_field_selector_requirement_local_var->key = key; + v1_field_selector_requirement_local_var->_operator = _operator; + v1_field_selector_requirement_local_var->values = values; + + v1_field_selector_requirement_local_var->_library_owned = 1; + return v1_field_selector_requirement_local_var; +} + +__attribute__((deprecated)) v1_field_selector_requirement_t *v1_field_selector_requirement_create( + char *key, + char *_operator, + list_t *values + ) { + return v1_field_selector_requirement_create_internal ( + key, + _operator, + values + ); +} + +void v1_field_selector_requirement_free(v1_field_selector_requirement_t *v1_field_selector_requirement) { + if(NULL == v1_field_selector_requirement){ + return ; + } + if(v1_field_selector_requirement->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_field_selector_requirement_free"); + return ; + } + listEntry_t *listEntry; + if (v1_field_selector_requirement->key) { + free(v1_field_selector_requirement->key); + v1_field_selector_requirement->key = NULL; + } + if (v1_field_selector_requirement->_operator) { + free(v1_field_selector_requirement->_operator); + v1_field_selector_requirement->_operator = NULL; + } + if (v1_field_selector_requirement->values) { + list_ForEach(listEntry, v1_field_selector_requirement->values) { + free(listEntry->data); + } + list_freeList(v1_field_selector_requirement->values); + v1_field_selector_requirement->values = NULL; + } + free(v1_field_selector_requirement); +} + +cJSON *v1_field_selector_requirement_convertToJSON(v1_field_selector_requirement_t *v1_field_selector_requirement) { + cJSON *item = cJSON_CreateObject(); + + // v1_field_selector_requirement->key + if (!v1_field_selector_requirement->key) { + goto fail; + } + if(cJSON_AddStringToObject(item, "key", v1_field_selector_requirement->key) == NULL) { + goto fail; //String + } + + + // v1_field_selector_requirement->_operator + if (!v1_field_selector_requirement->_operator) { + goto fail; + } + if(cJSON_AddStringToObject(item, "operator", v1_field_selector_requirement->_operator) == NULL) { + goto fail; //String + } + + + // v1_field_selector_requirement->values + if(v1_field_selector_requirement->values) { + cJSON *values = cJSON_AddArrayToObject(item, "values"); + if(values == NULL) { + goto fail; //primitive container + } + + listEntry_t *valuesListEntry; + list_ForEach(valuesListEntry, v1_field_selector_requirement->values) { + if(cJSON_AddStringToObject(values, "", valuesListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_field_selector_requirement_t *v1_field_selector_requirement_parseFromJSON(cJSON *v1_field_selector_requirementJSON){ + + v1_field_selector_requirement_t *v1_field_selector_requirement_local_var = NULL; + + // define the local list for v1_field_selector_requirement->values + list_t *valuesList = NULL; + + // v1_field_selector_requirement->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_field_selector_requirementJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (!key) { + goto end; + } + + + if(!cJSON_IsString(key)) + { + goto end; //String + } + + // v1_field_selector_requirement->_operator + cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_field_selector_requirementJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } + if (!_operator) { + goto end; + } + + + if(!cJSON_IsString(_operator)) + { + goto end; //String + } + + // v1_field_selector_requirement->values + cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_field_selector_requirementJSON, "values"); + if (cJSON_IsNull(values)) { + values = NULL; + } + if (values) { + cJSON *values_local = NULL; + if(!cJSON_IsArray(values)) { + goto end;//primitive container + } + valuesList = list_createList(); + + cJSON_ArrayForEach(values_local, values) + { + if(!cJSON_IsString(values_local)) + { + goto end; + } + list_addElement(valuesList , strdup(values_local->valuestring)); + } + } + + + v1_field_selector_requirement_local_var = v1_field_selector_requirement_create_internal ( + strdup(key->valuestring), + strdup(_operator->valuestring), + values ? valuesList : NULL + ); + + return v1_field_selector_requirement_local_var; +end: + if (valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valuesList); + valuesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_field_selector_requirement.h b/kubernetes/model/v1_field_selector_requirement.h new file mode 100644 index 00000000..2cd1df31 --- /dev/null +++ b/kubernetes/model/v1_field_selector_requirement.h @@ -0,0 +1,42 @@ +/* + * v1_field_selector_requirement.h + * + * FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values. + */ + +#ifndef _v1_field_selector_requirement_H_ +#define _v1_field_selector_requirement_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_field_selector_requirement_t v1_field_selector_requirement_t; + + + + +typedef struct v1_field_selector_requirement_t { + char *key; // string + char *_operator; // string + list_t *values; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_field_selector_requirement_t; + +__attribute__((deprecated)) v1_field_selector_requirement_t *v1_field_selector_requirement_create( + char *key, + char *_operator, + list_t *values +); + +void v1_field_selector_requirement_free(v1_field_selector_requirement_t *v1_field_selector_requirement); + +v1_field_selector_requirement_t *v1_field_selector_requirement_parseFromJSON(cJSON *v1_field_selector_requirementJSON); + +cJSON *v1_field_selector_requirement_convertToJSON(v1_field_selector_requirement_t *v1_field_selector_requirement); + +#endif /* _v1_field_selector_requirement_H_ */ + diff --git a/kubernetes/model/v1_file_key_selector.c b/kubernetes/model/v1_file_key_selector.c new file mode 100644 index 00000000..60fb51ea --- /dev/null +++ b/kubernetes/model/v1_file_key_selector.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include "v1_file_key_selector.h" + + + +static v1_file_key_selector_t *v1_file_key_selector_create_internal( + char *key, + int optional, + char *path, + char *volume_name + ) { + v1_file_key_selector_t *v1_file_key_selector_local_var = malloc(sizeof(v1_file_key_selector_t)); + if (!v1_file_key_selector_local_var) { + return NULL; + } + v1_file_key_selector_local_var->key = key; + v1_file_key_selector_local_var->optional = optional; + v1_file_key_selector_local_var->path = path; + v1_file_key_selector_local_var->volume_name = volume_name; + + v1_file_key_selector_local_var->_library_owned = 1; + return v1_file_key_selector_local_var; +} + +__attribute__((deprecated)) v1_file_key_selector_t *v1_file_key_selector_create( + char *key, + int optional, + char *path, + char *volume_name + ) { + return v1_file_key_selector_create_internal ( + key, + optional, + path, + volume_name + ); +} + +void v1_file_key_selector_free(v1_file_key_selector_t *v1_file_key_selector) { + if(NULL == v1_file_key_selector){ + return ; + } + if(v1_file_key_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_file_key_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1_file_key_selector->key) { + free(v1_file_key_selector->key); + v1_file_key_selector->key = NULL; + } + if (v1_file_key_selector->path) { + free(v1_file_key_selector->path); + v1_file_key_selector->path = NULL; + } + if (v1_file_key_selector->volume_name) { + free(v1_file_key_selector->volume_name); + v1_file_key_selector->volume_name = NULL; + } + free(v1_file_key_selector); +} + +cJSON *v1_file_key_selector_convertToJSON(v1_file_key_selector_t *v1_file_key_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1_file_key_selector->key + if (!v1_file_key_selector->key) { + goto fail; + } + if(cJSON_AddStringToObject(item, "key", v1_file_key_selector->key) == NULL) { + goto fail; //String + } + + + // v1_file_key_selector->optional + if(v1_file_key_selector->optional) { + if(cJSON_AddBoolToObject(item, "optional", v1_file_key_selector->optional) == NULL) { + goto fail; //Bool + } + } + + + // v1_file_key_selector->path + if (!v1_file_key_selector->path) { + goto fail; + } + if(cJSON_AddStringToObject(item, "path", v1_file_key_selector->path) == NULL) { + goto fail; //String + } + + + // v1_file_key_selector->volume_name + if (!v1_file_key_selector->volume_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "volumeName", v1_file_key_selector->volume_name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_file_key_selector_t *v1_file_key_selector_parseFromJSON(cJSON *v1_file_key_selectorJSON){ + + v1_file_key_selector_t *v1_file_key_selector_local_var = NULL; + + // v1_file_key_selector->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_file_key_selectorJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (!key) { + goto end; + } + + + if(!cJSON_IsString(key)) + { + goto end; //String + } + + // v1_file_key_selector->optional + cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_file_key_selectorJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } + if (optional) { + if(!cJSON_IsBool(optional)) + { + goto end; //Bool + } + } + + // v1_file_key_selector->path + cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_file_key_selectorJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } + if (!path) { + goto end; + } + + + if(!cJSON_IsString(path)) + { + goto end; //String + } + + // v1_file_key_selector->volume_name + cJSON *volume_name = cJSON_GetObjectItemCaseSensitive(v1_file_key_selectorJSON, "volumeName"); + if (cJSON_IsNull(volume_name)) { + volume_name = NULL; + } + if (!volume_name) { + goto end; + } + + + if(!cJSON_IsString(volume_name)) + { + goto end; //String + } + + + v1_file_key_selector_local_var = v1_file_key_selector_create_internal ( + strdup(key->valuestring), + optional ? optional->valueint : 0, + strdup(path->valuestring), + strdup(volume_name->valuestring) + ); + + return v1_file_key_selector_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_file_key_selector.h b/kubernetes/model/v1_file_key_selector.h new file mode 100644 index 00000000..b34242df --- /dev/null +++ b/kubernetes/model/v1_file_key_selector.h @@ -0,0 +1,44 @@ +/* + * v1_file_key_selector.h + * + * FileKeySelector selects a key of the env file. + */ + +#ifndef _v1_file_key_selector_H_ +#define _v1_file_key_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_file_key_selector_t v1_file_key_selector_t; + + + + +typedef struct v1_file_key_selector_t { + char *key; // string + int optional; //boolean + char *path; // string + char *volume_name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_file_key_selector_t; + +__attribute__((deprecated)) v1_file_key_selector_t *v1_file_key_selector_create( + char *key, + int optional, + char *path, + char *volume_name +); + +void v1_file_key_selector_free(v1_file_key_selector_t *v1_file_key_selector); + +v1_file_key_selector_t *v1_file_key_selector_parseFromJSON(cJSON *v1_file_key_selectorJSON); + +cJSON *v1_file_key_selector_convertToJSON(v1_file_key_selector_t *v1_file_key_selector); + +#endif /* _v1_file_key_selector_H_ */ + diff --git a/kubernetes/model/v1_flex_persistent_volume_source.c b/kubernetes/model/v1_flex_persistent_volume_source.c index 07677ef2..44084d51 100644 --- a/kubernetes/model/v1_flex_persistent_volume_source.c +++ b/kubernetes/model/v1_flex_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_create( +static v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_create_internal( char *driver, char *fs_type, list_t* options, @@ -22,14 +22,34 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_create( v1_flex_persistent_volume_source_local_var->read_only = read_only; v1_flex_persistent_volume_source_local_var->secret_ref = secret_ref; + v1_flex_persistent_volume_source_local_var->_library_owned = 1; return v1_flex_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_create( + char *driver, + char *fs_type, + list_t* options, + int read_only, + v1_secret_reference_t *secret_ref + ) { + return v1_flex_persistent_volume_source_create_internal ( + driver, + fs_type, + options, + read_only, + secret_ref + ); +} void v1_flex_persistent_volume_source_free(v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source) { if(NULL == v1_flex_persistent_volume_source){ return ; } + if(v1_flex_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flex_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_flex_persistent_volume_source->driver) { free(v1_flex_persistent_volume_source->driver); @@ -41,7 +61,7 @@ void v1_flex_persistent_volume_source_free(v1_flex_persistent_volume_source_t *v } if (v1_flex_persistent_volume_source->options) { list_ForEach(listEntry, v1_flex_persistent_volume_source->options) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -86,8 +106,8 @@ cJSON *v1_flex_persistent_volume_source_convertToJSON(v1_flex_persistent_volume_ listEntry_t *optionsListEntry; if (v1_flex_persistent_volume_source->options) { list_ForEach(optionsListEntry, v1_flex_persistent_volume_source->options) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)optionsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = optionsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -136,6 +156,9 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS // v1_flex_persistent_volume_source->driver cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_flex_persistent_volume_sourceJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } if (!driver) { goto end; } @@ -148,6 +171,9 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS // v1_flex_persistent_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_flex_persistent_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -157,6 +183,9 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS // v1_flex_persistent_volume_source->options cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_flex_persistent_volume_sourceJSON, "options"); + if (cJSON_IsNull(options)) { + options = NULL; + } if (options) { cJSON *options_local_map = NULL; if(!cJSON_IsObject(options) && !cJSON_IsNull(options)) @@ -182,6 +211,9 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS // v1_flex_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_flex_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -191,12 +223,15 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS // v1_flex_persistent_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_flex_persistent_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(secret_ref); //nonprimitive } - v1_flex_persistent_volume_source_local_var = v1_flex_persistent_volume_source_create ( + v1_flex_persistent_volume_source_local_var = v1_flex_persistent_volume_source_create_internal ( strdup(driver->valuestring), fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, options ? optionsList : NULL, @@ -209,7 +244,7 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS if (optionsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, optionsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_flex_persistent_volume_source.h b/kubernetes/model/v1_flex_persistent_volume_source.h index 77e561bb..fcfe4c5e 100644 --- a/kubernetes/model/v1_flex_persistent_volume_source.h +++ b/kubernetes/model/v1_flex_persistent_volume_source.h @@ -26,9 +26,10 @@ typedef struct v1_flex_persistent_volume_source_t { int read_only; //boolean struct v1_secret_reference_t *secret_ref; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_flex_persistent_volume_source_t; -v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_create( +__attribute__((deprecated)) v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_create( char *driver, char *fs_type, list_t* options, diff --git a/kubernetes/model/v1_flex_volume_source.c b/kubernetes/model/v1_flex_volume_source.c index 2c1a3c5c..0fa344c7 100644 --- a/kubernetes/model/v1_flex_volume_source.c +++ b/kubernetes/model/v1_flex_volume_source.c @@ -5,7 +5,7 @@ -v1_flex_volume_source_t *v1_flex_volume_source_create( +static v1_flex_volume_source_t *v1_flex_volume_source_create_internal( char *driver, char *fs_type, list_t* options, @@ -22,14 +22,34 @@ v1_flex_volume_source_t *v1_flex_volume_source_create( v1_flex_volume_source_local_var->read_only = read_only; v1_flex_volume_source_local_var->secret_ref = secret_ref; + v1_flex_volume_source_local_var->_library_owned = 1; return v1_flex_volume_source_local_var; } +__attribute__((deprecated)) v1_flex_volume_source_t *v1_flex_volume_source_create( + char *driver, + char *fs_type, + list_t* options, + int read_only, + v1_local_object_reference_t *secret_ref + ) { + return v1_flex_volume_source_create_internal ( + driver, + fs_type, + options, + read_only, + secret_ref + ); +} void v1_flex_volume_source_free(v1_flex_volume_source_t *v1_flex_volume_source) { if(NULL == v1_flex_volume_source){ return ; } + if(v1_flex_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flex_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_flex_volume_source->driver) { free(v1_flex_volume_source->driver); @@ -41,7 +61,7 @@ void v1_flex_volume_source_free(v1_flex_volume_source_t *v1_flex_volume_source) } if (v1_flex_volume_source->options) { list_ForEach(listEntry, v1_flex_volume_source->options) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -86,8 +106,8 @@ cJSON *v1_flex_volume_source_convertToJSON(v1_flex_volume_source_t *v1_flex_volu listEntry_t *optionsListEntry; if (v1_flex_volume_source->options) { list_ForEach(optionsListEntry, v1_flex_volume_source->options) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)optionsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = optionsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -136,6 +156,9 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu // v1_flex_volume_source->driver cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_flex_volume_sourceJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } if (!driver) { goto end; } @@ -148,6 +171,9 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu // v1_flex_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_flex_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -157,6 +183,9 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu // v1_flex_volume_source->options cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_flex_volume_sourceJSON, "options"); + if (cJSON_IsNull(options)) { + options = NULL; + } if (options) { cJSON *options_local_map = NULL; if(!cJSON_IsObject(options) && !cJSON_IsNull(options)) @@ -182,6 +211,9 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu // v1_flex_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_flex_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -191,12 +223,15 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu // v1_flex_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_flex_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_local_object_reference_parseFromJSON(secret_ref); //nonprimitive } - v1_flex_volume_source_local_var = v1_flex_volume_source_create ( + v1_flex_volume_source_local_var = v1_flex_volume_source_create_internal ( strdup(driver->valuestring), fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, options ? optionsList : NULL, @@ -209,7 +244,7 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu if (optionsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, optionsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_flex_volume_source.h b/kubernetes/model/v1_flex_volume_source.h index 48d909ee..3e4c83df 100644 --- a/kubernetes/model/v1_flex_volume_source.h +++ b/kubernetes/model/v1_flex_volume_source.h @@ -26,9 +26,10 @@ typedef struct v1_flex_volume_source_t { int read_only; //boolean struct v1_local_object_reference_t *secret_ref; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_flex_volume_source_t; -v1_flex_volume_source_t *v1_flex_volume_source_create( +__attribute__((deprecated)) v1_flex_volume_source_t *v1_flex_volume_source_create( char *driver, char *fs_type, list_t* options, diff --git a/kubernetes/model/v1_flocker_volume_source.c b/kubernetes/model/v1_flocker_volume_source.c index e86ae458..151831e6 100644 --- a/kubernetes/model/v1_flocker_volume_source.c +++ b/kubernetes/model/v1_flocker_volume_source.c @@ -5,7 +5,7 @@ -v1_flocker_volume_source_t *v1_flocker_volume_source_create( +static v1_flocker_volume_source_t *v1_flocker_volume_source_create_internal( char *dataset_name, char *dataset_uuid ) { @@ -16,14 +16,28 @@ v1_flocker_volume_source_t *v1_flocker_volume_source_create( v1_flocker_volume_source_local_var->dataset_name = dataset_name; v1_flocker_volume_source_local_var->dataset_uuid = dataset_uuid; + v1_flocker_volume_source_local_var->_library_owned = 1; return v1_flocker_volume_source_local_var; } +__attribute__((deprecated)) v1_flocker_volume_source_t *v1_flocker_volume_source_create( + char *dataset_name, + char *dataset_uuid + ) { + return v1_flocker_volume_source_create_internal ( + dataset_name, + dataset_uuid + ); +} void v1_flocker_volume_source_free(v1_flocker_volume_source_t *v1_flocker_volume_source) { if(NULL == v1_flocker_volume_source){ return ; } + if(v1_flocker_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flocker_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_flocker_volume_source->dataset_name) { free(v1_flocker_volume_source->dataset_name); @@ -68,6 +82,9 @@ v1_flocker_volume_source_t *v1_flocker_volume_source_parseFromJSON(cJSON *v1_flo // v1_flocker_volume_source->dataset_name cJSON *dataset_name = cJSON_GetObjectItemCaseSensitive(v1_flocker_volume_sourceJSON, "datasetName"); + if (cJSON_IsNull(dataset_name)) { + dataset_name = NULL; + } if (dataset_name) { if(!cJSON_IsString(dataset_name) && !cJSON_IsNull(dataset_name)) { @@ -77,6 +94,9 @@ v1_flocker_volume_source_t *v1_flocker_volume_source_parseFromJSON(cJSON *v1_flo // v1_flocker_volume_source->dataset_uuid cJSON *dataset_uuid = cJSON_GetObjectItemCaseSensitive(v1_flocker_volume_sourceJSON, "datasetUUID"); + if (cJSON_IsNull(dataset_uuid)) { + dataset_uuid = NULL; + } if (dataset_uuid) { if(!cJSON_IsString(dataset_uuid) && !cJSON_IsNull(dataset_uuid)) { @@ -85,7 +105,7 @@ v1_flocker_volume_source_t *v1_flocker_volume_source_parseFromJSON(cJSON *v1_flo } - v1_flocker_volume_source_local_var = v1_flocker_volume_source_create ( + v1_flocker_volume_source_local_var = v1_flocker_volume_source_create_internal ( dataset_name && !cJSON_IsNull(dataset_name) ? strdup(dataset_name->valuestring) : NULL, dataset_uuid && !cJSON_IsNull(dataset_uuid) ? strdup(dataset_uuid->valuestring) : NULL ); diff --git a/kubernetes/model/v1_flocker_volume_source.h b/kubernetes/model/v1_flocker_volume_source.h index cfb2e168..4fc9502a 100644 --- a/kubernetes/model/v1_flocker_volume_source.h +++ b/kubernetes/model/v1_flocker_volume_source.h @@ -22,9 +22,10 @@ typedef struct v1_flocker_volume_source_t { char *dataset_name; // string char *dataset_uuid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_flocker_volume_source_t; -v1_flocker_volume_source_t *v1_flocker_volume_source_create( +__attribute__((deprecated)) v1_flocker_volume_source_t *v1_flocker_volume_source_create( char *dataset_name, char *dataset_uuid ); diff --git a/kubernetes/model/v1_flow_distinguisher_method.c b/kubernetes/model/v1_flow_distinguisher_method.c index b861bdfb..63ae169a 100644 --- a/kubernetes/model/v1_flow_distinguisher_method.c +++ b/kubernetes/model/v1_flow_distinguisher_method.c @@ -5,7 +5,7 @@ -v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_create( +static v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_create_internal( char *type ) { v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_local_var = malloc(sizeof(v1_flow_distinguisher_method_t)); @@ -14,14 +14,26 @@ v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_create( } v1_flow_distinguisher_method_local_var->type = type; + v1_flow_distinguisher_method_local_var->_library_owned = 1; return v1_flow_distinguisher_method_local_var; } +__attribute__((deprecated)) v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_create( + char *type + ) { + return v1_flow_distinguisher_method_create_internal ( + type + ); +} void v1_flow_distinguisher_method_free(v1_flow_distinguisher_method_t *v1_flow_distinguisher_method) { if(NULL == v1_flow_distinguisher_method){ return ; } + if(v1_flow_distinguisher_method->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flow_distinguisher_method_free"); + return ; + } listEntry_t *listEntry; if (v1_flow_distinguisher_method->type) { free(v1_flow_distinguisher_method->type); @@ -55,6 +67,9 @@ v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_parseFromJSON(cJSON // v1_flow_distinguisher_method->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_flow_distinguisher_methodJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -66,7 +81,7 @@ v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_parseFromJSON(cJSON } - v1_flow_distinguisher_method_local_var = v1_flow_distinguisher_method_create ( + v1_flow_distinguisher_method_local_var = v1_flow_distinguisher_method_create_internal ( strdup(type->valuestring) ); diff --git a/kubernetes/model/v1_flow_distinguisher_method.h b/kubernetes/model/v1_flow_distinguisher_method.h index 2b10ada9..84efbfa2 100644 --- a/kubernetes/model/v1_flow_distinguisher_method.h +++ b/kubernetes/model/v1_flow_distinguisher_method.h @@ -21,9 +21,10 @@ typedef struct v1_flow_distinguisher_method_t v1_flow_distinguisher_method_t; typedef struct v1_flow_distinguisher_method_t { char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_flow_distinguisher_method_t; -v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_create( +__attribute__((deprecated)) v1_flow_distinguisher_method_t *v1_flow_distinguisher_method_create( char *type ); diff --git a/kubernetes/model/v1_flow_schema.c b/kubernetes/model/v1_flow_schema.c index b9ccf760..6ada544b 100644 --- a/kubernetes/model/v1_flow_schema.c +++ b/kubernetes/model/v1_flow_schema.c @@ -5,7 +5,7 @@ -v1_flow_schema_t *v1_flow_schema_create( +static v1_flow_schema_t *v1_flow_schema_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_flow_schema_t *v1_flow_schema_create( v1_flow_schema_local_var->spec = spec; v1_flow_schema_local_var->status = status; + v1_flow_schema_local_var->_library_owned = 1; return v1_flow_schema_local_var; } +__attribute__((deprecated)) v1_flow_schema_t *v1_flow_schema_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_flow_schema_spec_t *spec, + v1_flow_schema_status_t *status + ) { + return v1_flow_schema_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_flow_schema_free(v1_flow_schema_t *v1_flow_schema) { if(NULL == v1_flow_schema){ return ; } + if(v1_flow_schema->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flow_schema_free"); + return ; + } listEntry_t *listEntry; if (v1_flow_schema->api_version) { free(v1_flow_schema->api_version); @@ -134,6 +154,9 @@ v1_flow_schema_t *v1_flow_schema_parseFromJSON(cJSON *v1_flow_schemaJSON){ // v1_flow_schema->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_flow_schemaJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_flow_schema_t *v1_flow_schema_parseFromJSON(cJSON *v1_flow_schemaJSON){ // v1_flow_schema->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_flow_schemaJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_flow_schema_t *v1_flow_schema_parseFromJSON(cJSON *v1_flow_schemaJSON){ // v1_flow_schema->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_flow_schemaJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_flow_schema->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_flow_schemaJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_flow_schema_spec_parseFromJSON(spec); //nonprimitive } // v1_flow_schema->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_flow_schemaJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_flow_schema_status_parseFromJSON(status); //nonprimitive } - v1_flow_schema_local_var = v1_flow_schema_create ( + v1_flow_schema_local_var = v1_flow_schema_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_flow_schema.h b/kubernetes/model/v1_flow_schema.h index 913577d0..fce76d9a 100644 --- a/kubernetes/model/v1_flow_schema.h +++ b/kubernetes/model/v1_flow_schema.h @@ -28,9 +28,10 @@ typedef struct v1_flow_schema_t { struct v1_flow_schema_spec_t *spec; //model struct v1_flow_schema_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_flow_schema_t; -v1_flow_schema_t *v1_flow_schema_create( +__attribute__((deprecated)) v1_flow_schema_t *v1_flow_schema_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_flow_schema_condition.c b/kubernetes/model/v1_flow_schema_condition.c index 3467e0b4..616591ba 100644 --- a/kubernetes/model/v1_flow_schema_condition.c +++ b/kubernetes/model/v1_flow_schema_condition.c @@ -5,7 +5,7 @@ -v1_flow_schema_condition_t *v1_flow_schema_condition_create( +static v1_flow_schema_condition_t *v1_flow_schema_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_flow_schema_condition_t *v1_flow_schema_condition_create( v1_flow_schema_condition_local_var->status = status; v1_flow_schema_condition_local_var->type = type; + v1_flow_schema_condition_local_var->_library_owned = 1; return v1_flow_schema_condition_local_var; } +__attribute__((deprecated)) v1_flow_schema_condition_t *v1_flow_schema_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_flow_schema_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_flow_schema_condition_free(v1_flow_schema_condition_t *v1_flow_schema_condition) { if(NULL == v1_flow_schema_condition){ return ; } + if(v1_flow_schema_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flow_schema_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_flow_schema_condition->last_transition_time) { free(v1_flow_schema_condition->last_transition_time); @@ -110,6 +130,9 @@ v1_flow_schema_condition_t *v1_flow_schema_condition_parseFromJSON(cJSON *v1_flo // v1_flow_schema_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -119,6 +142,9 @@ v1_flow_schema_condition_t *v1_flow_schema_condition_parseFromJSON(cJSON *v1_flo // v1_flow_schema_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -128,6 +154,9 @@ v1_flow_schema_condition_t *v1_flow_schema_condition_parseFromJSON(cJSON *v1_flo // v1_flow_schema_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -137,6 +166,9 @@ v1_flow_schema_condition_t *v1_flow_schema_condition_parseFromJSON(cJSON *v1_flo // v1_flow_schema_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { if(!cJSON_IsString(status) && !cJSON_IsNull(status)) { @@ -146,6 +178,9 @@ v1_flow_schema_condition_t *v1_flow_schema_condition_parseFromJSON(cJSON *v1_flo // v1_flow_schema_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -154,7 +189,7 @@ v1_flow_schema_condition_t *v1_flow_schema_condition_parseFromJSON(cJSON *v1_flo } - v1_flow_schema_condition_local_var = v1_flow_schema_condition_create ( + v1_flow_schema_condition_local_var = v1_flow_schema_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_flow_schema_condition.h b/kubernetes/model/v1_flow_schema_condition.h index ba30bdc7..dc5edf59 100644 --- a/kubernetes/model/v1_flow_schema_condition.h +++ b/kubernetes/model/v1_flow_schema_condition.h @@ -25,9 +25,10 @@ typedef struct v1_flow_schema_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_flow_schema_condition_t; -v1_flow_schema_condition_t *v1_flow_schema_condition_create( +__attribute__((deprecated)) v1_flow_schema_condition_t *v1_flow_schema_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_flow_schema_list.c b/kubernetes/model/v1_flow_schema_list.c index 25b68455..c27e6196 100644 --- a/kubernetes/model/v1_flow_schema_list.c +++ b/kubernetes/model/v1_flow_schema_list.c @@ -5,7 +5,7 @@ -v1_flow_schema_list_t *v1_flow_schema_list_create( +static v1_flow_schema_list_t *v1_flow_schema_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_flow_schema_list_t *v1_flow_schema_list_create( v1_flow_schema_list_local_var->kind = kind; v1_flow_schema_list_local_var->metadata = metadata; + v1_flow_schema_list_local_var->_library_owned = 1; return v1_flow_schema_list_local_var; } +__attribute__((deprecated)) v1_flow_schema_list_t *v1_flow_schema_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_flow_schema_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_flow_schema_list_free(v1_flow_schema_list_t *v1_flow_schema_list) { if(NULL == v1_flow_schema_list){ return ; } + if(v1_flow_schema_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flow_schema_list_free"); + return ; + } listEntry_t *listEntry; if (v1_flow_schema_list->api_version) { free(v1_flow_schema_list->api_version); @@ -123,6 +141,9 @@ v1_flow_schema_list_t *v1_flow_schema_list_parseFromJSON(cJSON *v1_flow_schema_l // v1_flow_schema_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_flow_schema_list_t *v1_flow_schema_list_parseFromJSON(cJSON *v1_flow_schema_l // v1_flow_schema_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_flow_schema_list_t *v1_flow_schema_list_parseFromJSON(cJSON *v1_flow_schema_l // v1_flow_schema_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_flow_schema_list_t *v1_flow_schema_list_parseFromJSON(cJSON *v1_flow_schema_l // v1_flow_schema_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_flow_schema_list_local_var = v1_flow_schema_list_create ( + v1_flow_schema_list_local_var = v1_flow_schema_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_flow_schema_list.h b/kubernetes/model/v1_flow_schema_list.h index ffaa7316..c691688e 100644 --- a/kubernetes/model/v1_flow_schema_list.h +++ b/kubernetes/model/v1_flow_schema_list.h @@ -26,9 +26,10 @@ typedef struct v1_flow_schema_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_flow_schema_list_t; -v1_flow_schema_list_t *v1_flow_schema_list_create( +__attribute__((deprecated)) v1_flow_schema_list_t *v1_flow_schema_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_flow_schema_spec.c b/kubernetes/model/v1_flow_schema_spec.c index 06cec938..8e79c7ed 100644 --- a/kubernetes/model/v1_flow_schema_spec.c +++ b/kubernetes/model/v1_flow_schema_spec.c @@ -5,7 +5,7 @@ -v1_flow_schema_spec_t *v1_flow_schema_spec_create( +static v1_flow_schema_spec_t *v1_flow_schema_spec_create_internal( v1_flow_distinguisher_method_t *distinguisher_method, int matching_precedence, v1_priority_level_configuration_reference_t *priority_level_configuration, @@ -20,14 +20,32 @@ v1_flow_schema_spec_t *v1_flow_schema_spec_create( v1_flow_schema_spec_local_var->priority_level_configuration = priority_level_configuration; v1_flow_schema_spec_local_var->rules = rules; + v1_flow_schema_spec_local_var->_library_owned = 1; return v1_flow_schema_spec_local_var; } +__attribute__((deprecated)) v1_flow_schema_spec_t *v1_flow_schema_spec_create( + v1_flow_distinguisher_method_t *distinguisher_method, + int matching_precedence, + v1_priority_level_configuration_reference_t *priority_level_configuration, + list_t *rules + ) { + return v1_flow_schema_spec_create_internal ( + distinguisher_method, + matching_precedence, + priority_level_configuration, + rules + ); +} void v1_flow_schema_spec_free(v1_flow_schema_spec_t *v1_flow_schema_spec) { if(NULL == v1_flow_schema_spec){ return ; } + if(v1_flow_schema_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flow_schema_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_flow_schema_spec->distinguisher_method) { v1_flow_distinguisher_method_free(v1_flow_schema_spec->distinguisher_method); @@ -127,12 +145,18 @@ v1_flow_schema_spec_t *v1_flow_schema_spec_parseFromJSON(cJSON *v1_flow_schema_s // v1_flow_schema_spec->distinguisher_method cJSON *distinguisher_method = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_specJSON, "distinguisherMethod"); + if (cJSON_IsNull(distinguisher_method)) { + distinguisher_method = NULL; + } if (distinguisher_method) { distinguisher_method_local_nonprim = v1_flow_distinguisher_method_parseFromJSON(distinguisher_method); //nonprimitive } // v1_flow_schema_spec->matching_precedence cJSON *matching_precedence = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_specJSON, "matchingPrecedence"); + if (cJSON_IsNull(matching_precedence)) { + matching_precedence = NULL; + } if (matching_precedence) { if(!cJSON_IsNumber(matching_precedence)) { @@ -142,6 +166,9 @@ v1_flow_schema_spec_t *v1_flow_schema_spec_parseFromJSON(cJSON *v1_flow_schema_s // v1_flow_schema_spec->priority_level_configuration cJSON *priority_level_configuration = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_specJSON, "priorityLevelConfiguration"); + if (cJSON_IsNull(priority_level_configuration)) { + priority_level_configuration = NULL; + } if (!priority_level_configuration) { goto end; } @@ -151,6 +178,9 @@ v1_flow_schema_spec_t *v1_flow_schema_spec_parseFromJSON(cJSON *v1_flow_schema_s // v1_flow_schema_spec->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_specJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (rules) { cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ @@ -171,7 +201,7 @@ v1_flow_schema_spec_t *v1_flow_schema_spec_parseFromJSON(cJSON *v1_flow_schema_s } - v1_flow_schema_spec_local_var = v1_flow_schema_spec_create ( + v1_flow_schema_spec_local_var = v1_flow_schema_spec_create_internal ( distinguisher_method ? distinguisher_method_local_nonprim : NULL, matching_precedence ? matching_precedence->valuedouble : 0, priority_level_configuration_local_nonprim, diff --git a/kubernetes/model/v1_flow_schema_spec.h b/kubernetes/model/v1_flow_schema_spec.h index 90c774a1..c7269fd6 100644 --- a/kubernetes/model/v1_flow_schema_spec.h +++ b/kubernetes/model/v1_flow_schema_spec.h @@ -27,9 +27,10 @@ typedef struct v1_flow_schema_spec_t { struct v1_priority_level_configuration_reference_t *priority_level_configuration; //model list_t *rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_flow_schema_spec_t; -v1_flow_schema_spec_t *v1_flow_schema_spec_create( +__attribute__((deprecated)) v1_flow_schema_spec_t *v1_flow_schema_spec_create( v1_flow_distinguisher_method_t *distinguisher_method, int matching_precedence, v1_priority_level_configuration_reference_t *priority_level_configuration, diff --git a/kubernetes/model/v1_flow_schema_status.c b/kubernetes/model/v1_flow_schema_status.c index 4fc3b3d5..e046f36f 100644 --- a/kubernetes/model/v1_flow_schema_status.c +++ b/kubernetes/model/v1_flow_schema_status.c @@ -5,7 +5,7 @@ -v1_flow_schema_status_t *v1_flow_schema_status_create( +static v1_flow_schema_status_t *v1_flow_schema_status_create_internal( list_t *conditions ) { v1_flow_schema_status_t *v1_flow_schema_status_local_var = malloc(sizeof(v1_flow_schema_status_t)); @@ -14,14 +14,26 @@ v1_flow_schema_status_t *v1_flow_schema_status_create( } v1_flow_schema_status_local_var->conditions = conditions; + v1_flow_schema_status_local_var->_library_owned = 1; return v1_flow_schema_status_local_var; } +__attribute__((deprecated)) v1_flow_schema_status_t *v1_flow_schema_status_create( + list_t *conditions + ) { + return v1_flow_schema_status_create_internal ( + conditions + ); +} void v1_flow_schema_status_free(v1_flow_schema_status_t *v1_flow_schema_status) { if(NULL == v1_flow_schema_status){ return ; } + if(v1_flow_schema_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_flow_schema_status_free"); + return ; + } listEntry_t *listEntry; if (v1_flow_schema_status->conditions) { list_ForEach(listEntry, v1_flow_schema_status->conditions) { @@ -72,6 +84,9 @@ v1_flow_schema_status_t *v1_flow_schema_status_parseFromJSON(cJSON *v1_flow_sche // v1_flow_schema_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_flow_schema_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -92,7 +107,7 @@ v1_flow_schema_status_t *v1_flow_schema_status_parseFromJSON(cJSON *v1_flow_sche } - v1_flow_schema_status_local_var = v1_flow_schema_status_create ( + v1_flow_schema_status_local_var = v1_flow_schema_status_create_internal ( conditions ? conditionsList : NULL ); diff --git a/kubernetes/model/v1_flow_schema_status.h b/kubernetes/model/v1_flow_schema_status.h index bdd919a9..e715cfa8 100644 --- a/kubernetes/model/v1_flow_schema_status.h +++ b/kubernetes/model/v1_flow_schema_status.h @@ -22,9 +22,10 @@ typedef struct v1_flow_schema_status_t v1_flow_schema_status_t; typedef struct v1_flow_schema_status_t { list_t *conditions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_flow_schema_status_t; -v1_flow_schema_status_t *v1_flow_schema_status_create( +__attribute__((deprecated)) v1_flow_schema_status_t *v1_flow_schema_status_create( list_t *conditions ); diff --git a/kubernetes/model/v1_for_node.c b/kubernetes/model/v1_for_node.c new file mode 100644 index 00000000..ddbf2b4f --- /dev/null +++ b/kubernetes/model/v1_for_node.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1_for_node.h" + + + +static v1_for_node_t *v1_for_node_create_internal( + char *name + ) { + v1_for_node_t *v1_for_node_local_var = malloc(sizeof(v1_for_node_t)); + if (!v1_for_node_local_var) { + return NULL; + } + v1_for_node_local_var->name = name; + + v1_for_node_local_var->_library_owned = 1; + return v1_for_node_local_var; +} + +__attribute__((deprecated)) v1_for_node_t *v1_for_node_create( + char *name + ) { + return v1_for_node_create_internal ( + name + ); +} + +void v1_for_node_free(v1_for_node_t *v1_for_node) { + if(NULL == v1_for_node){ + return ; + } + if(v1_for_node->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_for_node_free"); + return ; + } + listEntry_t *listEntry; + if (v1_for_node->name) { + free(v1_for_node->name); + v1_for_node->name = NULL; + } + free(v1_for_node); +} + +cJSON *v1_for_node_convertToJSON(v1_for_node_t *v1_for_node) { + cJSON *item = cJSON_CreateObject(); + + // v1_for_node->name + if (!v1_for_node->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_for_node->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_for_node_t *v1_for_node_parseFromJSON(cJSON *v1_for_nodeJSON){ + + v1_for_node_t *v1_for_node_local_var = NULL; + + // v1_for_node->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_for_nodeJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1_for_node_local_var = v1_for_node_create_internal ( + strdup(name->valuestring) + ); + + return v1_for_node_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_for_node.h b/kubernetes/model/v1_for_node.h new file mode 100644 index 00000000..f00a4364 --- /dev/null +++ b/kubernetes/model/v1_for_node.h @@ -0,0 +1,38 @@ +/* + * v1_for_node.h + * + * ForNode provides information about which nodes should consume this endpoint. + */ + +#ifndef _v1_for_node_H_ +#define _v1_for_node_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_for_node_t v1_for_node_t; + + + + +typedef struct v1_for_node_t { + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_for_node_t; + +__attribute__((deprecated)) v1_for_node_t *v1_for_node_create( + char *name +); + +void v1_for_node_free(v1_for_node_t *v1_for_node); + +v1_for_node_t *v1_for_node_parseFromJSON(cJSON *v1_for_nodeJSON); + +cJSON *v1_for_node_convertToJSON(v1_for_node_t *v1_for_node); + +#endif /* _v1_for_node_H_ */ + diff --git a/kubernetes/model/v1_for_zone.c b/kubernetes/model/v1_for_zone.c index 9cc77a58..26e08ef7 100644 --- a/kubernetes/model/v1_for_zone.c +++ b/kubernetes/model/v1_for_zone.c @@ -5,7 +5,7 @@ -v1_for_zone_t *v1_for_zone_create( +static v1_for_zone_t *v1_for_zone_create_internal( char *name ) { v1_for_zone_t *v1_for_zone_local_var = malloc(sizeof(v1_for_zone_t)); @@ -14,14 +14,26 @@ v1_for_zone_t *v1_for_zone_create( } v1_for_zone_local_var->name = name; + v1_for_zone_local_var->_library_owned = 1; return v1_for_zone_local_var; } +__attribute__((deprecated)) v1_for_zone_t *v1_for_zone_create( + char *name + ) { + return v1_for_zone_create_internal ( + name + ); +} void v1_for_zone_free(v1_for_zone_t *v1_for_zone) { if(NULL == v1_for_zone){ return ; } + if(v1_for_zone->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_for_zone_free"); + return ; + } listEntry_t *listEntry; if (v1_for_zone->name) { free(v1_for_zone->name); @@ -55,6 +67,9 @@ v1_for_zone_t *v1_for_zone_parseFromJSON(cJSON *v1_for_zoneJSON){ // v1_for_zone->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_for_zoneJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -66,7 +81,7 @@ v1_for_zone_t *v1_for_zone_parseFromJSON(cJSON *v1_for_zoneJSON){ } - v1_for_zone_local_var = v1_for_zone_create ( + v1_for_zone_local_var = v1_for_zone_create_internal ( strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_for_zone.h b/kubernetes/model/v1_for_zone.h index e56a594d..143fdb7d 100644 --- a/kubernetes/model/v1_for_zone.h +++ b/kubernetes/model/v1_for_zone.h @@ -21,9 +21,10 @@ typedef struct v1_for_zone_t v1_for_zone_t; typedef struct v1_for_zone_t { char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_for_zone_t; -v1_for_zone_t *v1_for_zone_create( +__attribute__((deprecated)) v1_for_zone_t *v1_for_zone_create( char *name ); diff --git a/kubernetes/model/v1_gce_persistent_disk_volume_source.c b/kubernetes/model/v1_gce_persistent_disk_volume_source.c index f37f1837..d8254bcc 100644 --- a/kubernetes/model/v1_gce_persistent_disk_volume_source.c +++ b/kubernetes/model/v1_gce_persistent_disk_volume_source.c @@ -5,7 +5,7 @@ -v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_create( +static v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_create_internal( char *fs_type, int partition, char *pd_name, @@ -20,14 +20,32 @@ v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_cre v1_gce_persistent_disk_volume_source_local_var->pd_name = pd_name; v1_gce_persistent_disk_volume_source_local_var->read_only = read_only; + v1_gce_persistent_disk_volume_source_local_var->_library_owned = 1; return v1_gce_persistent_disk_volume_source_local_var; } +__attribute__((deprecated)) v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_create( + char *fs_type, + int partition, + char *pd_name, + int read_only + ) { + return v1_gce_persistent_disk_volume_source_create_internal ( + fs_type, + partition, + pd_name, + read_only + ); +} void v1_gce_persistent_disk_volume_source_free(v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source) { if(NULL == v1_gce_persistent_disk_volume_source){ return ; } + if(v1_gce_persistent_disk_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_gce_persistent_disk_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_gce_persistent_disk_volume_source->fs_type) { free(v1_gce_persistent_disk_volume_source->fs_type); @@ -89,6 +107,9 @@ v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_par // v1_gce_persistent_disk_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_gce_persistent_disk_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -98,6 +119,9 @@ v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_par // v1_gce_persistent_disk_volume_source->partition cJSON *partition = cJSON_GetObjectItemCaseSensitive(v1_gce_persistent_disk_volume_sourceJSON, "partition"); + if (cJSON_IsNull(partition)) { + partition = NULL; + } if (partition) { if(!cJSON_IsNumber(partition)) { @@ -107,6 +131,9 @@ v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_par // v1_gce_persistent_disk_volume_source->pd_name cJSON *pd_name = cJSON_GetObjectItemCaseSensitive(v1_gce_persistent_disk_volume_sourceJSON, "pdName"); + if (cJSON_IsNull(pd_name)) { + pd_name = NULL; + } if (!pd_name) { goto end; } @@ -119,6 +146,9 @@ v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_par // v1_gce_persistent_disk_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_gce_persistent_disk_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -127,7 +157,7 @@ v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_par } - v1_gce_persistent_disk_volume_source_local_var = v1_gce_persistent_disk_volume_source_create ( + v1_gce_persistent_disk_volume_source_local_var = v1_gce_persistent_disk_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, partition ? partition->valuedouble : 0, strdup(pd_name->valuestring), diff --git a/kubernetes/model/v1_gce_persistent_disk_volume_source.h b/kubernetes/model/v1_gce_persistent_disk_volume_source.h index 0d5b394b..f5aaf5ea 100644 --- a/kubernetes/model/v1_gce_persistent_disk_volume_source.h +++ b/kubernetes/model/v1_gce_persistent_disk_volume_source.h @@ -24,9 +24,10 @@ typedef struct v1_gce_persistent_disk_volume_source_t { char *pd_name; // string int read_only; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_gce_persistent_disk_volume_source_t; -v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_create( +__attribute__((deprecated)) v1_gce_persistent_disk_volume_source_t *v1_gce_persistent_disk_volume_source_create( char *fs_type, int partition, char *pd_name, diff --git a/kubernetes/model/v1_git_repo_volume_source.c b/kubernetes/model/v1_git_repo_volume_source.c index d8128c10..b282223a 100644 --- a/kubernetes/model/v1_git_repo_volume_source.c +++ b/kubernetes/model/v1_git_repo_volume_source.c @@ -5,7 +5,7 @@ -v1_git_repo_volume_source_t *v1_git_repo_volume_source_create( +static v1_git_repo_volume_source_t *v1_git_repo_volume_source_create_internal( char *directory, char *repository, char *revision @@ -18,14 +18,30 @@ v1_git_repo_volume_source_t *v1_git_repo_volume_source_create( v1_git_repo_volume_source_local_var->repository = repository; v1_git_repo_volume_source_local_var->revision = revision; + v1_git_repo_volume_source_local_var->_library_owned = 1; return v1_git_repo_volume_source_local_var; } +__attribute__((deprecated)) v1_git_repo_volume_source_t *v1_git_repo_volume_source_create( + char *directory, + char *repository, + char *revision + ) { + return v1_git_repo_volume_source_create_internal ( + directory, + repository, + revision + ); +} void v1_git_repo_volume_source_free(v1_git_repo_volume_source_t *v1_git_repo_volume_source) { if(NULL == v1_git_repo_volume_source){ return ; } + if(v1_git_repo_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_git_repo_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_git_repo_volume_source->directory) { free(v1_git_repo_volume_source->directory); @@ -83,6 +99,9 @@ v1_git_repo_volume_source_t *v1_git_repo_volume_source_parseFromJSON(cJSON *v1_g // v1_git_repo_volume_source->directory cJSON *directory = cJSON_GetObjectItemCaseSensitive(v1_git_repo_volume_sourceJSON, "directory"); + if (cJSON_IsNull(directory)) { + directory = NULL; + } if (directory) { if(!cJSON_IsString(directory) && !cJSON_IsNull(directory)) { @@ -92,6 +111,9 @@ v1_git_repo_volume_source_t *v1_git_repo_volume_source_parseFromJSON(cJSON *v1_g // v1_git_repo_volume_source->repository cJSON *repository = cJSON_GetObjectItemCaseSensitive(v1_git_repo_volume_sourceJSON, "repository"); + if (cJSON_IsNull(repository)) { + repository = NULL; + } if (!repository) { goto end; } @@ -104,6 +126,9 @@ v1_git_repo_volume_source_t *v1_git_repo_volume_source_parseFromJSON(cJSON *v1_g // v1_git_repo_volume_source->revision cJSON *revision = cJSON_GetObjectItemCaseSensitive(v1_git_repo_volume_sourceJSON, "revision"); + if (cJSON_IsNull(revision)) { + revision = NULL; + } if (revision) { if(!cJSON_IsString(revision) && !cJSON_IsNull(revision)) { @@ -112,7 +137,7 @@ v1_git_repo_volume_source_t *v1_git_repo_volume_source_parseFromJSON(cJSON *v1_g } - v1_git_repo_volume_source_local_var = v1_git_repo_volume_source_create ( + v1_git_repo_volume_source_local_var = v1_git_repo_volume_source_create_internal ( directory && !cJSON_IsNull(directory) ? strdup(directory->valuestring) : NULL, strdup(repository->valuestring), revision && !cJSON_IsNull(revision) ? strdup(revision->valuestring) : NULL diff --git a/kubernetes/model/v1_git_repo_volume_source.h b/kubernetes/model/v1_git_repo_volume_source.h index bb9be1ee..88790c1e 100644 --- a/kubernetes/model/v1_git_repo_volume_source.h +++ b/kubernetes/model/v1_git_repo_volume_source.h @@ -23,9 +23,10 @@ typedef struct v1_git_repo_volume_source_t { char *repository; // string char *revision; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_git_repo_volume_source_t; -v1_git_repo_volume_source_t *v1_git_repo_volume_source_create( +__attribute__((deprecated)) v1_git_repo_volume_source_t *v1_git_repo_volume_source_create( char *directory, char *repository, char *revision diff --git a/kubernetes/model/v1_glusterfs_persistent_volume_source.c b/kubernetes/model/v1_glusterfs_persistent_volume_source.c index 853c17a1..ea08ca3d 100644 --- a/kubernetes/model/v1_glusterfs_persistent_volume_source.c +++ b/kubernetes/model/v1_glusterfs_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_create( +static v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_create_internal( char *endpoints, char *endpoints_namespace, char *path, @@ -20,14 +20,32 @@ v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_c v1_glusterfs_persistent_volume_source_local_var->path = path; v1_glusterfs_persistent_volume_source_local_var->read_only = read_only; + v1_glusterfs_persistent_volume_source_local_var->_library_owned = 1; return v1_glusterfs_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_create( + char *endpoints, + char *endpoints_namespace, + char *path, + int read_only + ) { + return v1_glusterfs_persistent_volume_source_create_internal ( + endpoints, + endpoints_namespace, + path, + read_only + ); +} void v1_glusterfs_persistent_volume_source_free(v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source) { if(NULL == v1_glusterfs_persistent_volume_source){ return ; } + if(v1_glusterfs_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_glusterfs_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_glusterfs_persistent_volume_source->endpoints) { free(v1_glusterfs_persistent_volume_source->endpoints); @@ -94,6 +112,9 @@ v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_p // v1_glusterfs_persistent_volume_source->endpoints cJSON *endpoints = cJSON_GetObjectItemCaseSensitive(v1_glusterfs_persistent_volume_sourceJSON, "endpoints"); + if (cJSON_IsNull(endpoints)) { + endpoints = NULL; + } if (!endpoints) { goto end; } @@ -106,6 +127,9 @@ v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_p // v1_glusterfs_persistent_volume_source->endpoints_namespace cJSON *endpoints_namespace = cJSON_GetObjectItemCaseSensitive(v1_glusterfs_persistent_volume_sourceJSON, "endpointsNamespace"); + if (cJSON_IsNull(endpoints_namespace)) { + endpoints_namespace = NULL; + } if (endpoints_namespace) { if(!cJSON_IsString(endpoints_namespace) && !cJSON_IsNull(endpoints_namespace)) { @@ -115,6 +139,9 @@ v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_p // v1_glusterfs_persistent_volume_source->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_glusterfs_persistent_volume_sourceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -127,6 +154,9 @@ v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_p // v1_glusterfs_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_glusterfs_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -135,7 +165,7 @@ v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_p } - v1_glusterfs_persistent_volume_source_local_var = v1_glusterfs_persistent_volume_source_create ( + v1_glusterfs_persistent_volume_source_local_var = v1_glusterfs_persistent_volume_source_create_internal ( strdup(endpoints->valuestring), endpoints_namespace && !cJSON_IsNull(endpoints_namespace) ? strdup(endpoints_namespace->valuestring) : NULL, strdup(path->valuestring), diff --git a/kubernetes/model/v1_glusterfs_persistent_volume_source.h b/kubernetes/model/v1_glusterfs_persistent_volume_source.h index 4662465d..08f485e6 100644 --- a/kubernetes/model/v1_glusterfs_persistent_volume_source.h +++ b/kubernetes/model/v1_glusterfs_persistent_volume_source.h @@ -24,9 +24,10 @@ typedef struct v1_glusterfs_persistent_volume_source_t { char *path; // string int read_only; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_glusterfs_persistent_volume_source_t; -v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_create( +__attribute__((deprecated)) v1_glusterfs_persistent_volume_source_t *v1_glusterfs_persistent_volume_source_create( char *endpoints, char *endpoints_namespace, char *path, diff --git a/kubernetes/model/v1_glusterfs_volume_source.c b/kubernetes/model/v1_glusterfs_volume_source.c index e0c76789..2b114746 100644 --- a/kubernetes/model/v1_glusterfs_volume_source.c +++ b/kubernetes/model/v1_glusterfs_volume_source.c @@ -5,7 +5,7 @@ -v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_create( +static v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_create_internal( char *endpoints, char *path, int read_only @@ -18,14 +18,30 @@ v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_create( v1_glusterfs_volume_source_local_var->path = path; v1_glusterfs_volume_source_local_var->read_only = read_only; + v1_glusterfs_volume_source_local_var->_library_owned = 1; return v1_glusterfs_volume_source_local_var; } +__attribute__((deprecated)) v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_create( + char *endpoints, + char *path, + int read_only + ) { + return v1_glusterfs_volume_source_create_internal ( + endpoints, + path, + read_only + ); +} void v1_glusterfs_volume_source_free(v1_glusterfs_volume_source_t *v1_glusterfs_volume_source) { if(NULL == v1_glusterfs_volume_source){ return ; } + if(v1_glusterfs_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_glusterfs_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_glusterfs_volume_source->endpoints) { free(v1_glusterfs_volume_source->endpoints); @@ -80,6 +96,9 @@ v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_parseFromJSON(cJSON *v1 // v1_glusterfs_volume_source->endpoints cJSON *endpoints = cJSON_GetObjectItemCaseSensitive(v1_glusterfs_volume_sourceJSON, "endpoints"); + if (cJSON_IsNull(endpoints)) { + endpoints = NULL; + } if (!endpoints) { goto end; } @@ -92,6 +111,9 @@ v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_parseFromJSON(cJSON *v1 // v1_glusterfs_volume_source->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_glusterfs_volume_sourceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -104,6 +126,9 @@ v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_parseFromJSON(cJSON *v1 // v1_glusterfs_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_glusterfs_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -112,7 +137,7 @@ v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_parseFromJSON(cJSON *v1 } - v1_glusterfs_volume_source_local_var = v1_glusterfs_volume_source_create ( + v1_glusterfs_volume_source_local_var = v1_glusterfs_volume_source_create_internal ( strdup(endpoints->valuestring), strdup(path->valuestring), read_only ? read_only->valueint : 0 diff --git a/kubernetes/model/v1_glusterfs_volume_source.h b/kubernetes/model/v1_glusterfs_volume_source.h index 34de6098..762e5ea0 100644 --- a/kubernetes/model/v1_glusterfs_volume_source.h +++ b/kubernetes/model/v1_glusterfs_volume_source.h @@ -23,9 +23,10 @@ typedef struct v1_glusterfs_volume_source_t { char *path; // string int read_only; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_glusterfs_volume_source_t; -v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_create( +__attribute__((deprecated)) v1_glusterfs_volume_source_t *v1_glusterfs_volume_source_create( char *endpoints, char *path, int read_only diff --git a/kubernetes/model/v1_group_subject.c b/kubernetes/model/v1_group_subject.c index cc13b333..3d3b3140 100644 --- a/kubernetes/model/v1_group_subject.c +++ b/kubernetes/model/v1_group_subject.c @@ -5,7 +5,7 @@ -v1_group_subject_t *v1_group_subject_create( +static v1_group_subject_t *v1_group_subject_create_internal( char *name ) { v1_group_subject_t *v1_group_subject_local_var = malloc(sizeof(v1_group_subject_t)); @@ -14,14 +14,26 @@ v1_group_subject_t *v1_group_subject_create( } v1_group_subject_local_var->name = name; + v1_group_subject_local_var->_library_owned = 1; return v1_group_subject_local_var; } +__attribute__((deprecated)) v1_group_subject_t *v1_group_subject_create( + char *name + ) { + return v1_group_subject_create_internal ( + name + ); +} void v1_group_subject_free(v1_group_subject_t *v1_group_subject) { if(NULL == v1_group_subject){ return ; } + if(v1_group_subject->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_group_subject_free"); + return ; + } listEntry_t *listEntry; if (v1_group_subject->name) { free(v1_group_subject->name); @@ -55,6 +67,9 @@ v1_group_subject_t *v1_group_subject_parseFromJSON(cJSON *v1_group_subjectJSON){ // v1_group_subject->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_group_subjectJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -66,7 +81,7 @@ v1_group_subject_t *v1_group_subject_parseFromJSON(cJSON *v1_group_subjectJSON){ } - v1_group_subject_local_var = v1_group_subject_create ( + v1_group_subject_local_var = v1_group_subject_create_internal ( strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_group_subject.h b/kubernetes/model/v1_group_subject.h index 1e66fbc7..cadeb1ee 100644 --- a/kubernetes/model/v1_group_subject.h +++ b/kubernetes/model/v1_group_subject.h @@ -21,9 +21,10 @@ typedef struct v1_group_subject_t v1_group_subject_t; typedef struct v1_group_subject_t { char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_group_subject_t; -v1_group_subject_t *v1_group_subject_create( +__attribute__((deprecated)) v1_group_subject_t *v1_group_subject_create( char *name ); diff --git a/kubernetes/model/v1_group_version_for_discovery.c b/kubernetes/model/v1_group_version_for_discovery.c index 6358f486..1192ec96 100644 --- a/kubernetes/model/v1_group_version_for_discovery.c +++ b/kubernetes/model/v1_group_version_for_discovery.c @@ -5,7 +5,7 @@ -v1_group_version_for_discovery_t *v1_group_version_for_discovery_create( +static v1_group_version_for_discovery_t *v1_group_version_for_discovery_create_internal( char *group_version, char *version ) { @@ -16,14 +16,28 @@ v1_group_version_for_discovery_t *v1_group_version_for_discovery_create( v1_group_version_for_discovery_local_var->group_version = group_version; v1_group_version_for_discovery_local_var->version = version; + v1_group_version_for_discovery_local_var->_library_owned = 1; return v1_group_version_for_discovery_local_var; } +__attribute__((deprecated)) v1_group_version_for_discovery_t *v1_group_version_for_discovery_create( + char *group_version, + char *version + ) { + return v1_group_version_for_discovery_create_internal ( + group_version, + version + ); +} void v1_group_version_for_discovery_free(v1_group_version_for_discovery_t *v1_group_version_for_discovery) { if(NULL == v1_group_version_for_discovery){ return ; } + if(v1_group_version_for_discovery->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_group_version_for_discovery_free"); + return ; + } listEntry_t *listEntry; if (v1_group_version_for_discovery->group_version) { free(v1_group_version_for_discovery->group_version); @@ -70,6 +84,9 @@ v1_group_version_for_discovery_t *v1_group_version_for_discovery_parseFromJSON(c // v1_group_version_for_discovery->group_version cJSON *group_version = cJSON_GetObjectItemCaseSensitive(v1_group_version_for_discoveryJSON, "groupVersion"); + if (cJSON_IsNull(group_version)) { + group_version = NULL; + } if (!group_version) { goto end; } @@ -82,6 +99,9 @@ v1_group_version_for_discovery_t *v1_group_version_for_discovery_parseFromJSON(c // v1_group_version_for_discovery->version cJSON *version = cJSON_GetObjectItemCaseSensitive(v1_group_version_for_discoveryJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } if (!version) { goto end; } @@ -93,7 +113,7 @@ v1_group_version_for_discovery_t *v1_group_version_for_discovery_parseFromJSON(c } - v1_group_version_for_discovery_local_var = v1_group_version_for_discovery_create ( + v1_group_version_for_discovery_local_var = v1_group_version_for_discovery_create_internal ( strdup(group_version->valuestring), strdup(version->valuestring) ); diff --git a/kubernetes/model/v1_group_version_for_discovery.h b/kubernetes/model/v1_group_version_for_discovery.h index 0d8e3b1f..b3d30f51 100644 --- a/kubernetes/model/v1_group_version_for_discovery.h +++ b/kubernetes/model/v1_group_version_for_discovery.h @@ -22,9 +22,10 @@ typedef struct v1_group_version_for_discovery_t { char *group_version; // string char *version; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_group_version_for_discovery_t; -v1_group_version_for_discovery_t *v1_group_version_for_discovery_create( +__attribute__((deprecated)) v1_group_version_for_discovery_t *v1_group_version_for_discovery_create( char *group_version, char *version ); diff --git a/kubernetes/model/v1_grpc_action.c b/kubernetes/model/v1_grpc_action.c index ddef26c7..30ac5939 100644 --- a/kubernetes/model/v1_grpc_action.c +++ b/kubernetes/model/v1_grpc_action.c @@ -5,7 +5,7 @@ -v1_grpc_action_t *v1_grpc_action_create( +static v1_grpc_action_t *v1_grpc_action_create_internal( int port, char *service ) { @@ -16,14 +16,28 @@ v1_grpc_action_t *v1_grpc_action_create( v1_grpc_action_local_var->port = port; v1_grpc_action_local_var->service = service; + v1_grpc_action_local_var->_library_owned = 1; return v1_grpc_action_local_var; } +__attribute__((deprecated)) v1_grpc_action_t *v1_grpc_action_create( + int port, + char *service + ) { + return v1_grpc_action_create_internal ( + port, + service + ); +} void v1_grpc_action_free(v1_grpc_action_t *v1_grpc_action) { if(NULL == v1_grpc_action){ return ; } + if(v1_grpc_action->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_grpc_action_free"); + return ; + } listEntry_t *listEntry; if (v1_grpc_action->service) { free(v1_grpc_action->service); @@ -65,6 +79,9 @@ v1_grpc_action_t *v1_grpc_action_parseFromJSON(cJSON *v1_grpc_actionJSON){ // v1_grpc_action->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_grpc_actionJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -77,6 +94,9 @@ v1_grpc_action_t *v1_grpc_action_parseFromJSON(cJSON *v1_grpc_actionJSON){ // v1_grpc_action->service cJSON *service = cJSON_GetObjectItemCaseSensitive(v1_grpc_actionJSON, "service"); + if (cJSON_IsNull(service)) { + service = NULL; + } if (service) { if(!cJSON_IsString(service) && !cJSON_IsNull(service)) { @@ -85,7 +105,7 @@ v1_grpc_action_t *v1_grpc_action_parseFromJSON(cJSON *v1_grpc_actionJSON){ } - v1_grpc_action_local_var = v1_grpc_action_create ( + v1_grpc_action_local_var = v1_grpc_action_create_internal ( port->valuedouble, service && !cJSON_IsNull(service) ? strdup(service->valuestring) : NULL ); diff --git a/kubernetes/model/v1_grpc_action.h b/kubernetes/model/v1_grpc_action.h index e1e3c9d6..3f80c33c 100644 --- a/kubernetes/model/v1_grpc_action.h +++ b/kubernetes/model/v1_grpc_action.h @@ -1,7 +1,7 @@ /* * v1_grpc_action.h * - * + * GRPCAction specifies an action involving a GRPC service. */ #ifndef _v1_grpc_action_H_ @@ -22,9 +22,10 @@ typedef struct v1_grpc_action_t { int port; //numeric char *service; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_grpc_action_t; -v1_grpc_action_t *v1_grpc_action_create( +__attribute__((deprecated)) v1_grpc_action_t *v1_grpc_action_create( int port, char *service ); diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler.c b/kubernetes/model/v1_horizontal_pod_autoscaler.c index 3032bd2f..8aeb1e0f 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler.c +++ b/kubernetes/model/v1_horizontal_pod_autoscaler.c @@ -5,7 +5,7 @@ -v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_create( +static v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_create( v1_horizontal_pod_autoscaler_local_var->spec = spec; v1_horizontal_pod_autoscaler_local_var->status = status; + v1_horizontal_pod_autoscaler_local_var->_library_owned = 1; return v1_horizontal_pod_autoscaler_local_var; } +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_horizontal_pod_autoscaler_spec_t *spec, + v1_horizontal_pod_autoscaler_status_t *status + ) { + return v1_horizontal_pod_autoscaler_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_horizontal_pod_autoscaler_free(v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler) { if(NULL == v1_horizontal_pod_autoscaler){ return ; } + if(v1_horizontal_pod_autoscaler->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_horizontal_pod_autoscaler_free"); + return ; + } listEntry_t *listEntry; if (v1_horizontal_pod_autoscaler->api_version) { free(v1_horizontal_pod_autoscaler->api_version); @@ -134,6 +154,9 @@ v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_parseFromJSON(cJSON // v1_horizontal_pod_autoscaler->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscalerJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_parseFromJSON(cJSON // v1_horizontal_pod_autoscaler->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscalerJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_parseFromJSON(cJSON // v1_horizontal_pod_autoscaler->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscalerJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_horizontal_pod_autoscaler->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscalerJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_horizontal_pod_autoscaler_spec_parseFromJSON(spec); //nonprimitive } // v1_horizontal_pod_autoscaler->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscalerJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_horizontal_pod_autoscaler_status_parseFromJSON(status); //nonprimitive } - v1_horizontal_pod_autoscaler_local_var = v1_horizontal_pod_autoscaler_create ( + v1_horizontal_pod_autoscaler_local_var = v1_horizontal_pod_autoscaler_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler.h b/kubernetes/model/v1_horizontal_pod_autoscaler.h index d9d3444f..005050a1 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler.h +++ b/kubernetes/model/v1_horizontal_pod_autoscaler.h @@ -28,9 +28,10 @@ typedef struct v1_horizontal_pod_autoscaler_t { struct v1_horizontal_pod_autoscaler_spec_t *spec; //model struct v1_horizontal_pod_autoscaler_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_horizontal_pod_autoscaler_t; -v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_create( +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_t *v1_horizontal_pod_autoscaler_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler_list.c b/kubernetes/model/v1_horizontal_pod_autoscaler_list.c index 2ccd447f..598db696 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler_list.c +++ b/kubernetes/model/v1_horizontal_pod_autoscaler_list.c @@ -5,7 +5,7 @@ -v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_create( +static v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_create( v1_horizontal_pod_autoscaler_list_local_var->kind = kind; v1_horizontal_pod_autoscaler_list_local_var->metadata = metadata; + v1_horizontal_pod_autoscaler_list_local_var->_library_owned = 1; return v1_horizontal_pod_autoscaler_list_local_var; } +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_horizontal_pod_autoscaler_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_horizontal_pod_autoscaler_list_free(v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list) { if(NULL == v1_horizontal_pod_autoscaler_list){ return ; } + if(v1_horizontal_pod_autoscaler_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_horizontal_pod_autoscaler_list_free"); + return ; + } listEntry_t *listEntry; if (v1_horizontal_pod_autoscaler_list->api_version) { free(v1_horizontal_pod_autoscaler_list->api_version); @@ -123,6 +141,9 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_parseFrom // v1_horizontal_pod_autoscaler_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_parseFrom // v1_horizontal_pod_autoscaler_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_parseFrom // v1_horizontal_pod_autoscaler_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_parseFrom // v1_horizontal_pod_autoscaler_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_horizontal_pod_autoscaler_list_local_var = v1_horizontal_pod_autoscaler_list_create ( + v1_horizontal_pod_autoscaler_list_local_var = v1_horizontal_pod_autoscaler_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler_list.h b/kubernetes/model/v1_horizontal_pod_autoscaler_list.h index 56e7e2ca..b70d4e11 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler_list.h +++ b/kubernetes/model/v1_horizontal_pod_autoscaler_list.h @@ -26,9 +26,10 @@ typedef struct v1_horizontal_pod_autoscaler_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_horizontal_pod_autoscaler_list_t; -v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_create( +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler_spec.c b/kubernetes/model/v1_horizontal_pod_autoscaler_spec.c index c9216be4..8d7d9925 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler_spec.c +++ b/kubernetes/model/v1_horizontal_pod_autoscaler_spec.c @@ -5,7 +5,7 @@ -v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_create( +static v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_create_internal( int max_replicas, int min_replicas, v1_cross_version_object_reference_t *scale_target_ref, @@ -20,14 +20,32 @@ v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_create( v1_horizontal_pod_autoscaler_spec_local_var->scale_target_ref = scale_target_ref; v1_horizontal_pod_autoscaler_spec_local_var->target_cpu_utilization_percentage = target_cpu_utilization_percentage; + v1_horizontal_pod_autoscaler_spec_local_var->_library_owned = 1; return v1_horizontal_pod_autoscaler_spec_local_var; } +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_create( + int max_replicas, + int min_replicas, + v1_cross_version_object_reference_t *scale_target_ref, + int target_cpu_utilization_percentage + ) { + return v1_horizontal_pod_autoscaler_spec_create_internal ( + max_replicas, + min_replicas, + scale_target_ref, + target_cpu_utilization_percentage + ); +} void v1_horizontal_pod_autoscaler_spec_free(v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec) { if(NULL == v1_horizontal_pod_autoscaler_spec){ return ; } + if(v1_horizontal_pod_autoscaler_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_horizontal_pod_autoscaler_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_horizontal_pod_autoscaler_spec->scale_target_ref) { v1_cross_version_object_reference_free(v1_horizontal_pod_autoscaler_spec->scale_target_ref); @@ -94,6 +112,9 @@ v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_parseFrom // v1_horizontal_pod_autoscaler_spec->max_replicas cJSON *max_replicas = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_specJSON, "maxReplicas"); + if (cJSON_IsNull(max_replicas)) { + max_replicas = NULL; + } if (!max_replicas) { goto end; } @@ -106,6 +127,9 @@ v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_parseFrom // v1_horizontal_pod_autoscaler_spec->min_replicas cJSON *min_replicas = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_specJSON, "minReplicas"); + if (cJSON_IsNull(min_replicas)) { + min_replicas = NULL; + } if (min_replicas) { if(!cJSON_IsNumber(min_replicas)) { @@ -115,6 +139,9 @@ v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_parseFrom // v1_horizontal_pod_autoscaler_spec->scale_target_ref cJSON *scale_target_ref = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_specJSON, "scaleTargetRef"); + if (cJSON_IsNull(scale_target_ref)) { + scale_target_ref = NULL; + } if (!scale_target_ref) { goto end; } @@ -124,6 +151,9 @@ v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_parseFrom // v1_horizontal_pod_autoscaler_spec->target_cpu_utilization_percentage cJSON *target_cpu_utilization_percentage = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_specJSON, "targetCPUUtilizationPercentage"); + if (cJSON_IsNull(target_cpu_utilization_percentage)) { + target_cpu_utilization_percentage = NULL; + } if (target_cpu_utilization_percentage) { if(!cJSON_IsNumber(target_cpu_utilization_percentage)) { @@ -132,7 +162,7 @@ v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_parseFrom } - v1_horizontal_pod_autoscaler_spec_local_var = v1_horizontal_pod_autoscaler_spec_create ( + v1_horizontal_pod_autoscaler_spec_local_var = v1_horizontal_pod_autoscaler_spec_create_internal ( max_replicas->valuedouble, min_replicas ? min_replicas->valuedouble : 0, scale_target_ref_local_nonprim, diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler_spec.h b/kubernetes/model/v1_horizontal_pod_autoscaler_spec.h index ac9fa101..b7f508a6 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler_spec.h +++ b/kubernetes/model/v1_horizontal_pod_autoscaler_spec.h @@ -25,9 +25,10 @@ typedef struct v1_horizontal_pod_autoscaler_spec_t { struct v1_cross_version_object_reference_t *scale_target_ref; //model int target_cpu_utilization_percentage; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_horizontal_pod_autoscaler_spec_t; -v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_create( +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_spec_t *v1_horizontal_pod_autoscaler_spec_create( int max_replicas, int min_replicas, v1_cross_version_object_reference_t *scale_target_ref, diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler_status.c b/kubernetes/model/v1_horizontal_pod_autoscaler_status.c index fc977a90..83ccc5ee 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler_status.c +++ b/kubernetes/model/v1_horizontal_pod_autoscaler_status.c @@ -5,7 +5,7 @@ -v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_create( +static v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_create_internal( int current_cpu_utilization_percentage, int current_replicas, int desired_replicas, @@ -22,14 +22,34 @@ v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_creat v1_horizontal_pod_autoscaler_status_local_var->last_scale_time = last_scale_time; v1_horizontal_pod_autoscaler_status_local_var->observed_generation = observed_generation; + v1_horizontal_pod_autoscaler_status_local_var->_library_owned = 1; return v1_horizontal_pod_autoscaler_status_local_var; } +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_create( + int current_cpu_utilization_percentage, + int current_replicas, + int desired_replicas, + char *last_scale_time, + long observed_generation + ) { + return v1_horizontal_pod_autoscaler_status_create_internal ( + current_cpu_utilization_percentage, + current_replicas, + desired_replicas, + last_scale_time, + observed_generation + ); +} void v1_horizontal_pod_autoscaler_status_free(v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status) { if(NULL == v1_horizontal_pod_autoscaler_status){ return ; } + if(v1_horizontal_pod_autoscaler_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_horizontal_pod_autoscaler_status_free"); + return ; + } listEntry_t *listEntry; if (v1_horizontal_pod_autoscaler_status->last_scale_time) { free(v1_horizontal_pod_autoscaler_status->last_scale_time); @@ -96,6 +116,9 @@ v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_parse // v1_horizontal_pod_autoscaler_status->current_cpu_utilization_percentage cJSON *current_cpu_utilization_percentage = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_statusJSON, "currentCPUUtilizationPercentage"); + if (cJSON_IsNull(current_cpu_utilization_percentage)) { + current_cpu_utilization_percentage = NULL; + } if (current_cpu_utilization_percentage) { if(!cJSON_IsNumber(current_cpu_utilization_percentage)) { @@ -105,6 +128,9 @@ v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_parse // v1_horizontal_pod_autoscaler_status->current_replicas cJSON *current_replicas = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_statusJSON, "currentReplicas"); + if (cJSON_IsNull(current_replicas)) { + current_replicas = NULL; + } if (!current_replicas) { goto end; } @@ -117,6 +143,9 @@ v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_parse // v1_horizontal_pod_autoscaler_status->desired_replicas cJSON *desired_replicas = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_statusJSON, "desiredReplicas"); + if (cJSON_IsNull(desired_replicas)) { + desired_replicas = NULL; + } if (!desired_replicas) { goto end; } @@ -129,6 +158,9 @@ v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_parse // v1_horizontal_pod_autoscaler_status->last_scale_time cJSON *last_scale_time = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_statusJSON, "lastScaleTime"); + if (cJSON_IsNull(last_scale_time)) { + last_scale_time = NULL; + } if (last_scale_time) { if(!cJSON_IsString(last_scale_time) && !cJSON_IsNull(last_scale_time)) { @@ -138,6 +170,9 @@ v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_parse // v1_horizontal_pod_autoscaler_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_horizontal_pod_autoscaler_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -146,7 +181,7 @@ v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_parse } - v1_horizontal_pod_autoscaler_status_local_var = v1_horizontal_pod_autoscaler_status_create ( + v1_horizontal_pod_autoscaler_status_local_var = v1_horizontal_pod_autoscaler_status_create_internal ( current_cpu_utilization_percentage ? current_cpu_utilization_percentage->valuedouble : 0, current_replicas->valuedouble, desired_replicas->valuedouble, diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler_status.h b/kubernetes/model/v1_horizontal_pod_autoscaler_status.h index 6497181e..953cb7a3 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler_status.h +++ b/kubernetes/model/v1_horizontal_pod_autoscaler_status.h @@ -25,9 +25,10 @@ typedef struct v1_horizontal_pod_autoscaler_status_t { char *last_scale_time; //date time long observed_generation; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_horizontal_pod_autoscaler_status_t; -v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_create( +__attribute__((deprecated)) v1_horizontal_pod_autoscaler_status_t *v1_horizontal_pod_autoscaler_status_create( int current_cpu_utilization_percentage, int current_replicas, int desired_replicas, diff --git a/kubernetes/model/v1_host_alias.c b/kubernetes/model/v1_host_alias.c index 8e1d17dc..cc3bf998 100644 --- a/kubernetes/model/v1_host_alias.c +++ b/kubernetes/model/v1_host_alias.c @@ -5,7 +5,7 @@ -v1_host_alias_t *v1_host_alias_create( +static v1_host_alias_t *v1_host_alias_create_internal( list_t *hostnames, char *ip ) { @@ -16,14 +16,28 @@ v1_host_alias_t *v1_host_alias_create( v1_host_alias_local_var->hostnames = hostnames; v1_host_alias_local_var->ip = ip; + v1_host_alias_local_var->_library_owned = 1; return v1_host_alias_local_var; } +__attribute__((deprecated)) v1_host_alias_t *v1_host_alias_create( + list_t *hostnames, + char *ip + ) { + return v1_host_alias_create_internal ( + hostnames, + ip + ); +} void v1_host_alias_free(v1_host_alias_t *v1_host_alias) { if(NULL == v1_host_alias){ return ; } + if(v1_host_alias->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_host_alias_free"); + return ; + } listEntry_t *listEntry; if (v1_host_alias->hostnames) { list_ForEach(listEntry, v1_host_alias->hostnames) { @@ -51,7 +65,7 @@ cJSON *v1_host_alias_convertToJSON(v1_host_alias_t *v1_host_alias) { listEntry_t *hostnamesListEntry; list_ForEach(hostnamesListEntry, v1_host_alias->hostnames) { - if(cJSON_AddStringToObject(hostnames, "", (char*)hostnamesListEntry->data) == NULL) + if(cJSON_AddStringToObject(hostnames, "", hostnamesListEntry->data) == NULL) { goto fail; } @@ -84,6 +98,9 @@ v1_host_alias_t *v1_host_alias_parseFromJSON(cJSON *v1_host_aliasJSON){ // v1_host_alias->hostnames cJSON *hostnames = cJSON_GetObjectItemCaseSensitive(v1_host_aliasJSON, "hostnames"); + if (cJSON_IsNull(hostnames)) { + hostnames = NULL; + } if (hostnames) { cJSON *hostnames_local = NULL; if(!cJSON_IsArray(hostnames)) { @@ -103,6 +120,9 @@ v1_host_alias_t *v1_host_alias_parseFromJSON(cJSON *v1_host_aliasJSON){ // v1_host_alias->ip cJSON *ip = cJSON_GetObjectItemCaseSensitive(v1_host_aliasJSON, "ip"); + if (cJSON_IsNull(ip)) { + ip = NULL; + } if (!ip) { goto end; } @@ -114,7 +134,7 @@ v1_host_alias_t *v1_host_alias_parseFromJSON(cJSON *v1_host_aliasJSON){ } - v1_host_alias_local_var = v1_host_alias_create ( + v1_host_alias_local_var = v1_host_alias_create_internal ( hostnames ? hostnamesList : NULL, strdup(ip->valuestring) ); diff --git a/kubernetes/model/v1_host_alias.h b/kubernetes/model/v1_host_alias.h index 090798b8..a48b52f5 100644 --- a/kubernetes/model/v1_host_alias.h +++ b/kubernetes/model/v1_host_alias.h @@ -22,9 +22,10 @@ typedef struct v1_host_alias_t { list_t *hostnames; //primitive container char *ip; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_host_alias_t; -v1_host_alias_t *v1_host_alias_create( +__attribute__((deprecated)) v1_host_alias_t *v1_host_alias_create( list_t *hostnames, char *ip ); diff --git a/kubernetes/model/v1_host_ip.c b/kubernetes/model/v1_host_ip.c index a6d03bd2..c1816e60 100644 --- a/kubernetes/model/v1_host_ip.c +++ b/kubernetes/model/v1_host_ip.c @@ -5,7 +5,7 @@ -v1_host_ip_t *v1_host_ip_create( +static v1_host_ip_t *v1_host_ip_create_internal( char *ip ) { v1_host_ip_t *v1_host_ip_local_var = malloc(sizeof(v1_host_ip_t)); @@ -14,14 +14,26 @@ v1_host_ip_t *v1_host_ip_create( } v1_host_ip_local_var->ip = ip; + v1_host_ip_local_var->_library_owned = 1; return v1_host_ip_local_var; } +__attribute__((deprecated)) v1_host_ip_t *v1_host_ip_create( + char *ip + ) { + return v1_host_ip_create_internal ( + ip + ); +} void v1_host_ip_free(v1_host_ip_t *v1_host_ip) { if(NULL == v1_host_ip){ return ; } + if(v1_host_ip->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_host_ip_free"); + return ; + } listEntry_t *listEntry; if (v1_host_ip->ip) { free(v1_host_ip->ip); @@ -34,11 +46,12 @@ cJSON *v1_host_ip_convertToJSON(v1_host_ip_t *v1_host_ip) { cJSON *item = cJSON_CreateObject(); // v1_host_ip->ip - if(v1_host_ip->ip) { + if (!v1_host_ip->ip) { + goto fail; + } if(cJSON_AddStringToObject(item, "ip", v1_host_ip->ip) == NULL) { goto fail; //String } - } return item; fail: @@ -54,16 +67,22 @@ v1_host_ip_t *v1_host_ip_parseFromJSON(cJSON *v1_host_ipJSON){ // v1_host_ip->ip cJSON *ip = cJSON_GetObjectItemCaseSensitive(v1_host_ipJSON, "ip"); - if (ip) { - if(!cJSON_IsString(ip) && !cJSON_IsNull(ip)) + if (cJSON_IsNull(ip)) { + ip = NULL; + } + if (!ip) { + goto end; + } + + + if(!cJSON_IsString(ip)) { goto end; //String } - } - v1_host_ip_local_var = v1_host_ip_create ( - ip && !cJSON_IsNull(ip) ? strdup(ip->valuestring) : NULL + v1_host_ip_local_var = v1_host_ip_create_internal ( + strdup(ip->valuestring) ); return v1_host_ip_local_var; diff --git a/kubernetes/model/v1_host_ip.h b/kubernetes/model/v1_host_ip.h index 7e0ae433..6f7e3614 100644 --- a/kubernetes/model/v1_host_ip.h +++ b/kubernetes/model/v1_host_ip.h @@ -21,9 +21,10 @@ typedef struct v1_host_ip_t v1_host_ip_t; typedef struct v1_host_ip_t { char *ip; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_host_ip_t; -v1_host_ip_t *v1_host_ip_create( +__attribute__((deprecated)) v1_host_ip_t *v1_host_ip_create( char *ip ); diff --git a/kubernetes/model/v1_host_path_volume_source.c b/kubernetes/model/v1_host_path_volume_source.c index 71b83626..12b44153 100644 --- a/kubernetes/model/v1_host_path_volume_source.c +++ b/kubernetes/model/v1_host_path_volume_source.c @@ -5,7 +5,7 @@ -v1_host_path_volume_source_t *v1_host_path_volume_source_create( +static v1_host_path_volume_source_t *v1_host_path_volume_source_create_internal( char *path, char *type ) { @@ -16,14 +16,28 @@ v1_host_path_volume_source_t *v1_host_path_volume_source_create( v1_host_path_volume_source_local_var->path = path; v1_host_path_volume_source_local_var->type = type; + v1_host_path_volume_source_local_var->_library_owned = 1; return v1_host_path_volume_source_local_var; } +__attribute__((deprecated)) v1_host_path_volume_source_t *v1_host_path_volume_source_create( + char *path, + char *type + ) { + return v1_host_path_volume_source_create_internal ( + path, + type + ); +} void v1_host_path_volume_source_free(v1_host_path_volume_source_t *v1_host_path_volume_source) { if(NULL == v1_host_path_volume_source){ return ; } + if(v1_host_path_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_host_path_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_host_path_volume_source->path) { free(v1_host_path_volume_source->path); @@ -69,6 +83,9 @@ v1_host_path_volume_source_t *v1_host_path_volume_source_parseFromJSON(cJSON *v1 // v1_host_path_volume_source->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_host_path_volume_sourceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -81,6 +98,9 @@ v1_host_path_volume_source_t *v1_host_path_volume_source_parseFromJSON(cJSON *v1 // v1_host_path_volume_source->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_host_path_volume_sourceJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -89,7 +109,7 @@ v1_host_path_volume_source_t *v1_host_path_volume_source_parseFromJSON(cJSON *v1 } - v1_host_path_volume_source_local_var = v1_host_path_volume_source_create ( + v1_host_path_volume_source_local_var = v1_host_path_volume_source_create_internal ( strdup(path->valuestring), type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL ); diff --git a/kubernetes/model/v1_host_path_volume_source.h b/kubernetes/model/v1_host_path_volume_source.h index 074a9f79..88d2c6d3 100644 --- a/kubernetes/model/v1_host_path_volume_source.h +++ b/kubernetes/model/v1_host_path_volume_source.h @@ -22,9 +22,10 @@ typedef struct v1_host_path_volume_source_t { char *path; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_host_path_volume_source_t; -v1_host_path_volume_source_t *v1_host_path_volume_source_create( +__attribute__((deprecated)) v1_host_path_volume_source_t *v1_host_path_volume_source_create( char *path, char *type ); diff --git a/kubernetes/model/v1_http_get_action.c b/kubernetes/model/v1_http_get_action.c index 0bc2f4a5..9a1faa94 100644 --- a/kubernetes/model/v1_http_get_action.c +++ b/kubernetes/model/v1_http_get_action.c @@ -5,7 +5,7 @@ -v1_http_get_action_t *v1_http_get_action_create( +static v1_http_get_action_t *v1_http_get_action_create_internal( char *host, list_t *http_headers, char *path, @@ -22,14 +22,34 @@ v1_http_get_action_t *v1_http_get_action_create( v1_http_get_action_local_var->port = port; v1_http_get_action_local_var->scheme = scheme; + v1_http_get_action_local_var->_library_owned = 1; return v1_http_get_action_local_var; } +__attribute__((deprecated)) v1_http_get_action_t *v1_http_get_action_create( + char *host, + list_t *http_headers, + char *path, + int_or_string_t *port, + char *scheme + ) { + return v1_http_get_action_create_internal ( + host, + http_headers, + path, + port, + scheme + ); +} void v1_http_get_action_free(v1_http_get_action_t *v1_http_get_action) { if(NULL == v1_http_get_action){ return ; } + if(v1_http_get_action->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_http_get_action_free"); + return ; + } listEntry_t *listEntry; if (v1_http_get_action->host) { free(v1_http_get_action->host); @@ -137,6 +157,9 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action // v1_http_get_action->host cJSON *host = cJSON_GetObjectItemCaseSensitive(v1_http_get_actionJSON, "host"); + if (cJSON_IsNull(host)) { + host = NULL; + } if (host) { if(!cJSON_IsString(host) && !cJSON_IsNull(host)) { @@ -146,6 +169,9 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action // v1_http_get_action->http_headers cJSON *http_headers = cJSON_GetObjectItemCaseSensitive(v1_http_get_actionJSON, "httpHeaders"); + if (cJSON_IsNull(http_headers)) { + http_headers = NULL; + } if (http_headers) { cJSON *http_headers_local_nonprimitive = NULL; if(!cJSON_IsArray(http_headers)){ @@ -167,6 +193,9 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action // v1_http_get_action->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_http_get_actionJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (path) { if(!cJSON_IsString(path) && !cJSON_IsNull(path)) { @@ -176,6 +205,9 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action // v1_http_get_action->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_http_get_actionJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -185,6 +217,9 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action // v1_http_get_action->scheme cJSON *scheme = cJSON_GetObjectItemCaseSensitive(v1_http_get_actionJSON, "scheme"); + if (cJSON_IsNull(scheme)) { + scheme = NULL; + } if (scheme) { if(!cJSON_IsString(scheme) && !cJSON_IsNull(scheme)) { @@ -193,7 +228,7 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action } - v1_http_get_action_local_var = v1_http_get_action_create ( + v1_http_get_action_local_var = v1_http_get_action_create_internal ( host && !cJSON_IsNull(host) ? strdup(host->valuestring) : NULL, http_headers ? http_headersList : NULL, path && !cJSON_IsNull(path) ? strdup(path->valuestring) : NULL, diff --git a/kubernetes/model/v1_http_get_action.h b/kubernetes/model/v1_http_get_action.h index b7c4f2d0..479ea8b9 100644 --- a/kubernetes/model/v1_http_get_action.h +++ b/kubernetes/model/v1_http_get_action.h @@ -27,9 +27,10 @@ typedef struct v1_http_get_action_t { int_or_string_t *port; // custom char *scheme; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_http_get_action_t; -v1_http_get_action_t *v1_http_get_action_create( +__attribute__((deprecated)) v1_http_get_action_t *v1_http_get_action_create( char *host, list_t *http_headers, char *path, diff --git a/kubernetes/model/v1_http_header.c b/kubernetes/model/v1_http_header.c index 6a955cad..ece46066 100644 --- a/kubernetes/model/v1_http_header.c +++ b/kubernetes/model/v1_http_header.c @@ -5,7 +5,7 @@ -v1_http_header_t *v1_http_header_create( +static v1_http_header_t *v1_http_header_create_internal( char *name, char *value ) { @@ -16,14 +16,28 @@ v1_http_header_t *v1_http_header_create( v1_http_header_local_var->name = name; v1_http_header_local_var->value = value; + v1_http_header_local_var->_library_owned = 1; return v1_http_header_local_var; } +__attribute__((deprecated)) v1_http_header_t *v1_http_header_create( + char *name, + char *value + ) { + return v1_http_header_create_internal ( + name, + value + ); +} void v1_http_header_free(v1_http_header_t *v1_http_header) { if(NULL == v1_http_header){ return ; } + if(v1_http_header->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_http_header_free"); + return ; + } listEntry_t *listEntry; if (v1_http_header->name) { free(v1_http_header->name); @@ -70,6 +84,9 @@ v1_http_header_t *v1_http_header_parseFromJSON(cJSON *v1_http_headerJSON){ // v1_http_header->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_http_headerJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -82,6 +99,9 @@ v1_http_header_t *v1_http_header_parseFromJSON(cJSON *v1_http_headerJSON){ // v1_http_header->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_http_headerJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (!value) { goto end; } @@ -93,7 +113,7 @@ v1_http_header_t *v1_http_header_parseFromJSON(cJSON *v1_http_headerJSON){ } - v1_http_header_local_var = v1_http_header_create ( + v1_http_header_local_var = v1_http_header_create_internal ( strdup(name->valuestring), strdup(value->valuestring) ); diff --git a/kubernetes/model/v1_http_header.h b/kubernetes/model/v1_http_header.h index 99a4af08..65378774 100644 --- a/kubernetes/model/v1_http_header.h +++ b/kubernetes/model/v1_http_header.h @@ -22,9 +22,10 @@ typedef struct v1_http_header_t { char *name; // string char *value; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_http_header_t; -v1_http_header_t *v1_http_header_create( +__attribute__((deprecated)) v1_http_header_t *v1_http_header_create( char *name, char *value ); diff --git a/kubernetes/model/v1_http_ingress_path.c b/kubernetes/model/v1_http_ingress_path.c index 1a9ee969..63b47872 100644 --- a/kubernetes/model/v1_http_ingress_path.c +++ b/kubernetes/model/v1_http_ingress_path.c @@ -5,7 +5,7 @@ -v1_http_ingress_path_t *v1_http_ingress_path_create( +static v1_http_ingress_path_t *v1_http_ingress_path_create_internal( v1_ingress_backend_t *backend, char *path, char *path_type @@ -18,14 +18,30 @@ v1_http_ingress_path_t *v1_http_ingress_path_create( v1_http_ingress_path_local_var->path = path; v1_http_ingress_path_local_var->path_type = path_type; + v1_http_ingress_path_local_var->_library_owned = 1; return v1_http_ingress_path_local_var; } +__attribute__((deprecated)) v1_http_ingress_path_t *v1_http_ingress_path_create( + v1_ingress_backend_t *backend, + char *path, + char *path_type + ) { + return v1_http_ingress_path_create_internal ( + backend, + path, + path_type + ); +} void v1_http_ingress_path_free(v1_http_ingress_path_t *v1_http_ingress_path) { if(NULL == v1_http_ingress_path){ return ; } + if(v1_http_ingress_path->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_http_ingress_path_free"); + return ; + } listEntry_t *listEntry; if (v1_http_ingress_path->backend) { v1_ingress_backend_free(v1_http_ingress_path->backend); @@ -92,6 +108,9 @@ v1_http_ingress_path_t *v1_http_ingress_path_parseFromJSON(cJSON *v1_http_ingres // v1_http_ingress_path->backend cJSON *backend = cJSON_GetObjectItemCaseSensitive(v1_http_ingress_pathJSON, "backend"); + if (cJSON_IsNull(backend)) { + backend = NULL; + } if (!backend) { goto end; } @@ -101,6 +120,9 @@ v1_http_ingress_path_t *v1_http_ingress_path_parseFromJSON(cJSON *v1_http_ingres // v1_http_ingress_path->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_http_ingress_pathJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (path) { if(!cJSON_IsString(path) && !cJSON_IsNull(path)) { @@ -110,6 +132,9 @@ v1_http_ingress_path_t *v1_http_ingress_path_parseFromJSON(cJSON *v1_http_ingres // v1_http_ingress_path->path_type cJSON *path_type = cJSON_GetObjectItemCaseSensitive(v1_http_ingress_pathJSON, "pathType"); + if (cJSON_IsNull(path_type)) { + path_type = NULL; + } if (!path_type) { goto end; } @@ -121,7 +146,7 @@ v1_http_ingress_path_t *v1_http_ingress_path_parseFromJSON(cJSON *v1_http_ingres } - v1_http_ingress_path_local_var = v1_http_ingress_path_create ( + v1_http_ingress_path_local_var = v1_http_ingress_path_create_internal ( backend_local_nonprim, path && !cJSON_IsNull(path) ? strdup(path->valuestring) : NULL, strdup(path_type->valuestring) diff --git a/kubernetes/model/v1_http_ingress_path.h b/kubernetes/model/v1_http_ingress_path.h index ac5aec83..8229971d 100644 --- a/kubernetes/model/v1_http_ingress_path.h +++ b/kubernetes/model/v1_http_ingress_path.h @@ -24,9 +24,10 @@ typedef struct v1_http_ingress_path_t { char *path; // string char *path_type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_http_ingress_path_t; -v1_http_ingress_path_t *v1_http_ingress_path_create( +__attribute__((deprecated)) v1_http_ingress_path_t *v1_http_ingress_path_create( v1_ingress_backend_t *backend, char *path, char *path_type diff --git a/kubernetes/model/v1_http_ingress_rule_value.c b/kubernetes/model/v1_http_ingress_rule_value.c index abf33790..999c03a5 100644 --- a/kubernetes/model/v1_http_ingress_rule_value.c +++ b/kubernetes/model/v1_http_ingress_rule_value.c @@ -5,7 +5,7 @@ -v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_create( +static v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_create_internal( list_t *paths ) { v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_local_var = malloc(sizeof(v1_http_ingress_rule_value_t)); @@ -14,14 +14,26 @@ v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_create( } v1_http_ingress_rule_value_local_var->paths = paths; + v1_http_ingress_rule_value_local_var->_library_owned = 1; return v1_http_ingress_rule_value_local_var; } +__attribute__((deprecated)) v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_create( + list_t *paths + ) { + return v1_http_ingress_rule_value_create_internal ( + paths + ); +} void v1_http_ingress_rule_value_free(v1_http_ingress_rule_value_t *v1_http_ingress_rule_value) { if(NULL == v1_http_ingress_rule_value){ return ; } + if(v1_http_ingress_rule_value->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_http_ingress_rule_value_free"); + return ; + } listEntry_t *listEntry; if (v1_http_ingress_rule_value->paths) { list_ForEach(listEntry, v1_http_ingress_rule_value->paths) { @@ -73,6 +85,9 @@ v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_parseFromJSON(cJSON *v1 // v1_http_ingress_rule_value->paths cJSON *paths = cJSON_GetObjectItemCaseSensitive(v1_http_ingress_rule_valueJSON, "paths"); + if (cJSON_IsNull(paths)) { + paths = NULL; + } if (!paths) { goto end; } @@ -96,7 +111,7 @@ v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_parseFromJSON(cJSON *v1 } - v1_http_ingress_rule_value_local_var = v1_http_ingress_rule_value_create ( + v1_http_ingress_rule_value_local_var = v1_http_ingress_rule_value_create_internal ( pathsList ); diff --git a/kubernetes/model/v1_http_ingress_rule_value.h b/kubernetes/model/v1_http_ingress_rule_value.h index 25f0e0ad..007dde47 100644 --- a/kubernetes/model/v1_http_ingress_rule_value.h +++ b/kubernetes/model/v1_http_ingress_rule_value.h @@ -22,9 +22,10 @@ typedef struct v1_http_ingress_rule_value_t v1_http_ingress_rule_value_t; typedef struct v1_http_ingress_rule_value_t { list_t *paths; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_http_ingress_rule_value_t; -v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_create( +__attribute__((deprecated)) v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_create( list_t *paths ); diff --git a/kubernetes/model/v1_image_volume_source.c b/kubernetes/model/v1_image_volume_source.c new file mode 100644 index 00000000..487e12c1 --- /dev/null +++ b/kubernetes/model/v1_image_volume_source.c @@ -0,0 +1,117 @@ +#include +#include +#include +#include "v1_image_volume_source.h" + + + +static v1_image_volume_source_t *v1_image_volume_source_create_internal( + char *pull_policy, + char *reference + ) { + v1_image_volume_source_t *v1_image_volume_source_local_var = malloc(sizeof(v1_image_volume_source_t)); + if (!v1_image_volume_source_local_var) { + return NULL; + } + v1_image_volume_source_local_var->pull_policy = pull_policy; + v1_image_volume_source_local_var->reference = reference; + + v1_image_volume_source_local_var->_library_owned = 1; + return v1_image_volume_source_local_var; +} + +__attribute__((deprecated)) v1_image_volume_source_t *v1_image_volume_source_create( + char *pull_policy, + char *reference + ) { + return v1_image_volume_source_create_internal ( + pull_policy, + reference + ); +} + +void v1_image_volume_source_free(v1_image_volume_source_t *v1_image_volume_source) { + if(NULL == v1_image_volume_source){ + return ; + } + if(v1_image_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_image_volume_source_free"); + return ; + } + listEntry_t *listEntry; + if (v1_image_volume_source->pull_policy) { + free(v1_image_volume_source->pull_policy); + v1_image_volume_source->pull_policy = NULL; + } + if (v1_image_volume_source->reference) { + free(v1_image_volume_source->reference); + v1_image_volume_source->reference = NULL; + } + free(v1_image_volume_source); +} + +cJSON *v1_image_volume_source_convertToJSON(v1_image_volume_source_t *v1_image_volume_source) { + cJSON *item = cJSON_CreateObject(); + + // v1_image_volume_source->pull_policy + if(v1_image_volume_source->pull_policy) { + if(cJSON_AddStringToObject(item, "pullPolicy", v1_image_volume_source->pull_policy) == NULL) { + goto fail; //String + } + } + + + // v1_image_volume_source->reference + if(v1_image_volume_source->reference) { + if(cJSON_AddStringToObject(item, "reference", v1_image_volume_source->reference) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_image_volume_source_t *v1_image_volume_source_parseFromJSON(cJSON *v1_image_volume_sourceJSON){ + + v1_image_volume_source_t *v1_image_volume_source_local_var = NULL; + + // v1_image_volume_source->pull_policy + cJSON *pull_policy = cJSON_GetObjectItemCaseSensitive(v1_image_volume_sourceJSON, "pullPolicy"); + if (cJSON_IsNull(pull_policy)) { + pull_policy = NULL; + } + if (pull_policy) { + if(!cJSON_IsString(pull_policy) && !cJSON_IsNull(pull_policy)) + { + goto end; //String + } + } + + // v1_image_volume_source->reference + cJSON *reference = cJSON_GetObjectItemCaseSensitive(v1_image_volume_sourceJSON, "reference"); + if (cJSON_IsNull(reference)) { + reference = NULL; + } + if (reference) { + if(!cJSON_IsString(reference) && !cJSON_IsNull(reference)) + { + goto end; //String + } + } + + + v1_image_volume_source_local_var = v1_image_volume_source_create_internal ( + pull_policy && !cJSON_IsNull(pull_policy) ? strdup(pull_policy->valuestring) : NULL, + reference && !cJSON_IsNull(reference) ? strdup(reference->valuestring) : NULL + ); + + return v1_image_volume_source_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_image_volume_source.h b/kubernetes/model/v1_image_volume_source.h new file mode 100644 index 00000000..8edbd357 --- /dev/null +++ b/kubernetes/model/v1_image_volume_source.h @@ -0,0 +1,40 @@ +/* + * v1_image_volume_source.h + * + * ImageVolumeSource represents a image volume resource. + */ + +#ifndef _v1_image_volume_source_H_ +#define _v1_image_volume_source_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_image_volume_source_t v1_image_volume_source_t; + + + + +typedef struct v1_image_volume_source_t { + char *pull_policy; // string + char *reference; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_image_volume_source_t; + +__attribute__((deprecated)) v1_image_volume_source_t *v1_image_volume_source_create( + char *pull_policy, + char *reference +); + +void v1_image_volume_source_free(v1_image_volume_source_t *v1_image_volume_source); + +v1_image_volume_source_t *v1_image_volume_source_parseFromJSON(cJSON *v1_image_volume_sourceJSON); + +cJSON *v1_image_volume_source_convertToJSON(v1_image_volume_source_t *v1_image_volume_source); + +#endif /* _v1_image_volume_source_H_ */ + diff --git a/kubernetes/model/v1_ingress.c b/kubernetes/model/v1_ingress.c index 5f2c8941..79dcdbd1 100644 --- a/kubernetes/model/v1_ingress.c +++ b/kubernetes/model/v1_ingress.c @@ -5,7 +5,7 @@ -v1_ingress_t *v1_ingress_create( +static v1_ingress_t *v1_ingress_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_ingress_t *v1_ingress_create( v1_ingress_local_var->spec = spec; v1_ingress_local_var->status = status; + v1_ingress_local_var->_library_owned = 1; return v1_ingress_local_var; } +__attribute__((deprecated)) v1_ingress_t *v1_ingress_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_ingress_spec_t *spec, + v1_ingress_status_t *status + ) { + return v1_ingress_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_ingress_free(v1_ingress_t *v1_ingress) { if(NULL == v1_ingress){ return ; } + if(v1_ingress->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress->api_version) { free(v1_ingress->api_version); @@ -134,6 +154,9 @@ v1_ingress_t *v1_ingress_parseFromJSON(cJSON *v1_ingressJSON){ // v1_ingress->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_ingressJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_ingress_t *v1_ingress_parseFromJSON(cJSON *v1_ingressJSON){ // v1_ingress->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_ingressJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_ingress_t *v1_ingress_parseFromJSON(cJSON *v1_ingressJSON){ // v1_ingress->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_ingressJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_ingress->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_ingressJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_ingress_spec_parseFromJSON(spec); //nonprimitive } // v1_ingress->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_ingressJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_ingress_status_parseFromJSON(status); //nonprimitive } - v1_ingress_local_var = v1_ingress_create ( + v1_ingress_local_var = v1_ingress_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_ingress.h b/kubernetes/model/v1_ingress.h index 5891ca74..2e568426 100644 --- a/kubernetes/model/v1_ingress.h +++ b/kubernetes/model/v1_ingress.h @@ -28,9 +28,10 @@ typedef struct v1_ingress_t { struct v1_ingress_spec_t *spec; //model struct v1_ingress_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_t; -v1_ingress_t *v1_ingress_create( +__attribute__((deprecated)) v1_ingress_t *v1_ingress_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_ingress_backend.c b/kubernetes/model/v1_ingress_backend.c index 949c115a..ad80085d 100644 --- a/kubernetes/model/v1_ingress_backend.c +++ b/kubernetes/model/v1_ingress_backend.c @@ -5,7 +5,7 @@ -v1_ingress_backend_t *v1_ingress_backend_create( +static v1_ingress_backend_t *v1_ingress_backend_create_internal( v1_typed_local_object_reference_t *resource, v1_ingress_service_backend_t *service ) { @@ -16,14 +16,28 @@ v1_ingress_backend_t *v1_ingress_backend_create( v1_ingress_backend_local_var->resource = resource; v1_ingress_backend_local_var->service = service; + v1_ingress_backend_local_var->_library_owned = 1; return v1_ingress_backend_local_var; } +__attribute__((deprecated)) v1_ingress_backend_t *v1_ingress_backend_create( + v1_typed_local_object_reference_t *resource, + v1_ingress_service_backend_t *service + ) { + return v1_ingress_backend_create_internal ( + resource, + service + ); +} void v1_ingress_backend_free(v1_ingress_backend_t *v1_ingress_backend) { if(NULL == v1_ingress_backend){ return ; } + if(v1_ingress_backend->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_backend_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_backend->resource) { v1_typed_local_object_reference_free(v1_ingress_backend->resource); @@ -84,18 +98,24 @@ v1_ingress_backend_t *v1_ingress_backend_parseFromJSON(cJSON *v1_ingress_backend // v1_ingress_backend->resource cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1_ingress_backendJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } if (resource) { resource_local_nonprim = v1_typed_local_object_reference_parseFromJSON(resource); //nonprimitive } // v1_ingress_backend->service cJSON *service = cJSON_GetObjectItemCaseSensitive(v1_ingress_backendJSON, "service"); + if (cJSON_IsNull(service)) { + service = NULL; + } if (service) { service_local_nonprim = v1_ingress_service_backend_parseFromJSON(service); //nonprimitive } - v1_ingress_backend_local_var = v1_ingress_backend_create ( + v1_ingress_backend_local_var = v1_ingress_backend_create_internal ( resource ? resource_local_nonprim : NULL, service ? service_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_ingress_backend.h b/kubernetes/model/v1_ingress_backend.h index 89ea14c4..f79b44ad 100644 --- a/kubernetes/model/v1_ingress_backend.h +++ b/kubernetes/model/v1_ingress_backend.h @@ -24,9 +24,10 @@ typedef struct v1_ingress_backend_t { struct v1_typed_local_object_reference_t *resource; //model struct v1_ingress_service_backend_t *service; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_backend_t; -v1_ingress_backend_t *v1_ingress_backend_create( +__attribute__((deprecated)) v1_ingress_backend_t *v1_ingress_backend_create( v1_typed_local_object_reference_t *resource, v1_ingress_service_backend_t *service ); diff --git a/kubernetes/model/v1_ingress_class.c b/kubernetes/model/v1_ingress_class.c index ebe925b3..2cdf9ef5 100644 --- a/kubernetes/model/v1_ingress_class.c +++ b/kubernetes/model/v1_ingress_class.c @@ -5,7 +5,7 @@ -v1_ingress_class_t *v1_ingress_class_create( +static v1_ingress_class_t *v1_ingress_class_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_ingress_class_t *v1_ingress_class_create( v1_ingress_class_local_var->metadata = metadata; v1_ingress_class_local_var->spec = spec; + v1_ingress_class_local_var->_library_owned = 1; return v1_ingress_class_local_var; } +__attribute__((deprecated)) v1_ingress_class_t *v1_ingress_class_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_ingress_class_spec_t *spec + ) { + return v1_ingress_class_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1_ingress_class_free(v1_ingress_class_t *v1_ingress_class) { if(NULL == v1_ingress_class){ return ; } + if(v1_ingress_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_class_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_class->api_version) { free(v1_ingress_class->api_version); @@ -112,6 +130,9 @@ v1_ingress_class_t *v1_ingress_class_parseFromJSON(cJSON *v1_ingress_classJSON){ // v1_ingress_class->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_ingress_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,6 +142,9 @@ v1_ingress_class_t *v1_ingress_class_parseFromJSON(cJSON *v1_ingress_classJSON){ // v1_ingress_class->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_ingress_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -130,18 +154,24 @@ v1_ingress_class_t *v1_ingress_class_parseFromJSON(cJSON *v1_ingress_classJSON){ // v1_ingress_class->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_ingress_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_ingress_class->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_ingress_classJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_ingress_class_spec_parseFromJSON(spec); //nonprimitive } - v1_ingress_class_local_var = v1_ingress_class_create ( + v1_ingress_class_local_var = v1_ingress_class_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_ingress_class.h b/kubernetes/model/v1_ingress_class.h index 6551618e..762399b2 100644 --- a/kubernetes/model/v1_ingress_class.h +++ b/kubernetes/model/v1_ingress_class.h @@ -26,9 +26,10 @@ typedef struct v1_ingress_class_t { struct v1_object_meta_t *metadata; //model struct v1_ingress_class_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_class_t; -v1_ingress_class_t *v1_ingress_class_create( +__attribute__((deprecated)) v1_ingress_class_t *v1_ingress_class_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_ingress_class_list.c b/kubernetes/model/v1_ingress_class_list.c index 7c902b54..e687d675 100644 --- a/kubernetes/model/v1_ingress_class_list.c +++ b/kubernetes/model/v1_ingress_class_list.c @@ -5,7 +5,7 @@ -v1_ingress_class_list_t *v1_ingress_class_list_create( +static v1_ingress_class_list_t *v1_ingress_class_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_ingress_class_list_t *v1_ingress_class_list_create( v1_ingress_class_list_local_var->kind = kind; v1_ingress_class_list_local_var->metadata = metadata; + v1_ingress_class_list_local_var->_library_owned = 1; return v1_ingress_class_list_local_var; } +__attribute__((deprecated)) v1_ingress_class_list_t *v1_ingress_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_ingress_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_ingress_class_list_free(v1_ingress_class_list_t *v1_ingress_class_list) { if(NULL == v1_ingress_class_list){ return ; } + if(v1_ingress_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_class_list_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_class_list->api_version) { free(v1_ingress_class_list->api_version); @@ -123,6 +141,9 @@ v1_ingress_class_list_t *v1_ingress_class_list_parseFromJSON(cJSON *v1_ingress_c // v1_ingress_class_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_ingress_class_list_t *v1_ingress_class_list_parseFromJSON(cJSON *v1_ingress_c // v1_ingress_class_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_ingress_class_list_t *v1_ingress_class_list_parseFromJSON(cJSON *v1_ingress_c // v1_ingress_class_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_ingress_class_list_t *v1_ingress_class_list_parseFromJSON(cJSON *v1_ingress_c // v1_ingress_class_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_ingress_class_list_local_var = v1_ingress_class_list_create ( + v1_ingress_class_list_local_var = v1_ingress_class_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_ingress_class_list.h b/kubernetes/model/v1_ingress_class_list.h index 94eb00cd..deeed480 100644 --- a/kubernetes/model/v1_ingress_class_list.h +++ b/kubernetes/model/v1_ingress_class_list.h @@ -26,9 +26,10 @@ typedef struct v1_ingress_class_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_class_list_t; -v1_ingress_class_list_t *v1_ingress_class_list_create( +__attribute__((deprecated)) v1_ingress_class_list_t *v1_ingress_class_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_ingress_class_parameters_reference.c b/kubernetes/model/v1_ingress_class_parameters_reference.c index d8aae0e2..0643270b 100644 --- a/kubernetes/model/v1_ingress_class_parameters_reference.c +++ b/kubernetes/model/v1_ingress_class_parameters_reference.c @@ -5,7 +5,7 @@ -v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_create( +static v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_create_internal( char *api_group, char *kind, char *name, @@ -22,14 +22,34 @@ v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_c v1_ingress_class_parameters_reference_local_var->_namespace = _namespace; v1_ingress_class_parameters_reference_local_var->scope = scope; + v1_ingress_class_parameters_reference_local_var->_library_owned = 1; return v1_ingress_class_parameters_reference_local_var; } +__attribute__((deprecated)) v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_create( + char *api_group, + char *kind, + char *name, + char *_namespace, + char *scope + ) { + return v1_ingress_class_parameters_reference_create_internal ( + api_group, + kind, + name, + _namespace, + scope + ); +} void v1_ingress_class_parameters_reference_free(v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference) { if(NULL == v1_ingress_class_parameters_reference){ return ; } + if(v1_ingress_class_parameters_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_class_parameters_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_class_parameters_reference->api_group) { free(v1_ingress_class_parameters_reference->api_group); @@ -112,6 +132,9 @@ v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_p // v1_ingress_class_parameters_reference->api_group cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_parameters_referenceJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } if (api_group) { if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) { @@ -121,6 +144,9 @@ v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_p // v1_ingress_class_parameters_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_parameters_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -133,6 +159,9 @@ v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_p // v1_ingress_class_parameters_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_parameters_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -145,6 +174,9 @@ v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_p // v1_ingress_class_parameters_reference->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_parameters_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -154,6 +186,9 @@ v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_p // v1_ingress_class_parameters_reference->scope cJSON *scope = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_parameters_referenceJSON, "scope"); + if (cJSON_IsNull(scope)) { + scope = NULL; + } if (scope) { if(!cJSON_IsString(scope) && !cJSON_IsNull(scope)) { @@ -162,7 +197,7 @@ v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_p } - v1_ingress_class_parameters_reference_local_var = v1_ingress_class_parameters_reference_create ( + v1_ingress_class_parameters_reference_local_var = v1_ingress_class_parameters_reference_create_internal ( api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, strdup(kind->valuestring), strdup(name->valuestring), diff --git a/kubernetes/model/v1_ingress_class_parameters_reference.h b/kubernetes/model/v1_ingress_class_parameters_reference.h index 22d0fcbc..e2f2dfdb 100644 --- a/kubernetes/model/v1_ingress_class_parameters_reference.h +++ b/kubernetes/model/v1_ingress_class_parameters_reference.h @@ -25,9 +25,10 @@ typedef struct v1_ingress_class_parameters_reference_t { char *_namespace; // string char *scope; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_class_parameters_reference_t; -v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_create( +__attribute__((deprecated)) v1_ingress_class_parameters_reference_t *v1_ingress_class_parameters_reference_create( char *api_group, char *kind, char *name, diff --git a/kubernetes/model/v1_ingress_class_spec.c b/kubernetes/model/v1_ingress_class_spec.c index a17355a9..d98d39f4 100644 --- a/kubernetes/model/v1_ingress_class_spec.c +++ b/kubernetes/model/v1_ingress_class_spec.c @@ -5,7 +5,7 @@ -v1_ingress_class_spec_t *v1_ingress_class_spec_create( +static v1_ingress_class_spec_t *v1_ingress_class_spec_create_internal( char *controller, v1_ingress_class_parameters_reference_t *parameters ) { @@ -16,14 +16,28 @@ v1_ingress_class_spec_t *v1_ingress_class_spec_create( v1_ingress_class_spec_local_var->controller = controller; v1_ingress_class_spec_local_var->parameters = parameters; + v1_ingress_class_spec_local_var->_library_owned = 1; return v1_ingress_class_spec_local_var; } +__attribute__((deprecated)) v1_ingress_class_spec_t *v1_ingress_class_spec_create( + char *controller, + v1_ingress_class_parameters_reference_t *parameters + ) { + return v1_ingress_class_spec_create_internal ( + controller, + parameters + ); +} void v1_ingress_class_spec_free(v1_ingress_class_spec_t *v1_ingress_class_spec) { if(NULL == v1_ingress_class_spec){ return ; } + if(v1_ingress_class_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_class_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_class_spec->controller) { free(v1_ingress_class_spec->controller); @@ -76,6 +90,9 @@ v1_ingress_class_spec_t *v1_ingress_class_spec_parseFromJSON(cJSON *v1_ingress_c // v1_ingress_class_spec->controller cJSON *controller = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_specJSON, "controller"); + if (cJSON_IsNull(controller)) { + controller = NULL; + } if (controller) { if(!cJSON_IsString(controller) && !cJSON_IsNull(controller)) { @@ -85,12 +102,15 @@ v1_ingress_class_spec_t *v1_ingress_class_spec_parseFromJSON(cJSON *v1_ingress_c // v1_ingress_class_spec->parameters cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1_ingress_class_specJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } if (parameters) { parameters_local_nonprim = v1_ingress_class_parameters_reference_parseFromJSON(parameters); //nonprimitive } - v1_ingress_class_spec_local_var = v1_ingress_class_spec_create ( + v1_ingress_class_spec_local_var = v1_ingress_class_spec_create_internal ( controller && !cJSON_IsNull(controller) ? strdup(controller->valuestring) : NULL, parameters ? parameters_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_ingress_class_spec.h b/kubernetes/model/v1_ingress_class_spec.h index 14d241c8..f04f2e60 100644 --- a/kubernetes/model/v1_ingress_class_spec.h +++ b/kubernetes/model/v1_ingress_class_spec.h @@ -23,9 +23,10 @@ typedef struct v1_ingress_class_spec_t { char *controller; // string struct v1_ingress_class_parameters_reference_t *parameters; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_class_spec_t; -v1_ingress_class_spec_t *v1_ingress_class_spec_create( +__attribute__((deprecated)) v1_ingress_class_spec_t *v1_ingress_class_spec_create( char *controller, v1_ingress_class_parameters_reference_t *parameters ); diff --git a/kubernetes/model/v1_ingress_list.c b/kubernetes/model/v1_ingress_list.c index 880c1018..a388fdd1 100644 --- a/kubernetes/model/v1_ingress_list.c +++ b/kubernetes/model/v1_ingress_list.c @@ -5,7 +5,7 @@ -v1_ingress_list_t *v1_ingress_list_create( +static v1_ingress_list_t *v1_ingress_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_ingress_list_t *v1_ingress_list_create( v1_ingress_list_local_var->kind = kind; v1_ingress_list_local_var->metadata = metadata; + v1_ingress_list_local_var->_library_owned = 1; return v1_ingress_list_local_var; } +__attribute__((deprecated)) v1_ingress_list_t *v1_ingress_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_ingress_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_ingress_list_free(v1_ingress_list_t *v1_ingress_list) { if(NULL == v1_ingress_list){ return ; } + if(v1_ingress_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_list_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_list->api_version) { free(v1_ingress_list->api_version); @@ -123,6 +141,9 @@ v1_ingress_list_t *v1_ingress_list_parseFromJSON(cJSON *v1_ingress_listJSON){ // v1_ingress_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_ingress_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_ingress_list_t *v1_ingress_list_parseFromJSON(cJSON *v1_ingress_listJSON){ // v1_ingress_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_ingress_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_ingress_list_t *v1_ingress_list_parseFromJSON(cJSON *v1_ingress_listJSON){ // v1_ingress_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_ingress_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_ingress_list_t *v1_ingress_list_parseFromJSON(cJSON *v1_ingress_listJSON){ // v1_ingress_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_ingress_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_ingress_list_local_var = v1_ingress_list_create ( + v1_ingress_list_local_var = v1_ingress_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_ingress_list.h b/kubernetes/model/v1_ingress_list.h index f5f92225..e7a22705 100644 --- a/kubernetes/model/v1_ingress_list.h +++ b/kubernetes/model/v1_ingress_list.h @@ -26,9 +26,10 @@ typedef struct v1_ingress_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_list_t; -v1_ingress_list_t *v1_ingress_list_create( +__attribute__((deprecated)) v1_ingress_list_t *v1_ingress_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_ingress_load_balancer_ingress.c b/kubernetes/model/v1_ingress_load_balancer_ingress.c index f04ea4e4..aafbcc9c 100644 --- a/kubernetes/model/v1_ingress_load_balancer_ingress.c +++ b/kubernetes/model/v1_ingress_load_balancer_ingress.c @@ -5,7 +5,7 @@ -v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_create( +static v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_create_internal( char *hostname, char *ip, list_t *ports @@ -18,14 +18,30 @@ v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_create( v1_ingress_load_balancer_ingress_local_var->ip = ip; v1_ingress_load_balancer_ingress_local_var->ports = ports; + v1_ingress_load_balancer_ingress_local_var->_library_owned = 1; return v1_ingress_load_balancer_ingress_local_var; } +__attribute__((deprecated)) v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_create( + char *hostname, + char *ip, + list_t *ports + ) { + return v1_ingress_load_balancer_ingress_create_internal ( + hostname, + ip, + ports + ); +} void v1_ingress_load_balancer_ingress_free(v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress) { if(NULL == v1_ingress_load_balancer_ingress){ return ; } + if(v1_ingress_load_balancer_ingress->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_load_balancer_ingress_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_load_balancer_ingress->hostname) { free(v1_ingress_load_balancer_ingress->hostname); @@ -100,6 +116,9 @@ v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_parseFromJS // v1_ingress_load_balancer_ingress->hostname cJSON *hostname = cJSON_GetObjectItemCaseSensitive(v1_ingress_load_balancer_ingressJSON, "hostname"); + if (cJSON_IsNull(hostname)) { + hostname = NULL; + } if (hostname) { if(!cJSON_IsString(hostname) && !cJSON_IsNull(hostname)) { @@ -109,6 +128,9 @@ v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_parseFromJS // v1_ingress_load_balancer_ingress->ip cJSON *ip = cJSON_GetObjectItemCaseSensitive(v1_ingress_load_balancer_ingressJSON, "ip"); + if (cJSON_IsNull(ip)) { + ip = NULL; + } if (ip) { if(!cJSON_IsString(ip) && !cJSON_IsNull(ip)) { @@ -118,6 +140,9 @@ v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_parseFromJS // v1_ingress_load_balancer_ingress->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_ingress_load_balancer_ingressJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -138,7 +163,7 @@ v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_parseFromJS } - v1_ingress_load_balancer_ingress_local_var = v1_ingress_load_balancer_ingress_create ( + v1_ingress_load_balancer_ingress_local_var = v1_ingress_load_balancer_ingress_create_internal ( hostname && !cJSON_IsNull(hostname) ? strdup(hostname->valuestring) : NULL, ip && !cJSON_IsNull(ip) ? strdup(ip->valuestring) : NULL, ports ? portsList : NULL diff --git a/kubernetes/model/v1_ingress_load_balancer_ingress.h b/kubernetes/model/v1_ingress_load_balancer_ingress.h index b12c8309..e5586a20 100644 --- a/kubernetes/model/v1_ingress_load_balancer_ingress.h +++ b/kubernetes/model/v1_ingress_load_balancer_ingress.h @@ -24,9 +24,10 @@ typedef struct v1_ingress_load_balancer_ingress_t { char *ip; // string list_t *ports; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_load_balancer_ingress_t; -v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_create( +__attribute__((deprecated)) v1_ingress_load_balancer_ingress_t *v1_ingress_load_balancer_ingress_create( char *hostname, char *ip, list_t *ports diff --git a/kubernetes/model/v1_ingress_load_balancer_status.c b/kubernetes/model/v1_ingress_load_balancer_status.c index d0c4d8f8..62c3c5df 100644 --- a/kubernetes/model/v1_ingress_load_balancer_status.c +++ b/kubernetes/model/v1_ingress_load_balancer_status.c @@ -5,7 +5,7 @@ -v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_create( +static v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_create_internal( list_t *ingress ) { v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_local_var = malloc(sizeof(v1_ingress_load_balancer_status_t)); @@ -14,14 +14,26 @@ v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_create( } v1_ingress_load_balancer_status_local_var->ingress = ingress; + v1_ingress_load_balancer_status_local_var->_library_owned = 1; return v1_ingress_load_balancer_status_local_var; } +__attribute__((deprecated)) v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_create( + list_t *ingress + ) { + return v1_ingress_load_balancer_status_create_internal ( + ingress + ); +} void v1_ingress_load_balancer_status_free(v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status) { if(NULL == v1_ingress_load_balancer_status){ return ; } + if(v1_ingress_load_balancer_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_load_balancer_status_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_load_balancer_status->ingress) { list_ForEach(listEntry, v1_ingress_load_balancer_status->ingress) { @@ -72,6 +84,9 @@ v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_parseFromJSON // v1_ingress_load_balancer_status->ingress cJSON *ingress = cJSON_GetObjectItemCaseSensitive(v1_ingress_load_balancer_statusJSON, "ingress"); + if (cJSON_IsNull(ingress)) { + ingress = NULL; + } if (ingress) { cJSON *ingress_local_nonprimitive = NULL; if(!cJSON_IsArray(ingress)){ @@ -92,7 +107,7 @@ v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_parseFromJSON } - v1_ingress_load_balancer_status_local_var = v1_ingress_load_balancer_status_create ( + v1_ingress_load_balancer_status_local_var = v1_ingress_load_balancer_status_create_internal ( ingress ? ingressList : NULL ); diff --git a/kubernetes/model/v1_ingress_load_balancer_status.h b/kubernetes/model/v1_ingress_load_balancer_status.h index 6efdc3d0..3d37cc9c 100644 --- a/kubernetes/model/v1_ingress_load_balancer_status.h +++ b/kubernetes/model/v1_ingress_load_balancer_status.h @@ -22,9 +22,10 @@ typedef struct v1_ingress_load_balancer_status_t v1_ingress_load_balancer_status typedef struct v1_ingress_load_balancer_status_t { list_t *ingress; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_load_balancer_status_t; -v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_create( +__attribute__((deprecated)) v1_ingress_load_balancer_status_t *v1_ingress_load_balancer_status_create( list_t *ingress ); diff --git a/kubernetes/model/v1_ingress_port_status.c b/kubernetes/model/v1_ingress_port_status.c index d665b4e0..c713427d 100644 --- a/kubernetes/model/v1_ingress_port_status.c +++ b/kubernetes/model/v1_ingress_port_status.c @@ -5,7 +5,7 @@ -v1_ingress_port_status_t *v1_ingress_port_status_create( +static v1_ingress_port_status_t *v1_ingress_port_status_create_internal( char *error, int port, char *protocol @@ -18,14 +18,30 @@ v1_ingress_port_status_t *v1_ingress_port_status_create( v1_ingress_port_status_local_var->port = port; v1_ingress_port_status_local_var->protocol = protocol; + v1_ingress_port_status_local_var->_library_owned = 1; return v1_ingress_port_status_local_var; } +__attribute__((deprecated)) v1_ingress_port_status_t *v1_ingress_port_status_create( + char *error, + int port, + char *protocol + ) { + return v1_ingress_port_status_create_internal ( + error, + port, + protocol + ); +} void v1_ingress_port_status_free(v1_ingress_port_status_t *v1_ingress_port_status) { if(NULL == v1_ingress_port_status){ return ; } + if(v1_ingress_port_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_port_status_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_port_status->error) { free(v1_ingress_port_status->error); @@ -80,6 +96,9 @@ v1_ingress_port_status_t *v1_ingress_port_status_parseFromJSON(cJSON *v1_ingress // v1_ingress_port_status->error cJSON *error = cJSON_GetObjectItemCaseSensitive(v1_ingress_port_statusJSON, "error"); + if (cJSON_IsNull(error)) { + error = NULL; + } if (error) { if(!cJSON_IsString(error) && !cJSON_IsNull(error)) { @@ -89,6 +108,9 @@ v1_ingress_port_status_t *v1_ingress_port_status_parseFromJSON(cJSON *v1_ingress // v1_ingress_port_status->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_ingress_port_statusJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -101,6 +123,9 @@ v1_ingress_port_status_t *v1_ingress_port_status_parseFromJSON(cJSON *v1_ingress // v1_ingress_port_status->protocol cJSON *protocol = cJSON_GetObjectItemCaseSensitive(v1_ingress_port_statusJSON, "protocol"); + if (cJSON_IsNull(protocol)) { + protocol = NULL; + } if (!protocol) { goto end; } @@ -112,7 +137,7 @@ v1_ingress_port_status_t *v1_ingress_port_status_parseFromJSON(cJSON *v1_ingress } - v1_ingress_port_status_local_var = v1_ingress_port_status_create ( + v1_ingress_port_status_local_var = v1_ingress_port_status_create_internal ( error && !cJSON_IsNull(error) ? strdup(error->valuestring) : NULL, port->valuedouble, strdup(protocol->valuestring) diff --git a/kubernetes/model/v1_ingress_port_status.h b/kubernetes/model/v1_ingress_port_status.h index a6016a03..97e34e23 100644 --- a/kubernetes/model/v1_ingress_port_status.h +++ b/kubernetes/model/v1_ingress_port_status.h @@ -23,9 +23,10 @@ typedef struct v1_ingress_port_status_t { int port; //numeric char *protocol; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_port_status_t; -v1_ingress_port_status_t *v1_ingress_port_status_create( +__attribute__((deprecated)) v1_ingress_port_status_t *v1_ingress_port_status_create( char *error, int port, char *protocol diff --git a/kubernetes/model/v1_ingress_rule.c b/kubernetes/model/v1_ingress_rule.c index 9eb70041..d1ca9a3a 100644 --- a/kubernetes/model/v1_ingress_rule.c +++ b/kubernetes/model/v1_ingress_rule.c @@ -5,7 +5,7 @@ -v1_ingress_rule_t *v1_ingress_rule_create( +static v1_ingress_rule_t *v1_ingress_rule_create_internal( char *host, v1_http_ingress_rule_value_t *http ) { @@ -16,14 +16,28 @@ v1_ingress_rule_t *v1_ingress_rule_create( v1_ingress_rule_local_var->host = host; v1_ingress_rule_local_var->http = http; + v1_ingress_rule_local_var->_library_owned = 1; return v1_ingress_rule_local_var; } +__attribute__((deprecated)) v1_ingress_rule_t *v1_ingress_rule_create( + char *host, + v1_http_ingress_rule_value_t *http + ) { + return v1_ingress_rule_create_internal ( + host, + http + ); +} void v1_ingress_rule_free(v1_ingress_rule_t *v1_ingress_rule) { if(NULL == v1_ingress_rule){ return ; } + if(v1_ingress_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_rule->host) { free(v1_ingress_rule->host); @@ -76,6 +90,9 @@ v1_ingress_rule_t *v1_ingress_rule_parseFromJSON(cJSON *v1_ingress_ruleJSON){ // v1_ingress_rule->host cJSON *host = cJSON_GetObjectItemCaseSensitive(v1_ingress_ruleJSON, "host"); + if (cJSON_IsNull(host)) { + host = NULL; + } if (host) { if(!cJSON_IsString(host) && !cJSON_IsNull(host)) { @@ -85,12 +102,15 @@ v1_ingress_rule_t *v1_ingress_rule_parseFromJSON(cJSON *v1_ingress_ruleJSON){ // v1_ingress_rule->http cJSON *http = cJSON_GetObjectItemCaseSensitive(v1_ingress_ruleJSON, "http"); + if (cJSON_IsNull(http)) { + http = NULL; + } if (http) { http_local_nonprim = v1_http_ingress_rule_value_parseFromJSON(http); //nonprimitive } - v1_ingress_rule_local_var = v1_ingress_rule_create ( + v1_ingress_rule_local_var = v1_ingress_rule_create_internal ( host && !cJSON_IsNull(host) ? strdup(host->valuestring) : NULL, http ? http_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_ingress_rule.h b/kubernetes/model/v1_ingress_rule.h index 1965adf2..27e03b03 100644 --- a/kubernetes/model/v1_ingress_rule.h +++ b/kubernetes/model/v1_ingress_rule.h @@ -23,9 +23,10 @@ typedef struct v1_ingress_rule_t { char *host; // string struct v1_http_ingress_rule_value_t *http; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_rule_t; -v1_ingress_rule_t *v1_ingress_rule_create( +__attribute__((deprecated)) v1_ingress_rule_t *v1_ingress_rule_create( char *host, v1_http_ingress_rule_value_t *http ); diff --git a/kubernetes/model/v1_ingress_service_backend.c b/kubernetes/model/v1_ingress_service_backend.c index 2535593a..2c05e88b 100644 --- a/kubernetes/model/v1_ingress_service_backend.c +++ b/kubernetes/model/v1_ingress_service_backend.c @@ -5,7 +5,7 @@ -v1_ingress_service_backend_t *v1_ingress_service_backend_create( +static v1_ingress_service_backend_t *v1_ingress_service_backend_create_internal( char *name, v1_service_backend_port_t *port ) { @@ -16,14 +16,28 @@ v1_ingress_service_backend_t *v1_ingress_service_backend_create( v1_ingress_service_backend_local_var->name = name; v1_ingress_service_backend_local_var->port = port; + v1_ingress_service_backend_local_var->_library_owned = 1; return v1_ingress_service_backend_local_var; } +__attribute__((deprecated)) v1_ingress_service_backend_t *v1_ingress_service_backend_create( + char *name, + v1_service_backend_port_t *port + ) { + return v1_ingress_service_backend_create_internal ( + name, + port + ); +} void v1_ingress_service_backend_free(v1_ingress_service_backend_t *v1_ingress_service_backend) { if(NULL == v1_ingress_service_backend){ return ; } + if(v1_ingress_service_backend->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_service_backend_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_service_backend->name) { free(v1_ingress_service_backend->name); @@ -77,6 +91,9 @@ v1_ingress_service_backend_t *v1_ingress_service_backend_parseFromJSON(cJSON *v1 // v1_ingress_service_backend->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_ingress_service_backendJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -89,12 +106,15 @@ v1_ingress_service_backend_t *v1_ingress_service_backend_parseFromJSON(cJSON *v1 // v1_ingress_service_backend->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_ingress_service_backendJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (port) { port_local_nonprim = v1_service_backend_port_parseFromJSON(port); //nonprimitive } - v1_ingress_service_backend_local_var = v1_ingress_service_backend_create ( + v1_ingress_service_backend_local_var = v1_ingress_service_backend_create_internal ( strdup(name->valuestring), port ? port_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_ingress_service_backend.h b/kubernetes/model/v1_ingress_service_backend.h index 31946a3f..63b7b113 100644 --- a/kubernetes/model/v1_ingress_service_backend.h +++ b/kubernetes/model/v1_ingress_service_backend.h @@ -23,9 +23,10 @@ typedef struct v1_ingress_service_backend_t { char *name; // string struct v1_service_backend_port_t *port; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_service_backend_t; -v1_ingress_service_backend_t *v1_ingress_service_backend_create( +__attribute__((deprecated)) v1_ingress_service_backend_t *v1_ingress_service_backend_create( char *name, v1_service_backend_port_t *port ); diff --git a/kubernetes/model/v1_ingress_spec.c b/kubernetes/model/v1_ingress_spec.c index e3702912..dd90fd39 100644 --- a/kubernetes/model/v1_ingress_spec.c +++ b/kubernetes/model/v1_ingress_spec.c @@ -5,7 +5,7 @@ -v1_ingress_spec_t *v1_ingress_spec_create( +static v1_ingress_spec_t *v1_ingress_spec_create_internal( v1_ingress_backend_t *default_backend, char *ingress_class_name, list_t *rules, @@ -20,14 +20,32 @@ v1_ingress_spec_t *v1_ingress_spec_create( v1_ingress_spec_local_var->rules = rules; v1_ingress_spec_local_var->tls = tls; + v1_ingress_spec_local_var->_library_owned = 1; return v1_ingress_spec_local_var; } +__attribute__((deprecated)) v1_ingress_spec_t *v1_ingress_spec_create( + v1_ingress_backend_t *default_backend, + char *ingress_class_name, + list_t *rules, + list_t *tls + ) { + return v1_ingress_spec_create_internal ( + default_backend, + ingress_class_name, + rules, + tls + ); +} void v1_ingress_spec_free(v1_ingress_spec_t *v1_ingress_spec) { if(NULL == v1_ingress_spec){ return ; } + if(v1_ingress_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_spec->default_backend) { v1_ingress_backend_free(v1_ingress_spec->default_backend); @@ -140,12 +158,18 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ // v1_ingress_spec->default_backend cJSON *default_backend = cJSON_GetObjectItemCaseSensitive(v1_ingress_specJSON, "defaultBackend"); + if (cJSON_IsNull(default_backend)) { + default_backend = NULL; + } if (default_backend) { default_backend_local_nonprim = v1_ingress_backend_parseFromJSON(default_backend); //nonprimitive } // v1_ingress_spec->ingress_class_name cJSON *ingress_class_name = cJSON_GetObjectItemCaseSensitive(v1_ingress_specJSON, "ingressClassName"); + if (cJSON_IsNull(ingress_class_name)) { + ingress_class_name = NULL; + } if (ingress_class_name) { if(!cJSON_IsString(ingress_class_name) && !cJSON_IsNull(ingress_class_name)) { @@ -155,6 +179,9 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ // v1_ingress_spec->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_ingress_specJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (rules) { cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ @@ -176,6 +203,9 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ // v1_ingress_spec->tls cJSON *tls = cJSON_GetObjectItemCaseSensitive(v1_ingress_specJSON, "tls"); + if (cJSON_IsNull(tls)) { + tls = NULL; + } if (tls) { cJSON *tls_local_nonprimitive = NULL; if(!cJSON_IsArray(tls)){ @@ -196,7 +226,7 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ } - v1_ingress_spec_local_var = v1_ingress_spec_create ( + v1_ingress_spec_local_var = v1_ingress_spec_create_internal ( default_backend ? default_backend_local_nonprim : NULL, ingress_class_name && !cJSON_IsNull(ingress_class_name) ? strdup(ingress_class_name->valuestring) : NULL, rules ? rulesList : NULL, diff --git a/kubernetes/model/v1_ingress_spec.h b/kubernetes/model/v1_ingress_spec.h index 67c092e6..82ae288b 100644 --- a/kubernetes/model/v1_ingress_spec.h +++ b/kubernetes/model/v1_ingress_spec.h @@ -27,9 +27,10 @@ typedef struct v1_ingress_spec_t { list_t *rules; //nonprimitive container list_t *tls; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_spec_t; -v1_ingress_spec_t *v1_ingress_spec_create( +__attribute__((deprecated)) v1_ingress_spec_t *v1_ingress_spec_create( v1_ingress_backend_t *default_backend, char *ingress_class_name, list_t *rules, diff --git a/kubernetes/model/v1_ingress_status.c b/kubernetes/model/v1_ingress_status.c index 9f31b4c8..d8931399 100644 --- a/kubernetes/model/v1_ingress_status.c +++ b/kubernetes/model/v1_ingress_status.c @@ -5,7 +5,7 @@ -v1_ingress_status_t *v1_ingress_status_create( +static v1_ingress_status_t *v1_ingress_status_create_internal( v1_ingress_load_balancer_status_t *load_balancer ) { v1_ingress_status_t *v1_ingress_status_local_var = malloc(sizeof(v1_ingress_status_t)); @@ -14,14 +14,26 @@ v1_ingress_status_t *v1_ingress_status_create( } v1_ingress_status_local_var->load_balancer = load_balancer; + v1_ingress_status_local_var->_library_owned = 1; return v1_ingress_status_local_var; } +__attribute__((deprecated)) v1_ingress_status_t *v1_ingress_status_create( + v1_ingress_load_balancer_status_t *load_balancer + ) { + return v1_ingress_status_create_internal ( + load_balancer + ); +} void v1_ingress_status_free(v1_ingress_status_t *v1_ingress_status) { if(NULL == v1_ingress_status){ return ; } + if(v1_ingress_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_status_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_status->load_balancer) { v1_ingress_load_balancer_status_free(v1_ingress_status->load_balancer); @@ -62,12 +74,15 @@ v1_ingress_status_t *v1_ingress_status_parseFromJSON(cJSON *v1_ingress_statusJSO // v1_ingress_status->load_balancer cJSON *load_balancer = cJSON_GetObjectItemCaseSensitive(v1_ingress_statusJSON, "loadBalancer"); + if (cJSON_IsNull(load_balancer)) { + load_balancer = NULL; + } if (load_balancer) { load_balancer_local_nonprim = v1_ingress_load_balancer_status_parseFromJSON(load_balancer); //nonprimitive } - v1_ingress_status_local_var = v1_ingress_status_create ( + v1_ingress_status_local_var = v1_ingress_status_create_internal ( load_balancer ? load_balancer_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_ingress_status.h b/kubernetes/model/v1_ingress_status.h index cb13ea84..caf064aa 100644 --- a/kubernetes/model/v1_ingress_status.h +++ b/kubernetes/model/v1_ingress_status.h @@ -22,9 +22,10 @@ typedef struct v1_ingress_status_t v1_ingress_status_t; typedef struct v1_ingress_status_t { struct v1_ingress_load_balancer_status_t *load_balancer; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_status_t; -v1_ingress_status_t *v1_ingress_status_create( +__attribute__((deprecated)) v1_ingress_status_t *v1_ingress_status_create( v1_ingress_load_balancer_status_t *load_balancer ); diff --git a/kubernetes/model/v1_ingress_tls.c b/kubernetes/model/v1_ingress_tls.c index 60de9fa6..7c352d03 100644 --- a/kubernetes/model/v1_ingress_tls.c +++ b/kubernetes/model/v1_ingress_tls.c @@ -5,7 +5,7 @@ -v1_ingress_tls_t *v1_ingress_tls_create( +static v1_ingress_tls_t *v1_ingress_tls_create_internal( list_t *hosts, char *secret_name ) { @@ -16,14 +16,28 @@ v1_ingress_tls_t *v1_ingress_tls_create( v1_ingress_tls_local_var->hosts = hosts; v1_ingress_tls_local_var->secret_name = secret_name; + v1_ingress_tls_local_var->_library_owned = 1; return v1_ingress_tls_local_var; } +__attribute__((deprecated)) v1_ingress_tls_t *v1_ingress_tls_create( + list_t *hosts, + char *secret_name + ) { + return v1_ingress_tls_create_internal ( + hosts, + secret_name + ); +} void v1_ingress_tls_free(v1_ingress_tls_t *v1_ingress_tls) { if(NULL == v1_ingress_tls){ return ; } + if(v1_ingress_tls->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ingress_tls_free"); + return ; + } listEntry_t *listEntry; if (v1_ingress_tls->hosts) { list_ForEach(listEntry, v1_ingress_tls->hosts) { @@ -51,7 +65,7 @@ cJSON *v1_ingress_tls_convertToJSON(v1_ingress_tls_t *v1_ingress_tls) { listEntry_t *hostsListEntry; list_ForEach(hostsListEntry, v1_ingress_tls->hosts) { - if(cJSON_AddStringToObject(hosts, "", (char*)hostsListEntry->data) == NULL) + if(cJSON_AddStringToObject(hosts, "", hostsListEntry->data) == NULL) { goto fail; } @@ -83,6 +97,9 @@ v1_ingress_tls_t *v1_ingress_tls_parseFromJSON(cJSON *v1_ingress_tlsJSON){ // v1_ingress_tls->hosts cJSON *hosts = cJSON_GetObjectItemCaseSensitive(v1_ingress_tlsJSON, "hosts"); + if (cJSON_IsNull(hosts)) { + hosts = NULL; + } if (hosts) { cJSON *hosts_local = NULL; if(!cJSON_IsArray(hosts)) { @@ -102,6 +119,9 @@ v1_ingress_tls_t *v1_ingress_tls_parseFromJSON(cJSON *v1_ingress_tlsJSON){ // v1_ingress_tls->secret_name cJSON *secret_name = cJSON_GetObjectItemCaseSensitive(v1_ingress_tlsJSON, "secretName"); + if (cJSON_IsNull(secret_name)) { + secret_name = NULL; + } if (secret_name) { if(!cJSON_IsString(secret_name) && !cJSON_IsNull(secret_name)) { @@ -110,7 +130,7 @@ v1_ingress_tls_t *v1_ingress_tls_parseFromJSON(cJSON *v1_ingress_tlsJSON){ } - v1_ingress_tls_local_var = v1_ingress_tls_create ( + v1_ingress_tls_local_var = v1_ingress_tls_create_internal ( hosts ? hostsList : NULL, secret_name && !cJSON_IsNull(secret_name) ? strdup(secret_name->valuestring) : NULL ); diff --git a/kubernetes/model/v1_ingress_tls.h b/kubernetes/model/v1_ingress_tls.h index 2fb67ef4..afc62c5d 100644 --- a/kubernetes/model/v1_ingress_tls.h +++ b/kubernetes/model/v1_ingress_tls.h @@ -22,9 +22,10 @@ typedef struct v1_ingress_tls_t { list_t *hosts; //primitive container char *secret_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_ingress_tls_t; -v1_ingress_tls_t *v1_ingress_tls_create( +__attribute__((deprecated)) v1_ingress_tls_t *v1_ingress_tls_create( list_t *hosts, char *secret_name ); diff --git a/kubernetes/model/v1_ip_address.c b/kubernetes/model/v1_ip_address.c new file mode 100644 index 00000000..0bf5cb8a --- /dev/null +++ b/kubernetes/model/v1_ip_address.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1_ip_address.h" + + + +static v1_ip_address_t *v1_ip_address_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_ip_address_spec_t *spec + ) { + v1_ip_address_t *v1_ip_address_local_var = malloc(sizeof(v1_ip_address_t)); + if (!v1_ip_address_local_var) { + return NULL; + } + v1_ip_address_local_var->api_version = api_version; + v1_ip_address_local_var->kind = kind; + v1_ip_address_local_var->metadata = metadata; + v1_ip_address_local_var->spec = spec; + + v1_ip_address_local_var->_library_owned = 1; + return v1_ip_address_local_var; +} + +__attribute__((deprecated)) v1_ip_address_t *v1_ip_address_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_ip_address_spec_t *spec + ) { + return v1_ip_address_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1_ip_address_free(v1_ip_address_t *v1_ip_address) { + if(NULL == v1_ip_address){ + return ; + } + if(v1_ip_address->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ip_address_free"); + return ; + } + listEntry_t *listEntry; + if (v1_ip_address->api_version) { + free(v1_ip_address->api_version); + v1_ip_address->api_version = NULL; + } + if (v1_ip_address->kind) { + free(v1_ip_address->kind); + v1_ip_address->kind = NULL; + } + if (v1_ip_address->metadata) { + v1_object_meta_free(v1_ip_address->metadata); + v1_ip_address->metadata = NULL; + } + if (v1_ip_address->spec) { + v1_ip_address_spec_free(v1_ip_address->spec); + v1_ip_address->spec = NULL; + } + free(v1_ip_address); +} + +cJSON *v1_ip_address_convertToJSON(v1_ip_address_t *v1_ip_address) { + cJSON *item = cJSON_CreateObject(); + + // v1_ip_address->api_version + if(v1_ip_address->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_ip_address->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_ip_address->kind + if(v1_ip_address->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_ip_address->kind) == NULL) { + goto fail; //String + } + } + + + // v1_ip_address->metadata + if(v1_ip_address->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1_ip_address->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_ip_address->spec + if(v1_ip_address->spec) { + cJSON *spec_local_JSON = v1_ip_address_spec_convertToJSON(v1_ip_address->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_ip_address_t *v1_ip_address_parseFromJSON(cJSON *v1_ip_addressJSON){ + + v1_ip_address_t *v1_ip_address_local_var = NULL; + + // define the local variable for v1_ip_address->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1_ip_address->spec + v1_ip_address_spec_t *spec_local_nonprim = NULL; + + // v1_ip_address->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_ip_addressJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_ip_address->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_ip_addressJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_ip_address->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_ip_addressJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1_ip_address->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_ip_addressJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1_ip_address_spec_parseFromJSON(spec); //nonprimitive + } + + + v1_ip_address_local_var = v1_ip_address_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1_ip_address_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1_ip_address_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_ip_address.h b/kubernetes/model/v1_ip_address.h new file mode 100644 index 00000000..509fcc7f --- /dev/null +++ b/kubernetes/model/v1_ip_address.h @@ -0,0 +1,46 @@ +/* + * v1_ip_address.h + * + * IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 + */ + +#ifndef _v1_ip_address_H_ +#define _v1_ip_address_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_ip_address_t v1_ip_address_t; + +#include "v1_ip_address_spec.h" +#include "v1_object_meta.h" + + + +typedef struct v1_ip_address_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1_ip_address_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_ip_address_t; + +__attribute__((deprecated)) v1_ip_address_t *v1_ip_address_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_ip_address_spec_t *spec +); + +void v1_ip_address_free(v1_ip_address_t *v1_ip_address); + +v1_ip_address_t *v1_ip_address_parseFromJSON(cJSON *v1_ip_addressJSON); + +cJSON *v1_ip_address_convertToJSON(v1_ip_address_t *v1_ip_address); + +#endif /* _v1_ip_address_H_ */ + diff --git a/kubernetes/model/v1_ip_address_list.c b/kubernetes/model/v1_ip_address_list.c new file mode 100644 index 00000000..34dbe558 --- /dev/null +++ b/kubernetes/model/v1_ip_address_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1_ip_address_list.h" + + + +static v1_ip_address_list_t *v1_ip_address_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1_ip_address_list_t *v1_ip_address_list_local_var = malloc(sizeof(v1_ip_address_list_t)); + if (!v1_ip_address_list_local_var) { + return NULL; + } + v1_ip_address_list_local_var->api_version = api_version; + v1_ip_address_list_local_var->items = items; + v1_ip_address_list_local_var->kind = kind; + v1_ip_address_list_local_var->metadata = metadata; + + v1_ip_address_list_local_var->_library_owned = 1; + return v1_ip_address_list_local_var; +} + +__attribute__((deprecated)) v1_ip_address_list_t *v1_ip_address_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_ip_address_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1_ip_address_list_free(v1_ip_address_list_t *v1_ip_address_list) { + if(NULL == v1_ip_address_list){ + return ; + } + if(v1_ip_address_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ip_address_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1_ip_address_list->api_version) { + free(v1_ip_address_list->api_version); + v1_ip_address_list->api_version = NULL; + } + if (v1_ip_address_list->items) { + list_ForEach(listEntry, v1_ip_address_list->items) { + v1_ip_address_free(listEntry->data); + } + list_freeList(v1_ip_address_list->items); + v1_ip_address_list->items = NULL; + } + if (v1_ip_address_list->kind) { + free(v1_ip_address_list->kind); + v1_ip_address_list->kind = NULL; + } + if (v1_ip_address_list->metadata) { + v1_list_meta_free(v1_ip_address_list->metadata); + v1_ip_address_list->metadata = NULL; + } + free(v1_ip_address_list); +} + +cJSON *v1_ip_address_list_convertToJSON(v1_ip_address_list_t *v1_ip_address_list) { + cJSON *item = cJSON_CreateObject(); + + // v1_ip_address_list->api_version + if(v1_ip_address_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_ip_address_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_ip_address_list->items + if (!v1_ip_address_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1_ip_address_list->items) { + list_ForEach(itemsListEntry, v1_ip_address_list->items) { + cJSON *itemLocal = v1_ip_address_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1_ip_address_list->kind + if(v1_ip_address_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_ip_address_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1_ip_address_list->metadata + if(v1_ip_address_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1_ip_address_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_ip_address_list_t *v1_ip_address_list_parseFromJSON(cJSON *v1_ip_address_listJSON){ + + v1_ip_address_list_t *v1_ip_address_list_local_var = NULL; + + // define the local list for v1_ip_address_list->items + list_t *itemsList = NULL; + + // define the local variable for v1_ip_address_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1_ip_address_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_ip_address_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_ip_address_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_ip_address_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1_ip_address_t *itemsItem = v1_ip_address_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1_ip_address_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_ip_address_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_ip_address_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_ip_address_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1_ip_address_list_local_var = v1_ip_address_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1_ip_address_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_ip_address_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_ip_address_list.h b/kubernetes/model/v1_ip_address_list.h new file mode 100644 index 00000000..3b9c4a4f --- /dev/null +++ b/kubernetes/model/v1_ip_address_list.h @@ -0,0 +1,46 @@ +/* + * v1_ip_address_list.h + * + * IPAddressList contains a list of IPAddress. + */ + +#ifndef _v1_ip_address_list_H_ +#define _v1_ip_address_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_ip_address_list_t v1_ip_address_list_t; + +#include "v1_ip_address.h" +#include "v1_list_meta.h" + + + +typedef struct v1_ip_address_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_ip_address_list_t; + +__attribute__((deprecated)) v1_ip_address_list_t *v1_ip_address_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1_ip_address_list_free(v1_ip_address_list_t *v1_ip_address_list); + +v1_ip_address_list_t *v1_ip_address_list_parseFromJSON(cJSON *v1_ip_address_listJSON); + +cJSON *v1_ip_address_list_convertToJSON(v1_ip_address_list_t *v1_ip_address_list); + +#endif /* _v1_ip_address_list_H_ */ + diff --git a/kubernetes/model/v1_ip_address_spec.c b/kubernetes/model/v1_ip_address_spec.c new file mode 100644 index 00000000..9c560111 --- /dev/null +++ b/kubernetes/model/v1_ip_address_spec.c @@ -0,0 +1,101 @@ +#include +#include +#include +#include "v1_ip_address_spec.h" + + + +static v1_ip_address_spec_t *v1_ip_address_spec_create_internal( + v1_parent_reference_t *parent_ref + ) { + v1_ip_address_spec_t *v1_ip_address_spec_local_var = malloc(sizeof(v1_ip_address_spec_t)); + if (!v1_ip_address_spec_local_var) { + return NULL; + } + v1_ip_address_spec_local_var->parent_ref = parent_ref; + + v1_ip_address_spec_local_var->_library_owned = 1; + return v1_ip_address_spec_local_var; +} + +__attribute__((deprecated)) v1_ip_address_spec_t *v1_ip_address_spec_create( + v1_parent_reference_t *parent_ref + ) { + return v1_ip_address_spec_create_internal ( + parent_ref + ); +} + +void v1_ip_address_spec_free(v1_ip_address_spec_t *v1_ip_address_spec) { + if(NULL == v1_ip_address_spec){ + return ; + } + if(v1_ip_address_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ip_address_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1_ip_address_spec->parent_ref) { + v1_parent_reference_free(v1_ip_address_spec->parent_ref); + v1_ip_address_spec->parent_ref = NULL; + } + free(v1_ip_address_spec); +} + +cJSON *v1_ip_address_spec_convertToJSON(v1_ip_address_spec_t *v1_ip_address_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1_ip_address_spec->parent_ref + if (!v1_ip_address_spec->parent_ref) { + goto fail; + } + cJSON *parent_ref_local_JSON = v1_parent_reference_convertToJSON(v1_ip_address_spec->parent_ref); + if(parent_ref_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "parentRef", parent_ref_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_ip_address_spec_t *v1_ip_address_spec_parseFromJSON(cJSON *v1_ip_address_specJSON){ + + v1_ip_address_spec_t *v1_ip_address_spec_local_var = NULL; + + // define the local variable for v1_ip_address_spec->parent_ref + v1_parent_reference_t *parent_ref_local_nonprim = NULL; + + // v1_ip_address_spec->parent_ref + cJSON *parent_ref = cJSON_GetObjectItemCaseSensitive(v1_ip_address_specJSON, "parentRef"); + if (cJSON_IsNull(parent_ref)) { + parent_ref = NULL; + } + if (!parent_ref) { + goto end; + } + + + parent_ref_local_nonprim = v1_parent_reference_parseFromJSON(parent_ref); //nonprimitive + + + v1_ip_address_spec_local_var = v1_ip_address_spec_create_internal ( + parent_ref_local_nonprim + ); + + return v1_ip_address_spec_local_var; +end: + if (parent_ref_local_nonprim) { + v1_parent_reference_free(parent_ref_local_nonprim); + parent_ref_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_ip_address_spec.h b/kubernetes/model/v1_ip_address_spec.h new file mode 100644 index 00000000..4cf7b42f --- /dev/null +++ b/kubernetes/model/v1_ip_address_spec.h @@ -0,0 +1,39 @@ +/* + * v1_ip_address_spec.h + * + * IPAddressSpec describe the attributes in an IP Address. + */ + +#ifndef _v1_ip_address_spec_H_ +#define _v1_ip_address_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_ip_address_spec_t v1_ip_address_spec_t; + +#include "v1_parent_reference.h" + + + +typedef struct v1_ip_address_spec_t { + struct v1_parent_reference_t *parent_ref; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_ip_address_spec_t; + +__attribute__((deprecated)) v1_ip_address_spec_t *v1_ip_address_spec_create( + v1_parent_reference_t *parent_ref +); + +void v1_ip_address_spec_free(v1_ip_address_spec_t *v1_ip_address_spec); + +v1_ip_address_spec_t *v1_ip_address_spec_parseFromJSON(cJSON *v1_ip_address_specJSON); + +cJSON *v1_ip_address_spec_convertToJSON(v1_ip_address_spec_t *v1_ip_address_spec); + +#endif /* _v1_ip_address_spec_H_ */ + diff --git a/kubernetes/model/v1_ip_block.c b/kubernetes/model/v1_ip_block.c index 0bd299be..6e7a796d 100644 --- a/kubernetes/model/v1_ip_block.c +++ b/kubernetes/model/v1_ip_block.c @@ -5,7 +5,7 @@ -v1_ip_block_t *v1_ip_block_create( +static v1_ip_block_t *v1_ip_block_create_internal( char *cidr, list_t *except ) { @@ -16,14 +16,28 @@ v1_ip_block_t *v1_ip_block_create( v1_ip_block_local_var->cidr = cidr; v1_ip_block_local_var->except = except; + v1_ip_block_local_var->_library_owned = 1; return v1_ip_block_local_var; } +__attribute__((deprecated)) v1_ip_block_t *v1_ip_block_create( + char *cidr, + list_t *except + ) { + return v1_ip_block_create_internal ( + cidr, + except + ); +} void v1_ip_block_free(v1_ip_block_t *v1_ip_block) { if(NULL == v1_ip_block){ return ; } + if(v1_ip_block->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_ip_block_free"); + return ; + } listEntry_t *listEntry; if (v1_ip_block->cidr) { free(v1_ip_block->cidr); @@ -60,7 +74,7 @@ cJSON *v1_ip_block_convertToJSON(v1_ip_block_t *v1_ip_block) { listEntry_t *exceptListEntry; list_ForEach(exceptListEntry, v1_ip_block->except) { - if(cJSON_AddStringToObject(except, "", (char*)exceptListEntry->data) == NULL) + if(cJSON_AddStringToObject(except, "", exceptListEntry->data) == NULL) { goto fail; } @@ -84,6 +98,9 @@ v1_ip_block_t *v1_ip_block_parseFromJSON(cJSON *v1_ip_blockJSON){ // v1_ip_block->cidr cJSON *cidr = cJSON_GetObjectItemCaseSensitive(v1_ip_blockJSON, "cidr"); + if (cJSON_IsNull(cidr)) { + cidr = NULL; + } if (!cidr) { goto end; } @@ -96,6 +113,9 @@ v1_ip_block_t *v1_ip_block_parseFromJSON(cJSON *v1_ip_blockJSON){ // v1_ip_block->except cJSON *except = cJSON_GetObjectItemCaseSensitive(v1_ip_blockJSON, "except"); + if (cJSON_IsNull(except)) { + except = NULL; + } if (except) { cJSON *except_local = NULL; if(!cJSON_IsArray(except)) { @@ -114,7 +134,7 @@ v1_ip_block_t *v1_ip_block_parseFromJSON(cJSON *v1_ip_blockJSON){ } - v1_ip_block_local_var = v1_ip_block_create ( + v1_ip_block_local_var = v1_ip_block_create_internal ( strdup(cidr->valuestring), except ? exceptList : NULL ); diff --git a/kubernetes/model/v1_ip_block.h b/kubernetes/model/v1_ip_block.h index 6ac9ee71..10e1e2e0 100644 --- a/kubernetes/model/v1_ip_block.h +++ b/kubernetes/model/v1_ip_block.h @@ -22,9 +22,10 @@ typedef struct v1_ip_block_t { char *cidr; // string list_t *except; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_ip_block_t; -v1_ip_block_t *v1_ip_block_create( +__attribute__((deprecated)) v1_ip_block_t *v1_ip_block_create( char *cidr, list_t *except ); diff --git a/kubernetes/model/v1_iscsi_persistent_volume_source.c b/kubernetes/model/v1_iscsi_persistent_volume_source.c index 025a8911..7c6bae6d 100644 --- a/kubernetes/model/v1_iscsi_persistent_volume_source.c +++ b/kubernetes/model/v1_iscsi_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_create( +static v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_create_internal( int chap_auth_discovery, int chap_auth_session, char *fs_type, @@ -34,14 +34,46 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_create( v1_iscsi_persistent_volume_source_local_var->secret_ref = secret_ref; v1_iscsi_persistent_volume_source_local_var->target_portal = target_portal; + v1_iscsi_persistent_volume_source_local_var->_library_owned = 1; return v1_iscsi_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_create( + int chap_auth_discovery, + int chap_auth_session, + char *fs_type, + char *initiator_name, + char *iqn, + char *iscsi_interface, + int lun, + list_t *portals, + int read_only, + v1_secret_reference_t *secret_ref, + char *target_portal + ) { + return v1_iscsi_persistent_volume_source_create_internal ( + chap_auth_discovery, + chap_auth_session, + fs_type, + initiator_name, + iqn, + iscsi_interface, + lun, + portals, + read_only, + secret_ref, + target_portal + ); +} void v1_iscsi_persistent_volume_source_free(v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source) { if(NULL == v1_iscsi_persistent_volume_source){ return ; } + if(v1_iscsi_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_iscsi_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_iscsi_persistent_volume_source->fs_type) { free(v1_iscsi_persistent_volume_source->fs_type); @@ -147,7 +179,7 @@ cJSON *v1_iscsi_persistent_volume_source_convertToJSON(v1_iscsi_persistent_volum listEntry_t *portalsListEntry; list_ForEach(portalsListEntry, v1_iscsi_persistent_volume_source->portals) { - if(cJSON_AddStringToObject(portals, "", (char*)portalsListEntry->data) == NULL) + if(cJSON_AddStringToObject(portals, "", portalsListEntry->data) == NULL) { goto fail; } @@ -204,6 +236,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->chap_auth_discovery cJSON *chap_auth_discovery = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "chapAuthDiscovery"); + if (cJSON_IsNull(chap_auth_discovery)) { + chap_auth_discovery = NULL; + } if (chap_auth_discovery) { if(!cJSON_IsBool(chap_auth_discovery)) { @@ -213,6 +248,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->chap_auth_session cJSON *chap_auth_session = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "chapAuthSession"); + if (cJSON_IsNull(chap_auth_session)) { + chap_auth_session = NULL; + } if (chap_auth_session) { if(!cJSON_IsBool(chap_auth_session)) { @@ -222,6 +260,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -231,6 +272,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->initiator_name cJSON *initiator_name = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "initiatorName"); + if (cJSON_IsNull(initiator_name)) { + initiator_name = NULL; + } if (initiator_name) { if(!cJSON_IsString(initiator_name) && !cJSON_IsNull(initiator_name)) { @@ -240,6 +284,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->iqn cJSON *iqn = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "iqn"); + if (cJSON_IsNull(iqn)) { + iqn = NULL; + } if (!iqn) { goto end; } @@ -252,6 +299,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->iscsi_interface cJSON *iscsi_interface = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "iscsiInterface"); + if (cJSON_IsNull(iscsi_interface)) { + iscsi_interface = NULL; + } if (iscsi_interface) { if(!cJSON_IsString(iscsi_interface) && !cJSON_IsNull(iscsi_interface)) { @@ -261,6 +311,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->lun cJSON *lun = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "lun"); + if (cJSON_IsNull(lun)) { + lun = NULL; + } if (!lun) { goto end; } @@ -273,6 +326,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->portals cJSON *portals = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "portals"); + if (cJSON_IsNull(portals)) { + portals = NULL; + } if (portals) { cJSON *portals_local = NULL; if(!cJSON_IsArray(portals)) { @@ -292,6 +348,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -301,12 +360,18 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_iscsi_persistent_volume_source->target_portal cJSON *target_portal = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "targetPortal"); + if (cJSON_IsNull(target_portal)) { + target_portal = NULL; + } if (!target_portal) { goto end; } @@ -318,7 +383,7 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom } - v1_iscsi_persistent_volume_source_local_var = v1_iscsi_persistent_volume_source_create ( + v1_iscsi_persistent_volume_source_local_var = v1_iscsi_persistent_volume_source_create_internal ( chap_auth_discovery ? chap_auth_discovery->valueint : 0, chap_auth_session ? chap_auth_session->valueint : 0, fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, diff --git a/kubernetes/model/v1_iscsi_persistent_volume_source.h b/kubernetes/model/v1_iscsi_persistent_volume_source.h index 2e2bad74..4aa98e83 100644 --- a/kubernetes/model/v1_iscsi_persistent_volume_source.h +++ b/kubernetes/model/v1_iscsi_persistent_volume_source.h @@ -32,9 +32,10 @@ typedef struct v1_iscsi_persistent_volume_source_t { struct v1_secret_reference_t *secret_ref; //model char *target_portal; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_iscsi_persistent_volume_source_t; -v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_create( +__attribute__((deprecated)) v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_create( int chap_auth_discovery, int chap_auth_session, char *fs_type, diff --git a/kubernetes/model/v1_iscsi_volume_source.c b/kubernetes/model/v1_iscsi_volume_source.c index 7276802a..3027148c 100644 --- a/kubernetes/model/v1_iscsi_volume_source.c +++ b/kubernetes/model/v1_iscsi_volume_source.c @@ -5,7 +5,7 @@ -v1_iscsi_volume_source_t *v1_iscsi_volume_source_create( +static v1_iscsi_volume_source_t *v1_iscsi_volume_source_create_internal( int chap_auth_discovery, int chap_auth_session, char *fs_type, @@ -34,14 +34,46 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_create( v1_iscsi_volume_source_local_var->secret_ref = secret_ref; v1_iscsi_volume_source_local_var->target_portal = target_portal; + v1_iscsi_volume_source_local_var->_library_owned = 1; return v1_iscsi_volume_source_local_var; } +__attribute__((deprecated)) v1_iscsi_volume_source_t *v1_iscsi_volume_source_create( + int chap_auth_discovery, + int chap_auth_session, + char *fs_type, + char *initiator_name, + char *iqn, + char *iscsi_interface, + int lun, + list_t *portals, + int read_only, + v1_local_object_reference_t *secret_ref, + char *target_portal + ) { + return v1_iscsi_volume_source_create_internal ( + chap_auth_discovery, + chap_auth_session, + fs_type, + initiator_name, + iqn, + iscsi_interface, + lun, + portals, + read_only, + secret_ref, + target_portal + ); +} void v1_iscsi_volume_source_free(v1_iscsi_volume_source_t *v1_iscsi_volume_source) { if(NULL == v1_iscsi_volume_source){ return ; } + if(v1_iscsi_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_iscsi_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_iscsi_volume_source->fs_type) { free(v1_iscsi_volume_source->fs_type); @@ -147,7 +179,7 @@ cJSON *v1_iscsi_volume_source_convertToJSON(v1_iscsi_volume_source_t *v1_iscsi_v listEntry_t *portalsListEntry; list_ForEach(portalsListEntry, v1_iscsi_volume_source->portals) { - if(cJSON_AddStringToObject(portals, "", (char*)portalsListEntry->data) == NULL) + if(cJSON_AddStringToObject(portals, "", portalsListEntry->data) == NULL) { goto fail; } @@ -204,6 +236,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->chap_auth_discovery cJSON *chap_auth_discovery = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "chapAuthDiscovery"); + if (cJSON_IsNull(chap_auth_discovery)) { + chap_auth_discovery = NULL; + } if (chap_auth_discovery) { if(!cJSON_IsBool(chap_auth_discovery)) { @@ -213,6 +248,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->chap_auth_session cJSON *chap_auth_session = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "chapAuthSession"); + if (cJSON_IsNull(chap_auth_session)) { + chap_auth_session = NULL; + } if (chap_auth_session) { if(!cJSON_IsBool(chap_auth_session)) { @@ -222,6 +260,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -231,6 +272,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->initiator_name cJSON *initiator_name = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "initiatorName"); + if (cJSON_IsNull(initiator_name)) { + initiator_name = NULL; + } if (initiator_name) { if(!cJSON_IsString(initiator_name) && !cJSON_IsNull(initiator_name)) { @@ -240,6 +284,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->iqn cJSON *iqn = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "iqn"); + if (cJSON_IsNull(iqn)) { + iqn = NULL; + } if (!iqn) { goto end; } @@ -252,6 +299,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->iscsi_interface cJSON *iscsi_interface = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "iscsiInterface"); + if (cJSON_IsNull(iscsi_interface)) { + iscsi_interface = NULL; + } if (iscsi_interface) { if(!cJSON_IsString(iscsi_interface) && !cJSON_IsNull(iscsi_interface)) { @@ -261,6 +311,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->lun cJSON *lun = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "lun"); + if (cJSON_IsNull(lun)) { + lun = NULL; + } if (!lun) { goto end; } @@ -273,6 +326,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->portals cJSON *portals = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "portals"); + if (cJSON_IsNull(portals)) { + portals = NULL; + } if (portals) { cJSON *portals_local = NULL; if(!cJSON_IsArray(portals)) { @@ -292,6 +348,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -301,12 +360,18 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_local_object_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_iscsi_volume_source->target_portal cJSON *target_portal = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "targetPortal"); + if (cJSON_IsNull(target_portal)) { + target_portal = NULL; + } if (!target_portal) { goto end; } @@ -318,7 +383,7 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v } - v1_iscsi_volume_source_local_var = v1_iscsi_volume_source_create ( + v1_iscsi_volume_source_local_var = v1_iscsi_volume_source_create_internal ( chap_auth_discovery ? chap_auth_discovery->valueint : 0, chap_auth_session ? chap_auth_session->valueint : 0, fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, diff --git a/kubernetes/model/v1_iscsi_volume_source.h b/kubernetes/model/v1_iscsi_volume_source.h index 6b1c3b5b..453156fd 100644 --- a/kubernetes/model/v1_iscsi_volume_source.h +++ b/kubernetes/model/v1_iscsi_volume_source.h @@ -32,9 +32,10 @@ typedef struct v1_iscsi_volume_source_t { struct v1_local_object_reference_t *secret_ref; //model char *target_portal; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_iscsi_volume_source_t; -v1_iscsi_volume_source_t *v1_iscsi_volume_source_create( +__attribute__((deprecated)) v1_iscsi_volume_source_t *v1_iscsi_volume_source_create( int chap_auth_discovery, int chap_auth_session, char *fs_type, diff --git a/kubernetes/model/v1_job.c b/kubernetes/model/v1_job.c index cffd0d3e..c3c93ba7 100644 --- a/kubernetes/model/v1_job.c +++ b/kubernetes/model/v1_job.c @@ -5,7 +5,7 @@ -v1_job_t *v1_job_create( +static v1_job_t *v1_job_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_job_t *v1_job_create( v1_job_local_var->spec = spec; v1_job_local_var->status = status; + v1_job_local_var->_library_owned = 1; return v1_job_local_var; } +__attribute__((deprecated)) v1_job_t *v1_job_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_job_spec_t *spec, + v1_job_status_t *status + ) { + return v1_job_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_job_free(v1_job_t *v1_job) { if(NULL == v1_job){ return ; } + if(v1_job->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_job_free"); + return ; + } listEntry_t *listEntry; if (v1_job->api_version) { free(v1_job->api_version); @@ -134,6 +154,9 @@ v1_job_t *v1_job_parseFromJSON(cJSON *v1_jobJSON){ // v1_job->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_jobJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_job_t *v1_job_parseFromJSON(cJSON *v1_jobJSON){ // v1_job->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_jobJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_job_t *v1_job_parseFromJSON(cJSON *v1_jobJSON){ // v1_job->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_jobJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_job->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_jobJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_job_spec_parseFromJSON(spec); //nonprimitive } // v1_job->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_jobJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_job_status_parseFromJSON(status); //nonprimitive } - v1_job_local_var = v1_job_create ( + v1_job_local_var = v1_job_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_job.h b/kubernetes/model/v1_job.h index 4d3a2932..8efe19ec 100644 --- a/kubernetes/model/v1_job.h +++ b/kubernetes/model/v1_job.h @@ -28,9 +28,10 @@ typedef struct v1_job_t { struct v1_job_spec_t *spec; //model struct v1_job_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_job_t; -v1_job_t *v1_job_create( +__attribute__((deprecated)) v1_job_t *v1_job_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_job_condition.c b/kubernetes/model/v1_job_condition.c index 4d03fe4b..9a8f31e6 100644 --- a/kubernetes/model/v1_job_condition.c +++ b/kubernetes/model/v1_job_condition.c @@ -5,7 +5,7 @@ -v1_job_condition_t *v1_job_condition_create( +static v1_job_condition_t *v1_job_condition_create_internal( char *last_probe_time, char *last_transition_time, char *message, @@ -24,14 +24,36 @@ v1_job_condition_t *v1_job_condition_create( v1_job_condition_local_var->status = status; v1_job_condition_local_var->type = type; + v1_job_condition_local_var->_library_owned = 1; return v1_job_condition_local_var; } +__attribute__((deprecated)) v1_job_condition_t *v1_job_condition_create( + char *last_probe_time, + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_job_condition_create_internal ( + last_probe_time, + last_transition_time, + message, + reason, + status, + type + ); +} void v1_job_condition_free(v1_job_condition_t *v1_job_condition) { if(NULL == v1_job_condition){ return ; } + if(v1_job_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_job_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_job_condition->last_probe_time) { free(v1_job_condition->last_probe_time); @@ -126,6 +148,9 @@ v1_job_condition_t *v1_job_condition_parseFromJSON(cJSON *v1_job_conditionJSON){ // v1_job_condition->last_probe_time cJSON *last_probe_time = cJSON_GetObjectItemCaseSensitive(v1_job_conditionJSON, "lastProbeTime"); + if (cJSON_IsNull(last_probe_time)) { + last_probe_time = NULL; + } if (last_probe_time) { if(!cJSON_IsString(last_probe_time) && !cJSON_IsNull(last_probe_time)) { @@ -135,6 +160,9 @@ v1_job_condition_t *v1_job_condition_parseFromJSON(cJSON *v1_job_conditionJSON){ // v1_job_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_job_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -144,6 +172,9 @@ v1_job_condition_t *v1_job_condition_parseFromJSON(cJSON *v1_job_conditionJSON){ // v1_job_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_job_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -153,6 +184,9 @@ v1_job_condition_t *v1_job_condition_parseFromJSON(cJSON *v1_job_conditionJSON){ // v1_job_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_job_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -162,6 +196,9 @@ v1_job_condition_t *v1_job_condition_parseFromJSON(cJSON *v1_job_conditionJSON){ // v1_job_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_job_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -174,6 +211,9 @@ v1_job_condition_t *v1_job_condition_parseFromJSON(cJSON *v1_job_conditionJSON){ // v1_job_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_job_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -185,7 +225,7 @@ v1_job_condition_t *v1_job_condition_parseFromJSON(cJSON *v1_job_conditionJSON){ } - v1_job_condition_local_var = v1_job_condition_create ( + v1_job_condition_local_var = v1_job_condition_create_internal ( last_probe_time && !cJSON_IsNull(last_probe_time) ? strdup(last_probe_time->valuestring) : NULL, last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, diff --git a/kubernetes/model/v1_job_condition.h b/kubernetes/model/v1_job_condition.h index fc446970..81b2013c 100644 --- a/kubernetes/model/v1_job_condition.h +++ b/kubernetes/model/v1_job_condition.h @@ -26,9 +26,10 @@ typedef struct v1_job_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_job_condition_t; -v1_job_condition_t *v1_job_condition_create( +__attribute__((deprecated)) v1_job_condition_t *v1_job_condition_create( char *last_probe_time, char *last_transition_time, char *message, diff --git a/kubernetes/model/v1_job_list.c b/kubernetes/model/v1_job_list.c index 0404df89..f349a6e2 100644 --- a/kubernetes/model/v1_job_list.c +++ b/kubernetes/model/v1_job_list.c @@ -5,7 +5,7 @@ -v1_job_list_t *v1_job_list_create( +static v1_job_list_t *v1_job_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_job_list_t *v1_job_list_create( v1_job_list_local_var->kind = kind; v1_job_list_local_var->metadata = metadata; + v1_job_list_local_var->_library_owned = 1; return v1_job_list_local_var; } +__attribute__((deprecated)) v1_job_list_t *v1_job_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_job_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_job_list_free(v1_job_list_t *v1_job_list) { if(NULL == v1_job_list){ return ; } + if(v1_job_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_job_list_free"); + return ; + } listEntry_t *listEntry; if (v1_job_list->api_version) { free(v1_job_list->api_version); @@ -123,6 +141,9 @@ v1_job_list_t *v1_job_list_parseFromJSON(cJSON *v1_job_listJSON){ // v1_job_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_job_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_job_list_t *v1_job_list_parseFromJSON(cJSON *v1_job_listJSON){ // v1_job_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_job_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_job_list_t *v1_job_list_parseFromJSON(cJSON *v1_job_listJSON){ // v1_job_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_job_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_job_list_t *v1_job_list_parseFromJSON(cJSON *v1_job_listJSON){ // v1_job_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_job_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_job_list_local_var = v1_job_list_create ( + v1_job_list_local_var = v1_job_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_job_list.h b/kubernetes/model/v1_job_list.h index e61a3b20..891eed09 100644 --- a/kubernetes/model/v1_job_list.h +++ b/kubernetes/model/v1_job_list.h @@ -26,9 +26,10 @@ typedef struct v1_job_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_job_list_t; -v1_job_list_t *v1_job_list_create( +__attribute__((deprecated)) v1_job_list_t *v1_job_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_job_spec.c b/kubernetes/model/v1_job_spec.c index cdbe9b3f..589a30eb 100644 --- a/kubernetes/model/v1_job_spec.c +++ b/kubernetes/model/v1_job_spec.c @@ -5,7 +5,7 @@ -v1_job_spec_t *v1_job_spec_create( +static v1_job_spec_t *v1_job_spec_create_internal( long active_deadline_seconds, int backoff_limit, int backoff_limit_per_index, @@ -44,14 +44,56 @@ v1_job_spec_t *v1_job_spec_create( v1_job_spec_local_var->_template = _template; v1_job_spec_local_var->ttl_seconds_after_finished = ttl_seconds_after_finished; + v1_job_spec_local_var->_library_owned = 1; return v1_job_spec_local_var; } +__attribute__((deprecated)) v1_job_spec_t *v1_job_spec_create( + long active_deadline_seconds, + int backoff_limit, + int backoff_limit_per_index, + char *completion_mode, + int completions, + char *managed_by, + int manual_selector, + int max_failed_indexes, + int parallelism, + v1_pod_failure_policy_t *pod_failure_policy, + char *pod_replacement_policy, + v1_label_selector_t *selector, + v1_success_policy_t *success_policy, + int suspend, + v1_pod_template_spec_t *_template, + int ttl_seconds_after_finished + ) { + return v1_job_spec_create_internal ( + active_deadline_seconds, + backoff_limit, + backoff_limit_per_index, + completion_mode, + completions, + managed_by, + manual_selector, + max_failed_indexes, + parallelism, + pod_failure_policy, + pod_replacement_policy, + selector, + success_policy, + suspend, + _template, + ttl_seconds_after_finished + ); +} void v1_job_spec_free(v1_job_spec_t *v1_job_spec) { if(NULL == v1_job_spec){ return ; } + if(v1_job_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_job_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_job_spec->completion_mode) { free(v1_job_spec->completion_mode); @@ -261,6 +303,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->active_deadline_seconds cJSON *active_deadline_seconds = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "activeDeadlineSeconds"); + if (cJSON_IsNull(active_deadline_seconds)) { + active_deadline_seconds = NULL; + } if (active_deadline_seconds) { if(!cJSON_IsNumber(active_deadline_seconds)) { @@ -270,6 +315,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->backoff_limit cJSON *backoff_limit = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "backoffLimit"); + if (cJSON_IsNull(backoff_limit)) { + backoff_limit = NULL; + } if (backoff_limit) { if(!cJSON_IsNumber(backoff_limit)) { @@ -279,6 +327,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->backoff_limit_per_index cJSON *backoff_limit_per_index = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "backoffLimitPerIndex"); + if (cJSON_IsNull(backoff_limit_per_index)) { + backoff_limit_per_index = NULL; + } if (backoff_limit_per_index) { if(!cJSON_IsNumber(backoff_limit_per_index)) { @@ -288,6 +339,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->completion_mode cJSON *completion_mode = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "completionMode"); + if (cJSON_IsNull(completion_mode)) { + completion_mode = NULL; + } if (completion_mode) { if(!cJSON_IsString(completion_mode) && !cJSON_IsNull(completion_mode)) { @@ -297,6 +351,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->completions cJSON *completions = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "completions"); + if (cJSON_IsNull(completions)) { + completions = NULL; + } if (completions) { if(!cJSON_IsNumber(completions)) { @@ -306,6 +363,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->managed_by cJSON *managed_by = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "managedBy"); + if (cJSON_IsNull(managed_by)) { + managed_by = NULL; + } if (managed_by) { if(!cJSON_IsString(managed_by) && !cJSON_IsNull(managed_by)) { @@ -315,6 +375,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->manual_selector cJSON *manual_selector = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "manualSelector"); + if (cJSON_IsNull(manual_selector)) { + manual_selector = NULL; + } if (manual_selector) { if(!cJSON_IsBool(manual_selector)) { @@ -324,6 +387,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->max_failed_indexes cJSON *max_failed_indexes = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "maxFailedIndexes"); + if (cJSON_IsNull(max_failed_indexes)) { + max_failed_indexes = NULL; + } if (max_failed_indexes) { if(!cJSON_IsNumber(max_failed_indexes)) { @@ -333,6 +399,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->parallelism cJSON *parallelism = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "parallelism"); + if (cJSON_IsNull(parallelism)) { + parallelism = NULL; + } if (parallelism) { if(!cJSON_IsNumber(parallelism)) { @@ -342,12 +411,18 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->pod_failure_policy cJSON *pod_failure_policy = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "podFailurePolicy"); + if (cJSON_IsNull(pod_failure_policy)) { + pod_failure_policy = NULL; + } if (pod_failure_policy) { pod_failure_policy_local_nonprim = v1_pod_failure_policy_parseFromJSON(pod_failure_policy); //nonprimitive } // v1_job_spec->pod_replacement_policy cJSON *pod_replacement_policy = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "podReplacementPolicy"); + if (cJSON_IsNull(pod_replacement_policy)) { + pod_replacement_policy = NULL; + } if (pod_replacement_policy) { if(!cJSON_IsString(pod_replacement_policy) && !cJSON_IsNull(pod_replacement_policy)) { @@ -357,18 +432,27 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { selector_local_nonprim = v1_label_selector_parseFromJSON(selector); //nonprimitive } // v1_job_spec->success_policy cJSON *success_policy = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "successPolicy"); + if (cJSON_IsNull(success_policy)) { + success_policy = NULL; + } if (success_policy) { success_policy_local_nonprim = v1_success_policy_parseFromJSON(success_policy); //nonprimitive } // v1_job_spec->suspend cJSON *suspend = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "suspend"); + if (cJSON_IsNull(suspend)) { + suspend = NULL; + } if (suspend) { if(!cJSON_IsBool(suspend)) { @@ -378,6 +462,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->_template cJSON *_template = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "template"); + if (cJSON_IsNull(_template)) { + _template = NULL; + } if (!_template) { goto end; } @@ -387,6 +474,9 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ // v1_job_spec->ttl_seconds_after_finished cJSON *ttl_seconds_after_finished = cJSON_GetObjectItemCaseSensitive(v1_job_specJSON, "ttlSecondsAfterFinished"); + if (cJSON_IsNull(ttl_seconds_after_finished)) { + ttl_seconds_after_finished = NULL; + } if (ttl_seconds_after_finished) { if(!cJSON_IsNumber(ttl_seconds_after_finished)) { @@ -395,7 +485,7 @@ v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON){ } - v1_job_spec_local_var = v1_job_spec_create ( + v1_job_spec_local_var = v1_job_spec_create_internal ( active_deadline_seconds ? active_deadline_seconds->valuedouble : 0, backoff_limit ? backoff_limit->valuedouble : 0, backoff_limit_per_index ? backoff_limit_per_index->valuedouble : 0, diff --git a/kubernetes/model/v1_job_spec.h b/kubernetes/model/v1_job_spec.h index 3c360b02..76eedea4 100644 --- a/kubernetes/model/v1_job_spec.h +++ b/kubernetes/model/v1_job_spec.h @@ -40,9 +40,10 @@ typedef struct v1_job_spec_t { struct v1_pod_template_spec_t *_template; //model int ttl_seconds_after_finished; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_job_spec_t; -v1_job_spec_t *v1_job_spec_create( +__attribute__((deprecated)) v1_job_spec_t *v1_job_spec_create( long active_deadline_seconds, int backoff_limit, int backoff_limit_per_index, diff --git a/kubernetes/model/v1_job_status.c b/kubernetes/model/v1_job_status.c index dad70b85..35ba98f5 100644 --- a/kubernetes/model/v1_job_status.c +++ b/kubernetes/model/v1_job_status.c @@ -5,7 +5,7 @@ -v1_job_status_t *v1_job_status_create( +static v1_job_status_t *v1_job_status_create_internal( int active, char *completed_indexes, char *completion_time, @@ -34,14 +34,46 @@ v1_job_status_t *v1_job_status_create( v1_job_status_local_var->terminating = terminating; v1_job_status_local_var->uncounted_terminated_pods = uncounted_terminated_pods; + v1_job_status_local_var->_library_owned = 1; return v1_job_status_local_var; } +__attribute__((deprecated)) v1_job_status_t *v1_job_status_create( + int active, + char *completed_indexes, + char *completion_time, + list_t *conditions, + int failed, + char *failed_indexes, + int ready, + char *start_time, + int succeeded, + int terminating, + v1_uncounted_terminated_pods_t *uncounted_terminated_pods + ) { + return v1_job_status_create_internal ( + active, + completed_indexes, + completion_time, + conditions, + failed, + failed_indexes, + ready, + start_time, + succeeded, + terminating, + uncounted_terminated_pods + ); +} void v1_job_status_free(v1_job_status_t *v1_job_status) { if(NULL == v1_job_status){ return ; } + if(v1_job_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_job_status_free"); + return ; + } listEntry_t *listEntry; if (v1_job_status->completed_indexes) { free(v1_job_status->completed_indexes); @@ -200,6 +232,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->active cJSON *active = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "active"); + if (cJSON_IsNull(active)) { + active = NULL; + } if (active) { if(!cJSON_IsNumber(active)) { @@ -209,6 +244,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->completed_indexes cJSON *completed_indexes = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "completedIndexes"); + if (cJSON_IsNull(completed_indexes)) { + completed_indexes = NULL; + } if (completed_indexes) { if(!cJSON_IsString(completed_indexes) && !cJSON_IsNull(completed_indexes)) { @@ -218,6 +256,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->completion_time cJSON *completion_time = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "completionTime"); + if (cJSON_IsNull(completion_time)) { + completion_time = NULL; + } if (completion_time) { if(!cJSON_IsString(completion_time) && !cJSON_IsNull(completion_time)) { @@ -227,6 +268,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -248,6 +292,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->failed cJSON *failed = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "failed"); + if (cJSON_IsNull(failed)) { + failed = NULL; + } if (failed) { if(!cJSON_IsNumber(failed)) { @@ -257,6 +304,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->failed_indexes cJSON *failed_indexes = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "failedIndexes"); + if (cJSON_IsNull(failed_indexes)) { + failed_indexes = NULL; + } if (failed_indexes) { if(!cJSON_IsString(failed_indexes) && !cJSON_IsNull(failed_indexes)) { @@ -266,6 +316,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->ready cJSON *ready = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "ready"); + if (cJSON_IsNull(ready)) { + ready = NULL; + } if (ready) { if(!cJSON_IsNumber(ready)) { @@ -275,6 +328,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->start_time cJSON *start_time = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "startTime"); + if (cJSON_IsNull(start_time)) { + start_time = NULL; + } if (start_time) { if(!cJSON_IsString(start_time) && !cJSON_IsNull(start_time)) { @@ -284,6 +340,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->succeeded cJSON *succeeded = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "succeeded"); + if (cJSON_IsNull(succeeded)) { + succeeded = NULL; + } if (succeeded) { if(!cJSON_IsNumber(succeeded)) { @@ -293,6 +352,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->terminating cJSON *terminating = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "terminating"); + if (cJSON_IsNull(terminating)) { + terminating = NULL; + } if (terminating) { if(!cJSON_IsNumber(terminating)) { @@ -302,12 +364,15 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->uncounted_terminated_pods cJSON *uncounted_terminated_pods = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "uncountedTerminatedPods"); + if (cJSON_IsNull(uncounted_terminated_pods)) { + uncounted_terminated_pods = NULL; + } if (uncounted_terminated_pods) { uncounted_terminated_pods_local_nonprim = v1_uncounted_terminated_pods_parseFromJSON(uncounted_terminated_pods); //nonprimitive } - v1_job_status_local_var = v1_job_status_create ( + v1_job_status_local_var = v1_job_status_create_internal ( active ? active->valuedouble : 0, completed_indexes && !cJSON_IsNull(completed_indexes) ? strdup(completed_indexes->valuestring) : NULL, completion_time && !cJSON_IsNull(completion_time) ? strdup(completion_time->valuestring) : NULL, diff --git a/kubernetes/model/v1_job_status.h b/kubernetes/model/v1_job_status.h index dcd8df20..a7260823 100644 --- a/kubernetes/model/v1_job_status.h +++ b/kubernetes/model/v1_job_status.h @@ -33,9 +33,10 @@ typedef struct v1_job_status_t { int terminating; //numeric struct v1_uncounted_terminated_pods_t *uncounted_terminated_pods; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_job_status_t; -v1_job_status_t *v1_job_status_create( +__attribute__((deprecated)) v1_job_status_t *v1_job_status_create( int active, char *completed_indexes, char *completion_time, diff --git a/kubernetes/model/v1_job_template_spec.c b/kubernetes/model/v1_job_template_spec.c index ba4825ab..a11b0af4 100644 --- a/kubernetes/model/v1_job_template_spec.c +++ b/kubernetes/model/v1_job_template_spec.c @@ -5,7 +5,7 @@ -v1_job_template_spec_t *v1_job_template_spec_create( +static v1_job_template_spec_t *v1_job_template_spec_create_internal( v1_object_meta_t *metadata, v1_job_spec_t *spec ) { @@ -16,14 +16,28 @@ v1_job_template_spec_t *v1_job_template_spec_create( v1_job_template_spec_local_var->metadata = metadata; v1_job_template_spec_local_var->spec = spec; + v1_job_template_spec_local_var->_library_owned = 1; return v1_job_template_spec_local_var; } +__attribute__((deprecated)) v1_job_template_spec_t *v1_job_template_spec_create( + v1_object_meta_t *metadata, + v1_job_spec_t *spec + ) { + return v1_job_template_spec_create_internal ( + metadata, + spec + ); +} void v1_job_template_spec_free(v1_job_template_spec_t *v1_job_template_spec) { if(NULL == v1_job_template_spec){ return ; } + if(v1_job_template_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_job_template_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_job_template_spec->metadata) { v1_object_meta_free(v1_job_template_spec->metadata); @@ -84,18 +98,24 @@ v1_job_template_spec_t *v1_job_template_spec_parseFromJSON(cJSON *v1_job_templat // v1_job_template_spec->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_job_template_specJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_job_template_spec->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_job_template_specJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_job_spec_parseFromJSON(spec); //nonprimitive } - v1_job_template_spec_local_var = v1_job_template_spec_create ( + v1_job_template_spec_local_var = v1_job_template_spec_create_internal ( metadata ? metadata_local_nonprim : NULL, spec ? spec_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_job_template_spec.h b/kubernetes/model/v1_job_template_spec.h index 75f7c886..a5542252 100644 --- a/kubernetes/model/v1_job_template_spec.h +++ b/kubernetes/model/v1_job_template_spec.h @@ -24,9 +24,10 @@ typedef struct v1_job_template_spec_t { struct v1_object_meta_t *metadata; //model struct v1_job_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_job_template_spec_t; -v1_job_template_spec_t *v1_job_template_spec_create( +__attribute__((deprecated)) v1_job_template_spec_t *v1_job_template_spec_create( v1_object_meta_t *metadata, v1_job_spec_t *spec ); diff --git a/kubernetes/model/v1_json_schema_props.c b/kubernetes/model/v1_json_schema_props.c index 41316951..b83855b4 100644 --- a/kubernetes/model/v1_json_schema_props.c +++ b/kubernetes/model/v1_json_schema_props.c @@ -5,7 +5,7 @@ -v1_json_schema_props_t *v1_json_schema_props_create( +static v1_json_schema_props_t *v1_json_schema_props_create_internal( char *ref, char *schema, object_t *additional_items, @@ -100,14 +100,112 @@ v1_json_schema_props_t *v1_json_schema_props_create( v1_json_schema_props_local_var->x_kubernetes_preserve_unknown_fields = x_kubernetes_preserve_unknown_fields; v1_json_schema_props_local_var->x_kubernetes_validations = x_kubernetes_validations; + v1_json_schema_props_local_var->_library_owned = 1; return v1_json_schema_props_local_var; } +__attribute__((deprecated)) v1_json_schema_props_t *v1_json_schema_props_create( + char *ref, + char *schema, + object_t *additional_items, + object_t *additional_properties, + list_t *all_of, + list_t *any_of, + object_t *_default, + list_t* definitions, + list_t* dependencies, + char *description, + list_t *_enum, + object_t *example, + int exclusive_maximum, + int exclusive_minimum, + v1_external_documentation_t *external_docs, + char *format, + char *id, + object_t *items, + long max_items, + long max_length, + long max_properties, + double maximum, + long min_items, + long min_length, + long min_properties, + double minimum, + double multiple_of, + v1_json_schema_props_t *_not, + int nullable, + list_t *one_of, + char *pattern, + list_t* pattern_properties, + list_t* properties, + list_t *required, + char *title, + char *type, + int unique_items, + int x_kubernetes_embedded_resource, + int x_kubernetes_int_or_string, + list_t *x_kubernetes_list_map_keys, + char *x_kubernetes_list_type, + char *x_kubernetes_map_type, + int x_kubernetes_preserve_unknown_fields, + list_t *x_kubernetes_validations + ) { + return v1_json_schema_props_create_internal ( + ref, + schema, + additional_items, + additional_properties, + all_of, + any_of, + _default, + definitions, + dependencies, + description, + _enum, + example, + exclusive_maximum, + exclusive_minimum, + external_docs, + format, + id, + items, + max_items, + max_length, + max_properties, + maximum, + min_items, + min_length, + min_properties, + minimum, + multiple_of, + _not, + nullable, + one_of, + pattern, + pattern_properties, + properties, + required, + title, + type, + unique_items, + x_kubernetes_embedded_resource, + x_kubernetes_int_or_string, + x_kubernetes_list_map_keys, + x_kubernetes_list_type, + x_kubernetes_map_type, + x_kubernetes_preserve_unknown_fields, + x_kubernetes_validations + ); +} void v1_json_schema_props_free(v1_json_schema_props_t *v1_json_schema_props) { if(NULL == v1_json_schema_props){ return ; } + if(v1_json_schema_props->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_json_schema_props_free"); + return ; + } listEntry_t *listEntry; if (v1_json_schema_props->ref) { free(v1_json_schema_props->ref); @@ -145,7 +243,7 @@ void v1_json_schema_props_free(v1_json_schema_props_t *v1_json_schema_props) { } if (v1_json_schema_props->definitions) { list_ForEach(listEntry, v1_json_schema_props->definitions) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -155,7 +253,7 @@ void v1_json_schema_props_free(v1_json_schema_props_t *v1_json_schema_props) { } if (v1_json_schema_props->dependencies) { list_ForEach(listEntry, v1_json_schema_props->dependencies) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -211,7 +309,7 @@ void v1_json_schema_props_free(v1_json_schema_props_t *v1_json_schema_props) { } if (v1_json_schema_props->pattern_properties) { list_ForEach(listEntry, v1_json_schema_props->pattern_properties) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -221,7 +319,7 @@ void v1_json_schema_props_free(v1_json_schema_props_t *v1_json_schema_props) { } if (v1_json_schema_props->properties) { list_ForEach(listEntry, v1_json_schema_props->properties) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -377,7 +475,7 @@ cJSON *v1_json_schema_props_convertToJSON(v1_json_schema_props_t *v1_json_schema listEntry_t *definitionsListEntry; if (v1_json_schema_props->definitions) { list_ForEach(definitionsListEntry, v1_json_schema_props->definitions) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)definitionsListEntry->data; + keyValuePair_t *localKeyValue = definitionsListEntry->data; } } } @@ -393,7 +491,7 @@ cJSON *v1_json_schema_props_convertToJSON(v1_json_schema_props_t *v1_json_schema listEntry_t *dependenciesListEntry; if (v1_json_schema_props->dependencies) { list_ForEach(dependenciesListEntry, v1_json_schema_props->dependencies) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)dependenciesListEntry->data; + keyValuePair_t *localKeyValue = dependenciesListEntry->data; } } } @@ -629,7 +727,7 @@ cJSON *v1_json_schema_props_convertToJSON(v1_json_schema_props_t *v1_json_schema listEntry_t *pattern_propertiesListEntry; if (v1_json_schema_props->pattern_properties) { list_ForEach(pattern_propertiesListEntry, v1_json_schema_props->pattern_properties) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)pattern_propertiesListEntry->data; + keyValuePair_t *localKeyValue = pattern_propertiesListEntry->data; } } } @@ -645,7 +743,7 @@ cJSON *v1_json_schema_props_convertToJSON(v1_json_schema_props_t *v1_json_schema listEntry_t *propertiesListEntry; if (v1_json_schema_props->properties) { list_ForEach(propertiesListEntry, v1_json_schema_props->properties) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)propertiesListEntry->data; + keyValuePair_t *localKeyValue = propertiesListEntry->data; } } } @@ -660,7 +758,7 @@ cJSON *v1_json_schema_props_convertToJSON(v1_json_schema_props_t *v1_json_schema listEntry_t *requiredListEntry; list_ForEach(requiredListEntry, v1_json_schema_props->required) { - if(cJSON_AddStringToObject(required, "", (char*)requiredListEntry->data) == NULL) + if(cJSON_AddStringToObject(required, "", requiredListEntry->data) == NULL) { goto fail; } @@ -717,7 +815,7 @@ cJSON *v1_json_schema_props_convertToJSON(v1_json_schema_props_t *v1_json_schema listEntry_t *x_kubernetes_list_map_keysListEntry; list_ForEach(x_kubernetes_list_map_keysListEntry, v1_json_schema_props->x_kubernetes_list_map_keys) { - if(cJSON_AddStringToObject(x_kubernetes_list_map_keys, "", (char*)x_kubernetes_list_map_keysListEntry->data) == NULL) + if(cJSON_AddStringToObject(x_kubernetes_list_map_keys, "", x_kubernetes_list_map_keysListEntry->data) == NULL) { goto fail; } @@ -821,6 +919,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->ref cJSON *ref = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "$ref"); + if (cJSON_IsNull(ref)) { + ref = NULL; + } if (ref) { if(!cJSON_IsString(ref) && !cJSON_IsNull(ref)) { @@ -830,6 +931,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->schema cJSON *schema = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "$schema"); + if (cJSON_IsNull(schema)) { + schema = NULL; + } if (schema) { if(!cJSON_IsString(schema) && !cJSON_IsNull(schema)) { @@ -839,6 +943,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->additional_items cJSON *additional_items = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "additionalItems"); + if (cJSON_IsNull(additional_items)) { + additional_items = NULL; + } object_t *additional_items_local_object = NULL; if (additional_items) { additional_items_local_object = object_parseFromJSON(additional_items); //object @@ -846,6 +953,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->additional_properties cJSON *additional_properties = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "additionalProperties"); + if (cJSON_IsNull(additional_properties)) { + additional_properties = NULL; + } object_t *additional_properties_local_object = NULL; if (additional_properties) { additional_properties_local_object = object_parseFromJSON(additional_properties); //object @@ -853,6 +963,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->all_of cJSON *all_of = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "allOf"); + if (cJSON_IsNull(all_of)) { + all_of = NULL; + } if (all_of) { cJSON *all_of_local_nonprimitive = NULL; if(!cJSON_IsArray(all_of)){ @@ -874,6 +987,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->any_of cJSON *any_of = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "anyOf"); + if (cJSON_IsNull(any_of)) { + any_of = NULL; + } if (any_of) { cJSON *any_of_local_nonprimitive = NULL; if(!cJSON_IsArray(any_of)){ @@ -895,6 +1011,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->_default cJSON *_default = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "default"); + if (cJSON_IsNull(_default)) { + _default = NULL; + } object_t *_default_local_object = NULL; if (_default) { _default_local_object = object_parseFromJSON(_default); //object @@ -902,6 +1021,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->definitions cJSON *definitions = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "definitions"); + if (cJSON_IsNull(definitions)) { + definitions = NULL; + } if (definitions) { // The data type of the elements in v1_json_schema_props->definitions is currently not supported. @@ -910,6 +1032,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->dependencies cJSON *dependencies = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "dependencies"); + if (cJSON_IsNull(dependencies)) { + dependencies = NULL; + } if (dependencies) { cJSON *dependencies_local_map = NULL; if(!cJSON_IsObject(dependencies) && !cJSON_IsNull(dependencies)) @@ -930,6 +1055,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->description cJSON *description = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "description"); + if (cJSON_IsNull(description)) { + description = NULL; + } if (description) { if(!cJSON_IsString(description) && !cJSON_IsNull(description)) { @@ -939,6 +1067,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->_enum cJSON *_enum = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "enum"); + if (cJSON_IsNull(_enum)) { + _enum = NULL; + } if (_enum) { cJSON *_enum_local_nonprimitive = NULL; if(!cJSON_IsArray(_enum)){ @@ -960,6 +1091,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->example cJSON *example = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "example"); + if (cJSON_IsNull(example)) { + example = NULL; + } object_t *example_local_object = NULL; if (example) { example_local_object = object_parseFromJSON(example); //object @@ -967,6 +1101,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->exclusive_maximum cJSON *exclusive_maximum = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "exclusiveMaximum"); + if (cJSON_IsNull(exclusive_maximum)) { + exclusive_maximum = NULL; + } if (exclusive_maximum) { if(!cJSON_IsBool(exclusive_maximum)) { @@ -976,6 +1113,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->exclusive_minimum cJSON *exclusive_minimum = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "exclusiveMinimum"); + if (cJSON_IsNull(exclusive_minimum)) { + exclusive_minimum = NULL; + } if (exclusive_minimum) { if(!cJSON_IsBool(exclusive_minimum)) { @@ -985,12 +1125,18 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->external_docs cJSON *external_docs = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "externalDocs"); + if (cJSON_IsNull(external_docs)) { + external_docs = NULL; + } if (external_docs) { external_docs_local_nonprim = v1_external_documentation_parseFromJSON(external_docs); //nonprimitive } // v1_json_schema_props->format cJSON *format = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "format"); + if (cJSON_IsNull(format)) { + format = NULL; + } if (format) { if(!cJSON_IsString(format) && !cJSON_IsNull(format)) { @@ -1000,6 +1146,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->id cJSON *id = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsString(id) && !cJSON_IsNull(id)) { @@ -1009,6 +1158,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } object_t *items_local_object = NULL; if (items) { items_local_object = object_parseFromJSON(items); //object @@ -1016,6 +1168,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->max_items cJSON *max_items = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "maxItems"); + if (cJSON_IsNull(max_items)) { + max_items = NULL; + } if (max_items) { if(!cJSON_IsNumber(max_items)) { @@ -1025,6 +1180,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->max_length cJSON *max_length = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "maxLength"); + if (cJSON_IsNull(max_length)) { + max_length = NULL; + } if (max_length) { if(!cJSON_IsNumber(max_length)) { @@ -1034,6 +1192,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->max_properties cJSON *max_properties = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "maxProperties"); + if (cJSON_IsNull(max_properties)) { + max_properties = NULL; + } if (max_properties) { if(!cJSON_IsNumber(max_properties)) { @@ -1043,6 +1204,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->maximum cJSON *maximum = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "maximum"); + if (cJSON_IsNull(maximum)) { + maximum = NULL; + } if (maximum) { if(!cJSON_IsNumber(maximum)) { @@ -1052,6 +1216,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->min_items cJSON *min_items = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "minItems"); + if (cJSON_IsNull(min_items)) { + min_items = NULL; + } if (min_items) { if(!cJSON_IsNumber(min_items)) { @@ -1061,6 +1228,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->min_length cJSON *min_length = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "minLength"); + if (cJSON_IsNull(min_length)) { + min_length = NULL; + } if (min_length) { if(!cJSON_IsNumber(min_length)) { @@ -1070,6 +1240,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->min_properties cJSON *min_properties = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "minProperties"); + if (cJSON_IsNull(min_properties)) { + min_properties = NULL; + } if (min_properties) { if(!cJSON_IsNumber(min_properties)) { @@ -1079,6 +1252,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->minimum cJSON *minimum = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "minimum"); + if (cJSON_IsNull(minimum)) { + minimum = NULL; + } if (minimum) { if(!cJSON_IsNumber(minimum)) { @@ -1088,6 +1264,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->multiple_of cJSON *multiple_of = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "multipleOf"); + if (cJSON_IsNull(multiple_of)) { + multiple_of = NULL; + } if (multiple_of) { if(!cJSON_IsNumber(multiple_of)) { @@ -1097,12 +1276,18 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->_not cJSON *_not = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "not"); + if (cJSON_IsNull(_not)) { + _not = NULL; + } if (_not) { _not_local_nonprim = v1_json_schema_props_parseFromJSON(_not); //nonprimitive } // v1_json_schema_props->nullable cJSON *nullable = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "nullable"); + if (cJSON_IsNull(nullable)) { + nullable = NULL; + } if (nullable) { if(!cJSON_IsBool(nullable)) { @@ -1112,6 +1297,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->one_of cJSON *one_of = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "oneOf"); + if (cJSON_IsNull(one_of)) { + one_of = NULL; + } if (one_of) { cJSON *one_of_local_nonprimitive = NULL; if(!cJSON_IsArray(one_of)){ @@ -1133,6 +1321,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->pattern cJSON *pattern = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "pattern"); + if (cJSON_IsNull(pattern)) { + pattern = NULL; + } if (pattern) { if(!cJSON_IsString(pattern) && !cJSON_IsNull(pattern)) { @@ -1142,6 +1333,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->pattern_properties cJSON *pattern_properties = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "patternProperties"); + if (cJSON_IsNull(pattern_properties)) { + pattern_properties = NULL; + } if (pattern_properties) { // The data type of the elements in v1_json_schema_props->pattern_properties is currently not supported. @@ -1150,6 +1344,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->properties cJSON *properties = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "properties"); + if (cJSON_IsNull(properties)) { + properties = NULL; + } if (properties) { // The data type of the elements in v1_json_schema_props->properties is currently not supported. @@ -1158,6 +1355,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->required cJSON *required = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "required"); + if (cJSON_IsNull(required)) { + required = NULL; + } if (required) { cJSON *required_local = NULL; if(!cJSON_IsArray(required)) { @@ -1177,6 +1377,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->title cJSON *title = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "title"); + if (cJSON_IsNull(title)) { + title = NULL; + } if (title) { if(!cJSON_IsString(title) && !cJSON_IsNull(title)) { @@ -1186,6 +1389,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -1195,6 +1401,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->unique_items cJSON *unique_items = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "uniqueItems"); + if (cJSON_IsNull(unique_items)) { + unique_items = NULL; + } if (unique_items) { if(!cJSON_IsBool(unique_items)) { @@ -1204,6 +1413,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_embedded_resource cJSON *x_kubernetes_embedded_resource = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-embedded-resource"); + if (cJSON_IsNull(x_kubernetes_embedded_resource)) { + x_kubernetes_embedded_resource = NULL; + } if (x_kubernetes_embedded_resource) { if(!cJSON_IsBool(x_kubernetes_embedded_resource)) { @@ -1213,6 +1425,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_int_or_string cJSON *x_kubernetes_int_or_string = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-int-or-string"); + if (cJSON_IsNull(x_kubernetes_int_or_string)) { + x_kubernetes_int_or_string = NULL; + } if (x_kubernetes_int_or_string) { if(!cJSON_IsBool(x_kubernetes_int_or_string)) { @@ -1222,6 +1437,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_list_map_keys cJSON *x_kubernetes_list_map_keys = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-list-map-keys"); + if (cJSON_IsNull(x_kubernetes_list_map_keys)) { + x_kubernetes_list_map_keys = NULL; + } if (x_kubernetes_list_map_keys) { cJSON *x_kubernetes_list_map_keys_local = NULL; if(!cJSON_IsArray(x_kubernetes_list_map_keys)) { @@ -1241,6 +1459,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_list_type cJSON *x_kubernetes_list_type = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-list-type"); + if (cJSON_IsNull(x_kubernetes_list_type)) { + x_kubernetes_list_type = NULL; + } if (x_kubernetes_list_type) { if(!cJSON_IsString(x_kubernetes_list_type) && !cJSON_IsNull(x_kubernetes_list_type)) { @@ -1250,6 +1471,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_map_type cJSON *x_kubernetes_map_type = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-map-type"); + if (cJSON_IsNull(x_kubernetes_map_type)) { + x_kubernetes_map_type = NULL; + } if (x_kubernetes_map_type) { if(!cJSON_IsString(x_kubernetes_map_type) && !cJSON_IsNull(x_kubernetes_map_type)) { @@ -1259,6 +1483,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_preserve_unknown_fields cJSON *x_kubernetes_preserve_unknown_fields = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-preserve-unknown-fields"); + if (cJSON_IsNull(x_kubernetes_preserve_unknown_fields)) { + x_kubernetes_preserve_unknown_fields = NULL; + } if (x_kubernetes_preserve_unknown_fields) { if(!cJSON_IsBool(x_kubernetes_preserve_unknown_fields)) { @@ -1268,6 +1495,9 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_validations cJSON *x_kubernetes_validations = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-validations"); + if (cJSON_IsNull(x_kubernetes_validations)) { + x_kubernetes_validations = NULL; + } if (x_kubernetes_validations) { cJSON *x_kubernetes_validations_local_nonprimitive = NULL; if(!cJSON_IsArray(x_kubernetes_validations)){ @@ -1288,7 +1518,7 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema } - v1_json_schema_props_local_var = v1_json_schema_props_create ( + v1_json_schema_props_local_var = v1_json_schema_props_create_internal ( ref && !cJSON_IsNull(ref) ? strdup(ref->valuestring) : NULL, schema && !cJSON_IsNull(schema) ? strdup(schema->valuestring) : NULL, additional_items ? additional_items_local_object : NULL, @@ -1361,7 +1591,7 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema if (dependenciesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, dependenciesList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; keyValuePair_free(localKeyValue); diff --git a/kubernetes/model/v1_json_schema_props.h b/kubernetes/model/v1_json_schema_props.h index 51b6fa4f..46e5411f 100644 --- a/kubernetes/model/v1_json_schema_props.h +++ b/kubernetes/model/v1_json_schema_props.h @@ -67,9 +67,10 @@ typedef struct v1_json_schema_props_t { int x_kubernetes_preserve_unknown_fields; //boolean list_t *x_kubernetes_validations; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_json_schema_props_t; -v1_json_schema_props_t *v1_json_schema_props_create( +__attribute__((deprecated)) v1_json_schema_props_t *v1_json_schema_props_create( char *ref, char *schema, object_t *additional_items, diff --git a/kubernetes/model/v1_key_to_path.c b/kubernetes/model/v1_key_to_path.c index f849af6e..6cae0044 100644 --- a/kubernetes/model/v1_key_to_path.c +++ b/kubernetes/model/v1_key_to_path.c @@ -5,7 +5,7 @@ -v1_key_to_path_t *v1_key_to_path_create( +static v1_key_to_path_t *v1_key_to_path_create_internal( char *key, int mode, char *path @@ -18,14 +18,30 @@ v1_key_to_path_t *v1_key_to_path_create( v1_key_to_path_local_var->mode = mode; v1_key_to_path_local_var->path = path; + v1_key_to_path_local_var->_library_owned = 1; return v1_key_to_path_local_var; } +__attribute__((deprecated)) v1_key_to_path_t *v1_key_to_path_create( + char *key, + int mode, + char *path + ) { + return v1_key_to_path_create_internal ( + key, + mode, + path + ); +} void v1_key_to_path_free(v1_key_to_path_t *v1_key_to_path) { if(NULL == v1_key_to_path){ return ; } + if(v1_key_to_path->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_key_to_path_free"); + return ; + } listEntry_t *listEntry; if (v1_key_to_path->key) { free(v1_key_to_path->key); @@ -80,6 +96,9 @@ v1_key_to_path_t *v1_key_to_path_parseFromJSON(cJSON *v1_key_to_pathJSON){ // v1_key_to_path->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_key_to_pathJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -92,6 +111,9 @@ v1_key_to_path_t *v1_key_to_path_parseFromJSON(cJSON *v1_key_to_pathJSON){ // v1_key_to_path->mode cJSON *mode = cJSON_GetObjectItemCaseSensitive(v1_key_to_pathJSON, "mode"); + if (cJSON_IsNull(mode)) { + mode = NULL; + } if (mode) { if(!cJSON_IsNumber(mode)) { @@ -101,6 +123,9 @@ v1_key_to_path_t *v1_key_to_path_parseFromJSON(cJSON *v1_key_to_pathJSON){ // v1_key_to_path->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_key_to_pathJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -112,7 +137,7 @@ v1_key_to_path_t *v1_key_to_path_parseFromJSON(cJSON *v1_key_to_pathJSON){ } - v1_key_to_path_local_var = v1_key_to_path_create ( + v1_key_to_path_local_var = v1_key_to_path_create_internal ( strdup(key->valuestring), mode ? mode->valuedouble : 0, strdup(path->valuestring) diff --git a/kubernetes/model/v1_key_to_path.h b/kubernetes/model/v1_key_to_path.h index 15b82162..b669fc15 100644 --- a/kubernetes/model/v1_key_to_path.h +++ b/kubernetes/model/v1_key_to_path.h @@ -23,9 +23,10 @@ typedef struct v1_key_to_path_t { int mode; //numeric char *path; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_key_to_path_t; -v1_key_to_path_t *v1_key_to_path_create( +__attribute__((deprecated)) v1_key_to_path_t *v1_key_to_path_create( char *key, int mode, char *path diff --git a/kubernetes/model/v1_label_selector.c b/kubernetes/model/v1_label_selector.c index 5739a34f..7ddf8fa5 100644 --- a/kubernetes/model/v1_label_selector.c +++ b/kubernetes/model/v1_label_selector.c @@ -5,7 +5,7 @@ -v1_label_selector_t *v1_label_selector_create( +static v1_label_selector_t *v1_label_selector_create_internal( list_t *match_expressions, list_t* match_labels ) { @@ -16,14 +16,28 @@ v1_label_selector_t *v1_label_selector_create( v1_label_selector_local_var->match_expressions = match_expressions; v1_label_selector_local_var->match_labels = match_labels; + v1_label_selector_local_var->_library_owned = 1; return v1_label_selector_local_var; } +__attribute__((deprecated)) v1_label_selector_t *v1_label_selector_create( + list_t *match_expressions, + list_t* match_labels + ) { + return v1_label_selector_create_internal ( + match_expressions, + match_labels + ); +} void v1_label_selector_free(v1_label_selector_t *v1_label_selector) { if(NULL == v1_label_selector){ return ; } + if(v1_label_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_label_selector_free"); + return ; + } listEntry_t *listEntry; if (v1_label_selector->match_expressions) { list_ForEach(listEntry, v1_label_selector->match_expressions) { @@ -34,7 +48,7 @@ void v1_label_selector_free(v1_label_selector_t *v1_label_selector) { } if (v1_label_selector->match_labels) { list_ForEach(listEntry, v1_label_selector->match_labels) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -78,8 +92,8 @@ cJSON *v1_label_selector_convertToJSON(v1_label_selector_t *v1_label_selector) { listEntry_t *match_labelsListEntry; if (v1_label_selector->match_labels) { list_ForEach(match_labelsListEntry, v1_label_selector->match_labels) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)match_labelsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = match_labelsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -107,6 +121,9 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO // v1_label_selector->match_expressions cJSON *match_expressions = cJSON_GetObjectItemCaseSensitive(v1_label_selectorJSON, "matchExpressions"); + if (cJSON_IsNull(match_expressions)) { + match_expressions = NULL; + } if (match_expressions) { cJSON *match_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_expressions)){ @@ -128,6 +145,9 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO // v1_label_selector->match_labels cJSON *match_labels = cJSON_GetObjectItemCaseSensitive(v1_label_selectorJSON, "matchLabels"); + if (cJSON_IsNull(match_labels)) { + match_labels = NULL; + } if (match_labels) { cJSON *match_labels_local_map = NULL; if(!cJSON_IsObject(match_labels) && !cJSON_IsNull(match_labels)) @@ -152,7 +172,7 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO } - v1_label_selector_local_var = v1_label_selector_create ( + v1_label_selector_local_var = v1_label_selector_create_internal ( match_expressions ? match_expressionsList : NULL, match_labels ? match_labelsList : NULL ); @@ -171,7 +191,7 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO if (match_labelsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, match_labelsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_label_selector.h b/kubernetes/model/v1_label_selector.h index c072cdf9..36ad2ab4 100644 --- a/kubernetes/model/v1_label_selector.h +++ b/kubernetes/model/v1_label_selector.h @@ -23,9 +23,10 @@ typedef struct v1_label_selector_t { list_t *match_expressions; //nonprimitive container list_t* match_labels; //map + int _library_owned; // Is the library responsible for freeing this object? } v1_label_selector_t; -v1_label_selector_t *v1_label_selector_create( +__attribute__((deprecated)) v1_label_selector_t *v1_label_selector_create( list_t *match_expressions, list_t* match_labels ); diff --git a/kubernetes/model/v1_label_selector_attributes.c b/kubernetes/model/v1_label_selector_attributes.c new file mode 100644 index 00000000..a0e67d19 --- /dev/null +++ b/kubernetes/model/v1_label_selector_attributes.c @@ -0,0 +1,156 @@ +#include +#include +#include +#include "v1_label_selector_attributes.h" + + + +static v1_label_selector_attributes_t *v1_label_selector_attributes_create_internal( + char *raw_selector, + list_t *requirements + ) { + v1_label_selector_attributes_t *v1_label_selector_attributes_local_var = malloc(sizeof(v1_label_selector_attributes_t)); + if (!v1_label_selector_attributes_local_var) { + return NULL; + } + v1_label_selector_attributes_local_var->raw_selector = raw_selector; + v1_label_selector_attributes_local_var->requirements = requirements; + + v1_label_selector_attributes_local_var->_library_owned = 1; + return v1_label_selector_attributes_local_var; +} + +__attribute__((deprecated)) v1_label_selector_attributes_t *v1_label_selector_attributes_create( + char *raw_selector, + list_t *requirements + ) { + return v1_label_selector_attributes_create_internal ( + raw_selector, + requirements + ); +} + +void v1_label_selector_attributes_free(v1_label_selector_attributes_t *v1_label_selector_attributes) { + if(NULL == v1_label_selector_attributes){ + return ; + } + if(v1_label_selector_attributes->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_label_selector_attributes_free"); + return ; + } + listEntry_t *listEntry; + if (v1_label_selector_attributes->raw_selector) { + free(v1_label_selector_attributes->raw_selector); + v1_label_selector_attributes->raw_selector = NULL; + } + if (v1_label_selector_attributes->requirements) { + list_ForEach(listEntry, v1_label_selector_attributes->requirements) { + v1_label_selector_requirement_free(listEntry->data); + } + list_freeList(v1_label_selector_attributes->requirements); + v1_label_selector_attributes->requirements = NULL; + } + free(v1_label_selector_attributes); +} + +cJSON *v1_label_selector_attributes_convertToJSON(v1_label_selector_attributes_t *v1_label_selector_attributes) { + cJSON *item = cJSON_CreateObject(); + + // v1_label_selector_attributes->raw_selector + if(v1_label_selector_attributes->raw_selector) { + if(cJSON_AddStringToObject(item, "rawSelector", v1_label_selector_attributes->raw_selector) == NULL) { + goto fail; //String + } + } + + + // v1_label_selector_attributes->requirements + if(v1_label_selector_attributes->requirements) { + cJSON *requirements = cJSON_AddArrayToObject(item, "requirements"); + if(requirements == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *requirementsListEntry; + if (v1_label_selector_attributes->requirements) { + list_ForEach(requirementsListEntry, v1_label_selector_attributes->requirements) { + cJSON *itemLocal = v1_label_selector_requirement_convertToJSON(requirementsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(requirements, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_label_selector_attributes_t *v1_label_selector_attributes_parseFromJSON(cJSON *v1_label_selector_attributesJSON){ + + v1_label_selector_attributes_t *v1_label_selector_attributes_local_var = NULL; + + // define the local list for v1_label_selector_attributes->requirements + list_t *requirementsList = NULL; + + // v1_label_selector_attributes->raw_selector + cJSON *raw_selector = cJSON_GetObjectItemCaseSensitive(v1_label_selector_attributesJSON, "rawSelector"); + if (cJSON_IsNull(raw_selector)) { + raw_selector = NULL; + } + if (raw_selector) { + if(!cJSON_IsString(raw_selector) && !cJSON_IsNull(raw_selector)) + { + goto end; //String + } + } + + // v1_label_selector_attributes->requirements + cJSON *requirements = cJSON_GetObjectItemCaseSensitive(v1_label_selector_attributesJSON, "requirements"); + if (cJSON_IsNull(requirements)) { + requirements = NULL; + } + if (requirements) { + cJSON *requirements_local_nonprimitive = NULL; + if(!cJSON_IsArray(requirements)){ + goto end; //nonprimitive container + } + + requirementsList = list_createList(); + + cJSON_ArrayForEach(requirements_local_nonprimitive,requirements ) + { + if(!cJSON_IsObject(requirements_local_nonprimitive)){ + goto end; + } + v1_label_selector_requirement_t *requirementsItem = v1_label_selector_requirement_parseFromJSON(requirements_local_nonprimitive); + + list_addElement(requirementsList, requirementsItem); + } + } + + + v1_label_selector_attributes_local_var = v1_label_selector_attributes_create_internal ( + raw_selector && !cJSON_IsNull(raw_selector) ? strdup(raw_selector->valuestring) : NULL, + requirements ? requirementsList : NULL + ); + + return v1_label_selector_attributes_local_var; +end: + if (requirementsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requirementsList) { + v1_label_selector_requirement_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requirementsList); + requirementsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_label_selector_attributes.h b/kubernetes/model/v1_label_selector_attributes.h new file mode 100644 index 00000000..1f445c13 --- /dev/null +++ b/kubernetes/model/v1_label_selector_attributes.h @@ -0,0 +1,41 @@ +/* + * v1_label_selector_attributes.h + * + * LabelSelectorAttributes indicates a label limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid. + */ + +#ifndef _v1_label_selector_attributes_H_ +#define _v1_label_selector_attributes_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_label_selector_attributes_t v1_label_selector_attributes_t; + +#include "v1_label_selector_requirement.h" + + + +typedef struct v1_label_selector_attributes_t { + char *raw_selector; // string + list_t *requirements; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_label_selector_attributes_t; + +__attribute__((deprecated)) v1_label_selector_attributes_t *v1_label_selector_attributes_create( + char *raw_selector, + list_t *requirements +); + +void v1_label_selector_attributes_free(v1_label_selector_attributes_t *v1_label_selector_attributes); + +v1_label_selector_attributes_t *v1_label_selector_attributes_parseFromJSON(cJSON *v1_label_selector_attributesJSON); + +cJSON *v1_label_selector_attributes_convertToJSON(v1_label_selector_attributes_t *v1_label_selector_attributes); + +#endif /* _v1_label_selector_attributes_H_ */ + diff --git a/kubernetes/model/v1_label_selector_requirement.c b/kubernetes/model/v1_label_selector_requirement.c index 7ce417de..3411026f 100644 --- a/kubernetes/model/v1_label_selector_requirement.c +++ b/kubernetes/model/v1_label_selector_requirement.c @@ -5,7 +5,7 @@ -v1_label_selector_requirement_t *v1_label_selector_requirement_create( +static v1_label_selector_requirement_t *v1_label_selector_requirement_create_internal( char *key, char *_operator, list_t *values @@ -18,14 +18,30 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_create( v1_label_selector_requirement_local_var->_operator = _operator; v1_label_selector_requirement_local_var->values = values; + v1_label_selector_requirement_local_var->_library_owned = 1; return v1_label_selector_requirement_local_var; } +__attribute__((deprecated)) v1_label_selector_requirement_t *v1_label_selector_requirement_create( + char *key, + char *_operator, + list_t *values + ) { + return v1_label_selector_requirement_create_internal ( + key, + _operator, + values + ); +} void v1_label_selector_requirement_free(v1_label_selector_requirement_t *v1_label_selector_requirement) { if(NULL == v1_label_selector_requirement){ return ; } + if(v1_label_selector_requirement->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_label_selector_requirement_free"); + return ; + } listEntry_t *listEntry; if (v1_label_selector_requirement->key) { free(v1_label_selector_requirement->key); @@ -75,7 +91,7 @@ cJSON *v1_label_selector_requirement_convertToJSON(v1_label_selector_requirement listEntry_t *valuesListEntry; list_ForEach(valuesListEntry, v1_label_selector_requirement->values) { - if(cJSON_AddStringToObject(values, "", (char*)valuesListEntry->data) == NULL) + if(cJSON_AddStringToObject(values, "", valuesListEntry->data) == NULL) { goto fail; } @@ -99,6 +115,9 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_parseFromJSON(cJS // v1_label_selector_requirement->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_label_selector_requirementJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -111,6 +130,9 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_parseFromJSON(cJS // v1_label_selector_requirement->_operator cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_label_selector_requirementJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } if (!_operator) { goto end; } @@ -123,6 +145,9 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_parseFromJSON(cJS // v1_label_selector_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_label_selector_requirementJSON, "values"); + if (cJSON_IsNull(values)) { + values = NULL; + } if (values) { cJSON *values_local = NULL; if(!cJSON_IsArray(values)) { @@ -141,7 +166,7 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_parseFromJSON(cJS } - v1_label_selector_requirement_local_var = v1_label_selector_requirement_create ( + v1_label_selector_requirement_local_var = v1_label_selector_requirement_create_internal ( strdup(key->valuestring), strdup(_operator->valuestring), values ? valuesList : NULL diff --git a/kubernetes/model/v1_label_selector_requirement.h b/kubernetes/model/v1_label_selector_requirement.h index a3818a68..467b878d 100644 --- a/kubernetes/model/v1_label_selector_requirement.h +++ b/kubernetes/model/v1_label_selector_requirement.h @@ -23,9 +23,10 @@ typedef struct v1_label_selector_requirement_t { char *_operator; // string list_t *values; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_label_selector_requirement_t; -v1_label_selector_requirement_t *v1_label_selector_requirement_create( +__attribute__((deprecated)) v1_label_selector_requirement_t *v1_label_selector_requirement_create( char *key, char *_operator, list_t *values diff --git a/kubernetes/model/v1_lease.c b/kubernetes/model/v1_lease.c index acccb67c..214d66cc 100644 --- a/kubernetes/model/v1_lease.c +++ b/kubernetes/model/v1_lease.c @@ -5,7 +5,7 @@ -v1_lease_t *v1_lease_create( +static v1_lease_t *v1_lease_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_lease_t *v1_lease_create( v1_lease_local_var->metadata = metadata; v1_lease_local_var->spec = spec; + v1_lease_local_var->_library_owned = 1; return v1_lease_local_var; } +__attribute__((deprecated)) v1_lease_t *v1_lease_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_lease_spec_t *spec + ) { + return v1_lease_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1_lease_free(v1_lease_t *v1_lease) { if(NULL == v1_lease){ return ; } + if(v1_lease->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_lease_free"); + return ; + } listEntry_t *listEntry; if (v1_lease->api_version) { free(v1_lease->api_version); @@ -112,6 +130,9 @@ v1_lease_t *v1_lease_parseFromJSON(cJSON *v1_leaseJSON){ // v1_lease->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_leaseJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,6 +142,9 @@ v1_lease_t *v1_lease_parseFromJSON(cJSON *v1_leaseJSON){ // v1_lease->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_leaseJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -130,18 +154,24 @@ v1_lease_t *v1_lease_parseFromJSON(cJSON *v1_leaseJSON){ // v1_lease->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_leaseJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_lease->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_leaseJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_lease_spec_parseFromJSON(spec); //nonprimitive } - v1_lease_local_var = v1_lease_create ( + v1_lease_local_var = v1_lease_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_lease.h b/kubernetes/model/v1_lease.h index 58e8ca55..7b0be3e9 100644 --- a/kubernetes/model/v1_lease.h +++ b/kubernetes/model/v1_lease.h @@ -26,9 +26,10 @@ typedef struct v1_lease_t { struct v1_object_meta_t *metadata; //model struct v1_lease_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_lease_t; -v1_lease_t *v1_lease_create( +__attribute__((deprecated)) v1_lease_t *v1_lease_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_lease_list.c b/kubernetes/model/v1_lease_list.c index 45163a65..41aa7f6e 100644 --- a/kubernetes/model/v1_lease_list.c +++ b/kubernetes/model/v1_lease_list.c @@ -5,7 +5,7 @@ -v1_lease_list_t *v1_lease_list_create( +static v1_lease_list_t *v1_lease_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_lease_list_t *v1_lease_list_create( v1_lease_list_local_var->kind = kind; v1_lease_list_local_var->metadata = metadata; + v1_lease_list_local_var->_library_owned = 1; return v1_lease_list_local_var; } +__attribute__((deprecated)) v1_lease_list_t *v1_lease_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_lease_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_lease_list_free(v1_lease_list_t *v1_lease_list) { if(NULL == v1_lease_list){ return ; } + if(v1_lease_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_lease_list_free"); + return ; + } listEntry_t *listEntry; if (v1_lease_list->api_version) { free(v1_lease_list->api_version); @@ -123,6 +141,9 @@ v1_lease_list_t *v1_lease_list_parseFromJSON(cJSON *v1_lease_listJSON){ // v1_lease_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_lease_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_lease_list_t *v1_lease_list_parseFromJSON(cJSON *v1_lease_listJSON){ // v1_lease_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_lease_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_lease_list_t *v1_lease_list_parseFromJSON(cJSON *v1_lease_listJSON){ // v1_lease_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_lease_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_lease_list_t *v1_lease_list_parseFromJSON(cJSON *v1_lease_listJSON){ // v1_lease_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_lease_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_lease_list_local_var = v1_lease_list_create ( + v1_lease_list_local_var = v1_lease_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_lease_list.h b/kubernetes/model/v1_lease_list.h index 7c958e0c..19f45684 100644 --- a/kubernetes/model/v1_lease_list.h +++ b/kubernetes/model/v1_lease_list.h @@ -26,9 +26,10 @@ typedef struct v1_lease_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_lease_list_t; -v1_lease_list_t *v1_lease_list_create( +__attribute__((deprecated)) v1_lease_list_t *v1_lease_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_lease_spec.c b/kubernetes/model/v1_lease_spec.c index 9a424d96..fe91ce04 100644 --- a/kubernetes/model/v1_lease_spec.c +++ b/kubernetes/model/v1_lease_spec.c @@ -5,12 +5,14 @@ -v1_lease_spec_t *v1_lease_spec_create( +static v1_lease_spec_t *v1_lease_spec_create_internal( char *acquire_time, char *holder_identity, int lease_duration_seconds, int lease_transitions, - char *renew_time + char *preferred_holder, + char *renew_time, + char *strategy ) { v1_lease_spec_t *v1_lease_spec_local_var = malloc(sizeof(v1_lease_spec_t)); if (!v1_lease_spec_local_var) { @@ -20,16 +22,42 @@ v1_lease_spec_t *v1_lease_spec_create( v1_lease_spec_local_var->holder_identity = holder_identity; v1_lease_spec_local_var->lease_duration_seconds = lease_duration_seconds; v1_lease_spec_local_var->lease_transitions = lease_transitions; + v1_lease_spec_local_var->preferred_holder = preferred_holder; v1_lease_spec_local_var->renew_time = renew_time; + v1_lease_spec_local_var->strategy = strategy; + v1_lease_spec_local_var->_library_owned = 1; return v1_lease_spec_local_var; } +__attribute__((deprecated)) v1_lease_spec_t *v1_lease_spec_create( + char *acquire_time, + char *holder_identity, + int lease_duration_seconds, + int lease_transitions, + char *preferred_holder, + char *renew_time, + char *strategy + ) { + return v1_lease_spec_create_internal ( + acquire_time, + holder_identity, + lease_duration_seconds, + lease_transitions, + preferred_holder, + renew_time, + strategy + ); +} void v1_lease_spec_free(v1_lease_spec_t *v1_lease_spec) { if(NULL == v1_lease_spec){ return ; } + if(v1_lease_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_lease_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_lease_spec->acquire_time) { free(v1_lease_spec->acquire_time); @@ -39,10 +67,18 @@ void v1_lease_spec_free(v1_lease_spec_t *v1_lease_spec) { free(v1_lease_spec->holder_identity); v1_lease_spec->holder_identity = NULL; } + if (v1_lease_spec->preferred_holder) { + free(v1_lease_spec->preferred_holder); + v1_lease_spec->preferred_holder = NULL; + } if (v1_lease_spec->renew_time) { free(v1_lease_spec->renew_time); v1_lease_spec->renew_time = NULL; } + if (v1_lease_spec->strategy) { + free(v1_lease_spec->strategy); + v1_lease_spec->strategy = NULL; + } free(v1_lease_spec); } @@ -81,6 +117,14 @@ cJSON *v1_lease_spec_convertToJSON(v1_lease_spec_t *v1_lease_spec) { } + // v1_lease_spec->preferred_holder + if(v1_lease_spec->preferred_holder) { + if(cJSON_AddStringToObject(item, "preferredHolder", v1_lease_spec->preferred_holder) == NULL) { + goto fail; //String + } + } + + // v1_lease_spec->renew_time if(v1_lease_spec->renew_time) { if(cJSON_AddStringToObject(item, "renewTime", v1_lease_spec->renew_time) == NULL) { @@ -88,6 +132,14 @@ cJSON *v1_lease_spec_convertToJSON(v1_lease_spec_t *v1_lease_spec) { } } + + // v1_lease_spec->strategy + if(v1_lease_spec->strategy) { + if(cJSON_AddStringToObject(item, "strategy", v1_lease_spec->strategy) == NULL) { + goto fail; //String + } + } + return item; fail: if (item) { @@ -102,6 +154,9 @@ v1_lease_spec_t *v1_lease_spec_parseFromJSON(cJSON *v1_lease_specJSON){ // v1_lease_spec->acquire_time cJSON *acquire_time = cJSON_GetObjectItemCaseSensitive(v1_lease_specJSON, "acquireTime"); + if (cJSON_IsNull(acquire_time)) { + acquire_time = NULL; + } if (acquire_time) { if(!cJSON_IsString(acquire_time) && !cJSON_IsNull(acquire_time)) { @@ -111,6 +166,9 @@ v1_lease_spec_t *v1_lease_spec_parseFromJSON(cJSON *v1_lease_specJSON){ // v1_lease_spec->holder_identity cJSON *holder_identity = cJSON_GetObjectItemCaseSensitive(v1_lease_specJSON, "holderIdentity"); + if (cJSON_IsNull(holder_identity)) { + holder_identity = NULL; + } if (holder_identity) { if(!cJSON_IsString(holder_identity) && !cJSON_IsNull(holder_identity)) { @@ -120,6 +178,9 @@ v1_lease_spec_t *v1_lease_spec_parseFromJSON(cJSON *v1_lease_specJSON){ // v1_lease_spec->lease_duration_seconds cJSON *lease_duration_seconds = cJSON_GetObjectItemCaseSensitive(v1_lease_specJSON, "leaseDurationSeconds"); + if (cJSON_IsNull(lease_duration_seconds)) { + lease_duration_seconds = NULL; + } if (lease_duration_seconds) { if(!cJSON_IsNumber(lease_duration_seconds)) { @@ -129,6 +190,9 @@ v1_lease_spec_t *v1_lease_spec_parseFromJSON(cJSON *v1_lease_specJSON){ // v1_lease_spec->lease_transitions cJSON *lease_transitions = cJSON_GetObjectItemCaseSensitive(v1_lease_specJSON, "leaseTransitions"); + if (cJSON_IsNull(lease_transitions)) { + lease_transitions = NULL; + } if (lease_transitions) { if(!cJSON_IsNumber(lease_transitions)) { @@ -136,8 +200,23 @@ v1_lease_spec_t *v1_lease_spec_parseFromJSON(cJSON *v1_lease_specJSON){ } } + // v1_lease_spec->preferred_holder + cJSON *preferred_holder = cJSON_GetObjectItemCaseSensitive(v1_lease_specJSON, "preferredHolder"); + if (cJSON_IsNull(preferred_holder)) { + preferred_holder = NULL; + } + if (preferred_holder) { + if(!cJSON_IsString(preferred_holder) && !cJSON_IsNull(preferred_holder)) + { + goto end; //String + } + } + // v1_lease_spec->renew_time cJSON *renew_time = cJSON_GetObjectItemCaseSensitive(v1_lease_specJSON, "renewTime"); + if (cJSON_IsNull(renew_time)) { + renew_time = NULL; + } if (renew_time) { if(!cJSON_IsString(renew_time) && !cJSON_IsNull(renew_time)) { @@ -145,13 +224,27 @@ v1_lease_spec_t *v1_lease_spec_parseFromJSON(cJSON *v1_lease_specJSON){ } } + // v1_lease_spec->strategy + cJSON *strategy = cJSON_GetObjectItemCaseSensitive(v1_lease_specJSON, "strategy"); + if (cJSON_IsNull(strategy)) { + strategy = NULL; + } + if (strategy) { + if(!cJSON_IsString(strategy) && !cJSON_IsNull(strategy)) + { + goto end; //String + } + } + - v1_lease_spec_local_var = v1_lease_spec_create ( + v1_lease_spec_local_var = v1_lease_spec_create_internal ( acquire_time && !cJSON_IsNull(acquire_time) ? strdup(acquire_time->valuestring) : NULL, holder_identity && !cJSON_IsNull(holder_identity) ? strdup(holder_identity->valuestring) : NULL, lease_duration_seconds ? lease_duration_seconds->valuedouble : 0, lease_transitions ? lease_transitions->valuedouble : 0, - renew_time && !cJSON_IsNull(renew_time) ? strdup(renew_time->valuestring) : NULL + preferred_holder && !cJSON_IsNull(preferred_holder) ? strdup(preferred_holder->valuestring) : NULL, + renew_time && !cJSON_IsNull(renew_time) ? strdup(renew_time->valuestring) : NULL, + strategy && !cJSON_IsNull(strategy) ? strdup(strategy->valuestring) : NULL ); return v1_lease_spec_local_var; diff --git a/kubernetes/model/v1_lease_spec.h b/kubernetes/model/v1_lease_spec.h index 6931adfa..233eaadf 100644 --- a/kubernetes/model/v1_lease_spec.h +++ b/kubernetes/model/v1_lease_spec.h @@ -23,16 +23,21 @@ typedef struct v1_lease_spec_t { char *holder_identity; // string int lease_duration_seconds; //numeric int lease_transitions; //numeric + char *preferred_holder; // string char *renew_time; //date time + char *strategy; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_lease_spec_t; -v1_lease_spec_t *v1_lease_spec_create( +__attribute__((deprecated)) v1_lease_spec_t *v1_lease_spec_create( char *acquire_time, char *holder_identity, int lease_duration_seconds, int lease_transitions, - char *renew_time + char *preferred_holder, + char *renew_time, + char *strategy ); void v1_lease_spec_free(v1_lease_spec_t *v1_lease_spec); diff --git a/kubernetes/model/v1_lifecycle.c b/kubernetes/model/v1_lifecycle.c index 4d4c12c7..20229dad 100644 --- a/kubernetes/model/v1_lifecycle.c +++ b/kubernetes/model/v1_lifecycle.c @@ -5,9 +5,10 @@ -v1_lifecycle_t *v1_lifecycle_create( +static v1_lifecycle_t *v1_lifecycle_create_internal( v1_lifecycle_handler_t *post_start, - v1_lifecycle_handler_t *pre_stop + v1_lifecycle_handler_t *pre_stop, + char *stop_signal ) { v1_lifecycle_t *v1_lifecycle_local_var = malloc(sizeof(v1_lifecycle_t)); if (!v1_lifecycle_local_var) { @@ -15,15 +16,32 @@ v1_lifecycle_t *v1_lifecycle_create( } v1_lifecycle_local_var->post_start = post_start; v1_lifecycle_local_var->pre_stop = pre_stop; + v1_lifecycle_local_var->stop_signal = stop_signal; + v1_lifecycle_local_var->_library_owned = 1; return v1_lifecycle_local_var; } +__attribute__((deprecated)) v1_lifecycle_t *v1_lifecycle_create( + v1_lifecycle_handler_t *post_start, + v1_lifecycle_handler_t *pre_stop, + char *stop_signal + ) { + return v1_lifecycle_create_internal ( + post_start, + pre_stop, + stop_signal + ); +} void v1_lifecycle_free(v1_lifecycle_t *v1_lifecycle) { if(NULL == v1_lifecycle){ return ; } + if(v1_lifecycle->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_lifecycle_free"); + return ; + } listEntry_t *listEntry; if (v1_lifecycle->post_start) { v1_lifecycle_handler_free(v1_lifecycle->post_start); @@ -33,6 +51,10 @@ void v1_lifecycle_free(v1_lifecycle_t *v1_lifecycle) { v1_lifecycle_handler_free(v1_lifecycle->pre_stop); v1_lifecycle->pre_stop = NULL; } + if (v1_lifecycle->stop_signal) { + free(v1_lifecycle->stop_signal); + v1_lifecycle->stop_signal = NULL; + } free(v1_lifecycle); } @@ -64,6 +86,14 @@ cJSON *v1_lifecycle_convertToJSON(v1_lifecycle_t *v1_lifecycle) { } } + + // v1_lifecycle->stop_signal + if(v1_lifecycle->stop_signal) { + if(cJSON_AddStringToObject(item, "stopSignal", v1_lifecycle->stop_signal) == NULL) { + goto fail; //String + } + } + return item; fail: if (item) { @@ -84,20 +114,39 @@ v1_lifecycle_t *v1_lifecycle_parseFromJSON(cJSON *v1_lifecycleJSON){ // v1_lifecycle->post_start cJSON *post_start = cJSON_GetObjectItemCaseSensitive(v1_lifecycleJSON, "postStart"); + if (cJSON_IsNull(post_start)) { + post_start = NULL; + } if (post_start) { post_start_local_nonprim = v1_lifecycle_handler_parseFromJSON(post_start); //nonprimitive } // v1_lifecycle->pre_stop cJSON *pre_stop = cJSON_GetObjectItemCaseSensitive(v1_lifecycleJSON, "preStop"); + if (cJSON_IsNull(pre_stop)) { + pre_stop = NULL; + } if (pre_stop) { pre_stop_local_nonprim = v1_lifecycle_handler_parseFromJSON(pre_stop); //nonprimitive } + // v1_lifecycle->stop_signal + cJSON *stop_signal = cJSON_GetObjectItemCaseSensitive(v1_lifecycleJSON, "stopSignal"); + if (cJSON_IsNull(stop_signal)) { + stop_signal = NULL; + } + if (stop_signal) { + if(!cJSON_IsString(stop_signal) && !cJSON_IsNull(stop_signal)) + { + goto end; //String + } + } + - v1_lifecycle_local_var = v1_lifecycle_create ( + v1_lifecycle_local_var = v1_lifecycle_create_internal ( post_start ? post_start_local_nonprim : NULL, - pre_stop ? pre_stop_local_nonprim : NULL + pre_stop ? pre_stop_local_nonprim : NULL, + stop_signal && !cJSON_IsNull(stop_signal) ? strdup(stop_signal->valuestring) : NULL ); return v1_lifecycle_local_var; diff --git a/kubernetes/model/v1_lifecycle.h b/kubernetes/model/v1_lifecycle.h index 02fb8282..6dc4d015 100644 --- a/kubernetes/model/v1_lifecycle.h +++ b/kubernetes/model/v1_lifecycle.h @@ -22,12 +22,15 @@ typedef struct v1_lifecycle_t v1_lifecycle_t; typedef struct v1_lifecycle_t { struct v1_lifecycle_handler_t *post_start; //model struct v1_lifecycle_handler_t *pre_stop; //model + char *stop_signal; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_lifecycle_t; -v1_lifecycle_t *v1_lifecycle_create( +__attribute__((deprecated)) v1_lifecycle_t *v1_lifecycle_create( v1_lifecycle_handler_t *post_start, - v1_lifecycle_handler_t *pre_stop + v1_lifecycle_handler_t *pre_stop, + char *stop_signal ); void v1_lifecycle_free(v1_lifecycle_t *v1_lifecycle); diff --git a/kubernetes/model/v1_lifecycle_handler.c b/kubernetes/model/v1_lifecycle_handler.c index 76c951a2..0f157fd0 100644 --- a/kubernetes/model/v1_lifecycle_handler.c +++ b/kubernetes/model/v1_lifecycle_handler.c @@ -5,7 +5,7 @@ -v1_lifecycle_handler_t *v1_lifecycle_handler_create( +static v1_lifecycle_handler_t *v1_lifecycle_handler_create_internal( v1_exec_action_t *exec, v1_http_get_action_t *http_get, v1_sleep_action_t *sleep, @@ -20,14 +20,32 @@ v1_lifecycle_handler_t *v1_lifecycle_handler_create( v1_lifecycle_handler_local_var->sleep = sleep; v1_lifecycle_handler_local_var->tcp_socket = tcp_socket; + v1_lifecycle_handler_local_var->_library_owned = 1; return v1_lifecycle_handler_local_var; } +__attribute__((deprecated)) v1_lifecycle_handler_t *v1_lifecycle_handler_create( + v1_exec_action_t *exec, + v1_http_get_action_t *http_get, + v1_sleep_action_t *sleep, + v1_tcp_socket_action_t *tcp_socket + ) { + return v1_lifecycle_handler_create_internal ( + exec, + http_get, + sleep, + tcp_socket + ); +} void v1_lifecycle_handler_free(v1_lifecycle_handler_t *v1_lifecycle_handler) { if(NULL == v1_lifecycle_handler){ return ; } + if(v1_lifecycle_handler->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_lifecycle_handler_free"); + return ; + } listEntry_t *listEntry; if (v1_lifecycle_handler->exec) { v1_exec_action_free(v1_lifecycle_handler->exec); @@ -128,30 +146,42 @@ v1_lifecycle_handler_t *v1_lifecycle_handler_parseFromJSON(cJSON *v1_lifecycle_h // v1_lifecycle_handler->exec cJSON *exec = cJSON_GetObjectItemCaseSensitive(v1_lifecycle_handlerJSON, "exec"); + if (cJSON_IsNull(exec)) { + exec = NULL; + } if (exec) { exec_local_nonprim = v1_exec_action_parseFromJSON(exec); //nonprimitive } // v1_lifecycle_handler->http_get cJSON *http_get = cJSON_GetObjectItemCaseSensitive(v1_lifecycle_handlerJSON, "httpGet"); + if (cJSON_IsNull(http_get)) { + http_get = NULL; + } if (http_get) { http_get_local_nonprim = v1_http_get_action_parseFromJSON(http_get); //nonprimitive } // v1_lifecycle_handler->sleep cJSON *sleep = cJSON_GetObjectItemCaseSensitive(v1_lifecycle_handlerJSON, "sleep"); + if (cJSON_IsNull(sleep)) { + sleep = NULL; + } if (sleep) { sleep_local_nonprim = v1_sleep_action_parseFromJSON(sleep); //nonprimitive } // v1_lifecycle_handler->tcp_socket cJSON *tcp_socket = cJSON_GetObjectItemCaseSensitive(v1_lifecycle_handlerJSON, "tcpSocket"); + if (cJSON_IsNull(tcp_socket)) { + tcp_socket = NULL; + } if (tcp_socket) { tcp_socket_local_nonprim = v1_tcp_socket_action_parseFromJSON(tcp_socket); //nonprimitive } - v1_lifecycle_handler_local_var = v1_lifecycle_handler_create ( + v1_lifecycle_handler_local_var = v1_lifecycle_handler_create_internal ( exec ? exec_local_nonprim : NULL, http_get ? http_get_local_nonprim : NULL, sleep ? sleep_local_nonprim : NULL, diff --git a/kubernetes/model/v1_lifecycle_handler.h b/kubernetes/model/v1_lifecycle_handler.h index 9294a3b4..b463f070 100644 --- a/kubernetes/model/v1_lifecycle_handler.h +++ b/kubernetes/model/v1_lifecycle_handler.h @@ -28,9 +28,10 @@ typedef struct v1_lifecycle_handler_t { struct v1_sleep_action_t *sleep; //model struct v1_tcp_socket_action_t *tcp_socket; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_lifecycle_handler_t; -v1_lifecycle_handler_t *v1_lifecycle_handler_create( +__attribute__((deprecated)) v1_lifecycle_handler_t *v1_lifecycle_handler_create( v1_exec_action_t *exec, v1_http_get_action_t *http_get, v1_sleep_action_t *sleep, diff --git a/kubernetes/model/v1_limit_range.c b/kubernetes/model/v1_limit_range.c index 900f1966..659afe2e 100644 --- a/kubernetes/model/v1_limit_range.c +++ b/kubernetes/model/v1_limit_range.c @@ -5,7 +5,7 @@ -v1_limit_range_t *v1_limit_range_create( +static v1_limit_range_t *v1_limit_range_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_limit_range_t *v1_limit_range_create( v1_limit_range_local_var->metadata = metadata; v1_limit_range_local_var->spec = spec; + v1_limit_range_local_var->_library_owned = 1; return v1_limit_range_local_var; } +__attribute__((deprecated)) v1_limit_range_t *v1_limit_range_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_limit_range_spec_t *spec + ) { + return v1_limit_range_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1_limit_range_free(v1_limit_range_t *v1_limit_range) { if(NULL == v1_limit_range){ return ; } + if(v1_limit_range->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_limit_range_free"); + return ; + } listEntry_t *listEntry; if (v1_limit_range->api_version) { free(v1_limit_range->api_version); @@ -112,6 +130,9 @@ v1_limit_range_t *v1_limit_range_parseFromJSON(cJSON *v1_limit_rangeJSON){ // v1_limit_range->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_limit_rangeJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,6 +142,9 @@ v1_limit_range_t *v1_limit_range_parseFromJSON(cJSON *v1_limit_rangeJSON){ // v1_limit_range->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_limit_rangeJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -130,18 +154,24 @@ v1_limit_range_t *v1_limit_range_parseFromJSON(cJSON *v1_limit_rangeJSON){ // v1_limit_range->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_limit_rangeJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_limit_range->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_limit_rangeJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_limit_range_spec_parseFromJSON(spec); //nonprimitive } - v1_limit_range_local_var = v1_limit_range_create ( + v1_limit_range_local_var = v1_limit_range_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_limit_range.h b/kubernetes/model/v1_limit_range.h index befe442d..031e017e 100644 --- a/kubernetes/model/v1_limit_range.h +++ b/kubernetes/model/v1_limit_range.h @@ -26,9 +26,10 @@ typedef struct v1_limit_range_t { struct v1_object_meta_t *metadata; //model struct v1_limit_range_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_limit_range_t; -v1_limit_range_t *v1_limit_range_create( +__attribute__((deprecated)) v1_limit_range_t *v1_limit_range_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_limit_range_item.c b/kubernetes/model/v1_limit_range_item.c index dcfcfe92..d941eed0 100644 --- a/kubernetes/model/v1_limit_range_item.c +++ b/kubernetes/model/v1_limit_range_item.c @@ -5,7 +5,7 @@ -v1_limit_range_item_t *v1_limit_range_item_create( +static v1_limit_range_item_t *v1_limit_range_item_create_internal( list_t* _default, list_t* default_request, list_t* max, @@ -24,18 +24,40 @@ v1_limit_range_item_t *v1_limit_range_item_create( v1_limit_range_item_local_var->min = min; v1_limit_range_item_local_var->type = type; + v1_limit_range_item_local_var->_library_owned = 1; return v1_limit_range_item_local_var; } +__attribute__((deprecated)) v1_limit_range_item_t *v1_limit_range_item_create( + list_t* _default, + list_t* default_request, + list_t* max, + list_t* max_limit_request_ratio, + list_t* min, + char *type + ) { + return v1_limit_range_item_create_internal ( + _default, + default_request, + max, + max_limit_request_ratio, + min, + type + ); +} void v1_limit_range_item_free(v1_limit_range_item_t *v1_limit_range_item) { if(NULL == v1_limit_range_item){ return ; } + if(v1_limit_range_item->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_limit_range_item_free"); + return ; + } listEntry_t *listEntry; if (v1_limit_range_item->_default) { list_ForEach(listEntry, v1_limit_range_item->_default) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -45,7 +67,7 @@ void v1_limit_range_item_free(v1_limit_range_item_t *v1_limit_range_item) { } if (v1_limit_range_item->default_request) { list_ForEach(listEntry, v1_limit_range_item->default_request) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -55,7 +77,7 @@ void v1_limit_range_item_free(v1_limit_range_item_t *v1_limit_range_item) { } if (v1_limit_range_item->max) { list_ForEach(listEntry, v1_limit_range_item->max) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -65,7 +87,7 @@ void v1_limit_range_item_free(v1_limit_range_item_t *v1_limit_range_item) { } if (v1_limit_range_item->max_limit_request_ratio) { list_ForEach(listEntry, v1_limit_range_item->max_limit_request_ratio) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -75,7 +97,7 @@ void v1_limit_range_item_free(v1_limit_range_item_t *v1_limit_range_item) { } if (v1_limit_range_item->min) { list_ForEach(listEntry, v1_limit_range_item->min) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -103,8 +125,8 @@ cJSON *v1_limit_range_item_convertToJSON(v1_limit_range_item_t *v1_limit_range_i listEntry_t *_defaultListEntry; if (v1_limit_range_item->_default) { list_ForEach(_defaultListEntry, v1_limit_range_item->_default) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)_defaultListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = _defaultListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -123,8 +145,8 @@ cJSON *v1_limit_range_item_convertToJSON(v1_limit_range_item_t *v1_limit_range_i listEntry_t *default_requestListEntry; if (v1_limit_range_item->default_request) { list_ForEach(default_requestListEntry, v1_limit_range_item->default_request) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)default_requestListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = default_requestListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -143,8 +165,8 @@ cJSON *v1_limit_range_item_convertToJSON(v1_limit_range_item_t *v1_limit_range_i listEntry_t *maxListEntry; if (v1_limit_range_item->max) { list_ForEach(maxListEntry, v1_limit_range_item->max) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)maxListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = maxListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -163,8 +185,8 @@ cJSON *v1_limit_range_item_convertToJSON(v1_limit_range_item_t *v1_limit_range_i listEntry_t *max_limit_request_ratioListEntry; if (v1_limit_range_item->max_limit_request_ratio) { list_ForEach(max_limit_request_ratioListEntry, v1_limit_range_item->max_limit_request_ratio) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)max_limit_request_ratioListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = max_limit_request_ratioListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -183,8 +205,8 @@ cJSON *v1_limit_range_item_convertToJSON(v1_limit_range_item_t *v1_limit_range_i listEntry_t *minListEntry; if (v1_limit_range_item->min) { list_ForEach(minListEntry, v1_limit_range_item->min) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)minListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = minListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -230,6 +252,9 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->_default cJSON *_default = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "default"); + if (cJSON_IsNull(_default)) { + _default = NULL; + } if (_default) { cJSON *_default_local_map = NULL; if(!cJSON_IsObject(_default) && !cJSON_IsNull(_default)) @@ -255,6 +280,9 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->default_request cJSON *default_request = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "defaultRequest"); + if (cJSON_IsNull(default_request)) { + default_request = NULL; + } if (default_request) { cJSON *default_request_local_map = NULL; if(!cJSON_IsObject(default_request) && !cJSON_IsNull(default_request)) @@ -280,6 +308,9 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->max cJSON *max = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "max"); + if (cJSON_IsNull(max)) { + max = NULL; + } if (max) { cJSON *max_local_map = NULL; if(!cJSON_IsObject(max) && !cJSON_IsNull(max)) @@ -305,6 +336,9 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->max_limit_request_ratio cJSON *max_limit_request_ratio = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "maxLimitRequestRatio"); + if (cJSON_IsNull(max_limit_request_ratio)) { + max_limit_request_ratio = NULL; + } if (max_limit_request_ratio) { cJSON *max_limit_request_ratio_local_map = NULL; if(!cJSON_IsObject(max_limit_request_ratio) && !cJSON_IsNull(max_limit_request_ratio)) @@ -330,6 +364,9 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->min cJSON *min = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "min"); + if (cJSON_IsNull(min)) { + min = NULL; + } if (min) { cJSON *min_local_map = NULL; if(!cJSON_IsObject(min) && !cJSON_IsNull(min)) @@ -355,6 +392,9 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -366,7 +406,7 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i } - v1_limit_range_item_local_var = v1_limit_range_item_create ( + v1_limit_range_item_local_var = v1_limit_range_item_create_internal ( _default ? _defaultList : NULL, default_request ? default_requestList : NULL, max ? maxList : NULL, @@ -380,7 +420,7 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i if (_defaultList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, _defaultList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -394,7 +434,7 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i if (default_requestList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, default_requestList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -408,7 +448,7 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i if (maxList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, maxList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -422,7 +462,7 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i if (max_limit_request_ratioList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, max_limit_request_ratioList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -436,7 +476,7 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i if (minList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, minList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_limit_range_item.h b/kubernetes/model/v1_limit_range_item.h index a3fd20a9..ab8581b9 100644 --- a/kubernetes/model/v1_limit_range_item.h +++ b/kubernetes/model/v1_limit_range_item.h @@ -26,9 +26,10 @@ typedef struct v1_limit_range_item_t { list_t* min; //map char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_limit_range_item_t; -v1_limit_range_item_t *v1_limit_range_item_create( +__attribute__((deprecated)) v1_limit_range_item_t *v1_limit_range_item_create( list_t* _default, list_t* default_request, list_t* max, diff --git a/kubernetes/model/v1_limit_range_list.c b/kubernetes/model/v1_limit_range_list.c index 613ad041..f6322f29 100644 --- a/kubernetes/model/v1_limit_range_list.c +++ b/kubernetes/model/v1_limit_range_list.c @@ -5,7 +5,7 @@ -v1_limit_range_list_t *v1_limit_range_list_create( +static v1_limit_range_list_t *v1_limit_range_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_limit_range_list_t *v1_limit_range_list_create( v1_limit_range_list_local_var->kind = kind; v1_limit_range_list_local_var->metadata = metadata; + v1_limit_range_list_local_var->_library_owned = 1; return v1_limit_range_list_local_var; } +__attribute__((deprecated)) v1_limit_range_list_t *v1_limit_range_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_limit_range_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_limit_range_list_free(v1_limit_range_list_t *v1_limit_range_list) { if(NULL == v1_limit_range_list){ return ; } + if(v1_limit_range_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_limit_range_list_free"); + return ; + } listEntry_t *listEntry; if (v1_limit_range_list->api_version) { free(v1_limit_range_list->api_version); @@ -123,6 +141,9 @@ v1_limit_range_list_t *v1_limit_range_list_parseFromJSON(cJSON *v1_limit_range_l // v1_limit_range_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_limit_range_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_limit_range_list_t *v1_limit_range_list_parseFromJSON(cJSON *v1_limit_range_l // v1_limit_range_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_limit_range_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_limit_range_list_t *v1_limit_range_list_parseFromJSON(cJSON *v1_limit_range_l // v1_limit_range_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_limit_range_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_limit_range_list_t *v1_limit_range_list_parseFromJSON(cJSON *v1_limit_range_l // v1_limit_range_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_limit_range_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_limit_range_list_local_var = v1_limit_range_list_create ( + v1_limit_range_list_local_var = v1_limit_range_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_limit_range_list.h b/kubernetes/model/v1_limit_range_list.h index f85366b2..99f9f028 100644 --- a/kubernetes/model/v1_limit_range_list.h +++ b/kubernetes/model/v1_limit_range_list.h @@ -26,9 +26,10 @@ typedef struct v1_limit_range_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_limit_range_list_t; -v1_limit_range_list_t *v1_limit_range_list_create( +__attribute__((deprecated)) v1_limit_range_list_t *v1_limit_range_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_limit_range_spec.c b/kubernetes/model/v1_limit_range_spec.c index 3258be1a..a3baf8bc 100644 --- a/kubernetes/model/v1_limit_range_spec.c +++ b/kubernetes/model/v1_limit_range_spec.c @@ -5,7 +5,7 @@ -v1_limit_range_spec_t *v1_limit_range_spec_create( +static v1_limit_range_spec_t *v1_limit_range_spec_create_internal( list_t *limits ) { v1_limit_range_spec_t *v1_limit_range_spec_local_var = malloc(sizeof(v1_limit_range_spec_t)); @@ -14,14 +14,26 @@ v1_limit_range_spec_t *v1_limit_range_spec_create( } v1_limit_range_spec_local_var->limits = limits; + v1_limit_range_spec_local_var->_library_owned = 1; return v1_limit_range_spec_local_var; } +__attribute__((deprecated)) v1_limit_range_spec_t *v1_limit_range_spec_create( + list_t *limits + ) { + return v1_limit_range_spec_create_internal ( + limits + ); +} void v1_limit_range_spec_free(v1_limit_range_spec_t *v1_limit_range_spec) { if(NULL == v1_limit_range_spec){ return ; } + if(v1_limit_range_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_limit_range_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_limit_range_spec->limits) { list_ForEach(listEntry, v1_limit_range_spec->limits) { @@ -73,6 +85,9 @@ v1_limit_range_spec_t *v1_limit_range_spec_parseFromJSON(cJSON *v1_limit_range_s // v1_limit_range_spec->limits cJSON *limits = cJSON_GetObjectItemCaseSensitive(v1_limit_range_specJSON, "limits"); + if (cJSON_IsNull(limits)) { + limits = NULL; + } if (!limits) { goto end; } @@ -96,7 +111,7 @@ v1_limit_range_spec_t *v1_limit_range_spec_parseFromJSON(cJSON *v1_limit_range_s } - v1_limit_range_spec_local_var = v1_limit_range_spec_create ( + v1_limit_range_spec_local_var = v1_limit_range_spec_create_internal ( limitsList ); diff --git a/kubernetes/model/v1_limit_range_spec.h b/kubernetes/model/v1_limit_range_spec.h index 7c435fd5..78267952 100644 --- a/kubernetes/model/v1_limit_range_spec.h +++ b/kubernetes/model/v1_limit_range_spec.h @@ -22,9 +22,10 @@ typedef struct v1_limit_range_spec_t v1_limit_range_spec_t; typedef struct v1_limit_range_spec_t { list_t *limits; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_limit_range_spec_t; -v1_limit_range_spec_t *v1_limit_range_spec_create( +__attribute__((deprecated)) v1_limit_range_spec_t *v1_limit_range_spec_create( list_t *limits ); diff --git a/kubernetes/model/v1_limit_response.c b/kubernetes/model/v1_limit_response.c index 70c4bfbe..1e140e86 100644 --- a/kubernetes/model/v1_limit_response.c +++ b/kubernetes/model/v1_limit_response.c @@ -5,7 +5,7 @@ -v1_limit_response_t *v1_limit_response_create( +static v1_limit_response_t *v1_limit_response_create_internal( v1_queuing_configuration_t *queuing, char *type ) { @@ -16,14 +16,28 @@ v1_limit_response_t *v1_limit_response_create( v1_limit_response_local_var->queuing = queuing; v1_limit_response_local_var->type = type; + v1_limit_response_local_var->_library_owned = 1; return v1_limit_response_local_var; } +__attribute__((deprecated)) v1_limit_response_t *v1_limit_response_create( + v1_queuing_configuration_t *queuing, + char *type + ) { + return v1_limit_response_create_internal ( + queuing, + type + ); +} void v1_limit_response_free(v1_limit_response_t *v1_limit_response) { if(NULL == v1_limit_response){ return ; } + if(v1_limit_response->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_limit_response_free"); + return ; + } listEntry_t *listEntry; if (v1_limit_response->queuing) { v1_queuing_configuration_free(v1_limit_response->queuing); @@ -77,12 +91,18 @@ v1_limit_response_t *v1_limit_response_parseFromJSON(cJSON *v1_limit_responseJSO // v1_limit_response->queuing cJSON *queuing = cJSON_GetObjectItemCaseSensitive(v1_limit_responseJSON, "queuing"); + if (cJSON_IsNull(queuing)) { + queuing = NULL; + } if (queuing) { queuing_local_nonprim = v1_queuing_configuration_parseFromJSON(queuing); //nonprimitive } // v1_limit_response->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_limit_responseJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -94,7 +114,7 @@ v1_limit_response_t *v1_limit_response_parseFromJSON(cJSON *v1_limit_responseJSO } - v1_limit_response_local_var = v1_limit_response_create ( + v1_limit_response_local_var = v1_limit_response_create_internal ( queuing ? queuing_local_nonprim : NULL, strdup(type->valuestring) ); diff --git a/kubernetes/model/v1_limit_response.h b/kubernetes/model/v1_limit_response.h index 1657d12f..e9ae5807 100644 --- a/kubernetes/model/v1_limit_response.h +++ b/kubernetes/model/v1_limit_response.h @@ -23,9 +23,10 @@ typedef struct v1_limit_response_t { struct v1_queuing_configuration_t *queuing; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_limit_response_t; -v1_limit_response_t *v1_limit_response_create( +__attribute__((deprecated)) v1_limit_response_t *v1_limit_response_create( v1_queuing_configuration_t *queuing, char *type ); diff --git a/kubernetes/model/v1_limited_priority_level_configuration.c b/kubernetes/model/v1_limited_priority_level_configuration.c index fa355a6c..ab004b45 100644 --- a/kubernetes/model/v1_limited_priority_level_configuration.c +++ b/kubernetes/model/v1_limited_priority_level_configuration.c @@ -5,7 +5,7 @@ -v1_limited_priority_level_configuration_t *v1_limited_priority_level_configuration_create( +static v1_limited_priority_level_configuration_t *v1_limited_priority_level_configuration_create_internal( int borrowing_limit_percent, int lendable_percent, v1_limit_response_t *limit_response, @@ -20,14 +20,32 @@ v1_limited_priority_level_configuration_t *v1_limited_priority_level_configurati v1_limited_priority_level_configuration_local_var->limit_response = limit_response; v1_limited_priority_level_configuration_local_var->nominal_concurrency_shares = nominal_concurrency_shares; + v1_limited_priority_level_configuration_local_var->_library_owned = 1; return v1_limited_priority_level_configuration_local_var; } +__attribute__((deprecated)) v1_limited_priority_level_configuration_t *v1_limited_priority_level_configuration_create( + int borrowing_limit_percent, + int lendable_percent, + v1_limit_response_t *limit_response, + int nominal_concurrency_shares + ) { + return v1_limited_priority_level_configuration_create_internal ( + borrowing_limit_percent, + lendable_percent, + limit_response, + nominal_concurrency_shares + ); +} void v1_limited_priority_level_configuration_free(v1_limited_priority_level_configuration_t *v1_limited_priority_level_configuration) { if(NULL == v1_limited_priority_level_configuration){ return ; } + if(v1_limited_priority_level_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_limited_priority_level_configuration_free"); + return ; + } listEntry_t *listEntry; if (v1_limited_priority_level_configuration->limit_response) { v1_limit_response_free(v1_limited_priority_level_configuration->limit_response); @@ -92,6 +110,9 @@ v1_limited_priority_level_configuration_t *v1_limited_priority_level_configurati // v1_limited_priority_level_configuration->borrowing_limit_percent cJSON *borrowing_limit_percent = cJSON_GetObjectItemCaseSensitive(v1_limited_priority_level_configurationJSON, "borrowingLimitPercent"); + if (cJSON_IsNull(borrowing_limit_percent)) { + borrowing_limit_percent = NULL; + } if (borrowing_limit_percent) { if(!cJSON_IsNumber(borrowing_limit_percent)) { @@ -101,6 +122,9 @@ v1_limited_priority_level_configuration_t *v1_limited_priority_level_configurati // v1_limited_priority_level_configuration->lendable_percent cJSON *lendable_percent = cJSON_GetObjectItemCaseSensitive(v1_limited_priority_level_configurationJSON, "lendablePercent"); + if (cJSON_IsNull(lendable_percent)) { + lendable_percent = NULL; + } if (lendable_percent) { if(!cJSON_IsNumber(lendable_percent)) { @@ -110,12 +134,18 @@ v1_limited_priority_level_configuration_t *v1_limited_priority_level_configurati // v1_limited_priority_level_configuration->limit_response cJSON *limit_response = cJSON_GetObjectItemCaseSensitive(v1_limited_priority_level_configurationJSON, "limitResponse"); + if (cJSON_IsNull(limit_response)) { + limit_response = NULL; + } if (limit_response) { limit_response_local_nonprim = v1_limit_response_parseFromJSON(limit_response); //nonprimitive } // v1_limited_priority_level_configuration->nominal_concurrency_shares cJSON *nominal_concurrency_shares = cJSON_GetObjectItemCaseSensitive(v1_limited_priority_level_configurationJSON, "nominalConcurrencyShares"); + if (cJSON_IsNull(nominal_concurrency_shares)) { + nominal_concurrency_shares = NULL; + } if (nominal_concurrency_shares) { if(!cJSON_IsNumber(nominal_concurrency_shares)) { @@ -124,7 +154,7 @@ v1_limited_priority_level_configuration_t *v1_limited_priority_level_configurati } - v1_limited_priority_level_configuration_local_var = v1_limited_priority_level_configuration_create ( + v1_limited_priority_level_configuration_local_var = v1_limited_priority_level_configuration_create_internal ( borrowing_limit_percent ? borrowing_limit_percent->valuedouble : 0, lendable_percent ? lendable_percent->valuedouble : 0, limit_response ? limit_response_local_nonprim : NULL, diff --git a/kubernetes/model/v1_limited_priority_level_configuration.h b/kubernetes/model/v1_limited_priority_level_configuration.h index 7ece176a..89e5c2d6 100644 --- a/kubernetes/model/v1_limited_priority_level_configuration.h +++ b/kubernetes/model/v1_limited_priority_level_configuration.h @@ -25,9 +25,10 @@ typedef struct v1_limited_priority_level_configuration_t { struct v1_limit_response_t *limit_response; //model int nominal_concurrency_shares; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_limited_priority_level_configuration_t; -v1_limited_priority_level_configuration_t *v1_limited_priority_level_configuration_create( +__attribute__((deprecated)) v1_limited_priority_level_configuration_t *v1_limited_priority_level_configuration_create( int borrowing_limit_percent, int lendable_percent, v1_limit_response_t *limit_response, diff --git a/kubernetes/model/v1_linux_container_user.c b/kubernetes/model/v1_linux_container_user.c new file mode 100644 index 00000000..a2159ec7 --- /dev/null +++ b/kubernetes/model/v1_linux_container_user.c @@ -0,0 +1,186 @@ +#include +#include +#include +#include "v1_linux_container_user.h" + + + +static v1_linux_container_user_t *v1_linux_container_user_create_internal( + long gid, + list_t *supplemental_groups, + long uid + ) { + v1_linux_container_user_t *v1_linux_container_user_local_var = malloc(sizeof(v1_linux_container_user_t)); + if (!v1_linux_container_user_local_var) { + return NULL; + } + v1_linux_container_user_local_var->gid = gid; + v1_linux_container_user_local_var->supplemental_groups = supplemental_groups; + v1_linux_container_user_local_var->uid = uid; + + v1_linux_container_user_local_var->_library_owned = 1; + return v1_linux_container_user_local_var; +} + +__attribute__((deprecated)) v1_linux_container_user_t *v1_linux_container_user_create( + long gid, + list_t *supplemental_groups, + long uid + ) { + return v1_linux_container_user_create_internal ( + gid, + supplemental_groups, + uid + ); +} + +void v1_linux_container_user_free(v1_linux_container_user_t *v1_linux_container_user) { + if(NULL == v1_linux_container_user){ + return ; + } + if(v1_linux_container_user->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_linux_container_user_free"); + return ; + } + listEntry_t *listEntry; + if (v1_linux_container_user->supplemental_groups) { + list_ForEach(listEntry, v1_linux_container_user->supplemental_groups) { + free(listEntry->data); + } + list_freeList(v1_linux_container_user->supplemental_groups); + v1_linux_container_user->supplemental_groups = NULL; + } + free(v1_linux_container_user); +} + +cJSON *v1_linux_container_user_convertToJSON(v1_linux_container_user_t *v1_linux_container_user) { + cJSON *item = cJSON_CreateObject(); + + // v1_linux_container_user->gid + if (!v1_linux_container_user->gid) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "gid", v1_linux_container_user->gid) == NULL) { + goto fail; //Numeric + } + + + // v1_linux_container_user->supplemental_groups + if(v1_linux_container_user->supplemental_groups) { + cJSON *supplemental_groups = cJSON_AddArrayToObject(item, "supplementalGroups"); + if(supplemental_groups == NULL) { + goto fail; //primitive container + } + + listEntry_t *supplemental_groupsListEntry; + list_ForEach(supplemental_groupsListEntry, v1_linux_container_user->supplemental_groups) { + if(cJSON_AddNumberToObject(supplemental_groups, "", *(double *)supplemental_groupsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1_linux_container_user->uid + if (!v1_linux_container_user->uid) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "uid", v1_linux_container_user->uid) == NULL) { + goto fail; //Numeric + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_linux_container_user_t *v1_linux_container_user_parseFromJSON(cJSON *v1_linux_container_userJSON){ + + v1_linux_container_user_t *v1_linux_container_user_local_var = NULL; + + // define the local list for v1_linux_container_user->supplemental_groups + list_t *supplemental_groupsList = NULL; + + // v1_linux_container_user->gid + cJSON *gid = cJSON_GetObjectItemCaseSensitive(v1_linux_container_userJSON, "gid"); + if (cJSON_IsNull(gid)) { + gid = NULL; + } + if (!gid) { + goto end; + } + + + if(!cJSON_IsNumber(gid)) + { + goto end; //Numeric + } + + // v1_linux_container_user->supplemental_groups + cJSON *supplemental_groups = cJSON_GetObjectItemCaseSensitive(v1_linux_container_userJSON, "supplementalGroups"); + if (cJSON_IsNull(supplemental_groups)) { + supplemental_groups = NULL; + } + if (supplemental_groups) { + cJSON *supplemental_groups_local = NULL; + if(!cJSON_IsArray(supplemental_groups)) { + goto end;//primitive container + } + supplemental_groupsList = list_createList(); + + cJSON_ArrayForEach(supplemental_groups_local, supplemental_groups) + { + if(!cJSON_IsNumber(supplemental_groups_local)) + { + goto end; + } + double *supplemental_groups_local_value = calloc(1, sizeof(double)); + if(!supplemental_groups_local_value) + { + goto end; + } + *supplemental_groups_local_value = supplemental_groups_local->valuedouble; + list_addElement(supplemental_groupsList , supplemental_groups_local_value); + } + } + + // v1_linux_container_user->uid + cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_linux_container_userJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } + if (!uid) { + goto end; + } + + + if(!cJSON_IsNumber(uid)) + { + goto end; //Numeric + } + + + v1_linux_container_user_local_var = v1_linux_container_user_create_internal ( + gid->valuedouble, + supplemental_groups ? supplemental_groupsList : NULL, + uid->valuedouble + ); + + return v1_linux_container_user_local_var; +end: + if (supplemental_groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, supplemental_groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(supplemental_groupsList); + supplemental_groupsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_linux_container_user.h b/kubernetes/model/v1_linux_container_user.h new file mode 100644 index 00000000..8edcaae7 --- /dev/null +++ b/kubernetes/model/v1_linux_container_user.h @@ -0,0 +1,42 @@ +/* + * v1_linux_container_user.h + * + * LinuxContainerUser represents user identity information in Linux containers + */ + +#ifndef _v1_linux_container_user_H_ +#define _v1_linux_container_user_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_linux_container_user_t v1_linux_container_user_t; + + + + +typedef struct v1_linux_container_user_t { + long gid; //numeric + list_t *supplemental_groups; //primitive container + long uid; //numeric + + int _library_owned; // Is the library responsible for freeing this object? +} v1_linux_container_user_t; + +__attribute__((deprecated)) v1_linux_container_user_t *v1_linux_container_user_create( + long gid, + list_t *supplemental_groups, + long uid +); + +void v1_linux_container_user_free(v1_linux_container_user_t *v1_linux_container_user); + +v1_linux_container_user_t *v1_linux_container_user_parseFromJSON(cJSON *v1_linux_container_userJSON); + +cJSON *v1_linux_container_user_convertToJSON(v1_linux_container_user_t *v1_linux_container_user); + +#endif /* _v1_linux_container_user_H_ */ + diff --git a/kubernetes/model/v1_list_meta.c b/kubernetes/model/v1_list_meta.c index 7de1d516..eb289987 100644 --- a/kubernetes/model/v1_list_meta.c +++ b/kubernetes/model/v1_list_meta.c @@ -5,7 +5,7 @@ -v1_list_meta_t *v1_list_meta_create( +static v1_list_meta_t *v1_list_meta_create_internal( char *_continue, long remaining_item_count, char *resource_version, @@ -20,14 +20,32 @@ v1_list_meta_t *v1_list_meta_create( v1_list_meta_local_var->resource_version = resource_version; v1_list_meta_local_var->self_link = self_link; + v1_list_meta_local_var->_library_owned = 1; return v1_list_meta_local_var; } +__attribute__((deprecated)) v1_list_meta_t *v1_list_meta_create( + char *_continue, + long remaining_item_count, + char *resource_version, + char *self_link + ) { + return v1_list_meta_create_internal ( + _continue, + remaining_item_count, + resource_version, + self_link + ); +} void v1_list_meta_free(v1_list_meta_t *v1_list_meta) { if(NULL == v1_list_meta){ return ; } + if(v1_list_meta->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_list_meta_free"); + return ; + } listEntry_t *listEntry; if (v1_list_meta->_continue) { free(v1_list_meta->_continue); @@ -92,6 +110,9 @@ v1_list_meta_t *v1_list_meta_parseFromJSON(cJSON *v1_list_metaJSON){ // v1_list_meta->_continue cJSON *_continue = cJSON_GetObjectItemCaseSensitive(v1_list_metaJSON, "continue"); + if (cJSON_IsNull(_continue)) { + _continue = NULL; + } if (_continue) { if(!cJSON_IsString(_continue) && !cJSON_IsNull(_continue)) { @@ -101,6 +122,9 @@ v1_list_meta_t *v1_list_meta_parseFromJSON(cJSON *v1_list_metaJSON){ // v1_list_meta->remaining_item_count cJSON *remaining_item_count = cJSON_GetObjectItemCaseSensitive(v1_list_metaJSON, "remainingItemCount"); + if (cJSON_IsNull(remaining_item_count)) { + remaining_item_count = NULL; + } if (remaining_item_count) { if(!cJSON_IsNumber(remaining_item_count)) { @@ -110,6 +134,9 @@ v1_list_meta_t *v1_list_meta_parseFromJSON(cJSON *v1_list_metaJSON){ // v1_list_meta->resource_version cJSON *resource_version = cJSON_GetObjectItemCaseSensitive(v1_list_metaJSON, "resourceVersion"); + if (cJSON_IsNull(resource_version)) { + resource_version = NULL; + } if (resource_version) { if(!cJSON_IsString(resource_version) && !cJSON_IsNull(resource_version)) { @@ -119,6 +146,9 @@ v1_list_meta_t *v1_list_meta_parseFromJSON(cJSON *v1_list_metaJSON){ // v1_list_meta->self_link cJSON *self_link = cJSON_GetObjectItemCaseSensitive(v1_list_metaJSON, "selfLink"); + if (cJSON_IsNull(self_link)) { + self_link = NULL; + } if (self_link) { if(!cJSON_IsString(self_link) && !cJSON_IsNull(self_link)) { @@ -127,7 +157,7 @@ v1_list_meta_t *v1_list_meta_parseFromJSON(cJSON *v1_list_metaJSON){ } - v1_list_meta_local_var = v1_list_meta_create ( + v1_list_meta_local_var = v1_list_meta_create_internal ( _continue && !cJSON_IsNull(_continue) ? strdup(_continue->valuestring) : NULL, remaining_item_count ? remaining_item_count->valuedouble : 0, resource_version && !cJSON_IsNull(resource_version) ? strdup(resource_version->valuestring) : NULL, diff --git a/kubernetes/model/v1_list_meta.h b/kubernetes/model/v1_list_meta.h index 7458c2c6..18a39a50 100644 --- a/kubernetes/model/v1_list_meta.h +++ b/kubernetes/model/v1_list_meta.h @@ -24,9 +24,10 @@ typedef struct v1_list_meta_t { char *resource_version; // string char *self_link; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_list_meta_t; -v1_list_meta_t *v1_list_meta_create( +__attribute__((deprecated)) v1_list_meta_t *v1_list_meta_create( char *_continue, long remaining_item_count, char *resource_version, diff --git a/kubernetes/model/v1_load_balancer_ingress.c b/kubernetes/model/v1_load_balancer_ingress.c index c23e1460..c32a01c9 100644 --- a/kubernetes/model/v1_load_balancer_ingress.c +++ b/kubernetes/model/v1_load_balancer_ingress.c @@ -5,7 +5,7 @@ -v1_load_balancer_ingress_t *v1_load_balancer_ingress_create( +static v1_load_balancer_ingress_t *v1_load_balancer_ingress_create_internal( char *hostname, char *ip, char *ip_mode, @@ -20,14 +20,32 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_create( v1_load_balancer_ingress_local_var->ip_mode = ip_mode; v1_load_balancer_ingress_local_var->ports = ports; + v1_load_balancer_ingress_local_var->_library_owned = 1; return v1_load_balancer_ingress_local_var; } +__attribute__((deprecated)) v1_load_balancer_ingress_t *v1_load_balancer_ingress_create( + char *hostname, + char *ip, + char *ip_mode, + list_t *ports + ) { + return v1_load_balancer_ingress_create_internal ( + hostname, + ip, + ip_mode, + ports + ); +} void v1_load_balancer_ingress_free(v1_load_balancer_ingress_t *v1_load_balancer_ingress) { if(NULL == v1_load_balancer_ingress){ return ; } + if(v1_load_balancer_ingress->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_load_balancer_ingress_free"); + return ; + } listEntry_t *listEntry; if (v1_load_balancer_ingress->hostname) { free(v1_load_balancer_ingress->hostname); @@ -114,6 +132,9 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa // v1_load_balancer_ingress->hostname cJSON *hostname = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_ingressJSON, "hostname"); + if (cJSON_IsNull(hostname)) { + hostname = NULL; + } if (hostname) { if(!cJSON_IsString(hostname) && !cJSON_IsNull(hostname)) { @@ -123,6 +144,9 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa // v1_load_balancer_ingress->ip cJSON *ip = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_ingressJSON, "ip"); + if (cJSON_IsNull(ip)) { + ip = NULL; + } if (ip) { if(!cJSON_IsString(ip) && !cJSON_IsNull(ip)) { @@ -132,6 +156,9 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa // v1_load_balancer_ingress->ip_mode cJSON *ip_mode = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_ingressJSON, "ipMode"); + if (cJSON_IsNull(ip_mode)) { + ip_mode = NULL; + } if (ip_mode) { if(!cJSON_IsString(ip_mode) && !cJSON_IsNull(ip_mode)) { @@ -141,6 +168,9 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa // v1_load_balancer_ingress->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_ingressJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -161,7 +191,7 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa } - v1_load_balancer_ingress_local_var = v1_load_balancer_ingress_create ( + v1_load_balancer_ingress_local_var = v1_load_balancer_ingress_create_internal ( hostname && !cJSON_IsNull(hostname) ? strdup(hostname->valuestring) : NULL, ip && !cJSON_IsNull(ip) ? strdup(ip->valuestring) : NULL, ip_mode && !cJSON_IsNull(ip_mode) ? strdup(ip_mode->valuestring) : NULL, diff --git a/kubernetes/model/v1_load_balancer_ingress.h b/kubernetes/model/v1_load_balancer_ingress.h index c0842135..b2a59777 100644 --- a/kubernetes/model/v1_load_balancer_ingress.h +++ b/kubernetes/model/v1_load_balancer_ingress.h @@ -25,9 +25,10 @@ typedef struct v1_load_balancer_ingress_t { char *ip_mode; // string list_t *ports; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_load_balancer_ingress_t; -v1_load_balancer_ingress_t *v1_load_balancer_ingress_create( +__attribute__((deprecated)) v1_load_balancer_ingress_t *v1_load_balancer_ingress_create( char *hostname, char *ip, char *ip_mode, diff --git a/kubernetes/model/v1_load_balancer_status.c b/kubernetes/model/v1_load_balancer_status.c index 490dcf95..47999a75 100644 --- a/kubernetes/model/v1_load_balancer_status.c +++ b/kubernetes/model/v1_load_balancer_status.c @@ -5,7 +5,7 @@ -v1_load_balancer_status_t *v1_load_balancer_status_create( +static v1_load_balancer_status_t *v1_load_balancer_status_create_internal( list_t *ingress ) { v1_load_balancer_status_t *v1_load_balancer_status_local_var = malloc(sizeof(v1_load_balancer_status_t)); @@ -14,14 +14,26 @@ v1_load_balancer_status_t *v1_load_balancer_status_create( } v1_load_balancer_status_local_var->ingress = ingress; + v1_load_balancer_status_local_var->_library_owned = 1; return v1_load_balancer_status_local_var; } +__attribute__((deprecated)) v1_load_balancer_status_t *v1_load_balancer_status_create( + list_t *ingress + ) { + return v1_load_balancer_status_create_internal ( + ingress + ); +} void v1_load_balancer_status_free(v1_load_balancer_status_t *v1_load_balancer_status) { if(NULL == v1_load_balancer_status){ return ; } + if(v1_load_balancer_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_load_balancer_status_free"); + return ; + } listEntry_t *listEntry; if (v1_load_balancer_status->ingress) { list_ForEach(listEntry, v1_load_balancer_status->ingress) { @@ -72,6 +84,9 @@ v1_load_balancer_status_t *v1_load_balancer_status_parseFromJSON(cJSON *v1_load_ // v1_load_balancer_status->ingress cJSON *ingress = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_statusJSON, "ingress"); + if (cJSON_IsNull(ingress)) { + ingress = NULL; + } if (ingress) { cJSON *ingress_local_nonprimitive = NULL; if(!cJSON_IsArray(ingress)){ @@ -92,7 +107,7 @@ v1_load_balancer_status_t *v1_load_balancer_status_parseFromJSON(cJSON *v1_load_ } - v1_load_balancer_status_local_var = v1_load_balancer_status_create ( + v1_load_balancer_status_local_var = v1_load_balancer_status_create_internal ( ingress ? ingressList : NULL ); diff --git a/kubernetes/model/v1_load_balancer_status.h b/kubernetes/model/v1_load_balancer_status.h index 2ecc3f74..be910a10 100644 --- a/kubernetes/model/v1_load_balancer_status.h +++ b/kubernetes/model/v1_load_balancer_status.h @@ -22,9 +22,10 @@ typedef struct v1_load_balancer_status_t v1_load_balancer_status_t; typedef struct v1_load_balancer_status_t { list_t *ingress; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_load_balancer_status_t; -v1_load_balancer_status_t *v1_load_balancer_status_create( +__attribute__((deprecated)) v1_load_balancer_status_t *v1_load_balancer_status_create( list_t *ingress ); diff --git a/kubernetes/model/v1_local_object_reference.c b/kubernetes/model/v1_local_object_reference.c index c91e875c..4edd5900 100644 --- a/kubernetes/model/v1_local_object_reference.c +++ b/kubernetes/model/v1_local_object_reference.c @@ -5,7 +5,7 @@ -v1_local_object_reference_t *v1_local_object_reference_create( +static v1_local_object_reference_t *v1_local_object_reference_create_internal( char *name ) { v1_local_object_reference_t *v1_local_object_reference_local_var = malloc(sizeof(v1_local_object_reference_t)); @@ -14,14 +14,26 @@ v1_local_object_reference_t *v1_local_object_reference_create( } v1_local_object_reference_local_var->name = name; + v1_local_object_reference_local_var->_library_owned = 1; return v1_local_object_reference_local_var; } +__attribute__((deprecated)) v1_local_object_reference_t *v1_local_object_reference_create( + char *name + ) { + return v1_local_object_reference_create_internal ( + name + ); +} void v1_local_object_reference_free(v1_local_object_reference_t *v1_local_object_reference) { if(NULL == v1_local_object_reference){ return ; } + if(v1_local_object_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_local_object_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_local_object_reference->name) { free(v1_local_object_reference->name); @@ -54,6 +66,9 @@ v1_local_object_reference_t *v1_local_object_reference_parseFromJSON(cJSON *v1_l // v1_local_object_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_local_object_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -62,7 +77,7 @@ v1_local_object_reference_t *v1_local_object_reference_parseFromJSON(cJSON *v1_l } - v1_local_object_reference_local_var = v1_local_object_reference_create ( + v1_local_object_reference_local_var = v1_local_object_reference_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL ); diff --git a/kubernetes/model/v1_local_object_reference.h b/kubernetes/model/v1_local_object_reference.h index 0f1ac091..58249046 100644 --- a/kubernetes/model/v1_local_object_reference.h +++ b/kubernetes/model/v1_local_object_reference.h @@ -21,9 +21,10 @@ typedef struct v1_local_object_reference_t v1_local_object_reference_t; typedef struct v1_local_object_reference_t { char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_local_object_reference_t; -v1_local_object_reference_t *v1_local_object_reference_create( +__attribute__((deprecated)) v1_local_object_reference_t *v1_local_object_reference_create( char *name ); diff --git a/kubernetes/model/v1_local_subject_access_review.c b/kubernetes/model/v1_local_subject_access_review.c index b4000ae9..fff3c894 100644 --- a/kubernetes/model/v1_local_subject_access_review.c +++ b/kubernetes/model/v1_local_subject_access_review.c @@ -5,7 +5,7 @@ -v1_local_subject_access_review_t *v1_local_subject_access_review_create( +static v1_local_subject_access_review_t *v1_local_subject_access_review_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_local_subject_access_review_t *v1_local_subject_access_review_create( v1_local_subject_access_review_local_var->spec = spec; v1_local_subject_access_review_local_var->status = status; + v1_local_subject_access_review_local_var->_library_owned = 1; return v1_local_subject_access_review_local_var; } +__attribute__((deprecated)) v1_local_subject_access_review_t *v1_local_subject_access_review_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_subject_access_review_spec_t *spec, + v1_subject_access_review_status_t *status + ) { + return v1_local_subject_access_review_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_local_subject_access_review_free(v1_local_subject_access_review_t *v1_local_subject_access_review) { if(NULL == v1_local_subject_access_review){ return ; } + if(v1_local_subject_access_review->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_local_subject_access_review_free"); + return ; + } listEntry_t *listEntry; if (v1_local_subject_access_review->api_version) { free(v1_local_subject_access_review->api_version); @@ -135,6 +155,9 @@ v1_local_subject_access_review_t *v1_local_subject_access_review_parseFromJSON(c // v1_local_subject_access_review->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_local_subject_access_reviewJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_local_subject_access_review_t *v1_local_subject_access_review_parseFromJSON(c // v1_local_subject_access_review->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_local_subject_access_reviewJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_local_subject_access_review_t *v1_local_subject_access_review_parseFromJSON(c // v1_local_subject_access_review->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_local_subject_access_reviewJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_local_subject_access_review->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_local_subject_access_reviewJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_local_subject_access_review_t *v1_local_subject_access_review_parseFromJSON(c // v1_local_subject_access_review->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_local_subject_access_reviewJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_subject_access_review_status_parseFromJSON(status); //nonprimitive } - v1_local_subject_access_review_local_var = v1_local_subject_access_review_create ( + v1_local_subject_access_review_local_var = v1_local_subject_access_review_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_local_subject_access_review.h b/kubernetes/model/v1_local_subject_access_review.h index a255917e..833ffa33 100644 --- a/kubernetes/model/v1_local_subject_access_review.h +++ b/kubernetes/model/v1_local_subject_access_review.h @@ -28,9 +28,10 @@ typedef struct v1_local_subject_access_review_t { struct v1_subject_access_review_spec_t *spec; //model struct v1_subject_access_review_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_local_subject_access_review_t; -v1_local_subject_access_review_t *v1_local_subject_access_review_create( +__attribute__((deprecated)) v1_local_subject_access_review_t *v1_local_subject_access_review_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_local_volume_source.c b/kubernetes/model/v1_local_volume_source.c index 28509c37..7eadbc00 100644 --- a/kubernetes/model/v1_local_volume_source.c +++ b/kubernetes/model/v1_local_volume_source.c @@ -5,7 +5,7 @@ -v1_local_volume_source_t *v1_local_volume_source_create( +static v1_local_volume_source_t *v1_local_volume_source_create_internal( char *fs_type, char *path ) { @@ -16,14 +16,28 @@ v1_local_volume_source_t *v1_local_volume_source_create( v1_local_volume_source_local_var->fs_type = fs_type; v1_local_volume_source_local_var->path = path; + v1_local_volume_source_local_var->_library_owned = 1; return v1_local_volume_source_local_var; } +__attribute__((deprecated)) v1_local_volume_source_t *v1_local_volume_source_create( + char *fs_type, + char *path + ) { + return v1_local_volume_source_create_internal ( + fs_type, + path + ); +} void v1_local_volume_source_free(v1_local_volume_source_t *v1_local_volume_source) { if(NULL == v1_local_volume_source){ return ; } + if(v1_local_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_local_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_local_volume_source->fs_type) { free(v1_local_volume_source->fs_type); @@ -69,6 +83,9 @@ v1_local_volume_source_t *v1_local_volume_source_parseFromJSON(cJSON *v1_local_v // v1_local_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_local_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -78,6 +95,9 @@ v1_local_volume_source_t *v1_local_volume_source_parseFromJSON(cJSON *v1_local_v // v1_local_volume_source->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_local_volume_sourceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -89,7 +109,7 @@ v1_local_volume_source_t *v1_local_volume_source_parseFromJSON(cJSON *v1_local_v } - v1_local_volume_source_local_var = v1_local_volume_source_create ( + v1_local_volume_source_local_var = v1_local_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, strdup(path->valuestring) ); diff --git a/kubernetes/model/v1_local_volume_source.h b/kubernetes/model/v1_local_volume_source.h index 779459d1..285e1da6 100644 --- a/kubernetes/model/v1_local_volume_source.h +++ b/kubernetes/model/v1_local_volume_source.h @@ -1,7 +1,7 @@ /* * v1_local_volume_source.h * - * Local represents directly-attached storage with node affinity (Beta feature) + * Local represents directly-attached storage with node affinity */ #ifndef _v1_local_volume_source_H_ @@ -22,9 +22,10 @@ typedef struct v1_local_volume_source_t { char *fs_type; // string char *path; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_local_volume_source_t; -v1_local_volume_source_t *v1_local_volume_source_create( +__attribute__((deprecated)) v1_local_volume_source_t *v1_local_volume_source_create( char *fs_type, char *path ); diff --git a/kubernetes/model/v1_managed_fields_entry.c b/kubernetes/model/v1_managed_fields_entry.c index cb3f417f..80bd782b 100644 --- a/kubernetes/model/v1_managed_fields_entry.c +++ b/kubernetes/model/v1_managed_fields_entry.c @@ -5,7 +5,7 @@ -v1_managed_fields_entry_t *v1_managed_fields_entry_create( +static v1_managed_fields_entry_t *v1_managed_fields_entry_create_internal( char *api_version, char *fields_type, object_t *fields_v1, @@ -26,14 +26,38 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_create( v1_managed_fields_entry_local_var->subresource = subresource; v1_managed_fields_entry_local_var->time = time; + v1_managed_fields_entry_local_var->_library_owned = 1; return v1_managed_fields_entry_local_var; } +__attribute__((deprecated)) v1_managed_fields_entry_t *v1_managed_fields_entry_create( + char *api_version, + char *fields_type, + object_t *fields_v1, + char *manager, + char *operation, + char *subresource, + char *time + ) { + return v1_managed_fields_entry_create_internal ( + api_version, + fields_type, + fields_v1, + manager, + operation, + subresource, + time + ); +} void v1_managed_fields_entry_free(v1_managed_fields_entry_t *v1_managed_fields_entry) { if(NULL == v1_managed_fields_entry){ return ; } + if(v1_managed_fields_entry->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_managed_fields_entry_free"); + return ; + } listEntry_t *listEntry; if (v1_managed_fields_entry->api_version) { free(v1_managed_fields_entry->api_version); @@ -143,6 +167,9 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag // v1_managed_fields_entry->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_managed_fields_entryJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -152,6 +179,9 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag // v1_managed_fields_entry->fields_type cJSON *fields_type = cJSON_GetObjectItemCaseSensitive(v1_managed_fields_entryJSON, "fieldsType"); + if (cJSON_IsNull(fields_type)) { + fields_type = NULL; + } if (fields_type) { if(!cJSON_IsString(fields_type) && !cJSON_IsNull(fields_type)) { @@ -161,6 +191,9 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag // v1_managed_fields_entry->fields_v1 cJSON *fields_v1 = cJSON_GetObjectItemCaseSensitive(v1_managed_fields_entryJSON, "fieldsV1"); + if (cJSON_IsNull(fields_v1)) { + fields_v1 = NULL; + } object_t *fields_v1_local_object = NULL; if (fields_v1) { fields_v1_local_object = object_parseFromJSON(fields_v1); //object @@ -168,6 +201,9 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag // v1_managed_fields_entry->manager cJSON *manager = cJSON_GetObjectItemCaseSensitive(v1_managed_fields_entryJSON, "manager"); + if (cJSON_IsNull(manager)) { + manager = NULL; + } if (manager) { if(!cJSON_IsString(manager) && !cJSON_IsNull(manager)) { @@ -177,6 +213,9 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag // v1_managed_fields_entry->operation cJSON *operation = cJSON_GetObjectItemCaseSensitive(v1_managed_fields_entryJSON, "operation"); + if (cJSON_IsNull(operation)) { + operation = NULL; + } if (operation) { if(!cJSON_IsString(operation) && !cJSON_IsNull(operation)) { @@ -186,6 +225,9 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag // v1_managed_fields_entry->subresource cJSON *subresource = cJSON_GetObjectItemCaseSensitive(v1_managed_fields_entryJSON, "subresource"); + if (cJSON_IsNull(subresource)) { + subresource = NULL; + } if (subresource) { if(!cJSON_IsString(subresource) && !cJSON_IsNull(subresource)) { @@ -195,6 +237,9 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag // v1_managed_fields_entry->time cJSON *time = cJSON_GetObjectItemCaseSensitive(v1_managed_fields_entryJSON, "time"); + if (cJSON_IsNull(time)) { + time = NULL; + } if (time) { if(!cJSON_IsString(time) && !cJSON_IsNull(time)) { @@ -203,7 +248,7 @@ v1_managed_fields_entry_t *v1_managed_fields_entry_parseFromJSON(cJSON *v1_manag } - v1_managed_fields_entry_local_var = v1_managed_fields_entry_create ( + v1_managed_fields_entry_local_var = v1_managed_fields_entry_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, fields_type && !cJSON_IsNull(fields_type) ? strdup(fields_type->valuestring) : NULL, fields_v1 ? fields_v1_local_object : NULL, diff --git a/kubernetes/model/v1_managed_fields_entry.h b/kubernetes/model/v1_managed_fields_entry.h index bdd349b8..3b8ba1b8 100644 --- a/kubernetes/model/v1_managed_fields_entry.h +++ b/kubernetes/model/v1_managed_fields_entry.h @@ -28,9 +28,10 @@ typedef struct v1_managed_fields_entry_t { char *subresource; // string char *time; //date time + int _library_owned; // Is the library responsible for freeing this object? } v1_managed_fields_entry_t; -v1_managed_fields_entry_t *v1_managed_fields_entry_create( +__attribute__((deprecated)) v1_managed_fields_entry_t *v1_managed_fields_entry_create( char *api_version, char *fields_type, object_t *fields_v1, diff --git a/kubernetes/model/v1_match_condition.c b/kubernetes/model/v1_match_condition.c index 291b0b92..48ede980 100644 --- a/kubernetes/model/v1_match_condition.c +++ b/kubernetes/model/v1_match_condition.c @@ -5,7 +5,7 @@ -v1_match_condition_t *v1_match_condition_create( +static v1_match_condition_t *v1_match_condition_create_internal( char *expression, char *name ) { @@ -16,14 +16,28 @@ v1_match_condition_t *v1_match_condition_create( v1_match_condition_local_var->expression = expression; v1_match_condition_local_var->name = name; + v1_match_condition_local_var->_library_owned = 1; return v1_match_condition_local_var; } +__attribute__((deprecated)) v1_match_condition_t *v1_match_condition_create( + char *expression, + char *name + ) { + return v1_match_condition_create_internal ( + expression, + name + ); +} void v1_match_condition_free(v1_match_condition_t *v1_match_condition) { if(NULL == v1_match_condition){ return ; } + if(v1_match_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_match_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_match_condition->expression) { free(v1_match_condition->expression); @@ -70,6 +84,9 @@ v1_match_condition_t *v1_match_condition_parseFromJSON(cJSON *v1_match_condition // v1_match_condition->expression cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1_match_conditionJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } if (!expression) { goto end; } @@ -82,6 +99,9 @@ v1_match_condition_t *v1_match_condition_parseFromJSON(cJSON *v1_match_condition // v1_match_condition->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_match_conditionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1_match_condition_t *v1_match_condition_parseFromJSON(cJSON *v1_match_condition } - v1_match_condition_local_var = v1_match_condition_create ( + v1_match_condition_local_var = v1_match_condition_create_internal ( strdup(expression->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_match_condition.h b/kubernetes/model/v1_match_condition.h index a804f71f..9170b3c0 100644 --- a/kubernetes/model/v1_match_condition.h +++ b/kubernetes/model/v1_match_condition.h @@ -22,9 +22,10 @@ typedef struct v1_match_condition_t { char *expression; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_match_condition_t; -v1_match_condition_t *v1_match_condition_create( +__attribute__((deprecated)) v1_match_condition_t *v1_match_condition_create( char *expression, char *name ); diff --git a/kubernetes/model/v1_match_resources.c b/kubernetes/model/v1_match_resources.c index c7c2e8c0..471476a9 100644 --- a/kubernetes/model/v1_match_resources.c +++ b/kubernetes/model/v1_match_resources.c @@ -5,7 +5,7 @@ -v1_match_resources_t *v1_match_resources_create( +static v1_match_resources_t *v1_match_resources_create_internal( list_t *exclude_resource_rules, char *match_policy, v1_label_selector_t *namespace_selector, @@ -22,14 +22,34 @@ v1_match_resources_t *v1_match_resources_create( v1_match_resources_local_var->object_selector = object_selector; v1_match_resources_local_var->resource_rules = resource_rules; + v1_match_resources_local_var->_library_owned = 1; return v1_match_resources_local_var; } +__attribute__((deprecated)) v1_match_resources_t *v1_match_resources_create( + list_t *exclude_resource_rules, + char *match_policy, + v1_label_selector_t *namespace_selector, + v1_label_selector_t *object_selector, + list_t *resource_rules + ) { + return v1_match_resources_create_internal ( + exclude_resource_rules, + match_policy, + namespace_selector, + object_selector, + resource_rules + ); +} void v1_match_resources_free(v1_match_resources_t *v1_match_resources) { if(NULL == v1_match_resources){ return ; } + if(v1_match_resources->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_match_resources_free"); + return ; + } listEntry_t *listEntry; if (v1_match_resources->exclude_resource_rules) { list_ForEach(listEntry, v1_match_resources->exclude_resource_rules) { @@ -162,6 +182,9 @@ v1_match_resources_t *v1_match_resources_parseFromJSON(cJSON *v1_match_resources // v1_match_resources->exclude_resource_rules cJSON *exclude_resource_rules = cJSON_GetObjectItemCaseSensitive(v1_match_resourcesJSON, "excludeResourceRules"); + if (cJSON_IsNull(exclude_resource_rules)) { + exclude_resource_rules = NULL; + } if (exclude_resource_rules) { cJSON *exclude_resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(exclude_resource_rules)){ @@ -183,6 +206,9 @@ v1_match_resources_t *v1_match_resources_parseFromJSON(cJSON *v1_match_resources // v1_match_resources->match_policy cJSON *match_policy = cJSON_GetObjectItemCaseSensitive(v1_match_resourcesJSON, "matchPolicy"); + if (cJSON_IsNull(match_policy)) { + match_policy = NULL; + } if (match_policy) { if(!cJSON_IsString(match_policy) && !cJSON_IsNull(match_policy)) { @@ -192,18 +218,27 @@ v1_match_resources_t *v1_match_resources_parseFromJSON(cJSON *v1_match_resources // v1_match_resources->namespace_selector cJSON *namespace_selector = cJSON_GetObjectItemCaseSensitive(v1_match_resourcesJSON, "namespaceSelector"); + if (cJSON_IsNull(namespace_selector)) { + namespace_selector = NULL; + } if (namespace_selector) { namespace_selector_local_nonprim = v1_label_selector_parseFromJSON(namespace_selector); //nonprimitive } // v1_match_resources->object_selector cJSON *object_selector = cJSON_GetObjectItemCaseSensitive(v1_match_resourcesJSON, "objectSelector"); + if (cJSON_IsNull(object_selector)) { + object_selector = NULL; + } if (object_selector) { object_selector_local_nonprim = v1_label_selector_parseFromJSON(object_selector); //nonprimitive } // v1_match_resources->resource_rules cJSON *resource_rules = cJSON_GetObjectItemCaseSensitive(v1_match_resourcesJSON, "resourceRules"); + if (cJSON_IsNull(resource_rules)) { + resource_rules = NULL; + } if (resource_rules) { cJSON *resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_rules)){ @@ -224,7 +259,7 @@ v1_match_resources_t *v1_match_resources_parseFromJSON(cJSON *v1_match_resources } - v1_match_resources_local_var = v1_match_resources_create ( + v1_match_resources_local_var = v1_match_resources_create_internal ( exclude_resource_rules ? exclude_resource_rulesList : NULL, match_policy && !cJSON_IsNull(match_policy) ? strdup(match_policy->valuestring) : NULL, namespace_selector ? namespace_selector_local_nonprim : NULL, diff --git a/kubernetes/model/v1_match_resources.h b/kubernetes/model/v1_match_resources.h index a6a657f9..8e9dfcbd 100644 --- a/kubernetes/model/v1_match_resources.h +++ b/kubernetes/model/v1_match_resources.h @@ -27,9 +27,10 @@ typedef struct v1_match_resources_t { struct v1_label_selector_t *object_selector; //model list_t *resource_rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_match_resources_t; -v1_match_resources_t *v1_match_resources_create( +__attribute__((deprecated)) v1_match_resources_t *v1_match_resources_create( list_t *exclude_resource_rules, char *match_policy, v1_label_selector_t *namespace_selector, diff --git a/kubernetes/model/v1_modify_volume_status.c b/kubernetes/model/v1_modify_volume_status.c index 0ee6cb3f..a275681d 100644 --- a/kubernetes/model/v1_modify_volume_status.c +++ b/kubernetes/model/v1_modify_volume_status.c @@ -5,7 +5,7 @@ -v1_modify_volume_status_t *v1_modify_volume_status_create( +static v1_modify_volume_status_t *v1_modify_volume_status_create_internal( char *status, char *target_volume_attributes_class_name ) { @@ -16,14 +16,28 @@ v1_modify_volume_status_t *v1_modify_volume_status_create( v1_modify_volume_status_local_var->status = status; v1_modify_volume_status_local_var->target_volume_attributes_class_name = target_volume_attributes_class_name; + v1_modify_volume_status_local_var->_library_owned = 1; return v1_modify_volume_status_local_var; } +__attribute__((deprecated)) v1_modify_volume_status_t *v1_modify_volume_status_create( + char *status, + char *target_volume_attributes_class_name + ) { + return v1_modify_volume_status_create_internal ( + status, + target_volume_attributes_class_name + ); +} void v1_modify_volume_status_free(v1_modify_volume_status_t *v1_modify_volume_status) { if(NULL == v1_modify_volume_status){ return ; } + if(v1_modify_volume_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_modify_volume_status_free"); + return ; + } listEntry_t *listEntry; if (v1_modify_volume_status->status) { free(v1_modify_volume_status->status); @@ -69,6 +83,9 @@ v1_modify_volume_status_t *v1_modify_volume_status_parseFromJSON(cJSON *v1_modif // v1_modify_volume_status->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_modify_volume_statusJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -81,6 +98,9 @@ v1_modify_volume_status_t *v1_modify_volume_status_parseFromJSON(cJSON *v1_modif // v1_modify_volume_status->target_volume_attributes_class_name cJSON *target_volume_attributes_class_name = cJSON_GetObjectItemCaseSensitive(v1_modify_volume_statusJSON, "targetVolumeAttributesClassName"); + if (cJSON_IsNull(target_volume_attributes_class_name)) { + target_volume_attributes_class_name = NULL; + } if (target_volume_attributes_class_name) { if(!cJSON_IsString(target_volume_attributes_class_name) && !cJSON_IsNull(target_volume_attributes_class_name)) { @@ -89,7 +109,7 @@ v1_modify_volume_status_t *v1_modify_volume_status_parseFromJSON(cJSON *v1_modif } - v1_modify_volume_status_local_var = v1_modify_volume_status_create ( + v1_modify_volume_status_local_var = v1_modify_volume_status_create_internal ( strdup(status->valuestring), target_volume_attributes_class_name && !cJSON_IsNull(target_volume_attributes_class_name) ? strdup(target_volume_attributes_class_name->valuestring) : NULL ); diff --git a/kubernetes/model/v1_modify_volume_status.h b/kubernetes/model/v1_modify_volume_status.h index a24aad32..ae3aa033 100644 --- a/kubernetes/model/v1_modify_volume_status.h +++ b/kubernetes/model/v1_modify_volume_status.h @@ -22,9 +22,10 @@ typedef struct v1_modify_volume_status_t { char *status; // string char *target_volume_attributes_class_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_modify_volume_status_t; -v1_modify_volume_status_t *v1_modify_volume_status_create( +__attribute__((deprecated)) v1_modify_volume_status_t *v1_modify_volume_status_create( char *status, char *target_volume_attributes_class_name ); diff --git a/kubernetes/model/v1_mutating_webhook.c b/kubernetes/model/v1_mutating_webhook.c index 9e276528..b1e4d4d5 100644 --- a/kubernetes/model/v1_mutating_webhook.c +++ b/kubernetes/model/v1_mutating_webhook.c @@ -5,7 +5,7 @@ -v1_mutating_webhook_t *v1_mutating_webhook_create( +static v1_mutating_webhook_t *v1_mutating_webhook_create_internal( list_t *admission_review_versions, admissionregistration_v1_webhook_client_config_t *client_config, char *failure_policy, @@ -36,14 +36,48 @@ v1_mutating_webhook_t *v1_mutating_webhook_create( v1_mutating_webhook_local_var->side_effects = side_effects; v1_mutating_webhook_local_var->timeout_seconds = timeout_seconds; + v1_mutating_webhook_local_var->_library_owned = 1; return v1_mutating_webhook_local_var; } +__attribute__((deprecated)) v1_mutating_webhook_t *v1_mutating_webhook_create( + list_t *admission_review_versions, + admissionregistration_v1_webhook_client_config_t *client_config, + char *failure_policy, + list_t *match_conditions, + char *match_policy, + char *name, + v1_label_selector_t *namespace_selector, + v1_label_selector_t *object_selector, + char *reinvocation_policy, + list_t *rules, + char *side_effects, + int timeout_seconds + ) { + return v1_mutating_webhook_create_internal ( + admission_review_versions, + client_config, + failure_policy, + match_conditions, + match_policy, + name, + namespace_selector, + object_selector, + reinvocation_policy, + rules, + side_effects, + timeout_seconds + ); +} void v1_mutating_webhook_free(v1_mutating_webhook_t *v1_mutating_webhook) { if(NULL == v1_mutating_webhook){ return ; } + if(v1_mutating_webhook->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_mutating_webhook_free"); + return ; + } listEntry_t *listEntry; if (v1_mutating_webhook->admission_review_versions) { list_ForEach(listEntry, v1_mutating_webhook->admission_review_versions) { @@ -115,7 +149,7 @@ cJSON *v1_mutating_webhook_convertToJSON(v1_mutating_webhook_t *v1_mutating_webh listEntry_t *admission_review_versionsListEntry; list_ForEach(admission_review_versionsListEntry, v1_mutating_webhook->admission_review_versions) { - if(cJSON_AddStringToObject(admission_review_versions, "", (char*)admission_review_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(admission_review_versions, "", admission_review_versionsListEntry->data) == NULL) { goto fail; } @@ -283,6 +317,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->admission_review_versions cJSON *admission_review_versions = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "admissionReviewVersions"); + if (cJSON_IsNull(admission_review_versions)) { + admission_review_versions = NULL; + } if (!admission_review_versions) { goto end; } @@ -305,6 +342,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->client_config cJSON *client_config = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "clientConfig"); + if (cJSON_IsNull(client_config)) { + client_config = NULL; + } if (!client_config) { goto end; } @@ -314,6 +354,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->failure_policy cJSON *failure_policy = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "failurePolicy"); + if (cJSON_IsNull(failure_policy)) { + failure_policy = NULL; + } if (failure_policy) { if(!cJSON_IsString(failure_policy) && !cJSON_IsNull(failure_policy)) { @@ -323,6 +366,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->match_conditions cJSON *match_conditions = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "matchConditions"); + if (cJSON_IsNull(match_conditions)) { + match_conditions = NULL; + } if (match_conditions) { cJSON *match_conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_conditions)){ @@ -344,6 +390,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->match_policy cJSON *match_policy = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "matchPolicy"); + if (cJSON_IsNull(match_policy)) { + match_policy = NULL; + } if (match_policy) { if(!cJSON_IsString(match_policy) && !cJSON_IsNull(match_policy)) { @@ -353,6 +402,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -365,18 +417,27 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->namespace_selector cJSON *namespace_selector = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "namespaceSelector"); + if (cJSON_IsNull(namespace_selector)) { + namespace_selector = NULL; + } if (namespace_selector) { namespace_selector_local_nonprim = v1_label_selector_parseFromJSON(namespace_selector); //nonprimitive } // v1_mutating_webhook->object_selector cJSON *object_selector = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "objectSelector"); + if (cJSON_IsNull(object_selector)) { + object_selector = NULL; + } if (object_selector) { object_selector_local_nonprim = v1_label_selector_parseFromJSON(object_selector); //nonprimitive } // v1_mutating_webhook->reinvocation_policy cJSON *reinvocation_policy = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "reinvocationPolicy"); + if (cJSON_IsNull(reinvocation_policy)) { + reinvocation_policy = NULL; + } if (reinvocation_policy) { if(!cJSON_IsString(reinvocation_policy) && !cJSON_IsNull(reinvocation_policy)) { @@ -386,6 +447,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (rules) { cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ @@ -407,6 +471,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->side_effects cJSON *side_effects = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "sideEffects"); + if (cJSON_IsNull(side_effects)) { + side_effects = NULL; + } if (!side_effects) { goto end; } @@ -419,6 +486,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->timeout_seconds cJSON *timeout_seconds = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "timeoutSeconds"); + if (cJSON_IsNull(timeout_seconds)) { + timeout_seconds = NULL; + } if (timeout_seconds) { if(!cJSON_IsNumber(timeout_seconds)) { @@ -427,7 +497,7 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh } - v1_mutating_webhook_local_var = v1_mutating_webhook_create ( + v1_mutating_webhook_local_var = v1_mutating_webhook_create_internal ( admission_review_versionsList, client_config_local_nonprim, failure_policy && !cJSON_IsNull(failure_policy) ? strdup(failure_policy->valuestring) : NULL, diff --git a/kubernetes/model/v1_mutating_webhook.h b/kubernetes/model/v1_mutating_webhook.h index 534ae5e2..bacb0cc3 100644 --- a/kubernetes/model/v1_mutating_webhook.h +++ b/kubernetes/model/v1_mutating_webhook.h @@ -36,9 +36,10 @@ typedef struct v1_mutating_webhook_t { char *side_effects; // string int timeout_seconds; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_mutating_webhook_t; -v1_mutating_webhook_t *v1_mutating_webhook_create( +__attribute__((deprecated)) v1_mutating_webhook_t *v1_mutating_webhook_create( list_t *admission_review_versions, admissionregistration_v1_webhook_client_config_t *client_config, char *failure_policy, diff --git a/kubernetes/model/v1_mutating_webhook_configuration.c b/kubernetes/model/v1_mutating_webhook_configuration.c index 0718d433..1434d796 100644 --- a/kubernetes/model/v1_mutating_webhook_configuration.c +++ b/kubernetes/model/v1_mutating_webhook_configuration.c @@ -5,7 +5,7 @@ -v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_create( +static v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_create( v1_mutating_webhook_configuration_local_var->metadata = metadata; v1_mutating_webhook_configuration_local_var->webhooks = webhooks; + v1_mutating_webhook_configuration_local_var->_library_owned = 1; return v1_mutating_webhook_configuration_local_var; } +__attribute__((deprecated)) v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + list_t *webhooks + ) { + return v1_mutating_webhook_configuration_create_internal ( + api_version, + kind, + metadata, + webhooks + ); +} void v1_mutating_webhook_configuration_free(v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration) { if(NULL == v1_mutating_webhook_configuration){ return ; } + if(v1_mutating_webhook_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_mutating_webhook_configuration_free"); + return ; + } listEntry_t *listEntry; if (v1_mutating_webhook_configuration->api_version) { free(v1_mutating_webhook_configuration->api_version); @@ -122,6 +140,9 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_parseFrom // v1_mutating_webhook_configuration->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configurationJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -131,6 +152,9 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_parseFrom // v1_mutating_webhook_configuration->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configurationJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -140,12 +164,18 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_parseFrom // v1_mutating_webhook_configuration->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configurationJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_mutating_webhook_configuration->webhooks cJSON *webhooks = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configurationJSON, "webhooks"); + if (cJSON_IsNull(webhooks)) { + webhooks = NULL; + } if (webhooks) { cJSON *webhooks_local_nonprimitive = NULL; if(!cJSON_IsArray(webhooks)){ @@ -166,7 +196,7 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_parseFrom } - v1_mutating_webhook_configuration_local_var = v1_mutating_webhook_configuration_create ( + v1_mutating_webhook_configuration_local_var = v1_mutating_webhook_configuration_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_mutating_webhook_configuration.h b/kubernetes/model/v1_mutating_webhook_configuration.h index 503c9953..bb63dfd4 100644 --- a/kubernetes/model/v1_mutating_webhook_configuration.h +++ b/kubernetes/model/v1_mutating_webhook_configuration.h @@ -26,9 +26,10 @@ typedef struct v1_mutating_webhook_configuration_t { struct v1_object_meta_t *metadata; //model list_t *webhooks; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_mutating_webhook_configuration_t; -v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_create( +__attribute__((deprecated)) v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_mutating_webhook_configuration_list.c b/kubernetes/model/v1_mutating_webhook_configuration_list.c index c61ca0bb..39bdee52 100644 --- a/kubernetes/model/v1_mutating_webhook_configuration_list.c +++ b/kubernetes/model/v1_mutating_webhook_configuration_list.c @@ -5,7 +5,7 @@ -v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list_create( +static v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list v1_mutating_webhook_configuration_list_local_var->kind = kind; v1_mutating_webhook_configuration_list_local_var->metadata = metadata; + v1_mutating_webhook_configuration_list_local_var->_library_owned = 1; return v1_mutating_webhook_configuration_list_local_var; } +__attribute__((deprecated)) v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_mutating_webhook_configuration_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_mutating_webhook_configuration_list_free(v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list) { if(NULL == v1_mutating_webhook_configuration_list){ return ; } + if(v1_mutating_webhook_configuration_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_mutating_webhook_configuration_list_free"); + return ; + } listEntry_t *listEntry; if (v1_mutating_webhook_configuration_list->api_version) { free(v1_mutating_webhook_configuration_list->api_version); @@ -123,6 +141,9 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list // v1_mutating_webhook_configuration_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configuration_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list // v1_mutating_webhook_configuration_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configuration_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list // v1_mutating_webhook_configuration_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configuration_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list // v1_mutating_webhook_configuration_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configuration_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_mutating_webhook_configuration_list_local_var = v1_mutating_webhook_configuration_list_create ( + v1_mutating_webhook_configuration_list_local_var = v1_mutating_webhook_configuration_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_mutating_webhook_configuration_list.h b/kubernetes/model/v1_mutating_webhook_configuration_list.h index db94163b..6f633f14 100644 --- a/kubernetes/model/v1_mutating_webhook_configuration_list.h +++ b/kubernetes/model/v1_mutating_webhook_configuration_list.h @@ -26,9 +26,10 @@ typedef struct v1_mutating_webhook_configuration_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_mutating_webhook_configuration_list_t; -v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list_create( +__attribute__((deprecated)) v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_named_rule_with_operations.c b/kubernetes/model/v1_named_rule_with_operations.c index d1bd3183..f7c4de19 100644 --- a/kubernetes/model/v1_named_rule_with_operations.c +++ b/kubernetes/model/v1_named_rule_with_operations.c @@ -5,7 +5,7 @@ -v1_named_rule_with_operations_t *v1_named_rule_with_operations_create( +static v1_named_rule_with_operations_t *v1_named_rule_with_operations_create_internal( list_t *api_groups, list_t *api_versions, list_t *operations, @@ -24,14 +24,36 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_create( v1_named_rule_with_operations_local_var->resources = resources; v1_named_rule_with_operations_local_var->scope = scope; + v1_named_rule_with_operations_local_var->_library_owned = 1; return v1_named_rule_with_operations_local_var; } +__attribute__((deprecated)) v1_named_rule_with_operations_t *v1_named_rule_with_operations_create( + list_t *api_groups, + list_t *api_versions, + list_t *operations, + list_t *resource_names, + list_t *resources, + char *scope + ) { + return v1_named_rule_with_operations_create_internal ( + api_groups, + api_versions, + operations, + resource_names, + resources, + scope + ); +} void v1_named_rule_with_operations_free(v1_named_rule_with_operations_t *v1_named_rule_with_operations) { if(NULL == v1_named_rule_with_operations){ return ; } + if(v1_named_rule_with_operations->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_named_rule_with_operations_free"); + return ; + } listEntry_t *listEntry; if (v1_named_rule_with_operations->api_groups) { list_ForEach(listEntry, v1_named_rule_with_operations->api_groups) { @@ -87,7 +109,7 @@ cJSON *v1_named_rule_with_operations_convertToJSON(v1_named_rule_with_operations listEntry_t *api_groupsListEntry; list_ForEach(api_groupsListEntry, v1_named_rule_with_operations->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_groups, "", api_groupsListEntry->data) == NULL) { goto fail; } @@ -104,7 +126,7 @@ cJSON *v1_named_rule_with_operations_convertToJSON(v1_named_rule_with_operations listEntry_t *api_versionsListEntry; list_ForEach(api_versionsListEntry, v1_named_rule_with_operations->api_versions) { - if(cJSON_AddStringToObject(api_versions, "", (char*)api_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_versions, "", api_versionsListEntry->data) == NULL) { goto fail; } @@ -121,7 +143,7 @@ cJSON *v1_named_rule_with_operations_convertToJSON(v1_named_rule_with_operations listEntry_t *operationsListEntry; list_ForEach(operationsListEntry, v1_named_rule_with_operations->operations) { - if(cJSON_AddStringToObject(operations, "", (char*)operationsListEntry->data) == NULL) + if(cJSON_AddStringToObject(operations, "", operationsListEntry->data) == NULL) { goto fail; } @@ -138,7 +160,7 @@ cJSON *v1_named_rule_with_operations_convertToJSON(v1_named_rule_with_operations listEntry_t *resource_namesListEntry; list_ForEach(resource_namesListEntry, v1_named_rule_with_operations->resource_names) { - if(cJSON_AddStringToObject(resource_names, "", (char*)resource_namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resource_names, "", resource_namesListEntry->data) == NULL) { goto fail; } @@ -155,7 +177,7 @@ cJSON *v1_named_rule_with_operations_convertToJSON(v1_named_rule_with_operations listEntry_t *resourcesListEntry; list_ForEach(resourcesListEntry, v1_named_rule_with_operations->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resources, "", resourcesListEntry->data) == NULL) { goto fail; } @@ -199,6 +221,9 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_parseFromJSON(cJS // v1_named_rule_with_operations->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_named_rule_with_operationsJSON, "apiGroups"); + if (cJSON_IsNull(api_groups)) { + api_groups = NULL; + } if (api_groups) { cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { @@ -218,6 +243,9 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_parseFromJSON(cJS // v1_named_rule_with_operations->api_versions cJSON *api_versions = cJSON_GetObjectItemCaseSensitive(v1_named_rule_with_operationsJSON, "apiVersions"); + if (cJSON_IsNull(api_versions)) { + api_versions = NULL; + } if (api_versions) { cJSON *api_versions_local = NULL; if(!cJSON_IsArray(api_versions)) { @@ -237,6 +265,9 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_parseFromJSON(cJS // v1_named_rule_with_operations->operations cJSON *operations = cJSON_GetObjectItemCaseSensitive(v1_named_rule_with_operationsJSON, "operations"); + if (cJSON_IsNull(operations)) { + operations = NULL; + } if (operations) { cJSON *operations_local = NULL; if(!cJSON_IsArray(operations)) { @@ -256,6 +287,9 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_parseFromJSON(cJS // v1_named_rule_with_operations->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1_named_rule_with_operationsJSON, "resourceNames"); + if (cJSON_IsNull(resource_names)) { + resource_names = NULL; + } if (resource_names) { cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { @@ -275,6 +309,9 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_parseFromJSON(cJS // v1_named_rule_with_operations->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_named_rule_with_operationsJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { @@ -294,6 +331,9 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_parseFromJSON(cJS // v1_named_rule_with_operations->scope cJSON *scope = cJSON_GetObjectItemCaseSensitive(v1_named_rule_with_operationsJSON, "scope"); + if (cJSON_IsNull(scope)) { + scope = NULL; + } if (scope) { if(!cJSON_IsString(scope) && !cJSON_IsNull(scope)) { @@ -302,7 +342,7 @@ v1_named_rule_with_operations_t *v1_named_rule_with_operations_parseFromJSON(cJS } - v1_named_rule_with_operations_local_var = v1_named_rule_with_operations_create ( + v1_named_rule_with_operations_local_var = v1_named_rule_with_operations_create_internal ( api_groups ? api_groupsList : NULL, api_versions ? api_versionsList : NULL, operations ? operationsList : NULL, diff --git a/kubernetes/model/v1_named_rule_with_operations.h b/kubernetes/model/v1_named_rule_with_operations.h index f37ccecc..cae68d44 100644 --- a/kubernetes/model/v1_named_rule_with_operations.h +++ b/kubernetes/model/v1_named_rule_with_operations.h @@ -26,9 +26,10 @@ typedef struct v1_named_rule_with_operations_t { list_t *resources; //primitive container char *scope; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_named_rule_with_operations_t; -v1_named_rule_with_operations_t *v1_named_rule_with_operations_create( +__attribute__((deprecated)) v1_named_rule_with_operations_t *v1_named_rule_with_operations_create( list_t *api_groups, list_t *api_versions, list_t *operations, diff --git a/kubernetes/model/v1_namespace.c b/kubernetes/model/v1_namespace.c index ddac77bd..a5e2bcc4 100644 --- a/kubernetes/model/v1_namespace.c +++ b/kubernetes/model/v1_namespace.c @@ -5,7 +5,7 @@ -v1_namespace_t *v1_namespace_create( +static v1_namespace_t *v1_namespace_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_namespace_t *v1_namespace_create( v1_namespace_local_var->spec = spec; v1_namespace_local_var->status = status; + v1_namespace_local_var->_library_owned = 1; return v1_namespace_local_var; } +__attribute__((deprecated)) v1_namespace_t *v1_namespace_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_namespace_spec_t *spec, + v1_namespace_status_t *status + ) { + return v1_namespace_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_namespace_free(v1_namespace_t *v1_namespace) { if(NULL == v1_namespace){ return ; } + if(v1_namespace->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_namespace_free"); + return ; + } listEntry_t *listEntry; if (v1_namespace->api_version) { free(v1_namespace->api_version); @@ -134,6 +154,9 @@ v1_namespace_t *v1_namespace_parseFromJSON(cJSON *v1_namespaceJSON){ // v1_namespace->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_namespaceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_namespace_t *v1_namespace_parseFromJSON(cJSON *v1_namespaceJSON){ // v1_namespace->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_namespaceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_namespace_t *v1_namespace_parseFromJSON(cJSON *v1_namespaceJSON){ // v1_namespace->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_namespaceJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_namespace->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_namespaceJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_namespace_spec_parseFromJSON(spec); //nonprimitive } // v1_namespace->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_namespaceJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_namespace_status_parseFromJSON(status); //nonprimitive } - v1_namespace_local_var = v1_namespace_create ( + v1_namespace_local_var = v1_namespace_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_namespace.h b/kubernetes/model/v1_namespace.h index 98f37185..702aeecb 100644 --- a/kubernetes/model/v1_namespace.h +++ b/kubernetes/model/v1_namespace.h @@ -28,9 +28,10 @@ typedef struct v1_namespace_t { struct v1_namespace_spec_t *spec; //model struct v1_namespace_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_namespace_t; -v1_namespace_t *v1_namespace_create( +__attribute__((deprecated)) v1_namespace_t *v1_namespace_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_namespace_condition.c b/kubernetes/model/v1_namespace_condition.c index a1a25bc8..da70eb54 100644 --- a/kubernetes/model/v1_namespace_condition.c +++ b/kubernetes/model/v1_namespace_condition.c @@ -5,7 +5,7 @@ -v1_namespace_condition_t *v1_namespace_condition_create( +static v1_namespace_condition_t *v1_namespace_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_namespace_condition_t *v1_namespace_condition_create( v1_namespace_condition_local_var->status = status; v1_namespace_condition_local_var->type = type; + v1_namespace_condition_local_var->_library_owned = 1; return v1_namespace_condition_local_var; } +__attribute__((deprecated)) v1_namespace_condition_t *v1_namespace_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_namespace_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_namespace_condition_free(v1_namespace_condition_t *v1_namespace_condition) { if(NULL == v1_namespace_condition){ return ; } + if(v1_namespace_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_namespace_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_namespace_condition->last_transition_time) { free(v1_namespace_condition->last_transition_time); @@ -112,6 +132,9 @@ v1_namespace_condition_t *v1_namespace_condition_parseFromJSON(cJSON *v1_namespa // v1_namespace_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_namespace_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v1_namespace_condition_t *v1_namespace_condition_parseFromJSON(cJSON *v1_namespa // v1_namespace_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_namespace_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1_namespace_condition_t *v1_namespace_condition_parseFromJSON(cJSON *v1_namespa // v1_namespace_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_namespace_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1_namespace_condition_t *v1_namespace_condition_parseFromJSON(cJSON *v1_namespa // v1_namespace_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_namespace_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1_namespace_condition_t *v1_namespace_condition_parseFromJSON(cJSON *v1_namespa // v1_namespace_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_namespace_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1_namespace_condition_t *v1_namespace_condition_parseFromJSON(cJSON *v1_namespa } - v1_namespace_condition_local_var = v1_namespace_condition_create ( + v1_namespace_condition_local_var = v1_namespace_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_namespace_condition.h b/kubernetes/model/v1_namespace_condition.h index a5d5cdd2..2c05cbed 100644 --- a/kubernetes/model/v1_namespace_condition.h +++ b/kubernetes/model/v1_namespace_condition.h @@ -25,9 +25,10 @@ typedef struct v1_namespace_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_namespace_condition_t; -v1_namespace_condition_t *v1_namespace_condition_create( +__attribute__((deprecated)) v1_namespace_condition_t *v1_namespace_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_namespace_list.c b/kubernetes/model/v1_namespace_list.c index b93de994..1156bd46 100644 --- a/kubernetes/model/v1_namespace_list.c +++ b/kubernetes/model/v1_namespace_list.c @@ -5,7 +5,7 @@ -v1_namespace_list_t *v1_namespace_list_create( +static v1_namespace_list_t *v1_namespace_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_namespace_list_t *v1_namespace_list_create( v1_namespace_list_local_var->kind = kind; v1_namespace_list_local_var->metadata = metadata; + v1_namespace_list_local_var->_library_owned = 1; return v1_namespace_list_local_var; } +__attribute__((deprecated)) v1_namespace_list_t *v1_namespace_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_namespace_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_namespace_list_free(v1_namespace_list_t *v1_namespace_list) { if(NULL == v1_namespace_list){ return ; } + if(v1_namespace_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_namespace_list_free"); + return ; + } listEntry_t *listEntry; if (v1_namespace_list->api_version) { free(v1_namespace_list->api_version); @@ -123,6 +141,9 @@ v1_namespace_list_t *v1_namespace_list_parseFromJSON(cJSON *v1_namespace_listJSO // v1_namespace_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_namespace_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_namespace_list_t *v1_namespace_list_parseFromJSON(cJSON *v1_namespace_listJSO // v1_namespace_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_namespace_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_namespace_list_t *v1_namespace_list_parseFromJSON(cJSON *v1_namespace_listJSO // v1_namespace_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_namespace_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_namespace_list_t *v1_namespace_list_parseFromJSON(cJSON *v1_namespace_listJSO // v1_namespace_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_namespace_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_namespace_list_local_var = v1_namespace_list_create ( + v1_namespace_list_local_var = v1_namespace_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_namespace_list.h b/kubernetes/model/v1_namespace_list.h index d9261afb..58606d1c 100644 --- a/kubernetes/model/v1_namespace_list.h +++ b/kubernetes/model/v1_namespace_list.h @@ -26,9 +26,10 @@ typedef struct v1_namespace_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_namespace_list_t; -v1_namespace_list_t *v1_namespace_list_create( +__attribute__((deprecated)) v1_namespace_list_t *v1_namespace_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_namespace_spec.c b/kubernetes/model/v1_namespace_spec.c index ee999643..0553ae83 100644 --- a/kubernetes/model/v1_namespace_spec.c +++ b/kubernetes/model/v1_namespace_spec.c @@ -5,7 +5,7 @@ -v1_namespace_spec_t *v1_namespace_spec_create( +static v1_namespace_spec_t *v1_namespace_spec_create_internal( list_t *finalizers ) { v1_namespace_spec_t *v1_namespace_spec_local_var = malloc(sizeof(v1_namespace_spec_t)); @@ -14,14 +14,26 @@ v1_namespace_spec_t *v1_namespace_spec_create( } v1_namespace_spec_local_var->finalizers = finalizers; + v1_namespace_spec_local_var->_library_owned = 1; return v1_namespace_spec_local_var; } +__attribute__((deprecated)) v1_namespace_spec_t *v1_namespace_spec_create( + list_t *finalizers + ) { + return v1_namespace_spec_create_internal ( + finalizers + ); +} void v1_namespace_spec_free(v1_namespace_spec_t *v1_namespace_spec) { if(NULL == v1_namespace_spec){ return ; } + if(v1_namespace_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_namespace_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_namespace_spec->finalizers) { list_ForEach(listEntry, v1_namespace_spec->finalizers) { @@ -45,7 +57,7 @@ cJSON *v1_namespace_spec_convertToJSON(v1_namespace_spec_t *v1_namespace_spec) { listEntry_t *finalizersListEntry; list_ForEach(finalizersListEntry, v1_namespace_spec->finalizers) { - if(cJSON_AddStringToObject(finalizers, "", (char*)finalizersListEntry->data) == NULL) + if(cJSON_AddStringToObject(finalizers, "", finalizersListEntry->data) == NULL) { goto fail; } @@ -69,6 +81,9 @@ v1_namespace_spec_t *v1_namespace_spec_parseFromJSON(cJSON *v1_namespace_specJSO // v1_namespace_spec->finalizers cJSON *finalizers = cJSON_GetObjectItemCaseSensitive(v1_namespace_specJSON, "finalizers"); + if (cJSON_IsNull(finalizers)) { + finalizers = NULL; + } if (finalizers) { cJSON *finalizers_local = NULL; if(!cJSON_IsArray(finalizers)) { @@ -87,7 +102,7 @@ v1_namespace_spec_t *v1_namespace_spec_parseFromJSON(cJSON *v1_namespace_specJSO } - v1_namespace_spec_local_var = v1_namespace_spec_create ( + v1_namespace_spec_local_var = v1_namespace_spec_create_internal ( finalizers ? finalizersList : NULL ); diff --git a/kubernetes/model/v1_namespace_spec.h b/kubernetes/model/v1_namespace_spec.h index ce7eadec..df2ab791 100644 --- a/kubernetes/model/v1_namespace_spec.h +++ b/kubernetes/model/v1_namespace_spec.h @@ -21,9 +21,10 @@ typedef struct v1_namespace_spec_t v1_namespace_spec_t; typedef struct v1_namespace_spec_t { list_t *finalizers; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_namespace_spec_t; -v1_namespace_spec_t *v1_namespace_spec_create( +__attribute__((deprecated)) v1_namespace_spec_t *v1_namespace_spec_create( list_t *finalizers ); diff --git a/kubernetes/model/v1_namespace_status.c b/kubernetes/model/v1_namespace_status.c index e77d818a..f0aff02c 100644 --- a/kubernetes/model/v1_namespace_status.c +++ b/kubernetes/model/v1_namespace_status.c @@ -5,7 +5,7 @@ -v1_namespace_status_t *v1_namespace_status_create( +static v1_namespace_status_t *v1_namespace_status_create_internal( list_t *conditions, char *phase ) { @@ -16,14 +16,28 @@ v1_namespace_status_t *v1_namespace_status_create( v1_namespace_status_local_var->conditions = conditions; v1_namespace_status_local_var->phase = phase; + v1_namespace_status_local_var->_library_owned = 1; return v1_namespace_status_local_var; } +__attribute__((deprecated)) v1_namespace_status_t *v1_namespace_status_create( + list_t *conditions, + char *phase + ) { + return v1_namespace_status_create_internal ( + conditions, + phase + ); +} void v1_namespace_status_free(v1_namespace_status_t *v1_namespace_status) { if(NULL == v1_namespace_status){ return ; } + if(v1_namespace_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_namespace_status_free"); + return ; + } listEntry_t *listEntry; if (v1_namespace_status->conditions) { list_ForEach(listEntry, v1_namespace_status->conditions) { @@ -86,6 +100,9 @@ v1_namespace_status_t *v1_namespace_status_parseFromJSON(cJSON *v1_namespace_sta // v1_namespace_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_namespace_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -107,6 +124,9 @@ v1_namespace_status_t *v1_namespace_status_parseFromJSON(cJSON *v1_namespace_sta // v1_namespace_status->phase cJSON *phase = cJSON_GetObjectItemCaseSensitive(v1_namespace_statusJSON, "phase"); + if (cJSON_IsNull(phase)) { + phase = NULL; + } if (phase) { if(!cJSON_IsString(phase) && !cJSON_IsNull(phase)) { @@ -115,7 +135,7 @@ v1_namespace_status_t *v1_namespace_status_parseFromJSON(cJSON *v1_namespace_sta } - v1_namespace_status_local_var = v1_namespace_status_create ( + v1_namespace_status_local_var = v1_namespace_status_create_internal ( conditions ? conditionsList : NULL, phase && !cJSON_IsNull(phase) ? strdup(phase->valuestring) : NULL ); diff --git a/kubernetes/model/v1_namespace_status.h b/kubernetes/model/v1_namespace_status.h index 04833b78..46366b14 100644 --- a/kubernetes/model/v1_namespace_status.h +++ b/kubernetes/model/v1_namespace_status.h @@ -23,9 +23,10 @@ typedef struct v1_namespace_status_t { list_t *conditions; //nonprimitive container char *phase; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_namespace_status_t; -v1_namespace_status_t *v1_namespace_status_create( +__attribute__((deprecated)) v1_namespace_status_t *v1_namespace_status_create( list_t *conditions, char *phase ); diff --git a/kubernetes/model/v1_network_device_data.c b/kubernetes/model/v1_network_device_data.c new file mode 100644 index 00000000..1ce9f5cc --- /dev/null +++ b/kubernetes/model/v1_network_device_data.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include "v1_network_device_data.h" + + + +static v1_network_device_data_t *v1_network_device_data_create_internal( + char *hardware_address, + char *interface_name, + list_t *ips + ) { + v1_network_device_data_t *v1_network_device_data_local_var = malloc(sizeof(v1_network_device_data_t)); + if (!v1_network_device_data_local_var) { + return NULL; + } + v1_network_device_data_local_var->hardware_address = hardware_address; + v1_network_device_data_local_var->interface_name = interface_name; + v1_network_device_data_local_var->ips = ips; + + v1_network_device_data_local_var->_library_owned = 1; + return v1_network_device_data_local_var; +} + +__attribute__((deprecated)) v1_network_device_data_t *v1_network_device_data_create( + char *hardware_address, + char *interface_name, + list_t *ips + ) { + return v1_network_device_data_create_internal ( + hardware_address, + interface_name, + ips + ); +} + +void v1_network_device_data_free(v1_network_device_data_t *v1_network_device_data) { + if(NULL == v1_network_device_data){ + return ; + } + if(v1_network_device_data->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_device_data_free"); + return ; + } + listEntry_t *listEntry; + if (v1_network_device_data->hardware_address) { + free(v1_network_device_data->hardware_address); + v1_network_device_data->hardware_address = NULL; + } + if (v1_network_device_data->interface_name) { + free(v1_network_device_data->interface_name); + v1_network_device_data->interface_name = NULL; + } + if (v1_network_device_data->ips) { + list_ForEach(listEntry, v1_network_device_data->ips) { + free(listEntry->data); + } + list_freeList(v1_network_device_data->ips); + v1_network_device_data->ips = NULL; + } + free(v1_network_device_data); +} + +cJSON *v1_network_device_data_convertToJSON(v1_network_device_data_t *v1_network_device_data) { + cJSON *item = cJSON_CreateObject(); + + // v1_network_device_data->hardware_address + if(v1_network_device_data->hardware_address) { + if(cJSON_AddStringToObject(item, "hardwareAddress", v1_network_device_data->hardware_address) == NULL) { + goto fail; //String + } + } + + + // v1_network_device_data->interface_name + if(v1_network_device_data->interface_name) { + if(cJSON_AddStringToObject(item, "interfaceName", v1_network_device_data->interface_name) == NULL) { + goto fail; //String + } + } + + + // v1_network_device_data->ips + if(v1_network_device_data->ips) { + cJSON *ips = cJSON_AddArrayToObject(item, "ips"); + if(ips == NULL) { + goto fail; //primitive container + } + + listEntry_t *ipsListEntry; + list_ForEach(ipsListEntry, v1_network_device_data->ips) { + if(cJSON_AddStringToObject(ips, "", ipsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_network_device_data_t *v1_network_device_data_parseFromJSON(cJSON *v1_network_device_dataJSON){ + + v1_network_device_data_t *v1_network_device_data_local_var = NULL; + + // define the local list for v1_network_device_data->ips + list_t *ipsList = NULL; + + // v1_network_device_data->hardware_address + cJSON *hardware_address = cJSON_GetObjectItemCaseSensitive(v1_network_device_dataJSON, "hardwareAddress"); + if (cJSON_IsNull(hardware_address)) { + hardware_address = NULL; + } + if (hardware_address) { + if(!cJSON_IsString(hardware_address) && !cJSON_IsNull(hardware_address)) + { + goto end; //String + } + } + + // v1_network_device_data->interface_name + cJSON *interface_name = cJSON_GetObjectItemCaseSensitive(v1_network_device_dataJSON, "interfaceName"); + if (cJSON_IsNull(interface_name)) { + interface_name = NULL; + } + if (interface_name) { + if(!cJSON_IsString(interface_name) && !cJSON_IsNull(interface_name)) + { + goto end; //String + } + } + + // v1_network_device_data->ips + cJSON *ips = cJSON_GetObjectItemCaseSensitive(v1_network_device_dataJSON, "ips"); + if (cJSON_IsNull(ips)) { + ips = NULL; + } + if (ips) { + cJSON *ips_local = NULL; + if(!cJSON_IsArray(ips)) { + goto end;//primitive container + } + ipsList = list_createList(); + + cJSON_ArrayForEach(ips_local, ips) + { + if(!cJSON_IsString(ips_local)) + { + goto end; + } + list_addElement(ipsList , strdup(ips_local->valuestring)); + } + } + + + v1_network_device_data_local_var = v1_network_device_data_create_internal ( + hardware_address && !cJSON_IsNull(hardware_address) ? strdup(hardware_address->valuestring) : NULL, + interface_name && !cJSON_IsNull(interface_name) ? strdup(interface_name->valuestring) : NULL, + ips ? ipsList : NULL + ); + + return v1_network_device_data_local_var; +end: + if (ipsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ipsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ipsList); + ipsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_network_device_data.h b/kubernetes/model/v1_network_device_data.h new file mode 100644 index 00000000..1903eb38 --- /dev/null +++ b/kubernetes/model/v1_network_device_data.h @@ -0,0 +1,42 @@ +/* + * v1_network_device_data.h + * + * NetworkDeviceData provides network-related details for the allocated device. This information may be filled by drivers or other components to configure or identify the device within a network context. + */ + +#ifndef _v1_network_device_data_H_ +#define _v1_network_device_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_network_device_data_t v1_network_device_data_t; + + + + +typedef struct v1_network_device_data_t { + char *hardware_address; // string + char *interface_name; // string + list_t *ips; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_network_device_data_t; + +__attribute__((deprecated)) v1_network_device_data_t *v1_network_device_data_create( + char *hardware_address, + char *interface_name, + list_t *ips +); + +void v1_network_device_data_free(v1_network_device_data_t *v1_network_device_data); + +v1_network_device_data_t *v1_network_device_data_parseFromJSON(cJSON *v1_network_device_dataJSON); + +cJSON *v1_network_device_data_convertToJSON(v1_network_device_data_t *v1_network_device_data); + +#endif /* _v1_network_device_data_H_ */ + diff --git a/kubernetes/model/v1_network_policy.c b/kubernetes/model/v1_network_policy.c index f3567dac..fc30fd80 100644 --- a/kubernetes/model/v1_network_policy.c +++ b/kubernetes/model/v1_network_policy.c @@ -5,7 +5,7 @@ -v1_network_policy_t *v1_network_policy_create( +static v1_network_policy_t *v1_network_policy_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_network_policy_t *v1_network_policy_create( v1_network_policy_local_var->metadata = metadata; v1_network_policy_local_var->spec = spec; + v1_network_policy_local_var->_library_owned = 1; return v1_network_policy_local_var; } +__attribute__((deprecated)) v1_network_policy_t *v1_network_policy_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_network_policy_spec_t *spec + ) { + return v1_network_policy_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1_network_policy_free(v1_network_policy_t *v1_network_policy) { if(NULL == v1_network_policy){ return ; } + if(v1_network_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_policy_free"); + return ; + } listEntry_t *listEntry; if (v1_network_policy->api_version) { free(v1_network_policy->api_version); @@ -112,6 +130,9 @@ v1_network_policy_t *v1_network_policy_parseFromJSON(cJSON *v1_network_policyJSO // v1_network_policy->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_network_policyJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,6 +142,9 @@ v1_network_policy_t *v1_network_policy_parseFromJSON(cJSON *v1_network_policyJSO // v1_network_policy->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_network_policyJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -130,18 +154,24 @@ v1_network_policy_t *v1_network_policy_parseFromJSON(cJSON *v1_network_policyJSO // v1_network_policy->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_network_policyJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_network_policy->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_network_policyJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_network_policy_spec_parseFromJSON(spec); //nonprimitive } - v1_network_policy_local_var = v1_network_policy_create ( + v1_network_policy_local_var = v1_network_policy_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_network_policy.h b/kubernetes/model/v1_network_policy.h index 93f0fcbb..19809627 100644 --- a/kubernetes/model/v1_network_policy.h +++ b/kubernetes/model/v1_network_policy.h @@ -26,9 +26,10 @@ typedef struct v1_network_policy_t { struct v1_object_meta_t *metadata; //model struct v1_network_policy_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_network_policy_t; -v1_network_policy_t *v1_network_policy_create( +__attribute__((deprecated)) v1_network_policy_t *v1_network_policy_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_network_policy_egress_rule.c b/kubernetes/model/v1_network_policy_egress_rule.c index 2a10e1b9..3bafc4d8 100644 --- a/kubernetes/model/v1_network_policy_egress_rule.c +++ b/kubernetes/model/v1_network_policy_egress_rule.c @@ -5,7 +5,7 @@ -v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_create( +static v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_create_internal( list_t *ports, list_t *to ) { @@ -16,14 +16,28 @@ v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_create( v1_network_policy_egress_rule_local_var->ports = ports; v1_network_policy_egress_rule_local_var->to = to; + v1_network_policy_egress_rule_local_var->_library_owned = 1; return v1_network_policy_egress_rule_local_var; } +__attribute__((deprecated)) v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_create( + list_t *ports, + list_t *to + ) { + return v1_network_policy_egress_rule_create_internal ( + ports, + to + ); +} void v1_network_policy_egress_rule_free(v1_network_policy_egress_rule_t *v1_network_policy_egress_rule) { if(NULL == v1_network_policy_egress_rule){ return ; } + if(v1_network_policy_egress_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_policy_egress_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_network_policy_egress_rule->ports) { list_ForEach(listEntry, v1_network_policy_egress_rule->ports) { @@ -104,6 +118,9 @@ v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_parseFromJSON(cJS // v1_network_policy_egress_rule->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_network_policy_egress_ruleJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -125,6 +142,9 @@ v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_parseFromJSON(cJS // v1_network_policy_egress_rule->to cJSON *to = cJSON_GetObjectItemCaseSensitive(v1_network_policy_egress_ruleJSON, "to"); + if (cJSON_IsNull(to)) { + to = NULL; + } if (to) { cJSON *to_local_nonprimitive = NULL; if(!cJSON_IsArray(to)){ @@ -145,7 +165,7 @@ v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_parseFromJSON(cJS } - v1_network_policy_egress_rule_local_var = v1_network_policy_egress_rule_create ( + v1_network_policy_egress_rule_local_var = v1_network_policy_egress_rule_create_internal ( ports ? portsList : NULL, to ? toList : NULL ); diff --git a/kubernetes/model/v1_network_policy_egress_rule.h b/kubernetes/model/v1_network_policy_egress_rule.h index 2e35e348..c1e79a3e 100644 --- a/kubernetes/model/v1_network_policy_egress_rule.h +++ b/kubernetes/model/v1_network_policy_egress_rule.h @@ -24,9 +24,10 @@ typedef struct v1_network_policy_egress_rule_t { list_t *ports; //nonprimitive container list_t *to; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_network_policy_egress_rule_t; -v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_create( +__attribute__((deprecated)) v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_create( list_t *ports, list_t *to ); diff --git a/kubernetes/model/v1_network_policy_ingress_rule.c b/kubernetes/model/v1_network_policy_ingress_rule.c index aa2a2173..effe5983 100644 --- a/kubernetes/model/v1_network_policy_ingress_rule.c +++ b/kubernetes/model/v1_network_policy_ingress_rule.c @@ -5,7 +5,7 @@ -v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_create( +static v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_create_internal( list_t *from, list_t *ports ) { @@ -16,14 +16,28 @@ v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_create( v1_network_policy_ingress_rule_local_var->from = from; v1_network_policy_ingress_rule_local_var->ports = ports; + v1_network_policy_ingress_rule_local_var->_library_owned = 1; return v1_network_policy_ingress_rule_local_var; } +__attribute__((deprecated)) v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_create( + list_t *from, + list_t *ports + ) { + return v1_network_policy_ingress_rule_create_internal ( + from, + ports + ); +} void v1_network_policy_ingress_rule_free(v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule) { if(NULL == v1_network_policy_ingress_rule){ return ; } + if(v1_network_policy_ingress_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_policy_ingress_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_network_policy_ingress_rule->from) { list_ForEach(listEntry, v1_network_policy_ingress_rule->from) { @@ -104,6 +118,9 @@ v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_parseFromJSON(c // v1_network_policy_ingress_rule->from cJSON *from = cJSON_GetObjectItemCaseSensitive(v1_network_policy_ingress_ruleJSON, "from"); + if (cJSON_IsNull(from)) { + from = NULL; + } if (from) { cJSON *from_local_nonprimitive = NULL; if(!cJSON_IsArray(from)){ @@ -125,6 +142,9 @@ v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_parseFromJSON(c // v1_network_policy_ingress_rule->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_network_policy_ingress_ruleJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -145,7 +165,7 @@ v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_parseFromJSON(c } - v1_network_policy_ingress_rule_local_var = v1_network_policy_ingress_rule_create ( + v1_network_policy_ingress_rule_local_var = v1_network_policy_ingress_rule_create_internal ( from ? fromList : NULL, ports ? portsList : NULL ); diff --git a/kubernetes/model/v1_network_policy_ingress_rule.h b/kubernetes/model/v1_network_policy_ingress_rule.h index d9c94d97..42760042 100644 --- a/kubernetes/model/v1_network_policy_ingress_rule.h +++ b/kubernetes/model/v1_network_policy_ingress_rule.h @@ -24,9 +24,10 @@ typedef struct v1_network_policy_ingress_rule_t { list_t *from; //nonprimitive container list_t *ports; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_network_policy_ingress_rule_t; -v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_create( +__attribute__((deprecated)) v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_create( list_t *from, list_t *ports ); diff --git a/kubernetes/model/v1_network_policy_list.c b/kubernetes/model/v1_network_policy_list.c index 45ae9a6c..120f1ff5 100644 --- a/kubernetes/model/v1_network_policy_list.c +++ b/kubernetes/model/v1_network_policy_list.c @@ -5,7 +5,7 @@ -v1_network_policy_list_t *v1_network_policy_list_create( +static v1_network_policy_list_t *v1_network_policy_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_network_policy_list_t *v1_network_policy_list_create( v1_network_policy_list_local_var->kind = kind; v1_network_policy_list_local_var->metadata = metadata; + v1_network_policy_list_local_var->_library_owned = 1; return v1_network_policy_list_local_var; } +__attribute__((deprecated)) v1_network_policy_list_t *v1_network_policy_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_network_policy_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_network_policy_list_free(v1_network_policy_list_t *v1_network_policy_list) { if(NULL == v1_network_policy_list){ return ; } + if(v1_network_policy_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_policy_list_free"); + return ; + } listEntry_t *listEntry; if (v1_network_policy_list->api_version) { free(v1_network_policy_list->api_version); @@ -123,6 +141,9 @@ v1_network_policy_list_t *v1_network_policy_list_parseFromJSON(cJSON *v1_network // v1_network_policy_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_network_policy_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_network_policy_list_t *v1_network_policy_list_parseFromJSON(cJSON *v1_network // v1_network_policy_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_network_policy_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_network_policy_list_t *v1_network_policy_list_parseFromJSON(cJSON *v1_network // v1_network_policy_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_network_policy_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_network_policy_list_t *v1_network_policy_list_parseFromJSON(cJSON *v1_network // v1_network_policy_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_network_policy_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_network_policy_list_local_var = v1_network_policy_list_create ( + v1_network_policy_list_local_var = v1_network_policy_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_network_policy_list.h b/kubernetes/model/v1_network_policy_list.h index 9e919739..9725b55d 100644 --- a/kubernetes/model/v1_network_policy_list.h +++ b/kubernetes/model/v1_network_policy_list.h @@ -26,9 +26,10 @@ typedef struct v1_network_policy_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_network_policy_list_t; -v1_network_policy_list_t *v1_network_policy_list_create( +__attribute__((deprecated)) v1_network_policy_list_t *v1_network_policy_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_network_policy_peer.c b/kubernetes/model/v1_network_policy_peer.c index b9b52889..4b4d03e5 100644 --- a/kubernetes/model/v1_network_policy_peer.c +++ b/kubernetes/model/v1_network_policy_peer.c @@ -5,7 +5,7 @@ -v1_network_policy_peer_t *v1_network_policy_peer_create( +static v1_network_policy_peer_t *v1_network_policy_peer_create_internal( v1_ip_block_t *ip_block, v1_label_selector_t *namespace_selector, v1_label_selector_t *pod_selector @@ -18,14 +18,30 @@ v1_network_policy_peer_t *v1_network_policy_peer_create( v1_network_policy_peer_local_var->namespace_selector = namespace_selector; v1_network_policy_peer_local_var->pod_selector = pod_selector; + v1_network_policy_peer_local_var->_library_owned = 1; return v1_network_policy_peer_local_var; } +__attribute__((deprecated)) v1_network_policy_peer_t *v1_network_policy_peer_create( + v1_ip_block_t *ip_block, + v1_label_selector_t *namespace_selector, + v1_label_selector_t *pod_selector + ) { + return v1_network_policy_peer_create_internal ( + ip_block, + namespace_selector, + pod_selector + ); +} void v1_network_policy_peer_free(v1_network_policy_peer_t *v1_network_policy_peer) { if(NULL == v1_network_policy_peer){ return ; } + if(v1_network_policy_peer->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_policy_peer_free"); + return ; + } listEntry_t *listEntry; if (v1_network_policy_peer->ip_block) { v1_ip_block_free(v1_network_policy_peer->ip_block); @@ -106,24 +122,33 @@ v1_network_policy_peer_t *v1_network_policy_peer_parseFromJSON(cJSON *v1_network // v1_network_policy_peer->ip_block cJSON *ip_block = cJSON_GetObjectItemCaseSensitive(v1_network_policy_peerJSON, "ipBlock"); + if (cJSON_IsNull(ip_block)) { + ip_block = NULL; + } if (ip_block) { ip_block_local_nonprim = v1_ip_block_parseFromJSON(ip_block); //nonprimitive } // v1_network_policy_peer->namespace_selector cJSON *namespace_selector = cJSON_GetObjectItemCaseSensitive(v1_network_policy_peerJSON, "namespaceSelector"); + if (cJSON_IsNull(namespace_selector)) { + namespace_selector = NULL; + } if (namespace_selector) { namespace_selector_local_nonprim = v1_label_selector_parseFromJSON(namespace_selector); //nonprimitive } // v1_network_policy_peer->pod_selector cJSON *pod_selector = cJSON_GetObjectItemCaseSensitive(v1_network_policy_peerJSON, "podSelector"); + if (cJSON_IsNull(pod_selector)) { + pod_selector = NULL; + } if (pod_selector) { pod_selector_local_nonprim = v1_label_selector_parseFromJSON(pod_selector); //nonprimitive } - v1_network_policy_peer_local_var = v1_network_policy_peer_create ( + v1_network_policy_peer_local_var = v1_network_policy_peer_create_internal ( ip_block ? ip_block_local_nonprim : NULL, namespace_selector ? namespace_selector_local_nonprim : NULL, pod_selector ? pod_selector_local_nonprim : NULL diff --git a/kubernetes/model/v1_network_policy_peer.h b/kubernetes/model/v1_network_policy_peer.h index cf00a079..05228e50 100644 --- a/kubernetes/model/v1_network_policy_peer.h +++ b/kubernetes/model/v1_network_policy_peer.h @@ -25,9 +25,10 @@ typedef struct v1_network_policy_peer_t { struct v1_label_selector_t *namespace_selector; //model struct v1_label_selector_t *pod_selector; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_network_policy_peer_t; -v1_network_policy_peer_t *v1_network_policy_peer_create( +__attribute__((deprecated)) v1_network_policy_peer_t *v1_network_policy_peer_create( v1_ip_block_t *ip_block, v1_label_selector_t *namespace_selector, v1_label_selector_t *pod_selector diff --git a/kubernetes/model/v1_network_policy_port.c b/kubernetes/model/v1_network_policy_port.c index f05e8a56..0e8cc49f 100644 --- a/kubernetes/model/v1_network_policy_port.c +++ b/kubernetes/model/v1_network_policy_port.c @@ -5,7 +5,7 @@ -v1_network_policy_port_t *v1_network_policy_port_create( +static v1_network_policy_port_t *v1_network_policy_port_create_internal( int end_port, int_or_string_t *port, char *protocol @@ -18,14 +18,30 @@ v1_network_policy_port_t *v1_network_policy_port_create( v1_network_policy_port_local_var->port = port; v1_network_policy_port_local_var->protocol = protocol; + v1_network_policy_port_local_var->_library_owned = 1; return v1_network_policy_port_local_var; } +__attribute__((deprecated)) v1_network_policy_port_t *v1_network_policy_port_create( + int end_port, + int_or_string_t *port, + char *protocol + ) { + return v1_network_policy_port_create_internal ( + end_port, + port, + protocol + ); +} void v1_network_policy_port_free(v1_network_policy_port_t *v1_network_policy_port) { if(NULL == v1_network_policy_port){ return ; } + if(v1_network_policy_port->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_policy_port_free"); + return ; + } listEntry_t *listEntry; if (v1_network_policy_port->port) { int_or_string_free(v1_network_policy_port->port); @@ -86,6 +102,9 @@ v1_network_policy_port_t *v1_network_policy_port_parseFromJSON(cJSON *v1_network // v1_network_policy_port->end_port cJSON *end_port = cJSON_GetObjectItemCaseSensitive(v1_network_policy_portJSON, "endPort"); + if (cJSON_IsNull(end_port)) { + end_port = NULL; + } if (end_port) { if(!cJSON_IsNumber(end_port)) { @@ -95,12 +114,18 @@ v1_network_policy_port_t *v1_network_policy_port_parseFromJSON(cJSON *v1_network // v1_network_policy_port->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_network_policy_portJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (port) { port_local_nonprim = int_or_string_parseFromJSON(port); //custom } // v1_network_policy_port->protocol cJSON *protocol = cJSON_GetObjectItemCaseSensitive(v1_network_policy_portJSON, "protocol"); + if (cJSON_IsNull(protocol)) { + protocol = NULL; + } if (protocol) { if(!cJSON_IsString(protocol) && !cJSON_IsNull(protocol)) { @@ -109,7 +134,7 @@ v1_network_policy_port_t *v1_network_policy_port_parseFromJSON(cJSON *v1_network } - v1_network_policy_port_local_var = v1_network_policy_port_create ( + v1_network_policy_port_local_var = v1_network_policy_port_create_internal ( end_port ? end_port->valuedouble : 0, port ? port_local_nonprim : NULL, protocol && !cJSON_IsNull(protocol) ? strdup(protocol->valuestring) : NULL diff --git a/kubernetes/model/v1_network_policy_port.h b/kubernetes/model/v1_network_policy_port.h index c7bfd436..170bc2e5 100644 --- a/kubernetes/model/v1_network_policy_port.h +++ b/kubernetes/model/v1_network_policy_port.h @@ -24,9 +24,10 @@ typedef struct v1_network_policy_port_t { int_or_string_t *port; // custom char *protocol; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_network_policy_port_t; -v1_network_policy_port_t *v1_network_policy_port_create( +__attribute__((deprecated)) v1_network_policy_port_t *v1_network_policy_port_create( int end_port, int_or_string_t *port, char *protocol diff --git a/kubernetes/model/v1_network_policy_spec.c b/kubernetes/model/v1_network_policy_spec.c index 1ad93c0c..e9b7bda4 100644 --- a/kubernetes/model/v1_network_policy_spec.c +++ b/kubernetes/model/v1_network_policy_spec.c @@ -5,7 +5,7 @@ -v1_network_policy_spec_t *v1_network_policy_spec_create( +static v1_network_policy_spec_t *v1_network_policy_spec_create_internal( list_t *egress, list_t *ingress, v1_label_selector_t *pod_selector, @@ -20,14 +20,32 @@ v1_network_policy_spec_t *v1_network_policy_spec_create( v1_network_policy_spec_local_var->pod_selector = pod_selector; v1_network_policy_spec_local_var->policy_types = policy_types; + v1_network_policy_spec_local_var->_library_owned = 1; return v1_network_policy_spec_local_var; } +__attribute__((deprecated)) v1_network_policy_spec_t *v1_network_policy_spec_create( + list_t *egress, + list_t *ingress, + v1_label_selector_t *pod_selector, + list_t *policy_types + ) { + return v1_network_policy_spec_create_internal ( + egress, + ingress, + pod_selector, + policy_types + ); +} void v1_network_policy_spec_free(v1_network_policy_spec_t *v1_network_policy_spec) { if(NULL == v1_network_policy_spec){ return ; } + if(v1_network_policy_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_network_policy_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_network_policy_spec->egress) { list_ForEach(listEntry, v1_network_policy_spec->egress) { @@ -101,9 +119,7 @@ cJSON *v1_network_policy_spec_convertToJSON(v1_network_policy_spec_t *v1_network // v1_network_policy_spec->pod_selector - if (!v1_network_policy_spec->pod_selector) { - goto fail; - } + if(v1_network_policy_spec->pod_selector) { cJSON *pod_selector_local_JSON = v1_label_selector_convertToJSON(v1_network_policy_spec->pod_selector); if(pod_selector_local_JSON == NULL) { goto fail; //model @@ -112,6 +128,7 @@ cJSON *v1_network_policy_spec_convertToJSON(v1_network_policy_spec_t *v1_network if(item->child == NULL) { goto fail; } + } // v1_network_policy_spec->policy_types @@ -123,7 +140,7 @@ cJSON *v1_network_policy_spec_convertToJSON(v1_network_policy_spec_t *v1_network listEntry_t *policy_typesListEntry; list_ForEach(policy_typesListEntry, v1_network_policy_spec->policy_types) { - if(cJSON_AddStringToObject(policy_types, "", (char*)policy_typesListEntry->data) == NULL) + if(cJSON_AddStringToObject(policy_types, "", policy_typesListEntry->data) == NULL) { goto fail; } @@ -156,6 +173,9 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network // v1_network_policy_spec->egress cJSON *egress = cJSON_GetObjectItemCaseSensitive(v1_network_policy_specJSON, "egress"); + if (cJSON_IsNull(egress)) { + egress = NULL; + } if (egress) { cJSON *egress_local_nonprimitive = NULL; if(!cJSON_IsArray(egress)){ @@ -177,6 +197,9 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network // v1_network_policy_spec->ingress cJSON *ingress = cJSON_GetObjectItemCaseSensitive(v1_network_policy_specJSON, "ingress"); + if (cJSON_IsNull(ingress)) { + ingress = NULL; + } if (ingress) { cJSON *ingress_local_nonprimitive = NULL; if(!cJSON_IsArray(ingress)){ @@ -198,15 +221,18 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network // v1_network_policy_spec->pod_selector cJSON *pod_selector = cJSON_GetObjectItemCaseSensitive(v1_network_policy_specJSON, "podSelector"); - if (!pod_selector) { - goto end; + if (cJSON_IsNull(pod_selector)) { + pod_selector = NULL; } - - + if (pod_selector) { pod_selector_local_nonprim = v1_label_selector_parseFromJSON(pod_selector); //nonprimitive + } // v1_network_policy_spec->policy_types cJSON *policy_types = cJSON_GetObjectItemCaseSensitive(v1_network_policy_specJSON, "policyTypes"); + if (cJSON_IsNull(policy_types)) { + policy_types = NULL; + } if (policy_types) { cJSON *policy_types_local = NULL; if(!cJSON_IsArray(policy_types)) { @@ -225,10 +251,10 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network } - v1_network_policy_spec_local_var = v1_network_policy_spec_create ( + v1_network_policy_spec_local_var = v1_network_policy_spec_create_internal ( egress ? egressList : NULL, ingress ? ingressList : NULL, - pod_selector_local_nonprim, + pod_selector ? pod_selector_local_nonprim : NULL, policy_types ? policy_typesList : NULL ); diff --git a/kubernetes/model/v1_network_policy_spec.h b/kubernetes/model/v1_network_policy_spec.h index 8e23b9a6..2f9de15b 100644 --- a/kubernetes/model/v1_network_policy_spec.h +++ b/kubernetes/model/v1_network_policy_spec.h @@ -27,9 +27,10 @@ typedef struct v1_network_policy_spec_t { struct v1_label_selector_t *pod_selector; //model list_t *policy_types; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_network_policy_spec_t; -v1_network_policy_spec_t *v1_network_policy_spec_create( +__attribute__((deprecated)) v1_network_policy_spec_t *v1_network_policy_spec_create( list_t *egress, list_t *ingress, v1_label_selector_t *pod_selector, diff --git a/kubernetes/model/v1_nfs_volume_source.c b/kubernetes/model/v1_nfs_volume_source.c index d7f043e5..3311ac48 100644 --- a/kubernetes/model/v1_nfs_volume_source.c +++ b/kubernetes/model/v1_nfs_volume_source.c @@ -5,7 +5,7 @@ -v1_nfs_volume_source_t *v1_nfs_volume_source_create( +static v1_nfs_volume_source_t *v1_nfs_volume_source_create_internal( char *path, int read_only, char *server @@ -18,14 +18,30 @@ v1_nfs_volume_source_t *v1_nfs_volume_source_create( v1_nfs_volume_source_local_var->read_only = read_only; v1_nfs_volume_source_local_var->server = server; + v1_nfs_volume_source_local_var->_library_owned = 1; return v1_nfs_volume_source_local_var; } +__attribute__((deprecated)) v1_nfs_volume_source_t *v1_nfs_volume_source_create( + char *path, + int read_only, + char *server + ) { + return v1_nfs_volume_source_create_internal ( + path, + read_only, + server + ); +} void v1_nfs_volume_source_free(v1_nfs_volume_source_t *v1_nfs_volume_source) { if(NULL == v1_nfs_volume_source){ return ; } + if(v1_nfs_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_nfs_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_nfs_volume_source->path) { free(v1_nfs_volume_source->path); @@ -80,6 +96,9 @@ v1_nfs_volume_source_t *v1_nfs_volume_source_parseFromJSON(cJSON *v1_nfs_volume_ // v1_nfs_volume_source->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_nfs_volume_sourceJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -92,6 +111,9 @@ v1_nfs_volume_source_t *v1_nfs_volume_source_parseFromJSON(cJSON *v1_nfs_volume_ // v1_nfs_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_nfs_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -101,6 +123,9 @@ v1_nfs_volume_source_t *v1_nfs_volume_source_parseFromJSON(cJSON *v1_nfs_volume_ // v1_nfs_volume_source->server cJSON *server = cJSON_GetObjectItemCaseSensitive(v1_nfs_volume_sourceJSON, "server"); + if (cJSON_IsNull(server)) { + server = NULL; + } if (!server) { goto end; } @@ -112,7 +137,7 @@ v1_nfs_volume_source_t *v1_nfs_volume_source_parseFromJSON(cJSON *v1_nfs_volume_ } - v1_nfs_volume_source_local_var = v1_nfs_volume_source_create ( + v1_nfs_volume_source_local_var = v1_nfs_volume_source_create_internal ( strdup(path->valuestring), read_only ? read_only->valueint : 0, strdup(server->valuestring) diff --git a/kubernetes/model/v1_nfs_volume_source.h b/kubernetes/model/v1_nfs_volume_source.h index 88a945be..64bf8981 100644 --- a/kubernetes/model/v1_nfs_volume_source.h +++ b/kubernetes/model/v1_nfs_volume_source.h @@ -23,9 +23,10 @@ typedef struct v1_nfs_volume_source_t { int read_only; //boolean char *server; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_nfs_volume_source_t; -v1_nfs_volume_source_t *v1_nfs_volume_source_create( +__attribute__((deprecated)) v1_nfs_volume_source_t *v1_nfs_volume_source_create( char *path, int read_only, char *server diff --git a/kubernetes/model/v1_node.c b/kubernetes/model/v1_node.c index c9f3dbf9..d4bbc13e 100644 --- a/kubernetes/model/v1_node.c +++ b/kubernetes/model/v1_node.c @@ -5,7 +5,7 @@ -v1_node_t *v1_node_create( +static v1_node_t *v1_node_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_node_t *v1_node_create( v1_node_local_var->spec = spec; v1_node_local_var->status = status; + v1_node_local_var->_library_owned = 1; return v1_node_local_var; } +__attribute__((deprecated)) v1_node_t *v1_node_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_node_spec_t *spec, + v1_node_status_t *status + ) { + return v1_node_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_node_free(v1_node_t *v1_node) { if(NULL == v1_node){ return ; } + if(v1_node->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_free"); + return ; + } listEntry_t *listEntry; if (v1_node->api_version) { free(v1_node->api_version); @@ -134,6 +154,9 @@ v1_node_t *v1_node_parseFromJSON(cJSON *v1_nodeJSON){ // v1_node->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_nodeJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_node_t *v1_node_parseFromJSON(cJSON *v1_nodeJSON){ // v1_node->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_nodeJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_node_t *v1_node_parseFromJSON(cJSON *v1_nodeJSON){ // v1_node->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_nodeJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_node->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_nodeJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_node_spec_parseFromJSON(spec); //nonprimitive } // v1_node->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_nodeJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_node_status_parseFromJSON(status); //nonprimitive } - v1_node_local_var = v1_node_create ( + v1_node_local_var = v1_node_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_node.h b/kubernetes/model/v1_node.h index 845ea055..06ccc265 100644 --- a/kubernetes/model/v1_node.h +++ b/kubernetes/model/v1_node.h @@ -28,9 +28,10 @@ typedef struct v1_node_t { struct v1_node_spec_t *spec; //model struct v1_node_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_node_t; -v1_node_t *v1_node_create( +__attribute__((deprecated)) v1_node_t *v1_node_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_node_address.c b/kubernetes/model/v1_node_address.c index fee55368..b4c20950 100644 --- a/kubernetes/model/v1_node_address.c +++ b/kubernetes/model/v1_node_address.c @@ -5,7 +5,7 @@ -v1_node_address_t *v1_node_address_create( +static v1_node_address_t *v1_node_address_create_internal( char *address, char *type ) { @@ -16,14 +16,28 @@ v1_node_address_t *v1_node_address_create( v1_node_address_local_var->address = address; v1_node_address_local_var->type = type; + v1_node_address_local_var->_library_owned = 1; return v1_node_address_local_var; } +__attribute__((deprecated)) v1_node_address_t *v1_node_address_create( + char *address, + char *type + ) { + return v1_node_address_create_internal ( + address, + type + ); +} void v1_node_address_free(v1_node_address_t *v1_node_address) { if(NULL == v1_node_address){ return ; } + if(v1_node_address->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_address_free"); + return ; + } listEntry_t *listEntry; if (v1_node_address->address) { free(v1_node_address->address); @@ -70,6 +84,9 @@ v1_node_address_t *v1_node_address_parseFromJSON(cJSON *v1_node_addressJSON){ // v1_node_address->address cJSON *address = cJSON_GetObjectItemCaseSensitive(v1_node_addressJSON, "address"); + if (cJSON_IsNull(address)) { + address = NULL; + } if (!address) { goto end; } @@ -82,6 +99,9 @@ v1_node_address_t *v1_node_address_parseFromJSON(cJSON *v1_node_addressJSON){ // v1_node_address->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_node_addressJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -93,7 +113,7 @@ v1_node_address_t *v1_node_address_parseFromJSON(cJSON *v1_node_addressJSON){ } - v1_node_address_local_var = v1_node_address_create ( + v1_node_address_local_var = v1_node_address_create_internal ( strdup(address->valuestring), strdup(type->valuestring) ); diff --git a/kubernetes/model/v1_node_address.h b/kubernetes/model/v1_node_address.h index f9dcc0f8..92621d3e 100644 --- a/kubernetes/model/v1_node_address.h +++ b/kubernetes/model/v1_node_address.h @@ -22,9 +22,10 @@ typedef struct v1_node_address_t { char *address; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_node_address_t; -v1_node_address_t *v1_node_address_create( +__attribute__((deprecated)) v1_node_address_t *v1_node_address_create( char *address, char *type ); diff --git a/kubernetes/model/v1_node_affinity.c b/kubernetes/model/v1_node_affinity.c index 9e8ffc7d..fa4adf1b 100644 --- a/kubernetes/model/v1_node_affinity.c +++ b/kubernetes/model/v1_node_affinity.c @@ -5,7 +5,7 @@ -v1_node_affinity_t *v1_node_affinity_create( +static v1_node_affinity_t *v1_node_affinity_create_internal( list_t *preferred_during_scheduling_ignored_during_execution, v1_node_selector_t *required_during_scheduling_ignored_during_execution ) { @@ -16,14 +16,28 @@ v1_node_affinity_t *v1_node_affinity_create( v1_node_affinity_local_var->preferred_during_scheduling_ignored_during_execution = preferred_during_scheduling_ignored_during_execution; v1_node_affinity_local_var->required_during_scheduling_ignored_during_execution = required_during_scheduling_ignored_during_execution; + v1_node_affinity_local_var->_library_owned = 1; return v1_node_affinity_local_var; } +__attribute__((deprecated)) v1_node_affinity_t *v1_node_affinity_create( + list_t *preferred_during_scheduling_ignored_during_execution, + v1_node_selector_t *required_during_scheduling_ignored_during_execution + ) { + return v1_node_affinity_create_internal ( + preferred_during_scheduling_ignored_during_execution, + required_during_scheduling_ignored_during_execution + ); +} void v1_node_affinity_free(v1_node_affinity_t *v1_node_affinity) { if(NULL == v1_node_affinity){ return ; } + if(v1_node_affinity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_affinity_free"); + return ; + } listEntry_t *listEntry; if (v1_node_affinity->preferred_during_scheduling_ignored_during_execution) { list_ForEach(listEntry, v1_node_affinity->preferred_during_scheduling_ignored_during_execution) { @@ -94,6 +108,9 @@ v1_node_affinity_t *v1_node_affinity_parseFromJSON(cJSON *v1_node_affinityJSON){ // v1_node_affinity->preferred_during_scheduling_ignored_during_execution cJSON *preferred_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_node_affinityJSON, "preferredDuringSchedulingIgnoredDuringExecution"); + if (cJSON_IsNull(preferred_during_scheduling_ignored_during_execution)) { + preferred_during_scheduling_ignored_during_execution = NULL; + } if (preferred_during_scheduling_ignored_during_execution) { cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(preferred_during_scheduling_ignored_during_execution)){ @@ -115,12 +132,15 @@ v1_node_affinity_t *v1_node_affinity_parseFromJSON(cJSON *v1_node_affinityJSON){ // v1_node_affinity->required_during_scheduling_ignored_during_execution cJSON *required_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_node_affinityJSON, "requiredDuringSchedulingIgnoredDuringExecution"); + if (cJSON_IsNull(required_during_scheduling_ignored_during_execution)) { + required_during_scheduling_ignored_during_execution = NULL; + } if (required_during_scheduling_ignored_during_execution) { required_during_scheduling_ignored_during_execution_local_nonprim = v1_node_selector_parseFromJSON(required_during_scheduling_ignored_during_execution); //nonprimitive } - v1_node_affinity_local_var = v1_node_affinity_create ( + v1_node_affinity_local_var = v1_node_affinity_create_internal ( preferred_during_scheduling_ignored_during_execution ? preferred_during_scheduling_ignored_during_executionList : NULL, required_during_scheduling_ignored_during_execution ? required_during_scheduling_ignored_during_execution_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_node_affinity.h b/kubernetes/model/v1_node_affinity.h index 583df35f..c0807792 100644 --- a/kubernetes/model/v1_node_affinity.h +++ b/kubernetes/model/v1_node_affinity.h @@ -24,9 +24,10 @@ typedef struct v1_node_affinity_t { list_t *preferred_during_scheduling_ignored_during_execution; //nonprimitive container struct v1_node_selector_t *required_during_scheduling_ignored_during_execution; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_node_affinity_t; -v1_node_affinity_t *v1_node_affinity_create( +__attribute__((deprecated)) v1_node_affinity_t *v1_node_affinity_create( list_t *preferred_during_scheduling_ignored_during_execution, v1_node_selector_t *required_during_scheduling_ignored_during_execution ); diff --git a/kubernetes/model/v1_node_condition.c b/kubernetes/model/v1_node_condition.c index 4a716c6a..36627bad 100644 --- a/kubernetes/model/v1_node_condition.c +++ b/kubernetes/model/v1_node_condition.c @@ -5,7 +5,7 @@ -v1_node_condition_t *v1_node_condition_create( +static v1_node_condition_t *v1_node_condition_create_internal( char *last_heartbeat_time, char *last_transition_time, char *message, @@ -24,14 +24,36 @@ v1_node_condition_t *v1_node_condition_create( v1_node_condition_local_var->status = status; v1_node_condition_local_var->type = type; + v1_node_condition_local_var->_library_owned = 1; return v1_node_condition_local_var; } +__attribute__((deprecated)) v1_node_condition_t *v1_node_condition_create( + char *last_heartbeat_time, + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_node_condition_create_internal ( + last_heartbeat_time, + last_transition_time, + message, + reason, + status, + type + ); +} void v1_node_condition_free(v1_node_condition_t *v1_node_condition) { if(NULL == v1_node_condition){ return ; } + if(v1_node_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_node_condition->last_heartbeat_time) { free(v1_node_condition->last_heartbeat_time); @@ -126,6 +148,9 @@ v1_node_condition_t *v1_node_condition_parseFromJSON(cJSON *v1_node_conditionJSO // v1_node_condition->last_heartbeat_time cJSON *last_heartbeat_time = cJSON_GetObjectItemCaseSensitive(v1_node_conditionJSON, "lastHeartbeatTime"); + if (cJSON_IsNull(last_heartbeat_time)) { + last_heartbeat_time = NULL; + } if (last_heartbeat_time) { if(!cJSON_IsString(last_heartbeat_time) && !cJSON_IsNull(last_heartbeat_time)) { @@ -135,6 +160,9 @@ v1_node_condition_t *v1_node_condition_parseFromJSON(cJSON *v1_node_conditionJSO // v1_node_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_node_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -144,6 +172,9 @@ v1_node_condition_t *v1_node_condition_parseFromJSON(cJSON *v1_node_conditionJSO // v1_node_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_node_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -153,6 +184,9 @@ v1_node_condition_t *v1_node_condition_parseFromJSON(cJSON *v1_node_conditionJSO // v1_node_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_node_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -162,6 +196,9 @@ v1_node_condition_t *v1_node_condition_parseFromJSON(cJSON *v1_node_conditionJSO // v1_node_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_node_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -174,6 +211,9 @@ v1_node_condition_t *v1_node_condition_parseFromJSON(cJSON *v1_node_conditionJSO // v1_node_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_node_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -185,7 +225,7 @@ v1_node_condition_t *v1_node_condition_parseFromJSON(cJSON *v1_node_conditionJSO } - v1_node_condition_local_var = v1_node_condition_create ( + v1_node_condition_local_var = v1_node_condition_create_internal ( last_heartbeat_time && !cJSON_IsNull(last_heartbeat_time) ? strdup(last_heartbeat_time->valuestring) : NULL, last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, diff --git a/kubernetes/model/v1_node_condition.h b/kubernetes/model/v1_node_condition.h index 84862682..6ff69518 100644 --- a/kubernetes/model/v1_node_condition.h +++ b/kubernetes/model/v1_node_condition.h @@ -26,9 +26,10 @@ typedef struct v1_node_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_node_condition_t; -v1_node_condition_t *v1_node_condition_create( +__attribute__((deprecated)) v1_node_condition_t *v1_node_condition_create( char *last_heartbeat_time, char *last_transition_time, char *message, diff --git a/kubernetes/model/v1_node_config_source.c b/kubernetes/model/v1_node_config_source.c index d21f2365..d9300292 100644 --- a/kubernetes/model/v1_node_config_source.c +++ b/kubernetes/model/v1_node_config_source.c @@ -5,7 +5,7 @@ -v1_node_config_source_t *v1_node_config_source_create( +static v1_node_config_source_t *v1_node_config_source_create_internal( v1_config_map_node_config_source_t *config_map ) { v1_node_config_source_t *v1_node_config_source_local_var = malloc(sizeof(v1_node_config_source_t)); @@ -14,14 +14,26 @@ v1_node_config_source_t *v1_node_config_source_create( } v1_node_config_source_local_var->config_map = config_map; + v1_node_config_source_local_var->_library_owned = 1; return v1_node_config_source_local_var; } +__attribute__((deprecated)) v1_node_config_source_t *v1_node_config_source_create( + v1_config_map_node_config_source_t *config_map + ) { + return v1_node_config_source_create_internal ( + config_map + ); +} void v1_node_config_source_free(v1_node_config_source_t *v1_node_config_source) { if(NULL == v1_node_config_source){ return ; } + if(v1_node_config_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_config_source_free"); + return ; + } listEntry_t *listEntry; if (v1_node_config_source->config_map) { v1_config_map_node_config_source_free(v1_node_config_source->config_map); @@ -62,12 +74,15 @@ v1_node_config_source_t *v1_node_config_source_parseFromJSON(cJSON *v1_node_conf // v1_node_config_source->config_map cJSON *config_map = cJSON_GetObjectItemCaseSensitive(v1_node_config_sourceJSON, "configMap"); + if (cJSON_IsNull(config_map)) { + config_map = NULL; + } if (config_map) { config_map_local_nonprim = v1_config_map_node_config_source_parseFromJSON(config_map); //nonprimitive } - v1_node_config_source_local_var = v1_node_config_source_create ( + v1_node_config_source_local_var = v1_node_config_source_create_internal ( config_map ? config_map_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_node_config_source.h b/kubernetes/model/v1_node_config_source.h index 62b76bea..f2b51d55 100644 --- a/kubernetes/model/v1_node_config_source.h +++ b/kubernetes/model/v1_node_config_source.h @@ -22,9 +22,10 @@ typedef struct v1_node_config_source_t v1_node_config_source_t; typedef struct v1_node_config_source_t { struct v1_config_map_node_config_source_t *config_map; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_node_config_source_t; -v1_node_config_source_t *v1_node_config_source_create( +__attribute__((deprecated)) v1_node_config_source_t *v1_node_config_source_create( v1_config_map_node_config_source_t *config_map ); diff --git a/kubernetes/model/v1_node_config_status.c b/kubernetes/model/v1_node_config_status.c index 7386d50b..dd71430c 100644 --- a/kubernetes/model/v1_node_config_status.c +++ b/kubernetes/model/v1_node_config_status.c @@ -5,7 +5,7 @@ -v1_node_config_status_t *v1_node_config_status_create( +static v1_node_config_status_t *v1_node_config_status_create_internal( v1_node_config_source_t *active, v1_node_config_source_t *assigned, char *error, @@ -20,14 +20,32 @@ v1_node_config_status_t *v1_node_config_status_create( v1_node_config_status_local_var->error = error; v1_node_config_status_local_var->last_known_good = last_known_good; + v1_node_config_status_local_var->_library_owned = 1; return v1_node_config_status_local_var; } +__attribute__((deprecated)) v1_node_config_status_t *v1_node_config_status_create( + v1_node_config_source_t *active, + v1_node_config_source_t *assigned, + char *error, + v1_node_config_source_t *last_known_good + ) { + return v1_node_config_status_create_internal ( + active, + assigned, + error, + last_known_good + ); +} void v1_node_config_status_free(v1_node_config_status_t *v1_node_config_status) { if(NULL == v1_node_config_status){ return ; } + if(v1_node_config_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_config_status_free"); + return ; + } listEntry_t *listEntry; if (v1_node_config_status->active) { v1_node_config_source_free(v1_node_config_status->active); @@ -120,18 +138,27 @@ v1_node_config_status_t *v1_node_config_status_parseFromJSON(cJSON *v1_node_conf // v1_node_config_status->active cJSON *active = cJSON_GetObjectItemCaseSensitive(v1_node_config_statusJSON, "active"); + if (cJSON_IsNull(active)) { + active = NULL; + } if (active) { active_local_nonprim = v1_node_config_source_parseFromJSON(active); //nonprimitive } // v1_node_config_status->assigned cJSON *assigned = cJSON_GetObjectItemCaseSensitive(v1_node_config_statusJSON, "assigned"); + if (cJSON_IsNull(assigned)) { + assigned = NULL; + } if (assigned) { assigned_local_nonprim = v1_node_config_source_parseFromJSON(assigned); //nonprimitive } // v1_node_config_status->error cJSON *error = cJSON_GetObjectItemCaseSensitive(v1_node_config_statusJSON, "error"); + if (cJSON_IsNull(error)) { + error = NULL; + } if (error) { if(!cJSON_IsString(error) && !cJSON_IsNull(error)) { @@ -141,12 +168,15 @@ v1_node_config_status_t *v1_node_config_status_parseFromJSON(cJSON *v1_node_conf // v1_node_config_status->last_known_good cJSON *last_known_good = cJSON_GetObjectItemCaseSensitive(v1_node_config_statusJSON, "lastKnownGood"); + if (cJSON_IsNull(last_known_good)) { + last_known_good = NULL; + } if (last_known_good) { last_known_good_local_nonprim = v1_node_config_source_parseFromJSON(last_known_good); //nonprimitive } - v1_node_config_status_local_var = v1_node_config_status_create ( + v1_node_config_status_local_var = v1_node_config_status_create_internal ( active ? active_local_nonprim : NULL, assigned ? assigned_local_nonprim : NULL, error && !cJSON_IsNull(error) ? strdup(error->valuestring) : NULL, diff --git a/kubernetes/model/v1_node_config_status.h b/kubernetes/model/v1_node_config_status.h index fb21e954..b717dc99 100644 --- a/kubernetes/model/v1_node_config_status.h +++ b/kubernetes/model/v1_node_config_status.h @@ -25,9 +25,10 @@ typedef struct v1_node_config_status_t { char *error; // string struct v1_node_config_source_t *last_known_good; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_node_config_status_t; -v1_node_config_status_t *v1_node_config_status_create( +__attribute__((deprecated)) v1_node_config_status_t *v1_node_config_status_create( v1_node_config_source_t *active, v1_node_config_source_t *assigned, char *error, diff --git a/kubernetes/model/v1_node_daemon_endpoints.c b/kubernetes/model/v1_node_daemon_endpoints.c index 8b95ee5b..27e57252 100644 --- a/kubernetes/model/v1_node_daemon_endpoints.c +++ b/kubernetes/model/v1_node_daemon_endpoints.c @@ -5,7 +5,7 @@ -v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_create( +static v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_create_internal( v1_daemon_endpoint_t *kubelet_endpoint ) { v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_local_var = malloc(sizeof(v1_node_daemon_endpoints_t)); @@ -14,14 +14,26 @@ v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_create( } v1_node_daemon_endpoints_local_var->kubelet_endpoint = kubelet_endpoint; + v1_node_daemon_endpoints_local_var->_library_owned = 1; return v1_node_daemon_endpoints_local_var; } +__attribute__((deprecated)) v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_create( + v1_daemon_endpoint_t *kubelet_endpoint + ) { + return v1_node_daemon_endpoints_create_internal ( + kubelet_endpoint + ); +} void v1_node_daemon_endpoints_free(v1_node_daemon_endpoints_t *v1_node_daemon_endpoints) { if(NULL == v1_node_daemon_endpoints){ return ; } + if(v1_node_daemon_endpoints->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_daemon_endpoints_free"); + return ; + } listEntry_t *listEntry; if (v1_node_daemon_endpoints->kubelet_endpoint) { v1_daemon_endpoint_free(v1_node_daemon_endpoints->kubelet_endpoint); @@ -62,12 +74,15 @@ v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_parseFromJSON(cJSON *v1_nod // v1_node_daemon_endpoints->kubelet_endpoint cJSON *kubelet_endpoint = cJSON_GetObjectItemCaseSensitive(v1_node_daemon_endpointsJSON, "kubeletEndpoint"); + if (cJSON_IsNull(kubelet_endpoint)) { + kubelet_endpoint = NULL; + } if (kubelet_endpoint) { kubelet_endpoint_local_nonprim = v1_daemon_endpoint_parseFromJSON(kubelet_endpoint); //nonprimitive } - v1_node_daemon_endpoints_local_var = v1_node_daemon_endpoints_create ( + v1_node_daemon_endpoints_local_var = v1_node_daemon_endpoints_create_internal ( kubelet_endpoint ? kubelet_endpoint_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_node_daemon_endpoints.h b/kubernetes/model/v1_node_daemon_endpoints.h index 82cef965..a4644990 100644 --- a/kubernetes/model/v1_node_daemon_endpoints.h +++ b/kubernetes/model/v1_node_daemon_endpoints.h @@ -22,9 +22,10 @@ typedef struct v1_node_daemon_endpoints_t v1_node_daemon_endpoints_t; typedef struct v1_node_daemon_endpoints_t { struct v1_daemon_endpoint_t *kubelet_endpoint; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_node_daemon_endpoints_t; -v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_create( +__attribute__((deprecated)) v1_node_daemon_endpoints_t *v1_node_daemon_endpoints_create( v1_daemon_endpoint_t *kubelet_endpoint ); diff --git a/kubernetes/model/v1_node_features.c b/kubernetes/model/v1_node_features.c new file mode 100644 index 00000000..dbad59f5 --- /dev/null +++ b/kubernetes/model/v1_node_features.c @@ -0,0 +1,84 @@ +#include +#include +#include +#include "v1_node_features.h" + + + +static v1_node_features_t *v1_node_features_create_internal( + int supplemental_groups_policy + ) { + v1_node_features_t *v1_node_features_local_var = malloc(sizeof(v1_node_features_t)); + if (!v1_node_features_local_var) { + return NULL; + } + v1_node_features_local_var->supplemental_groups_policy = supplemental_groups_policy; + + v1_node_features_local_var->_library_owned = 1; + return v1_node_features_local_var; +} + +__attribute__((deprecated)) v1_node_features_t *v1_node_features_create( + int supplemental_groups_policy + ) { + return v1_node_features_create_internal ( + supplemental_groups_policy + ); +} + +void v1_node_features_free(v1_node_features_t *v1_node_features) { + if(NULL == v1_node_features){ + return ; + } + if(v1_node_features->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_features_free"); + return ; + } + listEntry_t *listEntry; + free(v1_node_features); +} + +cJSON *v1_node_features_convertToJSON(v1_node_features_t *v1_node_features) { + cJSON *item = cJSON_CreateObject(); + + // v1_node_features->supplemental_groups_policy + if(v1_node_features->supplemental_groups_policy) { + if(cJSON_AddBoolToObject(item, "supplementalGroupsPolicy", v1_node_features->supplemental_groups_policy) == NULL) { + goto fail; //Bool + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_node_features_t *v1_node_features_parseFromJSON(cJSON *v1_node_featuresJSON){ + + v1_node_features_t *v1_node_features_local_var = NULL; + + // v1_node_features->supplemental_groups_policy + cJSON *supplemental_groups_policy = cJSON_GetObjectItemCaseSensitive(v1_node_featuresJSON, "supplementalGroupsPolicy"); + if (cJSON_IsNull(supplemental_groups_policy)) { + supplemental_groups_policy = NULL; + } + if (supplemental_groups_policy) { + if(!cJSON_IsBool(supplemental_groups_policy)) + { + goto end; //Bool + } + } + + + v1_node_features_local_var = v1_node_features_create_internal ( + supplemental_groups_policy ? supplemental_groups_policy->valueint : 0 + ); + + return v1_node_features_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_node_features.h b/kubernetes/model/v1_node_features.h new file mode 100644 index 00000000..e29c4c44 --- /dev/null +++ b/kubernetes/model/v1_node_features.h @@ -0,0 +1,38 @@ +/* + * v1_node_features.h + * + * NodeFeatures describes the set of features implemented by the CRI implementation. The features contained in the NodeFeatures should depend only on the cri implementation independent of runtime handlers. + */ + +#ifndef _v1_node_features_H_ +#define _v1_node_features_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_node_features_t v1_node_features_t; + + + + +typedef struct v1_node_features_t { + int supplemental_groups_policy; //boolean + + int _library_owned; // Is the library responsible for freeing this object? +} v1_node_features_t; + +__attribute__((deprecated)) v1_node_features_t *v1_node_features_create( + int supplemental_groups_policy +); + +void v1_node_features_free(v1_node_features_t *v1_node_features); + +v1_node_features_t *v1_node_features_parseFromJSON(cJSON *v1_node_featuresJSON); + +cJSON *v1_node_features_convertToJSON(v1_node_features_t *v1_node_features); + +#endif /* _v1_node_features_H_ */ + diff --git a/kubernetes/model/v1_node_list.c b/kubernetes/model/v1_node_list.c index 49041211..ae0d78d1 100644 --- a/kubernetes/model/v1_node_list.c +++ b/kubernetes/model/v1_node_list.c @@ -5,7 +5,7 @@ -v1_node_list_t *v1_node_list_create( +static v1_node_list_t *v1_node_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_node_list_t *v1_node_list_create( v1_node_list_local_var->kind = kind; v1_node_list_local_var->metadata = metadata; + v1_node_list_local_var->_library_owned = 1; return v1_node_list_local_var; } +__attribute__((deprecated)) v1_node_list_t *v1_node_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_node_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_node_list_free(v1_node_list_t *v1_node_list) { if(NULL == v1_node_list){ return ; } + if(v1_node_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_list_free"); + return ; + } listEntry_t *listEntry; if (v1_node_list->api_version) { free(v1_node_list->api_version); @@ -123,6 +141,9 @@ v1_node_list_t *v1_node_list_parseFromJSON(cJSON *v1_node_listJSON){ // v1_node_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_node_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_node_list_t *v1_node_list_parseFromJSON(cJSON *v1_node_listJSON){ // v1_node_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_node_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_node_list_t *v1_node_list_parseFromJSON(cJSON *v1_node_listJSON){ // v1_node_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_node_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_node_list_t *v1_node_list_parseFromJSON(cJSON *v1_node_listJSON){ // v1_node_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_node_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_node_list_local_var = v1_node_list_create ( + v1_node_list_local_var = v1_node_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_node_list.h b/kubernetes/model/v1_node_list.h index 5135db1d..ee594ca0 100644 --- a/kubernetes/model/v1_node_list.h +++ b/kubernetes/model/v1_node_list.h @@ -26,9 +26,10 @@ typedef struct v1_node_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_node_list_t; -v1_node_list_t *v1_node_list_create( +__attribute__((deprecated)) v1_node_list_t *v1_node_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_node_runtime_handler.c b/kubernetes/model/v1_node_runtime_handler.c index b41e79e5..741d0d3c 100644 --- a/kubernetes/model/v1_node_runtime_handler.c +++ b/kubernetes/model/v1_node_runtime_handler.c @@ -5,7 +5,7 @@ -v1_node_runtime_handler_t *v1_node_runtime_handler_create( +static v1_node_runtime_handler_t *v1_node_runtime_handler_create_internal( v1_node_runtime_handler_features_t *features, char *name ) { @@ -16,14 +16,28 @@ v1_node_runtime_handler_t *v1_node_runtime_handler_create( v1_node_runtime_handler_local_var->features = features; v1_node_runtime_handler_local_var->name = name; + v1_node_runtime_handler_local_var->_library_owned = 1; return v1_node_runtime_handler_local_var; } +__attribute__((deprecated)) v1_node_runtime_handler_t *v1_node_runtime_handler_create( + v1_node_runtime_handler_features_t *features, + char *name + ) { + return v1_node_runtime_handler_create_internal ( + features, + name + ); +} void v1_node_runtime_handler_free(v1_node_runtime_handler_t *v1_node_runtime_handler) { if(NULL == v1_node_runtime_handler){ return ; } + if(v1_node_runtime_handler->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_runtime_handler_free"); + return ; + } listEntry_t *listEntry; if (v1_node_runtime_handler->features) { v1_node_runtime_handler_features_free(v1_node_runtime_handler->features); @@ -76,12 +90,18 @@ v1_node_runtime_handler_t *v1_node_runtime_handler_parseFromJSON(cJSON *v1_node_ // v1_node_runtime_handler->features cJSON *features = cJSON_GetObjectItemCaseSensitive(v1_node_runtime_handlerJSON, "features"); + if (cJSON_IsNull(features)) { + features = NULL; + } if (features) { features_local_nonprim = v1_node_runtime_handler_features_parseFromJSON(features); //nonprimitive } // v1_node_runtime_handler->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_node_runtime_handlerJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -90,7 +110,7 @@ v1_node_runtime_handler_t *v1_node_runtime_handler_parseFromJSON(cJSON *v1_node_ } - v1_node_runtime_handler_local_var = v1_node_runtime_handler_create ( + v1_node_runtime_handler_local_var = v1_node_runtime_handler_create_internal ( features ? features_local_nonprim : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL ); diff --git a/kubernetes/model/v1_node_runtime_handler.h b/kubernetes/model/v1_node_runtime_handler.h index edd0d552..66df6aae 100644 --- a/kubernetes/model/v1_node_runtime_handler.h +++ b/kubernetes/model/v1_node_runtime_handler.h @@ -23,9 +23,10 @@ typedef struct v1_node_runtime_handler_t { struct v1_node_runtime_handler_features_t *features; //model char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_node_runtime_handler_t; -v1_node_runtime_handler_t *v1_node_runtime_handler_create( +__attribute__((deprecated)) v1_node_runtime_handler_t *v1_node_runtime_handler_create( v1_node_runtime_handler_features_t *features, char *name ); diff --git a/kubernetes/model/v1_node_runtime_handler_features.c b/kubernetes/model/v1_node_runtime_handler_features.c index 5f219ba3..11a26518 100644 --- a/kubernetes/model/v1_node_runtime_handler_features.c +++ b/kubernetes/model/v1_node_runtime_handler_features.c @@ -5,23 +5,39 @@ -v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_create( - int recursive_read_only_mounts +static v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_create_internal( + int recursive_read_only_mounts, + int user_namespaces ) { v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_local_var = malloc(sizeof(v1_node_runtime_handler_features_t)); if (!v1_node_runtime_handler_features_local_var) { return NULL; } v1_node_runtime_handler_features_local_var->recursive_read_only_mounts = recursive_read_only_mounts; + v1_node_runtime_handler_features_local_var->user_namespaces = user_namespaces; + v1_node_runtime_handler_features_local_var->_library_owned = 1; return v1_node_runtime_handler_features_local_var; } +__attribute__((deprecated)) v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_create( + int recursive_read_only_mounts, + int user_namespaces + ) { + return v1_node_runtime_handler_features_create_internal ( + recursive_read_only_mounts, + user_namespaces + ); +} void v1_node_runtime_handler_features_free(v1_node_runtime_handler_features_t *v1_node_runtime_handler_features) { if(NULL == v1_node_runtime_handler_features){ return ; } + if(v1_node_runtime_handler_features->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_runtime_handler_features_free"); + return ; + } listEntry_t *listEntry; free(v1_node_runtime_handler_features); } @@ -36,6 +52,14 @@ cJSON *v1_node_runtime_handler_features_convertToJSON(v1_node_runtime_handler_fe } } + + // v1_node_runtime_handler_features->user_namespaces + if(v1_node_runtime_handler_features->user_namespaces) { + if(cJSON_AddBoolToObject(item, "userNamespaces", v1_node_runtime_handler_features->user_namespaces) == NULL) { + goto fail; //Bool + } + } + return item; fail: if (item) { @@ -50,6 +74,9 @@ v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_parseFromJS // v1_node_runtime_handler_features->recursive_read_only_mounts cJSON *recursive_read_only_mounts = cJSON_GetObjectItemCaseSensitive(v1_node_runtime_handler_featuresJSON, "recursiveReadOnlyMounts"); + if (cJSON_IsNull(recursive_read_only_mounts)) { + recursive_read_only_mounts = NULL; + } if (recursive_read_only_mounts) { if(!cJSON_IsBool(recursive_read_only_mounts)) { @@ -57,9 +84,22 @@ v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_parseFromJS } } + // v1_node_runtime_handler_features->user_namespaces + cJSON *user_namespaces = cJSON_GetObjectItemCaseSensitive(v1_node_runtime_handler_featuresJSON, "userNamespaces"); + if (cJSON_IsNull(user_namespaces)) { + user_namespaces = NULL; + } + if (user_namespaces) { + if(!cJSON_IsBool(user_namespaces)) + { + goto end; //Bool + } + } + - v1_node_runtime_handler_features_local_var = v1_node_runtime_handler_features_create ( - recursive_read_only_mounts ? recursive_read_only_mounts->valueint : 0 + v1_node_runtime_handler_features_local_var = v1_node_runtime_handler_features_create_internal ( + recursive_read_only_mounts ? recursive_read_only_mounts->valueint : 0, + user_namespaces ? user_namespaces->valueint : 0 ); return v1_node_runtime_handler_features_local_var; diff --git a/kubernetes/model/v1_node_runtime_handler_features.h b/kubernetes/model/v1_node_runtime_handler_features.h index 50a5d7e2..46db4779 100644 --- a/kubernetes/model/v1_node_runtime_handler_features.h +++ b/kubernetes/model/v1_node_runtime_handler_features.h @@ -1,7 +1,7 @@ /* * v1_node_runtime_handler_features.h * - * NodeRuntimeHandlerFeatures is a set of runtime features. + * NodeRuntimeHandlerFeatures is a set of features implemented by the runtime handler. */ #ifndef _v1_node_runtime_handler_features_H_ @@ -20,11 +20,14 @@ typedef struct v1_node_runtime_handler_features_t v1_node_runtime_handler_featur typedef struct v1_node_runtime_handler_features_t { int recursive_read_only_mounts; //boolean + int user_namespaces; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_node_runtime_handler_features_t; -v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_create( - int recursive_read_only_mounts +__attribute__((deprecated)) v1_node_runtime_handler_features_t *v1_node_runtime_handler_features_create( + int recursive_read_only_mounts, + int user_namespaces ); void v1_node_runtime_handler_features_free(v1_node_runtime_handler_features_t *v1_node_runtime_handler_features); diff --git a/kubernetes/model/v1_node_selector.c b/kubernetes/model/v1_node_selector.c index 5d90b64b..e4cab517 100644 --- a/kubernetes/model/v1_node_selector.c +++ b/kubernetes/model/v1_node_selector.c @@ -5,7 +5,7 @@ -v1_node_selector_t *v1_node_selector_create( +static v1_node_selector_t *v1_node_selector_create_internal( list_t *node_selector_terms ) { v1_node_selector_t *v1_node_selector_local_var = malloc(sizeof(v1_node_selector_t)); @@ -14,14 +14,26 @@ v1_node_selector_t *v1_node_selector_create( } v1_node_selector_local_var->node_selector_terms = node_selector_terms; + v1_node_selector_local_var->_library_owned = 1; return v1_node_selector_local_var; } +__attribute__((deprecated)) v1_node_selector_t *v1_node_selector_create( + list_t *node_selector_terms + ) { + return v1_node_selector_create_internal ( + node_selector_terms + ); +} void v1_node_selector_free(v1_node_selector_t *v1_node_selector) { if(NULL == v1_node_selector){ return ; } + if(v1_node_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_selector_free"); + return ; + } listEntry_t *listEntry; if (v1_node_selector->node_selector_terms) { list_ForEach(listEntry, v1_node_selector->node_selector_terms) { @@ -73,6 +85,9 @@ v1_node_selector_t *v1_node_selector_parseFromJSON(cJSON *v1_node_selectorJSON){ // v1_node_selector->node_selector_terms cJSON *node_selector_terms = cJSON_GetObjectItemCaseSensitive(v1_node_selectorJSON, "nodeSelectorTerms"); + if (cJSON_IsNull(node_selector_terms)) { + node_selector_terms = NULL; + } if (!node_selector_terms) { goto end; } @@ -96,7 +111,7 @@ v1_node_selector_t *v1_node_selector_parseFromJSON(cJSON *v1_node_selectorJSON){ } - v1_node_selector_local_var = v1_node_selector_create ( + v1_node_selector_local_var = v1_node_selector_create_internal ( node_selector_termsList ); diff --git a/kubernetes/model/v1_node_selector.h b/kubernetes/model/v1_node_selector.h index 64cd0e70..64cfd843 100644 --- a/kubernetes/model/v1_node_selector.h +++ b/kubernetes/model/v1_node_selector.h @@ -22,9 +22,10 @@ typedef struct v1_node_selector_t v1_node_selector_t; typedef struct v1_node_selector_t { list_t *node_selector_terms; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_node_selector_t; -v1_node_selector_t *v1_node_selector_create( +__attribute__((deprecated)) v1_node_selector_t *v1_node_selector_create( list_t *node_selector_terms ); diff --git a/kubernetes/model/v1_node_selector_requirement.c b/kubernetes/model/v1_node_selector_requirement.c index 14cc572b..41d1505e 100644 --- a/kubernetes/model/v1_node_selector_requirement.c +++ b/kubernetes/model/v1_node_selector_requirement.c @@ -5,7 +5,7 @@ -v1_node_selector_requirement_t *v1_node_selector_requirement_create( +static v1_node_selector_requirement_t *v1_node_selector_requirement_create_internal( char *key, char *_operator, list_t *values @@ -18,14 +18,30 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_create( v1_node_selector_requirement_local_var->_operator = _operator; v1_node_selector_requirement_local_var->values = values; + v1_node_selector_requirement_local_var->_library_owned = 1; return v1_node_selector_requirement_local_var; } +__attribute__((deprecated)) v1_node_selector_requirement_t *v1_node_selector_requirement_create( + char *key, + char *_operator, + list_t *values + ) { + return v1_node_selector_requirement_create_internal ( + key, + _operator, + values + ); +} void v1_node_selector_requirement_free(v1_node_selector_requirement_t *v1_node_selector_requirement) { if(NULL == v1_node_selector_requirement){ return ; } + if(v1_node_selector_requirement->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_selector_requirement_free"); + return ; + } listEntry_t *listEntry; if (v1_node_selector_requirement->key) { free(v1_node_selector_requirement->key); @@ -75,7 +91,7 @@ cJSON *v1_node_selector_requirement_convertToJSON(v1_node_selector_requirement_t listEntry_t *valuesListEntry; list_ForEach(valuesListEntry, v1_node_selector_requirement->values) { - if(cJSON_AddStringToObject(values, "", (char*)valuesListEntry->data) == NULL) + if(cJSON_AddStringToObject(values, "", valuesListEntry->data) == NULL) { goto fail; } @@ -99,6 +115,9 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON // v1_node_selector_requirement->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_node_selector_requirementJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -111,6 +130,9 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON // v1_node_selector_requirement->_operator cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_node_selector_requirementJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } if (!_operator) { goto end; } @@ -123,6 +145,9 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON // v1_node_selector_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_node_selector_requirementJSON, "values"); + if (cJSON_IsNull(values)) { + values = NULL; + } if (values) { cJSON *values_local = NULL; if(!cJSON_IsArray(values)) { @@ -141,7 +166,7 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON } - v1_node_selector_requirement_local_var = v1_node_selector_requirement_create ( + v1_node_selector_requirement_local_var = v1_node_selector_requirement_create_internal ( strdup(key->valuestring), strdup(_operator->valuestring), values ? valuesList : NULL diff --git a/kubernetes/model/v1_node_selector_requirement.h b/kubernetes/model/v1_node_selector_requirement.h index 8545ce40..1da68728 100644 --- a/kubernetes/model/v1_node_selector_requirement.h +++ b/kubernetes/model/v1_node_selector_requirement.h @@ -23,9 +23,10 @@ typedef struct v1_node_selector_requirement_t { char *_operator; // string list_t *values; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_node_selector_requirement_t; -v1_node_selector_requirement_t *v1_node_selector_requirement_create( +__attribute__((deprecated)) v1_node_selector_requirement_t *v1_node_selector_requirement_create( char *key, char *_operator, list_t *values diff --git a/kubernetes/model/v1_node_selector_term.c b/kubernetes/model/v1_node_selector_term.c index aaee7066..51b55b2f 100644 --- a/kubernetes/model/v1_node_selector_term.c +++ b/kubernetes/model/v1_node_selector_term.c @@ -5,7 +5,7 @@ -v1_node_selector_term_t *v1_node_selector_term_create( +static v1_node_selector_term_t *v1_node_selector_term_create_internal( list_t *match_expressions, list_t *match_fields ) { @@ -16,14 +16,28 @@ v1_node_selector_term_t *v1_node_selector_term_create( v1_node_selector_term_local_var->match_expressions = match_expressions; v1_node_selector_term_local_var->match_fields = match_fields; + v1_node_selector_term_local_var->_library_owned = 1; return v1_node_selector_term_local_var; } +__attribute__((deprecated)) v1_node_selector_term_t *v1_node_selector_term_create( + list_t *match_expressions, + list_t *match_fields + ) { + return v1_node_selector_term_create_internal ( + match_expressions, + match_fields + ); +} void v1_node_selector_term_free(v1_node_selector_term_t *v1_node_selector_term) { if(NULL == v1_node_selector_term){ return ; } + if(v1_node_selector_term->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_selector_term_free"); + return ; + } listEntry_t *listEntry; if (v1_node_selector_term->match_expressions) { list_ForEach(listEntry, v1_node_selector_term->match_expressions) { @@ -104,6 +118,9 @@ v1_node_selector_term_t *v1_node_selector_term_parseFromJSON(cJSON *v1_node_sele // v1_node_selector_term->match_expressions cJSON *match_expressions = cJSON_GetObjectItemCaseSensitive(v1_node_selector_termJSON, "matchExpressions"); + if (cJSON_IsNull(match_expressions)) { + match_expressions = NULL; + } if (match_expressions) { cJSON *match_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_expressions)){ @@ -125,6 +142,9 @@ v1_node_selector_term_t *v1_node_selector_term_parseFromJSON(cJSON *v1_node_sele // v1_node_selector_term->match_fields cJSON *match_fields = cJSON_GetObjectItemCaseSensitive(v1_node_selector_termJSON, "matchFields"); + if (cJSON_IsNull(match_fields)) { + match_fields = NULL; + } if (match_fields) { cJSON *match_fields_local_nonprimitive = NULL; if(!cJSON_IsArray(match_fields)){ @@ -145,7 +165,7 @@ v1_node_selector_term_t *v1_node_selector_term_parseFromJSON(cJSON *v1_node_sele } - v1_node_selector_term_local_var = v1_node_selector_term_create ( + v1_node_selector_term_local_var = v1_node_selector_term_create_internal ( match_expressions ? match_expressionsList : NULL, match_fields ? match_fieldsList : NULL ); diff --git a/kubernetes/model/v1_node_selector_term.h b/kubernetes/model/v1_node_selector_term.h index bf7676f3..73416a10 100644 --- a/kubernetes/model/v1_node_selector_term.h +++ b/kubernetes/model/v1_node_selector_term.h @@ -23,9 +23,10 @@ typedef struct v1_node_selector_term_t { list_t *match_expressions; //nonprimitive container list_t *match_fields; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_node_selector_term_t; -v1_node_selector_term_t *v1_node_selector_term_create( +__attribute__((deprecated)) v1_node_selector_term_t *v1_node_selector_term_create( list_t *match_expressions, list_t *match_fields ); diff --git a/kubernetes/model/v1_node_spec.c b/kubernetes/model/v1_node_spec.c index afddd5f3..8914561d 100644 --- a/kubernetes/model/v1_node_spec.c +++ b/kubernetes/model/v1_node_spec.c @@ -5,7 +5,7 @@ -v1_node_spec_t *v1_node_spec_create( +static v1_node_spec_t *v1_node_spec_create_internal( v1_node_config_source_t *config_source, char *external_id, char *pod_cidr, @@ -26,14 +26,38 @@ v1_node_spec_t *v1_node_spec_create( v1_node_spec_local_var->taints = taints; v1_node_spec_local_var->unschedulable = unschedulable; + v1_node_spec_local_var->_library_owned = 1; return v1_node_spec_local_var; } +__attribute__((deprecated)) v1_node_spec_t *v1_node_spec_create( + v1_node_config_source_t *config_source, + char *external_id, + char *pod_cidr, + list_t *pod_cidrs, + char *provider_id, + list_t *taints, + int unschedulable + ) { + return v1_node_spec_create_internal ( + config_source, + external_id, + pod_cidr, + pod_cidrs, + provider_id, + taints, + unschedulable + ); +} void v1_node_spec_free(v1_node_spec_t *v1_node_spec) { if(NULL == v1_node_spec){ return ; } + if(v1_node_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_node_spec->config_source) { v1_node_config_source_free(v1_node_spec->config_source); @@ -109,7 +133,7 @@ cJSON *v1_node_spec_convertToJSON(v1_node_spec_t *v1_node_spec) { listEntry_t *pod_cidrsListEntry; list_ForEach(pod_cidrsListEntry, v1_node_spec->pod_cidrs) { - if(cJSON_AddStringToObject(pod_cidrs, "", (char*)pod_cidrsListEntry->data) == NULL) + if(cJSON_AddStringToObject(pod_cidrs, "", pod_cidrsListEntry->data) == NULL) { goto fail; } @@ -175,12 +199,18 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->config_source cJSON *config_source = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "configSource"); + if (cJSON_IsNull(config_source)) { + config_source = NULL; + } if (config_source) { config_source_local_nonprim = v1_node_config_source_parseFromJSON(config_source); //nonprimitive } // v1_node_spec->external_id cJSON *external_id = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "externalID"); + if (cJSON_IsNull(external_id)) { + external_id = NULL; + } if (external_id) { if(!cJSON_IsString(external_id) && !cJSON_IsNull(external_id)) { @@ -190,6 +220,9 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->pod_cidr cJSON *pod_cidr = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "podCIDR"); + if (cJSON_IsNull(pod_cidr)) { + pod_cidr = NULL; + } if (pod_cidr) { if(!cJSON_IsString(pod_cidr) && !cJSON_IsNull(pod_cidr)) { @@ -199,6 +232,9 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->pod_cidrs cJSON *pod_cidrs = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "podCIDRs"); + if (cJSON_IsNull(pod_cidrs)) { + pod_cidrs = NULL; + } if (pod_cidrs) { cJSON *pod_cidrs_local = NULL; if(!cJSON_IsArray(pod_cidrs)) { @@ -218,6 +254,9 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->provider_id cJSON *provider_id = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "providerID"); + if (cJSON_IsNull(provider_id)) { + provider_id = NULL; + } if (provider_id) { if(!cJSON_IsString(provider_id) && !cJSON_IsNull(provider_id)) { @@ -227,6 +266,9 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->taints cJSON *taints = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "taints"); + if (cJSON_IsNull(taints)) { + taints = NULL; + } if (taints) { cJSON *taints_local_nonprimitive = NULL; if(!cJSON_IsArray(taints)){ @@ -248,6 +290,9 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->unschedulable cJSON *unschedulable = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "unschedulable"); + if (cJSON_IsNull(unschedulable)) { + unschedulable = NULL; + } if (unschedulable) { if(!cJSON_IsBool(unschedulable)) { @@ -256,7 +301,7 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ } - v1_node_spec_local_var = v1_node_spec_create ( + v1_node_spec_local_var = v1_node_spec_create_internal ( config_source ? config_source_local_nonprim : NULL, external_id && !cJSON_IsNull(external_id) ? strdup(external_id->valuestring) : NULL, pod_cidr && !cJSON_IsNull(pod_cidr) ? strdup(pod_cidr->valuestring) : NULL, diff --git a/kubernetes/model/v1_node_spec.h b/kubernetes/model/v1_node_spec.h index 1f4a86c6..2331ab70 100644 --- a/kubernetes/model/v1_node_spec.h +++ b/kubernetes/model/v1_node_spec.h @@ -29,9 +29,10 @@ typedef struct v1_node_spec_t { list_t *taints; //nonprimitive container int unschedulable; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_node_spec_t; -v1_node_spec_t *v1_node_spec_create( +__attribute__((deprecated)) v1_node_spec_t *v1_node_spec_create( v1_node_config_source_t *config_source, char *external_id, char *pod_cidr, diff --git a/kubernetes/model/v1_node_status.c b/kubernetes/model/v1_node_status.c index d238fc6d..cf9c49f2 100644 --- a/kubernetes/model/v1_node_status.c +++ b/kubernetes/model/v1_node_status.c @@ -5,13 +5,14 @@ -v1_node_status_t *v1_node_status_create( +static v1_node_status_t *v1_node_status_create_internal( list_t *addresses, list_t* allocatable, list_t* capacity, list_t *conditions, v1_node_config_status_t *config, v1_node_daemon_endpoints_t *daemon_endpoints, + v1_node_features_t *features, list_t *images, v1_node_system_info_t *node_info, char *phase, @@ -29,6 +30,7 @@ v1_node_status_t *v1_node_status_create( v1_node_status_local_var->conditions = conditions; v1_node_status_local_var->config = config; v1_node_status_local_var->daemon_endpoints = daemon_endpoints; + v1_node_status_local_var->features = features; v1_node_status_local_var->images = images; v1_node_status_local_var->node_info = node_info; v1_node_status_local_var->phase = phase; @@ -36,14 +38,50 @@ v1_node_status_t *v1_node_status_create( v1_node_status_local_var->volumes_attached = volumes_attached; v1_node_status_local_var->volumes_in_use = volumes_in_use; + v1_node_status_local_var->_library_owned = 1; return v1_node_status_local_var; } +__attribute__((deprecated)) v1_node_status_t *v1_node_status_create( + list_t *addresses, + list_t* allocatable, + list_t* capacity, + list_t *conditions, + v1_node_config_status_t *config, + v1_node_daemon_endpoints_t *daemon_endpoints, + v1_node_features_t *features, + list_t *images, + v1_node_system_info_t *node_info, + char *phase, + list_t *runtime_handlers, + list_t *volumes_attached, + list_t *volumes_in_use + ) { + return v1_node_status_create_internal ( + addresses, + allocatable, + capacity, + conditions, + config, + daemon_endpoints, + features, + images, + node_info, + phase, + runtime_handlers, + volumes_attached, + volumes_in_use + ); +} void v1_node_status_free(v1_node_status_t *v1_node_status) { if(NULL == v1_node_status){ return ; } + if(v1_node_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_status_free"); + return ; + } listEntry_t *listEntry; if (v1_node_status->addresses) { list_ForEach(listEntry, v1_node_status->addresses) { @@ -54,7 +92,7 @@ void v1_node_status_free(v1_node_status_t *v1_node_status) { } if (v1_node_status->allocatable) { list_ForEach(listEntry, v1_node_status->allocatable) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -64,7 +102,7 @@ void v1_node_status_free(v1_node_status_t *v1_node_status) { } if (v1_node_status->capacity) { list_ForEach(listEntry, v1_node_status->capacity) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -87,6 +125,10 @@ void v1_node_status_free(v1_node_status_t *v1_node_status) { v1_node_daemon_endpoints_free(v1_node_status->daemon_endpoints); v1_node_status->daemon_endpoints = NULL; } + if (v1_node_status->features) { + v1_node_features_free(v1_node_status->features); + v1_node_status->features = NULL; + } if (v1_node_status->images) { list_ForEach(listEntry, v1_node_status->images) { v1_container_image_free(listEntry->data); @@ -159,8 +201,8 @@ cJSON *v1_node_status_convertToJSON(v1_node_status_t *v1_node_status) { listEntry_t *allocatableListEntry; if (v1_node_status->allocatable) { list_ForEach(allocatableListEntry, v1_node_status->allocatable) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)allocatableListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = allocatableListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -179,8 +221,8 @@ cJSON *v1_node_status_convertToJSON(v1_node_status_t *v1_node_status) { listEntry_t *capacityListEntry; if (v1_node_status->capacity) { list_ForEach(capacityListEntry, v1_node_status->capacity) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)capacityListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = capacityListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -235,6 +277,19 @@ cJSON *v1_node_status_convertToJSON(v1_node_status_t *v1_node_status) { } + // v1_node_status->features + if(v1_node_status->features) { + cJSON *features_local_JSON = v1_node_features_convertToJSON(v1_node_status->features); + if(features_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "features", features_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_node_status->images if(v1_node_status->images) { cJSON *images = cJSON_AddArrayToObject(item, "images"); @@ -325,7 +380,7 @@ cJSON *v1_node_status_convertToJSON(v1_node_status_t *v1_node_status) { listEntry_t *volumes_in_useListEntry; list_ForEach(volumes_in_useListEntry, v1_node_status->volumes_in_use) { - if(cJSON_AddStringToObject(volumes_in_use, "", (char*)volumes_in_useListEntry->data) == NULL) + if(cJSON_AddStringToObject(volumes_in_use, "", volumes_in_useListEntry->data) == NULL) { goto fail; } @@ -362,6 +417,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // define the local variable for v1_node_status->daemon_endpoints v1_node_daemon_endpoints_t *daemon_endpoints_local_nonprim = NULL; + // define the local variable for v1_node_status->features + v1_node_features_t *features_local_nonprim = NULL; + // define the local list for v1_node_status->images list_t *imagesList = NULL; @@ -379,6 +437,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->addresses cJSON *addresses = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "addresses"); + if (cJSON_IsNull(addresses)) { + addresses = NULL; + } if (addresses) { cJSON *addresses_local_nonprimitive = NULL; if(!cJSON_IsArray(addresses)){ @@ -400,6 +461,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->allocatable cJSON *allocatable = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "allocatable"); + if (cJSON_IsNull(allocatable)) { + allocatable = NULL; + } if (allocatable) { cJSON *allocatable_local_map = NULL; if(!cJSON_IsObject(allocatable) && !cJSON_IsNull(allocatable)) @@ -425,6 +489,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->capacity cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } if (capacity) { cJSON *capacity_local_map = NULL; if(!cJSON_IsObject(capacity) && !cJSON_IsNull(capacity)) @@ -450,6 +517,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -471,18 +541,36 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->config cJSON *config = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } if (config) { config_local_nonprim = v1_node_config_status_parseFromJSON(config); //nonprimitive } // v1_node_status->daemon_endpoints cJSON *daemon_endpoints = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "daemonEndpoints"); + if (cJSON_IsNull(daemon_endpoints)) { + daemon_endpoints = NULL; + } if (daemon_endpoints) { daemon_endpoints_local_nonprim = v1_node_daemon_endpoints_parseFromJSON(daemon_endpoints); //nonprimitive } + // v1_node_status->features + cJSON *features = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "features"); + if (cJSON_IsNull(features)) { + features = NULL; + } + if (features) { + features_local_nonprim = v1_node_features_parseFromJSON(features); //nonprimitive + } + // v1_node_status->images cJSON *images = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "images"); + if (cJSON_IsNull(images)) { + images = NULL; + } if (images) { cJSON *images_local_nonprimitive = NULL; if(!cJSON_IsArray(images)){ @@ -504,12 +592,18 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->node_info cJSON *node_info = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "nodeInfo"); + if (cJSON_IsNull(node_info)) { + node_info = NULL; + } if (node_info) { node_info_local_nonprim = v1_node_system_info_parseFromJSON(node_info); //nonprimitive } // v1_node_status->phase cJSON *phase = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "phase"); + if (cJSON_IsNull(phase)) { + phase = NULL; + } if (phase) { if(!cJSON_IsString(phase) && !cJSON_IsNull(phase)) { @@ -519,6 +613,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->runtime_handlers cJSON *runtime_handlers = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "runtimeHandlers"); + if (cJSON_IsNull(runtime_handlers)) { + runtime_handlers = NULL; + } if (runtime_handlers) { cJSON *runtime_handlers_local_nonprimitive = NULL; if(!cJSON_IsArray(runtime_handlers)){ @@ -540,6 +637,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->volumes_attached cJSON *volumes_attached = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "volumesAttached"); + if (cJSON_IsNull(volumes_attached)) { + volumes_attached = NULL; + } if (volumes_attached) { cJSON *volumes_attached_local_nonprimitive = NULL; if(!cJSON_IsArray(volumes_attached)){ @@ -561,6 +661,9 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->volumes_in_use cJSON *volumes_in_use = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "volumesInUse"); + if (cJSON_IsNull(volumes_in_use)) { + volumes_in_use = NULL; + } if (volumes_in_use) { cJSON *volumes_in_use_local = NULL; if(!cJSON_IsArray(volumes_in_use)) { @@ -579,13 +682,14 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ } - v1_node_status_local_var = v1_node_status_create ( + v1_node_status_local_var = v1_node_status_create_internal ( addresses ? addressesList : NULL, allocatable ? allocatableList : NULL, capacity ? capacityList : NULL, conditions ? conditionsList : NULL, config ? config_local_nonprim : NULL, daemon_endpoints ? daemon_endpoints_local_nonprim : NULL, + features ? features_local_nonprim : NULL, images ? imagesList : NULL, node_info ? node_info_local_nonprim : NULL, phase && !cJSON_IsNull(phase) ? strdup(phase->valuestring) : NULL, @@ -608,7 +712,7 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ if (allocatableList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, allocatableList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -622,7 +726,7 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ if (capacityList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, capacityList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -650,6 +754,10 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ v1_node_daemon_endpoints_free(daemon_endpoints_local_nonprim); daemon_endpoints_local_nonprim = NULL; } + if (features_local_nonprim) { + v1_node_features_free(features_local_nonprim); + features_local_nonprim = NULL; + } if (imagesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, imagesList) { diff --git a/kubernetes/model/v1_node_status.h b/kubernetes/model/v1_node_status.h index c162771c..2d0e209d 100644 --- a/kubernetes/model/v1_node_status.h +++ b/kubernetes/model/v1_node_status.h @@ -21,6 +21,7 @@ typedef struct v1_node_status_t v1_node_status_t; #include "v1_node_condition.h" #include "v1_node_config_status.h" #include "v1_node_daemon_endpoints.h" +#include "v1_node_features.h" #include "v1_node_runtime_handler.h" #include "v1_node_system_info.h" @@ -33,6 +34,7 @@ typedef struct v1_node_status_t { list_t *conditions; //nonprimitive container struct v1_node_config_status_t *config; //model struct v1_node_daemon_endpoints_t *daemon_endpoints; //model + struct v1_node_features_t *features; //model list_t *images; //nonprimitive container struct v1_node_system_info_t *node_info; //model char *phase; // string @@ -40,15 +42,17 @@ typedef struct v1_node_status_t { list_t *volumes_attached; //nonprimitive container list_t *volumes_in_use; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_node_status_t; -v1_node_status_t *v1_node_status_create( +__attribute__((deprecated)) v1_node_status_t *v1_node_status_create( list_t *addresses, list_t* allocatable, list_t* capacity, list_t *conditions, v1_node_config_status_t *config, v1_node_daemon_endpoints_t *daemon_endpoints, + v1_node_features_t *features, list_t *images, v1_node_system_info_t *node_info, char *phase, diff --git a/kubernetes/model/v1_node_swap_status.c b/kubernetes/model/v1_node_swap_status.c new file mode 100644 index 00000000..076adb8f --- /dev/null +++ b/kubernetes/model/v1_node_swap_status.c @@ -0,0 +1,84 @@ +#include +#include +#include +#include "v1_node_swap_status.h" + + + +static v1_node_swap_status_t *v1_node_swap_status_create_internal( + long capacity + ) { + v1_node_swap_status_t *v1_node_swap_status_local_var = malloc(sizeof(v1_node_swap_status_t)); + if (!v1_node_swap_status_local_var) { + return NULL; + } + v1_node_swap_status_local_var->capacity = capacity; + + v1_node_swap_status_local_var->_library_owned = 1; + return v1_node_swap_status_local_var; +} + +__attribute__((deprecated)) v1_node_swap_status_t *v1_node_swap_status_create( + long capacity + ) { + return v1_node_swap_status_create_internal ( + capacity + ); +} + +void v1_node_swap_status_free(v1_node_swap_status_t *v1_node_swap_status) { + if(NULL == v1_node_swap_status){ + return ; + } + if(v1_node_swap_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_swap_status_free"); + return ; + } + listEntry_t *listEntry; + free(v1_node_swap_status); +} + +cJSON *v1_node_swap_status_convertToJSON(v1_node_swap_status_t *v1_node_swap_status) { + cJSON *item = cJSON_CreateObject(); + + // v1_node_swap_status->capacity + if(v1_node_swap_status->capacity) { + if(cJSON_AddNumberToObject(item, "capacity", v1_node_swap_status->capacity) == NULL) { + goto fail; //Numeric + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_node_swap_status_t *v1_node_swap_status_parseFromJSON(cJSON *v1_node_swap_statusJSON){ + + v1_node_swap_status_t *v1_node_swap_status_local_var = NULL; + + // v1_node_swap_status->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_node_swap_statusJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + if(!cJSON_IsNumber(capacity)) + { + goto end; //Numeric + } + } + + + v1_node_swap_status_local_var = v1_node_swap_status_create_internal ( + capacity ? capacity->valuedouble : 0 + ); + + return v1_node_swap_status_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_node_swap_status.h b/kubernetes/model/v1_node_swap_status.h new file mode 100644 index 00000000..3db8ee9e --- /dev/null +++ b/kubernetes/model/v1_node_swap_status.h @@ -0,0 +1,38 @@ +/* + * v1_node_swap_status.h + * + * NodeSwapStatus represents swap memory information. + */ + +#ifndef _v1_node_swap_status_H_ +#define _v1_node_swap_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_node_swap_status_t v1_node_swap_status_t; + + + + +typedef struct v1_node_swap_status_t { + long capacity; //numeric + + int _library_owned; // Is the library responsible for freeing this object? +} v1_node_swap_status_t; + +__attribute__((deprecated)) v1_node_swap_status_t *v1_node_swap_status_create( + long capacity +); + +void v1_node_swap_status_free(v1_node_swap_status_t *v1_node_swap_status); + +v1_node_swap_status_t *v1_node_swap_status_parseFromJSON(cJSON *v1_node_swap_statusJSON); + +cJSON *v1_node_swap_status_convertToJSON(v1_node_swap_status_t *v1_node_swap_status); + +#endif /* _v1_node_swap_status_H_ */ + diff --git a/kubernetes/model/v1_node_system_info.c b/kubernetes/model/v1_node_system_info.c index 7ed4c8da..38ae322c 100644 --- a/kubernetes/model/v1_node_system_info.c +++ b/kubernetes/model/v1_node_system_info.c @@ -5,7 +5,7 @@ -v1_node_system_info_t *v1_node_system_info_create( +static v1_node_system_info_t *v1_node_system_info_create_internal( char *architecture, char *boot_id, char *container_runtime_version, @@ -15,6 +15,7 @@ v1_node_system_info_t *v1_node_system_info_create( char *machine_id, char *operating_system, char *os_image, + v1_node_swap_status_t *swap, char *system_uuid ) { v1_node_system_info_t *v1_node_system_info_local_var = malloc(sizeof(v1_node_system_info_t)); @@ -30,16 +31,49 @@ v1_node_system_info_t *v1_node_system_info_create( v1_node_system_info_local_var->machine_id = machine_id; v1_node_system_info_local_var->operating_system = operating_system; v1_node_system_info_local_var->os_image = os_image; + v1_node_system_info_local_var->swap = swap; v1_node_system_info_local_var->system_uuid = system_uuid; + v1_node_system_info_local_var->_library_owned = 1; return v1_node_system_info_local_var; } +__attribute__((deprecated)) v1_node_system_info_t *v1_node_system_info_create( + char *architecture, + char *boot_id, + char *container_runtime_version, + char *kernel_version, + char *kube_proxy_version, + char *kubelet_version, + char *machine_id, + char *operating_system, + char *os_image, + v1_node_swap_status_t *swap, + char *system_uuid + ) { + return v1_node_system_info_create_internal ( + architecture, + boot_id, + container_runtime_version, + kernel_version, + kube_proxy_version, + kubelet_version, + machine_id, + operating_system, + os_image, + swap, + system_uuid + ); +} void v1_node_system_info_free(v1_node_system_info_t *v1_node_system_info) { if(NULL == v1_node_system_info){ return ; } + if(v1_node_system_info->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_node_system_info_free"); + return ; + } listEntry_t *listEntry; if (v1_node_system_info->architecture) { free(v1_node_system_info->architecture); @@ -77,6 +111,10 @@ void v1_node_system_info_free(v1_node_system_info_t *v1_node_system_info) { free(v1_node_system_info->os_image); v1_node_system_info->os_image = NULL; } + if (v1_node_system_info->swap) { + v1_node_swap_status_free(v1_node_system_info->swap); + v1_node_system_info->swap = NULL; + } if (v1_node_system_info->system_uuid) { free(v1_node_system_info->system_uuid); v1_node_system_info->system_uuid = NULL; @@ -168,6 +206,19 @@ cJSON *v1_node_system_info_convertToJSON(v1_node_system_info_t *v1_node_system_i } + // v1_node_system_info->swap + if(v1_node_system_info->swap) { + cJSON *swap_local_JSON = v1_node_swap_status_convertToJSON(v1_node_system_info->swap); + if(swap_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "swap", swap_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_node_system_info->system_uuid if (!v1_node_system_info->system_uuid) { goto fail; @@ -188,8 +239,14 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i v1_node_system_info_t *v1_node_system_info_local_var = NULL; + // define the local variable for v1_node_system_info->swap + v1_node_swap_status_t *swap_local_nonprim = NULL; + // v1_node_system_info->architecture cJSON *architecture = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "architecture"); + if (cJSON_IsNull(architecture)) { + architecture = NULL; + } if (!architecture) { goto end; } @@ -202,6 +259,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->boot_id cJSON *boot_id = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "bootID"); + if (cJSON_IsNull(boot_id)) { + boot_id = NULL; + } if (!boot_id) { goto end; } @@ -214,6 +274,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->container_runtime_version cJSON *container_runtime_version = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "containerRuntimeVersion"); + if (cJSON_IsNull(container_runtime_version)) { + container_runtime_version = NULL; + } if (!container_runtime_version) { goto end; } @@ -226,6 +289,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->kernel_version cJSON *kernel_version = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "kernelVersion"); + if (cJSON_IsNull(kernel_version)) { + kernel_version = NULL; + } if (!kernel_version) { goto end; } @@ -238,6 +304,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->kube_proxy_version cJSON *kube_proxy_version = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "kubeProxyVersion"); + if (cJSON_IsNull(kube_proxy_version)) { + kube_proxy_version = NULL; + } if (!kube_proxy_version) { goto end; } @@ -250,6 +319,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->kubelet_version cJSON *kubelet_version = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "kubeletVersion"); + if (cJSON_IsNull(kubelet_version)) { + kubelet_version = NULL; + } if (!kubelet_version) { goto end; } @@ -262,6 +334,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->machine_id cJSON *machine_id = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "machineID"); + if (cJSON_IsNull(machine_id)) { + machine_id = NULL; + } if (!machine_id) { goto end; } @@ -274,6 +349,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->operating_system cJSON *operating_system = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "operatingSystem"); + if (cJSON_IsNull(operating_system)) { + operating_system = NULL; + } if (!operating_system) { goto end; } @@ -286,6 +364,9 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i // v1_node_system_info->os_image cJSON *os_image = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "osImage"); + if (cJSON_IsNull(os_image)) { + os_image = NULL; + } if (!os_image) { goto end; } @@ -296,8 +377,20 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i goto end; //String } + // v1_node_system_info->swap + cJSON *swap = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "swap"); + if (cJSON_IsNull(swap)) { + swap = NULL; + } + if (swap) { + swap_local_nonprim = v1_node_swap_status_parseFromJSON(swap); //nonprimitive + } + // v1_node_system_info->system_uuid cJSON *system_uuid = cJSON_GetObjectItemCaseSensitive(v1_node_system_infoJSON, "systemUUID"); + if (cJSON_IsNull(system_uuid)) { + system_uuid = NULL; + } if (!system_uuid) { goto end; } @@ -309,7 +402,7 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i } - v1_node_system_info_local_var = v1_node_system_info_create ( + v1_node_system_info_local_var = v1_node_system_info_create_internal ( strdup(architecture->valuestring), strdup(boot_id->valuestring), strdup(container_runtime_version->valuestring), @@ -319,11 +412,16 @@ v1_node_system_info_t *v1_node_system_info_parseFromJSON(cJSON *v1_node_system_i strdup(machine_id->valuestring), strdup(operating_system->valuestring), strdup(os_image->valuestring), + swap ? swap_local_nonprim : NULL, strdup(system_uuid->valuestring) ); return v1_node_system_info_local_var; end: + if (swap_local_nonprim) { + v1_node_swap_status_free(swap_local_nonprim); + swap_local_nonprim = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_node_system_info.h b/kubernetes/model/v1_node_system_info.h index 3a9690e5..c066a5b6 100644 --- a/kubernetes/model/v1_node_system_info.h +++ b/kubernetes/model/v1_node_system_info.h @@ -15,6 +15,7 @@ typedef struct v1_node_system_info_t v1_node_system_info_t; +#include "v1_node_swap_status.h" @@ -28,11 +29,13 @@ typedef struct v1_node_system_info_t { char *machine_id; // string char *operating_system; // string char *os_image; // string + struct v1_node_swap_status_t *swap; //model char *system_uuid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_node_system_info_t; -v1_node_system_info_t *v1_node_system_info_create( +__attribute__((deprecated)) v1_node_system_info_t *v1_node_system_info_create( char *architecture, char *boot_id, char *container_runtime_version, @@ -42,6 +45,7 @@ v1_node_system_info_t *v1_node_system_info_create( char *machine_id, char *operating_system, char *os_image, + v1_node_swap_status_t *swap, char *system_uuid ); diff --git a/kubernetes/model/v1_non_resource_attributes.c b/kubernetes/model/v1_non_resource_attributes.c index 5a7c9cad..1613be9d 100644 --- a/kubernetes/model/v1_non_resource_attributes.c +++ b/kubernetes/model/v1_non_resource_attributes.c @@ -5,7 +5,7 @@ -v1_non_resource_attributes_t *v1_non_resource_attributes_create( +static v1_non_resource_attributes_t *v1_non_resource_attributes_create_internal( char *path, char *verb ) { @@ -16,14 +16,28 @@ v1_non_resource_attributes_t *v1_non_resource_attributes_create( v1_non_resource_attributes_local_var->path = path; v1_non_resource_attributes_local_var->verb = verb; + v1_non_resource_attributes_local_var->_library_owned = 1; return v1_non_resource_attributes_local_var; } +__attribute__((deprecated)) v1_non_resource_attributes_t *v1_non_resource_attributes_create( + char *path, + char *verb + ) { + return v1_non_resource_attributes_create_internal ( + path, + verb + ); +} void v1_non_resource_attributes_free(v1_non_resource_attributes_t *v1_non_resource_attributes) { if(NULL == v1_non_resource_attributes){ return ; } + if(v1_non_resource_attributes->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_non_resource_attributes_free"); + return ; + } listEntry_t *listEntry; if (v1_non_resource_attributes->path) { free(v1_non_resource_attributes->path); @@ -68,6 +82,9 @@ v1_non_resource_attributes_t *v1_non_resource_attributes_parseFromJSON(cJSON *v1 // v1_non_resource_attributes->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_non_resource_attributesJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (path) { if(!cJSON_IsString(path) && !cJSON_IsNull(path)) { @@ -77,6 +94,9 @@ v1_non_resource_attributes_t *v1_non_resource_attributes_parseFromJSON(cJSON *v1 // v1_non_resource_attributes->verb cJSON *verb = cJSON_GetObjectItemCaseSensitive(v1_non_resource_attributesJSON, "verb"); + if (cJSON_IsNull(verb)) { + verb = NULL; + } if (verb) { if(!cJSON_IsString(verb) && !cJSON_IsNull(verb)) { @@ -85,7 +105,7 @@ v1_non_resource_attributes_t *v1_non_resource_attributes_parseFromJSON(cJSON *v1 } - v1_non_resource_attributes_local_var = v1_non_resource_attributes_create ( + v1_non_resource_attributes_local_var = v1_non_resource_attributes_create_internal ( path && !cJSON_IsNull(path) ? strdup(path->valuestring) : NULL, verb && !cJSON_IsNull(verb) ? strdup(verb->valuestring) : NULL ); diff --git a/kubernetes/model/v1_non_resource_attributes.h b/kubernetes/model/v1_non_resource_attributes.h index fb49afd0..02e4896c 100644 --- a/kubernetes/model/v1_non_resource_attributes.h +++ b/kubernetes/model/v1_non_resource_attributes.h @@ -22,9 +22,10 @@ typedef struct v1_non_resource_attributes_t { char *path; // string char *verb; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_non_resource_attributes_t; -v1_non_resource_attributes_t *v1_non_resource_attributes_create( +__attribute__((deprecated)) v1_non_resource_attributes_t *v1_non_resource_attributes_create( char *path, char *verb ); diff --git a/kubernetes/model/v1_non_resource_policy_rule.c b/kubernetes/model/v1_non_resource_policy_rule.c index 9066c751..aa8d7f49 100644 --- a/kubernetes/model/v1_non_resource_policy_rule.c +++ b/kubernetes/model/v1_non_resource_policy_rule.c @@ -5,7 +5,7 @@ -v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_create( +static v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_create_internal( list_t *non_resource_urls, list_t *verbs ) { @@ -16,14 +16,28 @@ v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_create( v1_non_resource_policy_rule_local_var->non_resource_urls = non_resource_urls; v1_non_resource_policy_rule_local_var->verbs = verbs; + v1_non_resource_policy_rule_local_var->_library_owned = 1; return v1_non_resource_policy_rule_local_var; } +__attribute__((deprecated)) v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_create( + list_t *non_resource_urls, + list_t *verbs + ) { + return v1_non_resource_policy_rule_create_internal ( + non_resource_urls, + verbs + ); +} void v1_non_resource_policy_rule_free(v1_non_resource_policy_rule_t *v1_non_resource_policy_rule) { if(NULL == v1_non_resource_policy_rule){ return ; } + if(v1_non_resource_policy_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_non_resource_policy_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_non_resource_policy_rule->non_resource_urls) { list_ForEach(listEntry, v1_non_resource_policy_rule->non_resource_urls) { @@ -56,7 +70,7 @@ cJSON *v1_non_resource_policy_rule_convertToJSON(v1_non_resource_policy_rule_t * listEntry_t *non_resource_urlsListEntry; list_ForEach(non_resource_urlsListEntry, v1_non_resource_policy_rule->non_resource_urls) { - if(cJSON_AddStringToObject(non_resource_urls, "", (char*)non_resource_urlsListEntry->data) == NULL) + if(cJSON_AddStringToObject(non_resource_urls, "", non_resource_urlsListEntry->data) == NULL) { goto fail; } @@ -74,7 +88,7 @@ cJSON *v1_non_resource_policy_rule_convertToJSON(v1_non_resource_policy_rule_t * listEntry_t *verbsListEntry; list_ForEach(verbsListEntry, v1_non_resource_policy_rule->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) + if(cJSON_AddStringToObject(verbs, "", verbsListEntry->data) == NULL) { goto fail; } @@ -100,6 +114,9 @@ v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_parseFromJSON(cJSON * // v1_non_resource_policy_rule->non_resource_urls cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1_non_resource_policy_ruleJSON, "nonResourceURLs"); + if (cJSON_IsNull(non_resource_urls)) { + non_resource_urls = NULL; + } if (!non_resource_urls) { goto end; } @@ -122,6 +139,9 @@ v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_parseFromJSON(cJSON * // v1_non_resource_policy_rule->verbs cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1_non_resource_policy_ruleJSON, "verbs"); + if (cJSON_IsNull(verbs)) { + verbs = NULL; + } if (!verbs) { goto end; } @@ -143,7 +163,7 @@ v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_parseFromJSON(cJSON * } - v1_non_resource_policy_rule_local_var = v1_non_resource_policy_rule_create ( + v1_non_resource_policy_rule_local_var = v1_non_resource_policy_rule_create_internal ( non_resource_urlsList, verbsList ); diff --git a/kubernetes/model/v1_non_resource_policy_rule.h b/kubernetes/model/v1_non_resource_policy_rule.h index 7c6d800b..c6b93c18 100644 --- a/kubernetes/model/v1_non_resource_policy_rule.h +++ b/kubernetes/model/v1_non_resource_policy_rule.h @@ -22,9 +22,10 @@ typedef struct v1_non_resource_policy_rule_t { list_t *non_resource_urls; //primitive container list_t *verbs; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_non_resource_policy_rule_t; -v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_create( +__attribute__((deprecated)) v1_non_resource_policy_rule_t *v1_non_resource_policy_rule_create( list_t *non_resource_urls, list_t *verbs ); diff --git a/kubernetes/model/v1_non_resource_rule.c b/kubernetes/model/v1_non_resource_rule.c index 8d519eb6..1973b1f4 100644 --- a/kubernetes/model/v1_non_resource_rule.c +++ b/kubernetes/model/v1_non_resource_rule.c @@ -5,7 +5,7 @@ -v1_non_resource_rule_t *v1_non_resource_rule_create( +static v1_non_resource_rule_t *v1_non_resource_rule_create_internal( list_t *non_resource_urls, list_t *verbs ) { @@ -16,14 +16,28 @@ v1_non_resource_rule_t *v1_non_resource_rule_create( v1_non_resource_rule_local_var->non_resource_urls = non_resource_urls; v1_non_resource_rule_local_var->verbs = verbs; + v1_non_resource_rule_local_var->_library_owned = 1; return v1_non_resource_rule_local_var; } +__attribute__((deprecated)) v1_non_resource_rule_t *v1_non_resource_rule_create( + list_t *non_resource_urls, + list_t *verbs + ) { + return v1_non_resource_rule_create_internal ( + non_resource_urls, + verbs + ); +} void v1_non_resource_rule_free(v1_non_resource_rule_t *v1_non_resource_rule) { if(NULL == v1_non_resource_rule){ return ; } + if(v1_non_resource_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_non_resource_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_non_resource_rule->non_resource_urls) { list_ForEach(listEntry, v1_non_resource_rule->non_resource_urls) { @@ -54,7 +68,7 @@ cJSON *v1_non_resource_rule_convertToJSON(v1_non_resource_rule_t *v1_non_resourc listEntry_t *non_resource_urlsListEntry; list_ForEach(non_resource_urlsListEntry, v1_non_resource_rule->non_resource_urls) { - if(cJSON_AddStringToObject(non_resource_urls, "", (char*)non_resource_urlsListEntry->data) == NULL) + if(cJSON_AddStringToObject(non_resource_urls, "", non_resource_urlsListEntry->data) == NULL) { goto fail; } @@ -73,7 +87,7 @@ cJSON *v1_non_resource_rule_convertToJSON(v1_non_resource_rule_t *v1_non_resourc listEntry_t *verbsListEntry; list_ForEach(verbsListEntry, v1_non_resource_rule->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) + if(cJSON_AddStringToObject(verbs, "", verbsListEntry->data) == NULL) { goto fail; } @@ -99,6 +113,9 @@ v1_non_resource_rule_t *v1_non_resource_rule_parseFromJSON(cJSON *v1_non_resourc // v1_non_resource_rule->non_resource_urls cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1_non_resource_ruleJSON, "nonResourceURLs"); + if (cJSON_IsNull(non_resource_urls)) { + non_resource_urls = NULL; + } if (non_resource_urls) { cJSON *non_resource_urls_local = NULL; if(!cJSON_IsArray(non_resource_urls)) { @@ -118,6 +135,9 @@ v1_non_resource_rule_t *v1_non_resource_rule_parseFromJSON(cJSON *v1_non_resourc // v1_non_resource_rule->verbs cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1_non_resource_ruleJSON, "verbs"); + if (cJSON_IsNull(verbs)) { + verbs = NULL; + } if (!verbs) { goto end; } @@ -139,7 +159,7 @@ v1_non_resource_rule_t *v1_non_resource_rule_parseFromJSON(cJSON *v1_non_resourc } - v1_non_resource_rule_local_var = v1_non_resource_rule_create ( + v1_non_resource_rule_local_var = v1_non_resource_rule_create_internal ( non_resource_urls ? non_resource_urlsList : NULL, verbsList ); diff --git a/kubernetes/model/v1_non_resource_rule.h b/kubernetes/model/v1_non_resource_rule.h index a230d108..0f6d779f 100644 --- a/kubernetes/model/v1_non_resource_rule.h +++ b/kubernetes/model/v1_non_resource_rule.h @@ -22,9 +22,10 @@ typedef struct v1_non_resource_rule_t { list_t *non_resource_urls; //primitive container list_t *verbs; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_non_resource_rule_t; -v1_non_resource_rule_t *v1_non_resource_rule_create( +__attribute__((deprecated)) v1_non_resource_rule_t *v1_non_resource_rule_create( list_t *non_resource_urls, list_t *verbs ); diff --git a/kubernetes/model/v1_object_field_selector.c b/kubernetes/model/v1_object_field_selector.c index 5396e76f..eca71b4b 100644 --- a/kubernetes/model/v1_object_field_selector.c +++ b/kubernetes/model/v1_object_field_selector.c @@ -5,7 +5,7 @@ -v1_object_field_selector_t *v1_object_field_selector_create( +static v1_object_field_selector_t *v1_object_field_selector_create_internal( char *api_version, char *field_path ) { @@ -16,14 +16,28 @@ v1_object_field_selector_t *v1_object_field_selector_create( v1_object_field_selector_local_var->api_version = api_version; v1_object_field_selector_local_var->field_path = field_path; + v1_object_field_selector_local_var->_library_owned = 1; return v1_object_field_selector_local_var; } +__attribute__((deprecated)) v1_object_field_selector_t *v1_object_field_selector_create( + char *api_version, + char *field_path + ) { + return v1_object_field_selector_create_internal ( + api_version, + field_path + ); +} void v1_object_field_selector_free(v1_object_field_selector_t *v1_object_field_selector) { if(NULL == v1_object_field_selector){ return ; } + if(v1_object_field_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_object_field_selector_free"); + return ; + } listEntry_t *listEntry; if (v1_object_field_selector->api_version) { free(v1_object_field_selector->api_version); @@ -69,6 +83,9 @@ v1_object_field_selector_t *v1_object_field_selector_parseFromJSON(cJSON *v1_obj // v1_object_field_selector->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_object_field_selectorJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -78,6 +95,9 @@ v1_object_field_selector_t *v1_object_field_selector_parseFromJSON(cJSON *v1_obj // v1_object_field_selector->field_path cJSON *field_path = cJSON_GetObjectItemCaseSensitive(v1_object_field_selectorJSON, "fieldPath"); + if (cJSON_IsNull(field_path)) { + field_path = NULL; + } if (!field_path) { goto end; } @@ -89,7 +109,7 @@ v1_object_field_selector_t *v1_object_field_selector_parseFromJSON(cJSON *v1_obj } - v1_object_field_selector_local_var = v1_object_field_selector_create ( + v1_object_field_selector_local_var = v1_object_field_selector_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, strdup(field_path->valuestring) ); diff --git a/kubernetes/model/v1_object_field_selector.h b/kubernetes/model/v1_object_field_selector.h index 1b582311..9a0dd6aa 100644 --- a/kubernetes/model/v1_object_field_selector.h +++ b/kubernetes/model/v1_object_field_selector.h @@ -22,9 +22,10 @@ typedef struct v1_object_field_selector_t { char *api_version; // string char *field_path; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_object_field_selector_t; -v1_object_field_selector_t *v1_object_field_selector_create( +__attribute__((deprecated)) v1_object_field_selector_t *v1_object_field_selector_create( char *api_version, char *field_path ); diff --git a/kubernetes/model/v1_object_meta.c b/kubernetes/model/v1_object_meta.c index dd05b011..0c29f5a1 100644 --- a/kubernetes/model/v1_object_meta.c +++ b/kubernetes/model/v1_object_meta.c @@ -5,7 +5,7 @@ -v1_object_meta_t *v1_object_meta_create( +static v1_object_meta_t *v1_object_meta_create_internal( list_t* annotations, char *creation_timestamp, long deletion_grace_period_seconds, @@ -42,18 +42,58 @@ v1_object_meta_t *v1_object_meta_create( v1_object_meta_local_var->self_link = self_link; v1_object_meta_local_var->uid = uid; + v1_object_meta_local_var->_library_owned = 1; return v1_object_meta_local_var; } +__attribute__((deprecated)) v1_object_meta_t *v1_object_meta_create( + list_t* annotations, + char *creation_timestamp, + long deletion_grace_period_seconds, + char *deletion_timestamp, + list_t *finalizers, + char *generate_name, + long generation, + list_t* labels, + list_t *managed_fields, + char *name, + char *_namespace, + list_t *owner_references, + char *resource_version, + char *self_link, + char *uid + ) { + return v1_object_meta_create_internal ( + annotations, + creation_timestamp, + deletion_grace_period_seconds, + deletion_timestamp, + finalizers, + generate_name, + generation, + labels, + managed_fields, + name, + _namespace, + owner_references, + resource_version, + self_link, + uid + ); +} void v1_object_meta_free(v1_object_meta_t *v1_object_meta) { if(NULL == v1_object_meta){ return ; } + if(v1_object_meta->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_object_meta_free"); + return ; + } listEntry_t *listEntry; if (v1_object_meta->annotations) { list_ForEach(listEntry, v1_object_meta->annotations) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -82,7 +122,7 @@ void v1_object_meta_free(v1_object_meta_t *v1_object_meta) { } if (v1_object_meta->labels) { list_ForEach(listEntry, v1_object_meta->labels) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -140,8 +180,8 @@ cJSON *v1_object_meta_convertToJSON(v1_object_meta_t *v1_object_meta) { listEntry_t *annotationsListEntry; if (v1_object_meta->annotations) { list_ForEach(annotationsListEntry, v1_object_meta->annotations) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)annotationsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = annotationsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -183,7 +223,7 @@ cJSON *v1_object_meta_convertToJSON(v1_object_meta_t *v1_object_meta) { listEntry_t *finalizersListEntry; list_ForEach(finalizersListEntry, v1_object_meta->finalizers) { - if(cJSON_AddStringToObject(finalizers, "", (char*)finalizersListEntry->data) == NULL) + if(cJSON_AddStringToObject(finalizers, "", finalizersListEntry->data) == NULL) { goto fail; } @@ -217,8 +257,8 @@ cJSON *v1_object_meta_convertToJSON(v1_object_meta_t *v1_object_meta) { listEntry_t *labelsListEntry; if (v1_object_meta->labels) { list_ForEach(labelsListEntry, v1_object_meta->labels) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)labelsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = labelsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -335,6 +375,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->annotations cJSON *annotations = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "annotations"); + if (cJSON_IsNull(annotations)) { + annotations = NULL; + } if (annotations) { cJSON *annotations_local_map = NULL; if(!cJSON_IsObject(annotations) && !cJSON_IsNull(annotations)) @@ -360,6 +403,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->creation_timestamp cJSON *creation_timestamp = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "creationTimestamp"); + if (cJSON_IsNull(creation_timestamp)) { + creation_timestamp = NULL; + } if (creation_timestamp) { if(!cJSON_IsString(creation_timestamp) && !cJSON_IsNull(creation_timestamp)) { @@ -369,6 +415,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->deletion_grace_period_seconds cJSON *deletion_grace_period_seconds = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "deletionGracePeriodSeconds"); + if (cJSON_IsNull(deletion_grace_period_seconds)) { + deletion_grace_period_seconds = NULL; + } if (deletion_grace_period_seconds) { if(!cJSON_IsNumber(deletion_grace_period_seconds)) { @@ -378,6 +427,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->deletion_timestamp cJSON *deletion_timestamp = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "deletionTimestamp"); + if (cJSON_IsNull(deletion_timestamp)) { + deletion_timestamp = NULL; + } if (deletion_timestamp) { if(!cJSON_IsString(deletion_timestamp) && !cJSON_IsNull(deletion_timestamp)) { @@ -387,6 +439,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->finalizers cJSON *finalizers = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "finalizers"); + if (cJSON_IsNull(finalizers)) { + finalizers = NULL; + } if (finalizers) { cJSON *finalizers_local = NULL; if(!cJSON_IsArray(finalizers)) { @@ -406,6 +461,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->generate_name cJSON *generate_name = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "generateName"); + if (cJSON_IsNull(generate_name)) { + generate_name = NULL; + } if (generate_name) { if(!cJSON_IsString(generate_name) && !cJSON_IsNull(generate_name)) { @@ -415,6 +473,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->generation cJSON *generation = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "generation"); + if (cJSON_IsNull(generation)) { + generation = NULL; + } if (generation) { if(!cJSON_IsNumber(generation)) { @@ -424,6 +485,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->labels cJSON *labels = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "labels"); + if (cJSON_IsNull(labels)) { + labels = NULL; + } if (labels) { cJSON *labels_local_map = NULL; if(!cJSON_IsObject(labels) && !cJSON_IsNull(labels)) @@ -449,6 +513,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->managed_fields cJSON *managed_fields = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "managedFields"); + if (cJSON_IsNull(managed_fields)) { + managed_fields = NULL; + } if (managed_fields) { cJSON *managed_fields_local_nonprimitive = NULL; if(!cJSON_IsArray(managed_fields)){ @@ -470,6 +537,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -479,6 +549,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -488,6 +561,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->owner_references cJSON *owner_references = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "ownerReferences"); + if (cJSON_IsNull(owner_references)) { + owner_references = NULL; + } if (owner_references) { cJSON *owner_references_local_nonprimitive = NULL; if(!cJSON_IsArray(owner_references)){ @@ -509,6 +585,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->resource_version cJSON *resource_version = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "resourceVersion"); + if (cJSON_IsNull(resource_version)) { + resource_version = NULL; + } if (resource_version) { if(!cJSON_IsString(resource_version) && !cJSON_IsNull(resource_version)) { @@ -518,6 +597,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->self_link cJSON *self_link = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "selfLink"); + if (cJSON_IsNull(self_link)) { + self_link = NULL; + } if (self_link) { if(!cJSON_IsString(self_link) && !cJSON_IsNull(self_link)) { @@ -527,6 +609,9 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -535,7 +620,7 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ } - v1_object_meta_local_var = v1_object_meta_create ( + v1_object_meta_local_var = v1_object_meta_create_internal ( annotations ? annotationsList : NULL, creation_timestamp && !cJSON_IsNull(creation_timestamp) ? strdup(creation_timestamp->valuestring) : NULL, deletion_grace_period_seconds ? deletion_grace_period_seconds->valuedouble : 0, @@ -558,7 +643,7 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ if (annotationsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, annotationsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -581,7 +666,7 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ if (labelsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, labelsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_object_meta.h b/kubernetes/model/v1_object_meta.h index b085f66c..493fb8d4 100644 --- a/kubernetes/model/v1_object_meta.h +++ b/kubernetes/model/v1_object_meta.h @@ -37,9 +37,10 @@ typedef struct v1_object_meta_t { char *self_link; // string char *uid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_object_meta_t; -v1_object_meta_t *v1_object_meta_create( +__attribute__((deprecated)) v1_object_meta_t *v1_object_meta_create( list_t* annotations, char *creation_timestamp, long deletion_grace_period_seconds, diff --git a/kubernetes/model/v1_object_reference.c b/kubernetes/model/v1_object_reference.c index 71e30bd9..ffb08ff9 100644 --- a/kubernetes/model/v1_object_reference.c +++ b/kubernetes/model/v1_object_reference.c @@ -5,7 +5,7 @@ -v1_object_reference_t *v1_object_reference_create( +static v1_object_reference_t *v1_object_reference_create_internal( char *api_version, char *field_path, char *kind, @@ -26,14 +26,38 @@ v1_object_reference_t *v1_object_reference_create( v1_object_reference_local_var->resource_version = resource_version; v1_object_reference_local_var->uid = uid; + v1_object_reference_local_var->_library_owned = 1; return v1_object_reference_local_var; } +__attribute__((deprecated)) v1_object_reference_t *v1_object_reference_create( + char *api_version, + char *field_path, + char *kind, + char *name, + char *_namespace, + char *resource_version, + char *uid + ) { + return v1_object_reference_create_internal ( + api_version, + field_path, + kind, + name, + _namespace, + resource_version, + uid + ); +} void v1_object_reference_free(v1_object_reference_t *v1_object_reference) { if(NULL == v1_object_reference){ return ; } + if(v1_object_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_object_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_object_reference->api_version) { free(v1_object_reference->api_version); @@ -138,6 +162,9 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere // v1_object_reference->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_object_referenceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -147,6 +174,9 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere // v1_object_reference->field_path cJSON *field_path = cJSON_GetObjectItemCaseSensitive(v1_object_referenceJSON, "fieldPath"); + if (cJSON_IsNull(field_path)) { + field_path = NULL; + } if (field_path) { if(!cJSON_IsString(field_path) && !cJSON_IsNull(field_path)) { @@ -156,6 +186,9 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere // v1_object_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_object_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,6 +198,9 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere // v1_object_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_object_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -174,6 +210,9 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere // v1_object_reference->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_object_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -183,6 +222,9 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere // v1_object_reference->resource_version cJSON *resource_version = cJSON_GetObjectItemCaseSensitive(v1_object_referenceJSON, "resourceVersion"); + if (cJSON_IsNull(resource_version)) { + resource_version = NULL; + } if (resource_version) { if(!cJSON_IsString(resource_version) && !cJSON_IsNull(resource_version)) { @@ -192,6 +234,9 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere // v1_object_reference->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_object_referenceJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -200,7 +245,7 @@ v1_object_reference_t *v1_object_reference_parseFromJSON(cJSON *v1_object_refere } - v1_object_reference_local_var = v1_object_reference_create ( + v1_object_reference_local_var = v1_object_reference_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, field_path && !cJSON_IsNull(field_path) ? strdup(field_path->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_object_reference.h b/kubernetes/model/v1_object_reference.h index f0f54d95..0d531800 100644 --- a/kubernetes/model/v1_object_reference.h +++ b/kubernetes/model/v1_object_reference.h @@ -27,9 +27,10 @@ typedef struct v1_object_reference_t { char *resource_version; // string char *uid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_object_reference_t; -v1_object_reference_t *v1_object_reference_create( +__attribute__((deprecated)) v1_object_reference_t *v1_object_reference_create( char *api_version, char *field_path, char *kind, diff --git a/kubernetes/model/v1_opaque_device_configuration.c b/kubernetes/model/v1_opaque_device_configuration.c new file mode 100644 index 00000000..cf70708c --- /dev/null +++ b/kubernetes/model/v1_opaque_device_configuration.c @@ -0,0 +1,128 @@ +#include +#include +#include +#include "v1_opaque_device_configuration.h" + + + +static v1_opaque_device_configuration_t *v1_opaque_device_configuration_create_internal( + char *driver, + object_t *parameters + ) { + v1_opaque_device_configuration_t *v1_opaque_device_configuration_local_var = malloc(sizeof(v1_opaque_device_configuration_t)); + if (!v1_opaque_device_configuration_local_var) { + return NULL; + } + v1_opaque_device_configuration_local_var->driver = driver; + v1_opaque_device_configuration_local_var->parameters = parameters; + + v1_opaque_device_configuration_local_var->_library_owned = 1; + return v1_opaque_device_configuration_local_var; +} + +__attribute__((deprecated)) v1_opaque_device_configuration_t *v1_opaque_device_configuration_create( + char *driver, + object_t *parameters + ) { + return v1_opaque_device_configuration_create_internal ( + driver, + parameters + ); +} + +void v1_opaque_device_configuration_free(v1_opaque_device_configuration_t *v1_opaque_device_configuration) { + if(NULL == v1_opaque_device_configuration){ + return ; + } + if(v1_opaque_device_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_opaque_device_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1_opaque_device_configuration->driver) { + free(v1_opaque_device_configuration->driver); + v1_opaque_device_configuration->driver = NULL; + } + if (v1_opaque_device_configuration->parameters) { + object_free(v1_opaque_device_configuration->parameters); + v1_opaque_device_configuration->parameters = NULL; + } + free(v1_opaque_device_configuration); +} + +cJSON *v1_opaque_device_configuration_convertToJSON(v1_opaque_device_configuration_t *v1_opaque_device_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1_opaque_device_configuration->driver + if (!v1_opaque_device_configuration->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1_opaque_device_configuration->driver) == NULL) { + goto fail; //String + } + + + // v1_opaque_device_configuration->parameters + if (!v1_opaque_device_configuration->parameters) { + goto fail; + } + cJSON *parameters_object = object_convertToJSON(v1_opaque_device_configuration->parameters); + if(parameters_object == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "parameters", parameters_object); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_opaque_device_configuration_t *v1_opaque_device_configuration_parseFromJSON(cJSON *v1_opaque_device_configurationJSON){ + + v1_opaque_device_configuration_t *v1_opaque_device_configuration_local_var = NULL; + + // v1_opaque_device_configuration->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_opaque_device_configurationJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1_opaque_device_configuration->parameters + cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1_opaque_device_configurationJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } + if (!parameters) { + goto end; + } + + object_t *parameters_local_object = NULL; + + parameters_local_object = object_parseFromJSON(parameters); //object + + + v1_opaque_device_configuration_local_var = v1_opaque_device_configuration_create_internal ( + strdup(driver->valuestring), + parameters_local_object + ); + + return v1_opaque_device_configuration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_opaque_device_configuration.h b/kubernetes/model/v1_opaque_device_configuration.h new file mode 100644 index 00000000..888b56d8 --- /dev/null +++ b/kubernetes/model/v1_opaque_device_configuration.h @@ -0,0 +1,41 @@ +/* + * v1_opaque_device_configuration.h + * + * OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor. + */ + +#ifndef _v1_opaque_device_configuration_H_ +#define _v1_opaque_device_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_opaque_device_configuration_t v1_opaque_device_configuration_t; + +#include "object.h" + + + +typedef struct v1_opaque_device_configuration_t { + char *driver; // string + object_t *parameters; //object + + int _library_owned; // Is the library responsible for freeing this object? +} v1_opaque_device_configuration_t; + +__attribute__((deprecated)) v1_opaque_device_configuration_t *v1_opaque_device_configuration_create( + char *driver, + object_t *parameters +); + +void v1_opaque_device_configuration_free(v1_opaque_device_configuration_t *v1_opaque_device_configuration); + +v1_opaque_device_configuration_t *v1_opaque_device_configuration_parseFromJSON(cJSON *v1_opaque_device_configurationJSON); + +cJSON *v1_opaque_device_configuration_convertToJSON(v1_opaque_device_configuration_t *v1_opaque_device_configuration); + +#endif /* _v1_opaque_device_configuration_H_ */ + diff --git a/kubernetes/model/v1_overhead.c b/kubernetes/model/v1_overhead.c index 66e189f5..cfdb6ae5 100644 --- a/kubernetes/model/v1_overhead.c +++ b/kubernetes/model/v1_overhead.c @@ -5,7 +5,7 @@ -v1_overhead_t *v1_overhead_create( +static v1_overhead_t *v1_overhead_create_internal( list_t* pod_fixed ) { v1_overhead_t *v1_overhead_local_var = malloc(sizeof(v1_overhead_t)); @@ -14,18 +14,30 @@ v1_overhead_t *v1_overhead_create( } v1_overhead_local_var->pod_fixed = pod_fixed; + v1_overhead_local_var->_library_owned = 1; return v1_overhead_local_var; } +__attribute__((deprecated)) v1_overhead_t *v1_overhead_create( + list_t* pod_fixed + ) { + return v1_overhead_create_internal ( + pod_fixed + ); +} void v1_overhead_free(v1_overhead_t *v1_overhead) { if(NULL == v1_overhead){ return ; } + if(v1_overhead->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_overhead_free"); + return ; + } listEntry_t *listEntry; if (v1_overhead->pod_fixed) { list_ForEach(listEntry, v1_overhead->pod_fixed) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -49,8 +61,8 @@ cJSON *v1_overhead_convertToJSON(v1_overhead_t *v1_overhead) { listEntry_t *pod_fixedListEntry; if (v1_overhead->pod_fixed) { list_ForEach(pod_fixedListEntry, v1_overhead->pod_fixed) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)pod_fixedListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = pod_fixedListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -75,6 +87,9 @@ v1_overhead_t *v1_overhead_parseFromJSON(cJSON *v1_overheadJSON){ // v1_overhead->pod_fixed cJSON *pod_fixed = cJSON_GetObjectItemCaseSensitive(v1_overheadJSON, "podFixed"); + if (cJSON_IsNull(pod_fixed)) { + pod_fixed = NULL; + } if (pod_fixed) { cJSON *pod_fixed_local_map = NULL; if(!cJSON_IsObject(pod_fixed) && !cJSON_IsNull(pod_fixed)) @@ -99,7 +114,7 @@ v1_overhead_t *v1_overhead_parseFromJSON(cJSON *v1_overheadJSON){ } - v1_overhead_local_var = v1_overhead_create ( + v1_overhead_local_var = v1_overhead_create_internal ( pod_fixed ? pod_fixedList : NULL ); @@ -108,7 +123,7 @@ v1_overhead_t *v1_overhead_parseFromJSON(cJSON *v1_overheadJSON){ if (pod_fixedList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, pod_fixedList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_overhead.h b/kubernetes/model/v1_overhead.h index 4ae758de..660f0ec3 100644 --- a/kubernetes/model/v1_overhead.h +++ b/kubernetes/model/v1_overhead.h @@ -21,9 +21,10 @@ typedef struct v1_overhead_t v1_overhead_t; typedef struct v1_overhead_t { list_t* pod_fixed; //map + int _library_owned; // Is the library responsible for freeing this object? } v1_overhead_t; -v1_overhead_t *v1_overhead_create( +__attribute__((deprecated)) v1_overhead_t *v1_overhead_create( list_t* pod_fixed ); diff --git a/kubernetes/model/v1_owner_reference.c b/kubernetes/model/v1_owner_reference.c index 4afb26f9..cef78dd6 100644 --- a/kubernetes/model/v1_owner_reference.c +++ b/kubernetes/model/v1_owner_reference.c @@ -5,7 +5,7 @@ -v1_owner_reference_t *v1_owner_reference_create( +static v1_owner_reference_t *v1_owner_reference_create_internal( char *api_version, int block_owner_deletion, int controller, @@ -24,14 +24,36 @@ v1_owner_reference_t *v1_owner_reference_create( v1_owner_reference_local_var->name = name; v1_owner_reference_local_var->uid = uid; + v1_owner_reference_local_var->_library_owned = 1; return v1_owner_reference_local_var; } +__attribute__((deprecated)) v1_owner_reference_t *v1_owner_reference_create( + char *api_version, + int block_owner_deletion, + int controller, + char *kind, + char *name, + char *uid + ) { + return v1_owner_reference_create_internal ( + api_version, + block_owner_deletion, + controller, + kind, + name, + uid + ); +} void v1_owner_reference_free(v1_owner_reference_t *v1_owner_reference) { if(NULL == v1_owner_reference){ return ; } + if(v1_owner_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_owner_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_owner_reference->api_version) { free(v1_owner_reference->api_version); @@ -120,6 +142,9 @@ v1_owner_reference_t *v1_owner_reference_parseFromJSON(cJSON *v1_owner_reference // v1_owner_reference->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_owner_referenceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (!api_version) { goto end; } @@ -132,6 +157,9 @@ v1_owner_reference_t *v1_owner_reference_parseFromJSON(cJSON *v1_owner_reference // v1_owner_reference->block_owner_deletion cJSON *block_owner_deletion = cJSON_GetObjectItemCaseSensitive(v1_owner_referenceJSON, "blockOwnerDeletion"); + if (cJSON_IsNull(block_owner_deletion)) { + block_owner_deletion = NULL; + } if (block_owner_deletion) { if(!cJSON_IsBool(block_owner_deletion)) { @@ -141,6 +169,9 @@ v1_owner_reference_t *v1_owner_reference_parseFromJSON(cJSON *v1_owner_reference // v1_owner_reference->controller cJSON *controller = cJSON_GetObjectItemCaseSensitive(v1_owner_referenceJSON, "controller"); + if (cJSON_IsNull(controller)) { + controller = NULL; + } if (controller) { if(!cJSON_IsBool(controller)) { @@ -150,6 +181,9 @@ v1_owner_reference_t *v1_owner_reference_parseFromJSON(cJSON *v1_owner_reference // v1_owner_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_owner_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -162,6 +196,9 @@ v1_owner_reference_t *v1_owner_reference_parseFromJSON(cJSON *v1_owner_reference // v1_owner_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_owner_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -174,6 +211,9 @@ v1_owner_reference_t *v1_owner_reference_parseFromJSON(cJSON *v1_owner_reference // v1_owner_reference->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_owner_referenceJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (!uid) { goto end; } @@ -185,7 +225,7 @@ v1_owner_reference_t *v1_owner_reference_parseFromJSON(cJSON *v1_owner_reference } - v1_owner_reference_local_var = v1_owner_reference_create ( + v1_owner_reference_local_var = v1_owner_reference_create_internal ( strdup(api_version->valuestring), block_owner_deletion ? block_owner_deletion->valueint : 0, controller ? controller->valueint : 0, diff --git a/kubernetes/model/v1_owner_reference.h b/kubernetes/model/v1_owner_reference.h index 73e64a38..0af81f3b 100644 --- a/kubernetes/model/v1_owner_reference.h +++ b/kubernetes/model/v1_owner_reference.h @@ -26,9 +26,10 @@ typedef struct v1_owner_reference_t { char *name; // string char *uid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_owner_reference_t; -v1_owner_reference_t *v1_owner_reference_create( +__attribute__((deprecated)) v1_owner_reference_t *v1_owner_reference_create( char *api_version, int block_owner_deletion, int controller, diff --git a/kubernetes/model/v1_param_kind.c b/kubernetes/model/v1_param_kind.c index ae8adc9c..56842e57 100644 --- a/kubernetes/model/v1_param_kind.c +++ b/kubernetes/model/v1_param_kind.c @@ -5,7 +5,7 @@ -v1_param_kind_t *v1_param_kind_create( +static v1_param_kind_t *v1_param_kind_create_internal( char *api_version, char *kind ) { @@ -16,14 +16,28 @@ v1_param_kind_t *v1_param_kind_create( v1_param_kind_local_var->api_version = api_version; v1_param_kind_local_var->kind = kind; + v1_param_kind_local_var->_library_owned = 1; return v1_param_kind_local_var; } +__attribute__((deprecated)) v1_param_kind_t *v1_param_kind_create( + char *api_version, + char *kind + ) { + return v1_param_kind_create_internal ( + api_version, + kind + ); +} void v1_param_kind_free(v1_param_kind_t *v1_param_kind) { if(NULL == v1_param_kind){ return ; } + if(v1_param_kind->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_param_kind_free"); + return ; + } listEntry_t *listEntry; if (v1_param_kind->api_version) { free(v1_param_kind->api_version); @@ -68,6 +82,9 @@ v1_param_kind_t *v1_param_kind_parseFromJSON(cJSON *v1_param_kindJSON){ // v1_param_kind->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_param_kindJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -77,6 +94,9 @@ v1_param_kind_t *v1_param_kind_parseFromJSON(cJSON *v1_param_kindJSON){ // v1_param_kind->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_param_kindJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -85,7 +105,7 @@ v1_param_kind_t *v1_param_kind_parseFromJSON(cJSON *v1_param_kindJSON){ } - v1_param_kind_local_var = v1_param_kind_create ( + v1_param_kind_local_var = v1_param_kind_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL ); diff --git a/kubernetes/model/v1_param_kind.h b/kubernetes/model/v1_param_kind.h index 5d96afd7..942d7382 100644 --- a/kubernetes/model/v1_param_kind.h +++ b/kubernetes/model/v1_param_kind.h @@ -22,9 +22,10 @@ typedef struct v1_param_kind_t { char *api_version; // string char *kind; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_param_kind_t; -v1_param_kind_t *v1_param_kind_create( +__attribute__((deprecated)) v1_param_kind_t *v1_param_kind_create( char *api_version, char *kind ); diff --git a/kubernetes/model/v1_param_ref.c b/kubernetes/model/v1_param_ref.c index 01b45f33..13118191 100644 --- a/kubernetes/model/v1_param_ref.c +++ b/kubernetes/model/v1_param_ref.c @@ -5,7 +5,7 @@ -v1_param_ref_t *v1_param_ref_create( +static v1_param_ref_t *v1_param_ref_create_internal( char *name, char *_namespace, char *parameter_not_found_action, @@ -20,14 +20,32 @@ v1_param_ref_t *v1_param_ref_create( v1_param_ref_local_var->parameter_not_found_action = parameter_not_found_action; v1_param_ref_local_var->selector = selector; + v1_param_ref_local_var->_library_owned = 1; return v1_param_ref_local_var; } +__attribute__((deprecated)) v1_param_ref_t *v1_param_ref_create( + char *name, + char *_namespace, + char *parameter_not_found_action, + v1_label_selector_t *selector + ) { + return v1_param_ref_create_internal ( + name, + _namespace, + parameter_not_found_action, + selector + ); +} void v1_param_ref_free(v1_param_ref_t *v1_param_ref) { if(NULL == v1_param_ref){ return ; } + if(v1_param_ref->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_param_ref_free"); + return ; + } listEntry_t *listEntry; if (v1_param_ref->name) { free(v1_param_ref->name); @@ -104,6 +122,9 @@ v1_param_ref_t *v1_param_ref_parseFromJSON(cJSON *v1_param_refJSON){ // v1_param_ref->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_param_refJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -113,6 +134,9 @@ v1_param_ref_t *v1_param_ref_parseFromJSON(cJSON *v1_param_refJSON){ // v1_param_ref->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_param_refJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -122,6 +146,9 @@ v1_param_ref_t *v1_param_ref_parseFromJSON(cJSON *v1_param_refJSON){ // v1_param_ref->parameter_not_found_action cJSON *parameter_not_found_action = cJSON_GetObjectItemCaseSensitive(v1_param_refJSON, "parameterNotFoundAction"); + if (cJSON_IsNull(parameter_not_found_action)) { + parameter_not_found_action = NULL; + } if (parameter_not_found_action) { if(!cJSON_IsString(parameter_not_found_action) && !cJSON_IsNull(parameter_not_found_action)) { @@ -131,12 +158,15 @@ v1_param_ref_t *v1_param_ref_parseFromJSON(cJSON *v1_param_refJSON){ // v1_param_ref->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_param_refJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { selector_local_nonprim = v1_label_selector_parseFromJSON(selector); //nonprimitive } - v1_param_ref_local_var = v1_param_ref_create ( + v1_param_ref_local_var = v1_param_ref_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, parameter_not_found_action && !cJSON_IsNull(parameter_not_found_action) ? strdup(parameter_not_found_action->valuestring) : NULL, diff --git a/kubernetes/model/v1_param_ref.h b/kubernetes/model/v1_param_ref.h index 211669c0..5414bb64 100644 --- a/kubernetes/model/v1_param_ref.h +++ b/kubernetes/model/v1_param_ref.h @@ -25,9 +25,10 @@ typedef struct v1_param_ref_t { char *parameter_not_found_action; // string struct v1_label_selector_t *selector; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_param_ref_t; -v1_param_ref_t *v1_param_ref_create( +__attribute__((deprecated)) v1_param_ref_t *v1_param_ref_create( char *name, char *_namespace, char *parameter_not_found_action, diff --git a/kubernetes/model/v1_parent_reference.c b/kubernetes/model/v1_parent_reference.c new file mode 100644 index 00000000..c2269ed9 --- /dev/null +++ b/kubernetes/model/v1_parent_reference.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include "v1_parent_reference.h" + + + +static v1_parent_reference_t *v1_parent_reference_create_internal( + char *group, + char *name, + char *_namespace, + char *resource + ) { + v1_parent_reference_t *v1_parent_reference_local_var = malloc(sizeof(v1_parent_reference_t)); + if (!v1_parent_reference_local_var) { + return NULL; + } + v1_parent_reference_local_var->group = group; + v1_parent_reference_local_var->name = name; + v1_parent_reference_local_var->_namespace = _namespace; + v1_parent_reference_local_var->resource = resource; + + v1_parent_reference_local_var->_library_owned = 1; + return v1_parent_reference_local_var; +} + +__attribute__((deprecated)) v1_parent_reference_t *v1_parent_reference_create( + char *group, + char *name, + char *_namespace, + char *resource + ) { + return v1_parent_reference_create_internal ( + group, + name, + _namespace, + resource + ); +} + +void v1_parent_reference_free(v1_parent_reference_t *v1_parent_reference) { + if(NULL == v1_parent_reference){ + return ; + } + if(v1_parent_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_parent_reference_free"); + return ; + } + listEntry_t *listEntry; + if (v1_parent_reference->group) { + free(v1_parent_reference->group); + v1_parent_reference->group = NULL; + } + if (v1_parent_reference->name) { + free(v1_parent_reference->name); + v1_parent_reference->name = NULL; + } + if (v1_parent_reference->_namespace) { + free(v1_parent_reference->_namespace); + v1_parent_reference->_namespace = NULL; + } + if (v1_parent_reference->resource) { + free(v1_parent_reference->resource); + v1_parent_reference->resource = NULL; + } + free(v1_parent_reference); +} + +cJSON *v1_parent_reference_convertToJSON(v1_parent_reference_t *v1_parent_reference) { + cJSON *item = cJSON_CreateObject(); + + // v1_parent_reference->group + if(v1_parent_reference->group) { + if(cJSON_AddStringToObject(item, "group", v1_parent_reference->group) == NULL) { + goto fail; //String + } + } + + + // v1_parent_reference->name + if (!v1_parent_reference->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_parent_reference->name) == NULL) { + goto fail; //String + } + + + // v1_parent_reference->_namespace + if(v1_parent_reference->_namespace) { + if(cJSON_AddStringToObject(item, "namespace", v1_parent_reference->_namespace) == NULL) { + goto fail; //String + } + } + + + // v1_parent_reference->resource + if (!v1_parent_reference->resource) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resource", v1_parent_reference->resource) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_parent_reference_t *v1_parent_reference_parseFromJSON(cJSON *v1_parent_referenceJSON){ + + v1_parent_reference_t *v1_parent_reference_local_var = NULL; + + // v1_parent_reference->group + cJSON *group = cJSON_GetObjectItemCaseSensitive(v1_parent_referenceJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } + if (group) { + if(!cJSON_IsString(group) && !cJSON_IsNull(group)) + { + goto end; //String + } + } + + // v1_parent_reference->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_parent_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1_parent_reference->_namespace + cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_parent_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } + if (_namespace) { + if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) + { + goto end; //String + } + } + + // v1_parent_reference->resource + cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1_parent_referenceJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } + if (!resource) { + goto end; + } + + + if(!cJSON_IsString(resource)) + { + goto end; //String + } + + + v1_parent_reference_local_var = v1_parent_reference_create_internal ( + group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, + strdup(name->valuestring), + _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, + strdup(resource->valuestring) + ); + + return v1_parent_reference_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_parent_reference.h b/kubernetes/model/v1_parent_reference.h new file mode 100644 index 00000000..02fd95b8 --- /dev/null +++ b/kubernetes/model/v1_parent_reference.h @@ -0,0 +1,44 @@ +/* + * v1_parent_reference.h + * + * ParentReference describes a reference to a parent object. + */ + +#ifndef _v1_parent_reference_H_ +#define _v1_parent_reference_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_parent_reference_t v1_parent_reference_t; + + + + +typedef struct v1_parent_reference_t { + char *group; // string + char *name; // string + char *_namespace; // string + char *resource; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_parent_reference_t; + +__attribute__((deprecated)) v1_parent_reference_t *v1_parent_reference_create( + char *group, + char *name, + char *_namespace, + char *resource +); + +void v1_parent_reference_free(v1_parent_reference_t *v1_parent_reference); + +v1_parent_reference_t *v1_parent_reference_parseFromJSON(cJSON *v1_parent_referenceJSON); + +cJSON *v1_parent_reference_convertToJSON(v1_parent_reference_t *v1_parent_reference); + +#endif /* _v1_parent_reference_H_ */ + diff --git a/kubernetes/model/v1_persistent_volume.c b/kubernetes/model/v1_persistent_volume.c index b23eb890..699d94ff 100644 --- a/kubernetes/model/v1_persistent_volume.c +++ b/kubernetes/model/v1_persistent_volume.c @@ -5,7 +5,7 @@ -v1_persistent_volume_t *v1_persistent_volume_create( +static v1_persistent_volume_t *v1_persistent_volume_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_persistent_volume_t *v1_persistent_volume_create( v1_persistent_volume_local_var->spec = spec; v1_persistent_volume_local_var->status = status; + v1_persistent_volume_local_var->_library_owned = 1; return v1_persistent_volume_local_var; } +__attribute__((deprecated)) v1_persistent_volume_t *v1_persistent_volume_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_persistent_volume_spec_t *spec, + v1_persistent_volume_status_t *status + ) { + return v1_persistent_volume_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_persistent_volume_free(v1_persistent_volume_t *v1_persistent_volume) { if(NULL == v1_persistent_volume){ return ; } + if(v1_persistent_volume->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume->api_version) { free(v1_persistent_volume->api_version); @@ -134,6 +154,9 @@ v1_persistent_volume_t *v1_persistent_volume_parseFromJSON(cJSON *v1_persistent_ // v1_persistent_volume->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_persistent_volumeJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_persistent_volume_t *v1_persistent_volume_parseFromJSON(cJSON *v1_persistent_ // v1_persistent_volume->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_persistent_volumeJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_persistent_volume_t *v1_persistent_volume_parseFromJSON(cJSON *v1_persistent_ // v1_persistent_volume->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_persistent_volumeJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_persistent_volume->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_persistent_volumeJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_persistent_volume_spec_parseFromJSON(spec); //nonprimitive } // v1_persistent_volume->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_persistent_volumeJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_persistent_volume_status_parseFromJSON(status); //nonprimitive } - v1_persistent_volume_local_var = v1_persistent_volume_create ( + v1_persistent_volume_local_var = v1_persistent_volume_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_persistent_volume.h b/kubernetes/model/v1_persistent_volume.h index d24a8325..ee1f434b 100644 --- a/kubernetes/model/v1_persistent_volume.h +++ b/kubernetes/model/v1_persistent_volume.h @@ -28,9 +28,10 @@ typedef struct v1_persistent_volume_t { struct v1_persistent_volume_spec_t *spec; //model struct v1_persistent_volume_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_t; -v1_persistent_volume_t *v1_persistent_volume_create( +__attribute__((deprecated)) v1_persistent_volume_t *v1_persistent_volume_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_persistent_volume_claim.c b/kubernetes/model/v1_persistent_volume_claim.c index 835d5ad3..f863b5c4 100644 --- a/kubernetes/model/v1_persistent_volume_claim.c +++ b/kubernetes/model/v1_persistent_volume_claim.c @@ -5,7 +5,7 @@ -v1_persistent_volume_claim_t *v1_persistent_volume_claim_create( +static v1_persistent_volume_claim_t *v1_persistent_volume_claim_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_persistent_volume_claim_t *v1_persistent_volume_claim_create( v1_persistent_volume_claim_local_var->spec = spec; v1_persistent_volume_claim_local_var->status = status; + v1_persistent_volume_claim_local_var->_library_owned = 1; return v1_persistent_volume_claim_local_var; } +__attribute__((deprecated)) v1_persistent_volume_claim_t *v1_persistent_volume_claim_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_persistent_volume_claim_spec_t *spec, + v1_persistent_volume_claim_status_t *status + ) { + return v1_persistent_volume_claim_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_persistent_volume_claim_free(v1_persistent_volume_claim_t *v1_persistent_volume_claim) { if(NULL == v1_persistent_volume_claim){ return ; } + if(v1_persistent_volume_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_claim_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_claim->api_version) { free(v1_persistent_volume_claim->api_version); @@ -134,6 +154,9 @@ v1_persistent_volume_claim_t *v1_persistent_volume_claim_parseFromJSON(cJSON *v1 // v1_persistent_volume_claim->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claimJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_persistent_volume_claim_t *v1_persistent_volume_claim_parseFromJSON(cJSON *v1 // v1_persistent_volume_claim->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claimJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_persistent_volume_claim_t *v1_persistent_volume_claim_parseFromJSON(cJSON *v1 // v1_persistent_volume_claim->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claimJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_persistent_volume_claim->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claimJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_persistent_volume_claim_spec_parseFromJSON(spec); //nonprimitive } // v1_persistent_volume_claim->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claimJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_persistent_volume_claim_status_parseFromJSON(status); //nonprimitive } - v1_persistent_volume_claim_local_var = v1_persistent_volume_claim_create ( + v1_persistent_volume_claim_local_var = v1_persistent_volume_claim_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_persistent_volume_claim.h b/kubernetes/model/v1_persistent_volume_claim.h index 46b0bffd..c309d558 100644 --- a/kubernetes/model/v1_persistent_volume_claim.h +++ b/kubernetes/model/v1_persistent_volume_claim.h @@ -28,9 +28,10 @@ typedef struct v1_persistent_volume_claim_t { struct v1_persistent_volume_claim_spec_t *spec; //model struct v1_persistent_volume_claim_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_claim_t; -v1_persistent_volume_claim_t *v1_persistent_volume_claim_create( +__attribute__((deprecated)) v1_persistent_volume_claim_t *v1_persistent_volume_claim_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_persistent_volume_claim_condition.c b/kubernetes/model/v1_persistent_volume_claim_condition.c index f5d59485..684bc434 100644 --- a/kubernetes/model/v1_persistent_volume_claim_condition.c +++ b/kubernetes/model/v1_persistent_volume_claim_condition.c @@ -5,7 +5,7 @@ -v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_create( +static v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_create_internal( char *last_probe_time, char *last_transition_time, char *message, @@ -24,14 +24,36 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_cre v1_persistent_volume_claim_condition_local_var->status = status; v1_persistent_volume_claim_condition_local_var->type = type; + v1_persistent_volume_claim_condition_local_var->_library_owned = 1; return v1_persistent_volume_claim_condition_local_var; } +__attribute__((deprecated)) v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_create( + char *last_probe_time, + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_persistent_volume_claim_condition_create_internal ( + last_probe_time, + last_transition_time, + message, + reason, + status, + type + ); +} void v1_persistent_volume_claim_condition_free(v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition) { if(NULL == v1_persistent_volume_claim_condition){ return ; } + if(v1_persistent_volume_claim_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_claim_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_claim_condition->last_probe_time) { free(v1_persistent_volume_claim_condition->last_probe_time); @@ -126,6 +148,9 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_par // v1_persistent_volume_claim_condition->last_probe_time cJSON *last_probe_time = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_conditionJSON, "lastProbeTime"); + if (cJSON_IsNull(last_probe_time)) { + last_probe_time = NULL; + } if (last_probe_time) { if(!cJSON_IsString(last_probe_time) && !cJSON_IsNull(last_probe_time)) { @@ -135,6 +160,9 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_par // v1_persistent_volume_claim_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -144,6 +172,9 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_par // v1_persistent_volume_claim_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -153,6 +184,9 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_par // v1_persistent_volume_claim_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -162,6 +196,9 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_par // v1_persistent_volume_claim_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -174,6 +211,9 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_par // v1_persistent_volume_claim_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -185,7 +225,7 @@ v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_par } - v1_persistent_volume_claim_condition_local_var = v1_persistent_volume_claim_condition_create ( + v1_persistent_volume_claim_condition_local_var = v1_persistent_volume_claim_condition_create_internal ( last_probe_time && !cJSON_IsNull(last_probe_time) ? strdup(last_probe_time->valuestring) : NULL, last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, diff --git a/kubernetes/model/v1_persistent_volume_claim_condition.h b/kubernetes/model/v1_persistent_volume_claim_condition.h index 345b3997..a11b867a 100644 --- a/kubernetes/model/v1_persistent_volume_claim_condition.h +++ b/kubernetes/model/v1_persistent_volume_claim_condition.h @@ -26,9 +26,10 @@ typedef struct v1_persistent_volume_claim_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_claim_condition_t; -v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_create( +__attribute__((deprecated)) v1_persistent_volume_claim_condition_t *v1_persistent_volume_claim_condition_create( char *last_probe_time, char *last_transition_time, char *message, diff --git a/kubernetes/model/v1_persistent_volume_claim_list.c b/kubernetes/model/v1_persistent_volume_claim_list.c index a19ca5c4..9992c85c 100644 --- a/kubernetes/model/v1_persistent_volume_claim_list.c +++ b/kubernetes/model/v1_persistent_volume_claim_list.c @@ -5,7 +5,7 @@ -v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_create( +static v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_create( v1_persistent_volume_claim_list_local_var->kind = kind; v1_persistent_volume_claim_list_local_var->metadata = metadata; + v1_persistent_volume_claim_list_local_var->_library_owned = 1; return v1_persistent_volume_claim_list_local_var; } +__attribute__((deprecated)) v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_persistent_volume_claim_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_persistent_volume_claim_list_free(v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list) { if(NULL == v1_persistent_volume_claim_list){ return ; } + if(v1_persistent_volume_claim_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_claim_list_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_claim_list->api_version) { free(v1_persistent_volume_claim_list->api_version); @@ -123,6 +141,9 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_parseFromJSON // v1_persistent_volume_claim_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_parseFromJSON // v1_persistent_volume_claim_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_parseFromJSON // v1_persistent_volume_claim_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_parseFromJSON // v1_persistent_volume_claim_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_persistent_volume_claim_list_local_var = v1_persistent_volume_claim_list_create ( + v1_persistent_volume_claim_list_local_var = v1_persistent_volume_claim_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_persistent_volume_claim_list.h b/kubernetes/model/v1_persistent_volume_claim_list.h index f79ea966..97510096 100644 --- a/kubernetes/model/v1_persistent_volume_claim_list.h +++ b/kubernetes/model/v1_persistent_volume_claim_list.h @@ -26,9 +26,10 @@ typedef struct v1_persistent_volume_claim_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_claim_list_t; -v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_create( +__attribute__((deprecated)) v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_persistent_volume_claim_spec.c b/kubernetes/model/v1_persistent_volume_claim_spec.c index b638899e..63918023 100644 --- a/kubernetes/model/v1_persistent_volume_claim_spec.c +++ b/kubernetes/model/v1_persistent_volume_claim_spec.c @@ -5,7 +5,7 @@ -v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_create( +static v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_create_internal( list_t *access_modes, v1_typed_local_object_reference_t *data_source, v1_typed_object_reference_t *data_source_ref, @@ -30,14 +30,42 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_create( v1_persistent_volume_claim_spec_local_var->volume_mode = volume_mode; v1_persistent_volume_claim_spec_local_var->volume_name = volume_name; + v1_persistent_volume_claim_spec_local_var->_library_owned = 1; return v1_persistent_volume_claim_spec_local_var; } +__attribute__((deprecated)) v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_create( + list_t *access_modes, + v1_typed_local_object_reference_t *data_source, + v1_typed_object_reference_t *data_source_ref, + v1_volume_resource_requirements_t *resources, + v1_label_selector_t *selector, + char *storage_class_name, + char *volume_attributes_class_name, + char *volume_mode, + char *volume_name + ) { + return v1_persistent_volume_claim_spec_create_internal ( + access_modes, + data_source, + data_source_ref, + resources, + selector, + storage_class_name, + volume_attributes_class_name, + volume_mode, + volume_name + ); +} void v1_persistent_volume_claim_spec_free(v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec) { if(NULL == v1_persistent_volume_claim_spec){ return ; } + if(v1_persistent_volume_claim_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_claim_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_claim_spec->access_modes) { list_ForEach(listEntry, v1_persistent_volume_claim_spec->access_modes) { @@ -93,7 +121,7 @@ cJSON *v1_persistent_volume_claim_spec_convertToJSON(v1_persistent_volume_claim_ listEntry_t *access_modesListEntry; list_ForEach(access_modesListEntry, v1_persistent_volume_claim_spec->access_modes) { - if(cJSON_AddStringToObject(access_modes, "", (char*)access_modesListEntry->data) == NULL) + if(cJSON_AddStringToObject(access_modes, "", access_modesListEntry->data) == NULL) { goto fail; } @@ -213,6 +241,9 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON // v1_persistent_volume_claim_spec->access_modes cJSON *access_modes = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "accessModes"); + if (cJSON_IsNull(access_modes)) { + access_modes = NULL; + } if (access_modes) { cJSON *access_modes_local = NULL; if(!cJSON_IsArray(access_modes)) { @@ -232,30 +263,45 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON // v1_persistent_volume_claim_spec->data_source cJSON *data_source = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "dataSource"); + if (cJSON_IsNull(data_source)) { + data_source = NULL; + } if (data_source) { data_source_local_nonprim = v1_typed_local_object_reference_parseFromJSON(data_source); //nonprimitive } // v1_persistent_volume_claim_spec->data_source_ref cJSON *data_source_ref = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "dataSourceRef"); + if (cJSON_IsNull(data_source_ref)) { + data_source_ref = NULL; + } if (data_source_ref) { data_source_ref_local_nonprim = v1_typed_object_reference_parseFromJSON(data_source_ref); //nonprimitive } // v1_persistent_volume_claim_spec->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { resources_local_nonprim = v1_volume_resource_requirements_parseFromJSON(resources); //nonprimitive } // v1_persistent_volume_claim_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { selector_local_nonprim = v1_label_selector_parseFromJSON(selector); //nonprimitive } // v1_persistent_volume_claim_spec->storage_class_name cJSON *storage_class_name = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "storageClassName"); + if (cJSON_IsNull(storage_class_name)) { + storage_class_name = NULL; + } if (storage_class_name) { if(!cJSON_IsString(storage_class_name) && !cJSON_IsNull(storage_class_name)) { @@ -265,6 +311,9 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON // v1_persistent_volume_claim_spec->volume_attributes_class_name cJSON *volume_attributes_class_name = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "volumeAttributesClassName"); + if (cJSON_IsNull(volume_attributes_class_name)) { + volume_attributes_class_name = NULL; + } if (volume_attributes_class_name) { if(!cJSON_IsString(volume_attributes_class_name) && !cJSON_IsNull(volume_attributes_class_name)) { @@ -274,6 +323,9 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON // v1_persistent_volume_claim_spec->volume_mode cJSON *volume_mode = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "volumeMode"); + if (cJSON_IsNull(volume_mode)) { + volume_mode = NULL; + } if (volume_mode) { if(!cJSON_IsString(volume_mode) && !cJSON_IsNull(volume_mode)) { @@ -283,6 +335,9 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON // v1_persistent_volume_claim_spec->volume_name cJSON *volume_name = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "volumeName"); + if (cJSON_IsNull(volume_name)) { + volume_name = NULL; + } if (volume_name) { if(!cJSON_IsString(volume_name) && !cJSON_IsNull(volume_name)) { @@ -291,7 +346,7 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON } - v1_persistent_volume_claim_spec_local_var = v1_persistent_volume_claim_spec_create ( + v1_persistent_volume_claim_spec_local_var = v1_persistent_volume_claim_spec_create_internal ( access_modes ? access_modesList : NULL, data_source ? data_source_local_nonprim : NULL, data_source_ref ? data_source_ref_local_nonprim : NULL, diff --git a/kubernetes/model/v1_persistent_volume_claim_spec.h b/kubernetes/model/v1_persistent_volume_claim_spec.h index 7eb23a38..dffcd4cf 100644 --- a/kubernetes/model/v1_persistent_volume_claim_spec.h +++ b/kubernetes/model/v1_persistent_volume_claim_spec.h @@ -33,9 +33,10 @@ typedef struct v1_persistent_volume_claim_spec_t { char *volume_mode; // string char *volume_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_claim_spec_t; -v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_create( +__attribute__((deprecated)) v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_create( list_t *access_modes, v1_typed_local_object_reference_t *data_source, v1_typed_object_reference_t *data_source_ref, diff --git a/kubernetes/model/v1_persistent_volume_claim_status.c b/kubernetes/model/v1_persistent_volume_claim_status.c index d05ee5b1..033467f7 100644 --- a/kubernetes/model/v1_persistent_volume_claim_status.c +++ b/kubernetes/model/v1_persistent_volume_claim_status.c @@ -5,7 +5,7 @@ -v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_create( +static v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_create_internal( list_t *access_modes, list_t* allocated_resource_statuses, list_t* allocated_resources, @@ -28,14 +28,40 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_create( v1_persistent_volume_claim_status_local_var->modify_volume_status = modify_volume_status; v1_persistent_volume_claim_status_local_var->phase = phase; + v1_persistent_volume_claim_status_local_var->_library_owned = 1; return v1_persistent_volume_claim_status_local_var; } +__attribute__((deprecated)) v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_create( + list_t *access_modes, + list_t* allocated_resource_statuses, + list_t* allocated_resources, + list_t* capacity, + list_t *conditions, + char *current_volume_attributes_class_name, + v1_modify_volume_status_t *modify_volume_status, + char *phase + ) { + return v1_persistent_volume_claim_status_create_internal ( + access_modes, + allocated_resource_statuses, + allocated_resources, + capacity, + conditions, + current_volume_attributes_class_name, + modify_volume_status, + phase + ); +} void v1_persistent_volume_claim_status_free(v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status) { if(NULL == v1_persistent_volume_claim_status){ return ; } + if(v1_persistent_volume_claim_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_claim_status_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_claim_status->access_modes) { list_ForEach(listEntry, v1_persistent_volume_claim_status->access_modes) { @@ -46,7 +72,7 @@ void v1_persistent_volume_claim_status_free(v1_persistent_volume_claim_status_t } if (v1_persistent_volume_claim_status->allocated_resource_statuses) { list_ForEach(listEntry, v1_persistent_volume_claim_status->allocated_resource_statuses) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -56,7 +82,7 @@ void v1_persistent_volume_claim_status_free(v1_persistent_volume_claim_status_t } if (v1_persistent_volume_claim_status->allocated_resources) { list_ForEach(listEntry, v1_persistent_volume_claim_status->allocated_resources) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -66,7 +92,7 @@ void v1_persistent_volume_claim_status_free(v1_persistent_volume_claim_status_t } if (v1_persistent_volume_claim_status->capacity) { list_ForEach(listEntry, v1_persistent_volume_claim_status->capacity) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -108,7 +134,7 @@ cJSON *v1_persistent_volume_claim_status_convertToJSON(v1_persistent_volume_clai listEntry_t *access_modesListEntry; list_ForEach(access_modesListEntry, v1_persistent_volume_claim_status->access_modes) { - if(cJSON_AddStringToObject(access_modes, "", (char*)access_modesListEntry->data) == NULL) + if(cJSON_AddStringToObject(access_modes, "", access_modesListEntry->data) == NULL) { goto fail; } @@ -126,8 +152,8 @@ cJSON *v1_persistent_volume_claim_status_convertToJSON(v1_persistent_volume_clai listEntry_t *allocated_resource_statusesListEntry; if (v1_persistent_volume_claim_status->allocated_resource_statuses) { list_ForEach(allocated_resource_statusesListEntry, v1_persistent_volume_claim_status->allocated_resource_statuses) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)allocated_resource_statusesListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = allocated_resource_statusesListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -146,8 +172,8 @@ cJSON *v1_persistent_volume_claim_status_convertToJSON(v1_persistent_volume_clai listEntry_t *allocated_resourcesListEntry; if (v1_persistent_volume_claim_status->allocated_resources) { list_ForEach(allocated_resourcesListEntry, v1_persistent_volume_claim_status->allocated_resources) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)allocated_resourcesListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = allocated_resourcesListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -166,8 +192,8 @@ cJSON *v1_persistent_volume_claim_status_convertToJSON(v1_persistent_volume_clai listEntry_t *capacityListEntry; if (v1_persistent_volume_claim_status->capacity) { list_ForEach(capacityListEntry, v1_persistent_volume_claim_status->capacity) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)capacityListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = capacityListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -256,6 +282,9 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->access_modes cJSON *access_modes = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "accessModes"); + if (cJSON_IsNull(access_modes)) { + access_modes = NULL; + } if (access_modes) { cJSON *access_modes_local = NULL; if(!cJSON_IsArray(access_modes)) { @@ -275,6 +304,9 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->allocated_resource_statuses cJSON *allocated_resource_statuses = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "allocatedResourceStatuses"); + if (cJSON_IsNull(allocated_resource_statuses)) { + allocated_resource_statuses = NULL; + } if (allocated_resource_statuses) { cJSON *allocated_resource_statuses_local_map = NULL; if(!cJSON_IsObject(allocated_resource_statuses) && !cJSON_IsNull(allocated_resource_statuses)) @@ -300,6 +332,9 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->allocated_resources cJSON *allocated_resources = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "allocatedResources"); + if (cJSON_IsNull(allocated_resources)) { + allocated_resources = NULL; + } if (allocated_resources) { cJSON *allocated_resources_local_map = NULL; if(!cJSON_IsObject(allocated_resources) && !cJSON_IsNull(allocated_resources)) @@ -325,6 +360,9 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->capacity cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } if (capacity) { cJSON *capacity_local_map = NULL; if(!cJSON_IsObject(capacity) && !cJSON_IsNull(capacity)) @@ -350,6 +388,9 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -371,6 +412,9 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->current_volume_attributes_class_name cJSON *current_volume_attributes_class_name = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "currentVolumeAttributesClassName"); + if (cJSON_IsNull(current_volume_attributes_class_name)) { + current_volume_attributes_class_name = NULL; + } if (current_volume_attributes_class_name) { if(!cJSON_IsString(current_volume_attributes_class_name) && !cJSON_IsNull(current_volume_attributes_class_name)) { @@ -380,12 +424,18 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->modify_volume_status cJSON *modify_volume_status = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "modifyVolumeStatus"); + if (cJSON_IsNull(modify_volume_status)) { + modify_volume_status = NULL; + } if (modify_volume_status) { modify_volume_status_local_nonprim = v1_modify_volume_status_parseFromJSON(modify_volume_status); //nonprimitive } // v1_persistent_volume_claim_status->phase cJSON *phase = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "phase"); + if (cJSON_IsNull(phase)) { + phase = NULL; + } if (phase) { if(!cJSON_IsString(phase) && !cJSON_IsNull(phase)) { @@ -394,7 +444,7 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom } - v1_persistent_volume_claim_status_local_var = v1_persistent_volume_claim_status_create ( + v1_persistent_volume_claim_status_local_var = v1_persistent_volume_claim_status_create_internal ( access_modes ? access_modesList : NULL, allocated_resource_statuses ? allocated_resource_statusesList : NULL, allocated_resources ? allocated_resourcesList : NULL, @@ -419,7 +469,7 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom if (allocated_resource_statusesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, allocated_resource_statusesList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -433,7 +483,7 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom if (allocated_resourcesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, allocated_resourcesList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -447,7 +497,7 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom if (capacityList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, capacityList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_persistent_volume_claim_status.h b/kubernetes/model/v1_persistent_volume_claim_status.h index 02a50f11..7731a139 100644 --- a/kubernetes/model/v1_persistent_volume_claim_status.h +++ b/kubernetes/model/v1_persistent_volume_claim_status.h @@ -30,9 +30,10 @@ typedef struct v1_persistent_volume_claim_status_t { struct v1_modify_volume_status_t *modify_volume_status; //model char *phase; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_claim_status_t; -v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_create( +__attribute__((deprecated)) v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_create( list_t *access_modes, list_t* allocated_resource_statuses, list_t* allocated_resources, diff --git a/kubernetes/model/v1_persistent_volume_claim_template.c b/kubernetes/model/v1_persistent_volume_claim_template.c index 60376dff..31f893ce 100644 --- a/kubernetes/model/v1_persistent_volume_claim_template.c +++ b/kubernetes/model/v1_persistent_volume_claim_template.c @@ -5,7 +5,7 @@ -v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_create( +static v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_create_internal( v1_object_meta_t *metadata, v1_persistent_volume_claim_spec_t *spec ) { @@ -16,14 +16,28 @@ v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_creat v1_persistent_volume_claim_template_local_var->metadata = metadata; v1_persistent_volume_claim_template_local_var->spec = spec; + v1_persistent_volume_claim_template_local_var->_library_owned = 1; return v1_persistent_volume_claim_template_local_var; } +__attribute__((deprecated)) v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_create( + v1_object_meta_t *metadata, + v1_persistent_volume_claim_spec_t *spec + ) { + return v1_persistent_volume_claim_template_create_internal ( + metadata, + spec + ); +} void v1_persistent_volume_claim_template_free(v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template) { if(NULL == v1_persistent_volume_claim_template){ return ; } + if(v1_persistent_volume_claim_template->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_claim_template_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_claim_template->metadata) { v1_object_meta_free(v1_persistent_volume_claim_template->metadata); @@ -85,12 +99,18 @@ v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_parse // v1_persistent_volume_claim_template->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_templateJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_persistent_volume_claim_template->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_templateJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -99,7 +119,7 @@ v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_parse spec_local_nonprim = v1_persistent_volume_claim_spec_parseFromJSON(spec); //nonprimitive - v1_persistent_volume_claim_template_local_var = v1_persistent_volume_claim_template_create ( + v1_persistent_volume_claim_template_local_var = v1_persistent_volume_claim_template_create_internal ( metadata ? metadata_local_nonprim : NULL, spec_local_nonprim ); diff --git a/kubernetes/model/v1_persistent_volume_claim_template.h b/kubernetes/model/v1_persistent_volume_claim_template.h index c367cff0..04f6b74b 100644 --- a/kubernetes/model/v1_persistent_volume_claim_template.h +++ b/kubernetes/model/v1_persistent_volume_claim_template.h @@ -24,9 +24,10 @@ typedef struct v1_persistent_volume_claim_template_t { struct v1_object_meta_t *metadata; //model struct v1_persistent_volume_claim_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_claim_template_t; -v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_create( +__attribute__((deprecated)) v1_persistent_volume_claim_template_t *v1_persistent_volume_claim_template_create( v1_object_meta_t *metadata, v1_persistent_volume_claim_spec_t *spec ); diff --git a/kubernetes/model/v1_persistent_volume_claim_volume_source.c b/kubernetes/model/v1_persistent_volume_claim_volume_source.c index 8f729ab2..56ddfaf6 100644 --- a/kubernetes/model/v1_persistent_volume_claim_volume_source.c +++ b/kubernetes/model/v1_persistent_volume_claim_volume_source.c @@ -5,7 +5,7 @@ -v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_source_create( +static v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_source_create_internal( char *claim_name, int read_only ) { @@ -16,14 +16,28 @@ v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_so v1_persistent_volume_claim_volume_source_local_var->claim_name = claim_name; v1_persistent_volume_claim_volume_source_local_var->read_only = read_only; + v1_persistent_volume_claim_volume_source_local_var->_library_owned = 1; return v1_persistent_volume_claim_volume_source_local_var; } +__attribute__((deprecated)) v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_source_create( + char *claim_name, + int read_only + ) { + return v1_persistent_volume_claim_volume_source_create_internal ( + claim_name, + read_only + ); +} void v1_persistent_volume_claim_volume_source_free(v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_source) { if(NULL == v1_persistent_volume_claim_volume_source){ return ; } + if(v1_persistent_volume_claim_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_claim_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_claim_volume_source->claim_name) { free(v1_persistent_volume_claim_volume_source->claim_name); @@ -65,6 +79,9 @@ v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_so // v1_persistent_volume_claim_volume_source->claim_name cJSON *claim_name = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_volume_sourceJSON, "claimName"); + if (cJSON_IsNull(claim_name)) { + claim_name = NULL; + } if (!claim_name) { goto end; } @@ -77,6 +94,9 @@ v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_so // v1_persistent_volume_claim_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -85,7 +105,7 @@ v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_so } - v1_persistent_volume_claim_volume_source_local_var = v1_persistent_volume_claim_volume_source_create ( + v1_persistent_volume_claim_volume_source_local_var = v1_persistent_volume_claim_volume_source_create_internal ( strdup(claim_name->valuestring), read_only ? read_only->valueint : 0 ); diff --git a/kubernetes/model/v1_persistent_volume_claim_volume_source.h b/kubernetes/model/v1_persistent_volume_claim_volume_source.h index cda866ff..1fce629f 100644 --- a/kubernetes/model/v1_persistent_volume_claim_volume_source.h +++ b/kubernetes/model/v1_persistent_volume_claim_volume_source.h @@ -22,9 +22,10 @@ typedef struct v1_persistent_volume_claim_volume_source_t { char *claim_name; // string int read_only; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_claim_volume_source_t; -v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_source_create( +__attribute__((deprecated)) v1_persistent_volume_claim_volume_source_t *v1_persistent_volume_claim_volume_source_create( char *claim_name, int read_only ); diff --git a/kubernetes/model/v1_persistent_volume_list.c b/kubernetes/model/v1_persistent_volume_list.c index e1cedeea..9de72ac5 100644 --- a/kubernetes/model/v1_persistent_volume_list.c +++ b/kubernetes/model/v1_persistent_volume_list.c @@ -5,7 +5,7 @@ -v1_persistent_volume_list_t *v1_persistent_volume_list_create( +static v1_persistent_volume_list_t *v1_persistent_volume_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_create( v1_persistent_volume_list_local_var->kind = kind; v1_persistent_volume_list_local_var->metadata = metadata; + v1_persistent_volume_list_local_var->_library_owned = 1; return v1_persistent_volume_list_local_var; } +__attribute__((deprecated)) v1_persistent_volume_list_t *v1_persistent_volume_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_persistent_volume_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_persistent_volume_list_free(v1_persistent_volume_list_t *v1_persistent_volume_list) { if(NULL == v1_persistent_volume_list){ return ; } + if(v1_persistent_volume_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_list_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_list->api_version) { free(v1_persistent_volume_list->api_version); @@ -123,6 +141,9 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_parseFromJSON(cJSON *v1_p // v1_persistent_volume_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_parseFromJSON(cJSON *v1_p // v1_persistent_volume_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_parseFromJSON(cJSON *v1_p // v1_persistent_volume_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_parseFromJSON(cJSON *v1_p // v1_persistent_volume_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_persistent_volume_list_local_var = v1_persistent_volume_list_create ( + v1_persistent_volume_list_local_var = v1_persistent_volume_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_persistent_volume_list.h b/kubernetes/model/v1_persistent_volume_list.h index 1a07f84a..27ad1f09 100644 --- a/kubernetes/model/v1_persistent_volume_list.h +++ b/kubernetes/model/v1_persistent_volume_list.h @@ -26,9 +26,10 @@ typedef struct v1_persistent_volume_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_list_t; -v1_persistent_volume_list_t *v1_persistent_volume_list_create( +__attribute__((deprecated)) v1_persistent_volume_list_t *v1_persistent_volume_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_persistent_volume_spec.c b/kubernetes/model/v1_persistent_volume_spec.c index e14f826b..352e9fe2 100644 --- a/kubernetes/model/v1_persistent_volume_spec.c +++ b/kubernetes/model/v1_persistent_volume_spec.c @@ -5,7 +5,7 @@ -v1_persistent_volume_spec_t *v1_persistent_volume_spec_create( +static v1_persistent_volume_spec_t *v1_persistent_volume_spec_create_internal( list_t *access_modes, v1_aws_elastic_block_store_volume_source_t *aws_elastic_block_store, v1_azure_disk_volume_source_t *azure_disk, @@ -74,14 +74,86 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_create( v1_persistent_volume_spec_local_var->volume_mode = volume_mode; v1_persistent_volume_spec_local_var->vsphere_volume = vsphere_volume; + v1_persistent_volume_spec_local_var->_library_owned = 1; return v1_persistent_volume_spec_local_var; } +__attribute__((deprecated)) v1_persistent_volume_spec_t *v1_persistent_volume_spec_create( + list_t *access_modes, + v1_aws_elastic_block_store_volume_source_t *aws_elastic_block_store, + v1_azure_disk_volume_source_t *azure_disk, + v1_azure_file_persistent_volume_source_t *azure_file, + list_t* capacity, + v1_ceph_fs_persistent_volume_source_t *cephfs, + v1_cinder_persistent_volume_source_t *cinder, + v1_object_reference_t *claim_ref, + v1_csi_persistent_volume_source_t *csi, + v1_fc_volume_source_t *fc, + v1_flex_persistent_volume_source_t *flex_volume, + v1_flocker_volume_source_t *flocker, + v1_gce_persistent_disk_volume_source_t *gce_persistent_disk, + v1_glusterfs_persistent_volume_source_t *glusterfs, + v1_host_path_volume_source_t *host_path, + v1_iscsi_persistent_volume_source_t *iscsi, + v1_local_volume_source_t *local, + list_t *mount_options, + v1_nfs_volume_source_t *nfs, + v1_volume_node_affinity_t *node_affinity, + char *persistent_volume_reclaim_policy, + v1_photon_persistent_disk_volume_source_t *photon_persistent_disk, + v1_portworx_volume_source_t *portworx_volume, + v1_quobyte_volume_source_t *quobyte, + v1_rbd_persistent_volume_source_t *rbd, + v1_scale_io_persistent_volume_source_t *scale_io, + char *storage_class_name, + v1_storage_os_persistent_volume_source_t *storageos, + char *volume_attributes_class_name, + char *volume_mode, + v1_vsphere_virtual_disk_volume_source_t *vsphere_volume + ) { + return v1_persistent_volume_spec_create_internal ( + access_modes, + aws_elastic_block_store, + azure_disk, + azure_file, + capacity, + cephfs, + cinder, + claim_ref, + csi, + fc, + flex_volume, + flocker, + gce_persistent_disk, + glusterfs, + host_path, + iscsi, + local, + mount_options, + nfs, + node_affinity, + persistent_volume_reclaim_policy, + photon_persistent_disk, + portworx_volume, + quobyte, + rbd, + scale_io, + storage_class_name, + storageos, + volume_attributes_class_name, + volume_mode, + vsphere_volume + ); +} void v1_persistent_volume_spec_free(v1_persistent_volume_spec_t *v1_persistent_volume_spec) { if(NULL == v1_persistent_volume_spec){ return ; } + if(v1_persistent_volume_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_spec->access_modes) { list_ForEach(listEntry, v1_persistent_volume_spec->access_modes) { @@ -104,7 +176,7 @@ void v1_persistent_volume_spec_free(v1_persistent_volume_spec_t *v1_persistent_v } if (v1_persistent_volume_spec->capacity) { list_ForEach(listEntry, v1_persistent_volume_spec->capacity) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -234,7 +306,7 @@ cJSON *v1_persistent_volume_spec_convertToJSON(v1_persistent_volume_spec_t *v1_p listEntry_t *access_modesListEntry; list_ForEach(access_modesListEntry, v1_persistent_volume_spec->access_modes) { - if(cJSON_AddStringToObject(access_modes, "", (char*)access_modesListEntry->data) == NULL) + if(cJSON_AddStringToObject(access_modes, "", access_modesListEntry->data) == NULL) { goto fail; } @@ -291,8 +363,8 @@ cJSON *v1_persistent_volume_spec_convertToJSON(v1_persistent_volume_spec_t *v1_p listEntry_t *capacityListEntry; if (v1_persistent_volume_spec->capacity) { list_ForEach(capacityListEntry, v1_persistent_volume_spec->capacity) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)capacityListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = capacityListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -466,7 +538,7 @@ cJSON *v1_persistent_volume_spec_convertToJSON(v1_persistent_volume_spec_t *v1_p listEntry_t *mount_optionsListEntry; list_ForEach(mount_optionsListEntry, v1_persistent_volume_spec->mount_options) { - if(cJSON_AddStringToObject(mount_options, "", (char*)mount_optionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(mount_options, "", mount_optionsListEntry->data) == NULL) { goto fail; } @@ -717,6 +789,9 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->access_modes cJSON *access_modes = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "accessModes"); + if (cJSON_IsNull(access_modes)) { + access_modes = NULL; + } if (access_modes) { cJSON *access_modes_local = NULL; if(!cJSON_IsArray(access_modes)) { @@ -736,24 +811,36 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->aws_elastic_block_store cJSON *aws_elastic_block_store = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "awsElasticBlockStore"); + if (cJSON_IsNull(aws_elastic_block_store)) { + aws_elastic_block_store = NULL; + } if (aws_elastic_block_store) { aws_elastic_block_store_local_nonprim = v1_aws_elastic_block_store_volume_source_parseFromJSON(aws_elastic_block_store); //nonprimitive } // v1_persistent_volume_spec->azure_disk cJSON *azure_disk = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "azureDisk"); + if (cJSON_IsNull(azure_disk)) { + azure_disk = NULL; + } if (azure_disk) { azure_disk_local_nonprim = v1_azure_disk_volume_source_parseFromJSON(azure_disk); //nonprimitive } // v1_persistent_volume_spec->azure_file cJSON *azure_file = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "azureFile"); + if (cJSON_IsNull(azure_file)) { + azure_file = NULL; + } if (azure_file) { azure_file_local_nonprim = v1_azure_file_persistent_volume_source_parseFromJSON(azure_file); //nonprimitive } // v1_persistent_volume_spec->capacity cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } if (capacity) { cJSON *capacity_local_map = NULL; if(!cJSON_IsObject(capacity) && !cJSON_IsNull(capacity)) @@ -779,78 +866,117 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->cephfs cJSON *cephfs = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "cephfs"); + if (cJSON_IsNull(cephfs)) { + cephfs = NULL; + } if (cephfs) { cephfs_local_nonprim = v1_ceph_fs_persistent_volume_source_parseFromJSON(cephfs); //nonprimitive } // v1_persistent_volume_spec->cinder cJSON *cinder = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "cinder"); + if (cJSON_IsNull(cinder)) { + cinder = NULL; + } if (cinder) { cinder_local_nonprim = v1_cinder_persistent_volume_source_parseFromJSON(cinder); //nonprimitive } // v1_persistent_volume_spec->claim_ref cJSON *claim_ref = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "claimRef"); + if (cJSON_IsNull(claim_ref)) { + claim_ref = NULL; + } if (claim_ref) { claim_ref_local_nonprim = v1_object_reference_parseFromJSON(claim_ref); //nonprimitive } // v1_persistent_volume_spec->csi cJSON *csi = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "csi"); + if (cJSON_IsNull(csi)) { + csi = NULL; + } if (csi) { csi_local_nonprim = v1_csi_persistent_volume_source_parseFromJSON(csi); //nonprimitive } // v1_persistent_volume_spec->fc cJSON *fc = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "fc"); + if (cJSON_IsNull(fc)) { + fc = NULL; + } if (fc) { fc_local_nonprim = v1_fc_volume_source_parseFromJSON(fc); //nonprimitive } // v1_persistent_volume_spec->flex_volume cJSON *flex_volume = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "flexVolume"); + if (cJSON_IsNull(flex_volume)) { + flex_volume = NULL; + } if (flex_volume) { flex_volume_local_nonprim = v1_flex_persistent_volume_source_parseFromJSON(flex_volume); //nonprimitive } // v1_persistent_volume_spec->flocker cJSON *flocker = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "flocker"); + if (cJSON_IsNull(flocker)) { + flocker = NULL; + } if (flocker) { flocker_local_nonprim = v1_flocker_volume_source_parseFromJSON(flocker); //nonprimitive } // v1_persistent_volume_spec->gce_persistent_disk cJSON *gce_persistent_disk = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "gcePersistentDisk"); + if (cJSON_IsNull(gce_persistent_disk)) { + gce_persistent_disk = NULL; + } if (gce_persistent_disk) { gce_persistent_disk_local_nonprim = v1_gce_persistent_disk_volume_source_parseFromJSON(gce_persistent_disk); //nonprimitive } // v1_persistent_volume_spec->glusterfs cJSON *glusterfs = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "glusterfs"); + if (cJSON_IsNull(glusterfs)) { + glusterfs = NULL; + } if (glusterfs) { glusterfs_local_nonprim = v1_glusterfs_persistent_volume_source_parseFromJSON(glusterfs); //nonprimitive } // v1_persistent_volume_spec->host_path cJSON *host_path = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "hostPath"); + if (cJSON_IsNull(host_path)) { + host_path = NULL; + } if (host_path) { host_path_local_nonprim = v1_host_path_volume_source_parseFromJSON(host_path); //nonprimitive } // v1_persistent_volume_spec->iscsi cJSON *iscsi = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "iscsi"); + if (cJSON_IsNull(iscsi)) { + iscsi = NULL; + } if (iscsi) { iscsi_local_nonprim = v1_iscsi_persistent_volume_source_parseFromJSON(iscsi); //nonprimitive } // v1_persistent_volume_spec->local cJSON *local = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "local"); + if (cJSON_IsNull(local)) { + local = NULL; + } if (local) { local_local_nonprim = v1_local_volume_source_parseFromJSON(local); //nonprimitive } // v1_persistent_volume_spec->mount_options cJSON *mount_options = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "mountOptions"); + if (cJSON_IsNull(mount_options)) { + mount_options = NULL; + } if (mount_options) { cJSON *mount_options_local = NULL; if(!cJSON_IsArray(mount_options)) { @@ -870,18 +996,27 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->nfs cJSON *nfs = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "nfs"); + if (cJSON_IsNull(nfs)) { + nfs = NULL; + } if (nfs) { nfs_local_nonprim = v1_nfs_volume_source_parseFromJSON(nfs); //nonprimitive } // v1_persistent_volume_spec->node_affinity cJSON *node_affinity = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "nodeAffinity"); + if (cJSON_IsNull(node_affinity)) { + node_affinity = NULL; + } if (node_affinity) { node_affinity_local_nonprim = v1_volume_node_affinity_parseFromJSON(node_affinity); //nonprimitive } // v1_persistent_volume_spec->persistent_volume_reclaim_policy cJSON *persistent_volume_reclaim_policy = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "persistentVolumeReclaimPolicy"); + if (cJSON_IsNull(persistent_volume_reclaim_policy)) { + persistent_volume_reclaim_policy = NULL; + } if (persistent_volume_reclaim_policy) { if(!cJSON_IsString(persistent_volume_reclaim_policy) && !cJSON_IsNull(persistent_volume_reclaim_policy)) { @@ -891,36 +1026,54 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->photon_persistent_disk cJSON *photon_persistent_disk = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "photonPersistentDisk"); + if (cJSON_IsNull(photon_persistent_disk)) { + photon_persistent_disk = NULL; + } if (photon_persistent_disk) { photon_persistent_disk_local_nonprim = v1_photon_persistent_disk_volume_source_parseFromJSON(photon_persistent_disk); //nonprimitive } // v1_persistent_volume_spec->portworx_volume cJSON *portworx_volume = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "portworxVolume"); + if (cJSON_IsNull(portworx_volume)) { + portworx_volume = NULL; + } if (portworx_volume) { portworx_volume_local_nonprim = v1_portworx_volume_source_parseFromJSON(portworx_volume); //nonprimitive } // v1_persistent_volume_spec->quobyte cJSON *quobyte = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "quobyte"); + if (cJSON_IsNull(quobyte)) { + quobyte = NULL; + } if (quobyte) { quobyte_local_nonprim = v1_quobyte_volume_source_parseFromJSON(quobyte); //nonprimitive } // v1_persistent_volume_spec->rbd cJSON *rbd = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "rbd"); + if (cJSON_IsNull(rbd)) { + rbd = NULL; + } if (rbd) { rbd_local_nonprim = v1_rbd_persistent_volume_source_parseFromJSON(rbd); //nonprimitive } // v1_persistent_volume_spec->scale_io cJSON *scale_io = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "scaleIO"); + if (cJSON_IsNull(scale_io)) { + scale_io = NULL; + } if (scale_io) { scale_io_local_nonprim = v1_scale_io_persistent_volume_source_parseFromJSON(scale_io); //nonprimitive } // v1_persistent_volume_spec->storage_class_name cJSON *storage_class_name = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "storageClassName"); + if (cJSON_IsNull(storage_class_name)) { + storage_class_name = NULL; + } if (storage_class_name) { if(!cJSON_IsString(storage_class_name) && !cJSON_IsNull(storage_class_name)) { @@ -930,12 +1083,18 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->storageos cJSON *storageos = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "storageos"); + if (cJSON_IsNull(storageos)) { + storageos = NULL; + } if (storageos) { storageos_local_nonprim = v1_storage_os_persistent_volume_source_parseFromJSON(storageos); //nonprimitive } // v1_persistent_volume_spec->volume_attributes_class_name cJSON *volume_attributes_class_name = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "volumeAttributesClassName"); + if (cJSON_IsNull(volume_attributes_class_name)) { + volume_attributes_class_name = NULL; + } if (volume_attributes_class_name) { if(!cJSON_IsString(volume_attributes_class_name) && !cJSON_IsNull(volume_attributes_class_name)) { @@ -945,6 +1104,9 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->volume_mode cJSON *volume_mode = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "volumeMode"); + if (cJSON_IsNull(volume_mode)) { + volume_mode = NULL; + } if (volume_mode) { if(!cJSON_IsString(volume_mode) && !cJSON_IsNull(volume_mode)) { @@ -954,12 +1116,15 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->vsphere_volume cJSON *vsphere_volume = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "vsphereVolume"); + if (cJSON_IsNull(vsphere_volume)) { + vsphere_volume = NULL; + } if (vsphere_volume) { vsphere_volume_local_nonprim = v1_vsphere_virtual_disk_volume_source_parseFromJSON(vsphere_volume); //nonprimitive } - v1_persistent_volume_spec_local_var = v1_persistent_volume_spec_create ( + v1_persistent_volume_spec_local_var = v1_persistent_volume_spec_create_internal ( access_modes ? access_modesList : NULL, aws_elastic_block_store ? aws_elastic_block_store_local_nonprim : NULL, azure_disk ? azure_disk_local_nonprim : NULL, @@ -1019,7 +1184,7 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p if (capacityList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, capacityList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_persistent_volume_spec.h b/kubernetes/model/v1_persistent_volume_spec.h index 15a32460..64f9b29e 100644 --- a/kubernetes/model/v1_persistent_volume_spec.h +++ b/kubernetes/model/v1_persistent_volume_spec.h @@ -75,9 +75,10 @@ typedef struct v1_persistent_volume_spec_t { char *volume_mode; // string struct v1_vsphere_virtual_disk_volume_source_t *vsphere_volume; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_spec_t; -v1_persistent_volume_spec_t *v1_persistent_volume_spec_create( +__attribute__((deprecated)) v1_persistent_volume_spec_t *v1_persistent_volume_spec_create( list_t *access_modes, v1_aws_elastic_block_store_volume_source_t *aws_elastic_block_store, v1_azure_disk_volume_source_t *azure_disk, diff --git a/kubernetes/model/v1_persistent_volume_status.c b/kubernetes/model/v1_persistent_volume_status.c index d5d5d5c7..b62046c0 100644 --- a/kubernetes/model/v1_persistent_volume_status.c +++ b/kubernetes/model/v1_persistent_volume_status.c @@ -5,7 +5,7 @@ -v1_persistent_volume_status_t *v1_persistent_volume_status_create( +static v1_persistent_volume_status_t *v1_persistent_volume_status_create_internal( char *last_phase_transition_time, char *message, char *phase, @@ -20,14 +20,32 @@ v1_persistent_volume_status_t *v1_persistent_volume_status_create( v1_persistent_volume_status_local_var->phase = phase; v1_persistent_volume_status_local_var->reason = reason; + v1_persistent_volume_status_local_var->_library_owned = 1; return v1_persistent_volume_status_local_var; } +__attribute__((deprecated)) v1_persistent_volume_status_t *v1_persistent_volume_status_create( + char *last_phase_transition_time, + char *message, + char *phase, + char *reason + ) { + return v1_persistent_volume_status_create_internal ( + last_phase_transition_time, + message, + phase, + reason + ); +} void v1_persistent_volume_status_free(v1_persistent_volume_status_t *v1_persistent_volume_status) { if(NULL == v1_persistent_volume_status){ return ; } + if(v1_persistent_volume_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_persistent_volume_status_free"); + return ; + } listEntry_t *listEntry; if (v1_persistent_volume_status->last_phase_transition_time) { free(v1_persistent_volume_status->last_phase_transition_time); @@ -96,6 +114,9 @@ v1_persistent_volume_status_t *v1_persistent_volume_status_parseFromJSON(cJSON * // v1_persistent_volume_status->last_phase_transition_time cJSON *last_phase_transition_time = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_statusJSON, "lastPhaseTransitionTime"); + if (cJSON_IsNull(last_phase_transition_time)) { + last_phase_transition_time = NULL; + } if (last_phase_transition_time) { if(!cJSON_IsString(last_phase_transition_time) && !cJSON_IsNull(last_phase_transition_time)) { @@ -105,6 +126,9 @@ v1_persistent_volume_status_t *v1_persistent_volume_status_parseFromJSON(cJSON * // v1_persistent_volume_status->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_statusJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -114,6 +138,9 @@ v1_persistent_volume_status_t *v1_persistent_volume_status_parseFromJSON(cJSON * // v1_persistent_volume_status->phase cJSON *phase = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_statusJSON, "phase"); + if (cJSON_IsNull(phase)) { + phase = NULL; + } if (phase) { if(!cJSON_IsString(phase) && !cJSON_IsNull(phase)) { @@ -123,6 +150,9 @@ v1_persistent_volume_status_t *v1_persistent_volume_status_parseFromJSON(cJSON * // v1_persistent_volume_status->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_statusJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -131,7 +161,7 @@ v1_persistent_volume_status_t *v1_persistent_volume_status_parseFromJSON(cJSON * } - v1_persistent_volume_status_local_var = v1_persistent_volume_status_create ( + v1_persistent_volume_status_local_var = v1_persistent_volume_status_create_internal ( last_phase_transition_time && !cJSON_IsNull(last_phase_transition_time) ? strdup(last_phase_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, phase && !cJSON_IsNull(phase) ? strdup(phase->valuestring) : NULL, diff --git a/kubernetes/model/v1_persistent_volume_status.h b/kubernetes/model/v1_persistent_volume_status.h index 2892808d..4d13c62d 100644 --- a/kubernetes/model/v1_persistent_volume_status.h +++ b/kubernetes/model/v1_persistent_volume_status.h @@ -24,9 +24,10 @@ typedef struct v1_persistent_volume_status_t { char *phase; // string char *reason; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_persistent_volume_status_t; -v1_persistent_volume_status_t *v1_persistent_volume_status_create( +__attribute__((deprecated)) v1_persistent_volume_status_t *v1_persistent_volume_status_create( char *last_phase_transition_time, char *message, char *phase, diff --git a/kubernetes/model/v1_photon_persistent_disk_volume_source.c b/kubernetes/model/v1_photon_persistent_disk_volume_source.c index 2aa1e787..8a65e1b5 100644 --- a/kubernetes/model/v1_photon_persistent_disk_volume_source.c +++ b/kubernetes/model/v1_photon_persistent_disk_volume_source.c @@ -5,7 +5,7 @@ -v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_source_create( +static v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_source_create_internal( char *fs_type, char *pd_id ) { @@ -16,14 +16,28 @@ v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_sour v1_photon_persistent_disk_volume_source_local_var->fs_type = fs_type; v1_photon_persistent_disk_volume_source_local_var->pd_id = pd_id; + v1_photon_persistent_disk_volume_source_local_var->_library_owned = 1; return v1_photon_persistent_disk_volume_source_local_var; } +__attribute__((deprecated)) v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_source_create( + char *fs_type, + char *pd_id + ) { + return v1_photon_persistent_disk_volume_source_create_internal ( + fs_type, + pd_id + ); +} void v1_photon_persistent_disk_volume_source_free(v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_source) { if(NULL == v1_photon_persistent_disk_volume_source){ return ; } + if(v1_photon_persistent_disk_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_photon_persistent_disk_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_photon_persistent_disk_volume_source->fs_type) { free(v1_photon_persistent_disk_volume_source->fs_type); @@ -69,6 +83,9 @@ v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_sour // v1_photon_persistent_disk_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_photon_persistent_disk_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -78,6 +95,9 @@ v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_sour // v1_photon_persistent_disk_volume_source->pd_id cJSON *pd_id = cJSON_GetObjectItemCaseSensitive(v1_photon_persistent_disk_volume_sourceJSON, "pdID"); + if (cJSON_IsNull(pd_id)) { + pd_id = NULL; + } if (!pd_id) { goto end; } @@ -89,7 +109,7 @@ v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_sour } - v1_photon_persistent_disk_volume_source_local_var = v1_photon_persistent_disk_volume_source_create ( + v1_photon_persistent_disk_volume_source_local_var = v1_photon_persistent_disk_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, strdup(pd_id->valuestring) ); diff --git a/kubernetes/model/v1_photon_persistent_disk_volume_source.h b/kubernetes/model/v1_photon_persistent_disk_volume_source.h index 9d10900f..a0002678 100644 --- a/kubernetes/model/v1_photon_persistent_disk_volume_source.h +++ b/kubernetes/model/v1_photon_persistent_disk_volume_source.h @@ -22,9 +22,10 @@ typedef struct v1_photon_persistent_disk_volume_source_t { char *fs_type; // string char *pd_id; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_photon_persistent_disk_volume_source_t; -v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_source_create( +__attribute__((deprecated)) v1_photon_persistent_disk_volume_source_t *v1_photon_persistent_disk_volume_source_create( char *fs_type, char *pd_id ); diff --git a/kubernetes/model/v1_pod.c b/kubernetes/model/v1_pod.c index 20781bb3..eb8b53a4 100644 --- a/kubernetes/model/v1_pod.c +++ b/kubernetes/model/v1_pod.c @@ -5,7 +5,7 @@ -v1_pod_t *v1_pod_create( +static v1_pod_t *v1_pod_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_pod_t *v1_pod_create( v1_pod_local_var->spec = spec; v1_pod_local_var->status = status; + v1_pod_local_var->_library_owned = 1; return v1_pod_local_var; } +__attribute__((deprecated)) v1_pod_t *v1_pod_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_pod_spec_t *spec, + v1_pod_status_t *status + ) { + return v1_pod_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_pod_free(v1_pod_t *v1_pod) { if(NULL == v1_pod){ return ; } + if(v1_pod->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_free"); + return ; + } listEntry_t *listEntry; if (v1_pod->api_version) { free(v1_pod->api_version); @@ -134,6 +154,9 @@ v1_pod_t *v1_pod_parseFromJSON(cJSON *v1_podJSON){ // v1_pod->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_podJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_pod_t *v1_pod_parseFromJSON(cJSON *v1_podJSON){ // v1_pod->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_podJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_pod_t *v1_pod_parseFromJSON(cJSON *v1_podJSON){ // v1_pod->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_podJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_pod->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_podJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_pod_spec_parseFromJSON(spec); //nonprimitive } // v1_pod->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_podJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_pod_status_parseFromJSON(status); //nonprimitive } - v1_pod_local_var = v1_pod_create ( + v1_pod_local_var = v1_pod_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_pod.h b/kubernetes/model/v1_pod.h index 324893ec..073a9463 100644 --- a/kubernetes/model/v1_pod.h +++ b/kubernetes/model/v1_pod.h @@ -28,9 +28,10 @@ typedef struct v1_pod_t { struct v1_pod_spec_t *spec; //model struct v1_pod_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_t; -v1_pod_t *v1_pod_create( +__attribute__((deprecated)) v1_pod_t *v1_pod_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_pod_affinity.c b/kubernetes/model/v1_pod_affinity.c index c19b3b71..9e79f4e3 100644 --- a/kubernetes/model/v1_pod_affinity.c +++ b/kubernetes/model/v1_pod_affinity.c @@ -5,7 +5,7 @@ -v1_pod_affinity_t *v1_pod_affinity_create( +static v1_pod_affinity_t *v1_pod_affinity_create_internal( list_t *preferred_during_scheduling_ignored_during_execution, list_t *required_during_scheduling_ignored_during_execution ) { @@ -16,14 +16,28 @@ v1_pod_affinity_t *v1_pod_affinity_create( v1_pod_affinity_local_var->preferred_during_scheduling_ignored_during_execution = preferred_during_scheduling_ignored_during_execution; v1_pod_affinity_local_var->required_during_scheduling_ignored_during_execution = required_during_scheduling_ignored_during_execution; + v1_pod_affinity_local_var->_library_owned = 1; return v1_pod_affinity_local_var; } +__attribute__((deprecated)) v1_pod_affinity_t *v1_pod_affinity_create( + list_t *preferred_during_scheduling_ignored_during_execution, + list_t *required_during_scheduling_ignored_during_execution + ) { + return v1_pod_affinity_create_internal ( + preferred_during_scheduling_ignored_during_execution, + required_during_scheduling_ignored_during_execution + ); +} void v1_pod_affinity_free(v1_pod_affinity_t *v1_pod_affinity) { if(NULL == v1_pod_affinity){ return ; } + if(v1_pod_affinity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_affinity_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_affinity->preferred_during_scheduling_ignored_during_execution) { list_ForEach(listEntry, v1_pod_affinity->preferred_during_scheduling_ignored_during_execution) { @@ -104,6 +118,9 @@ v1_pod_affinity_t *v1_pod_affinity_parseFromJSON(cJSON *v1_pod_affinityJSON){ // v1_pod_affinity->preferred_during_scheduling_ignored_during_execution cJSON *preferred_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_affinityJSON, "preferredDuringSchedulingIgnoredDuringExecution"); + if (cJSON_IsNull(preferred_during_scheduling_ignored_during_execution)) { + preferred_during_scheduling_ignored_during_execution = NULL; + } if (preferred_during_scheduling_ignored_during_execution) { cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(preferred_during_scheduling_ignored_during_execution)){ @@ -125,6 +142,9 @@ v1_pod_affinity_t *v1_pod_affinity_parseFromJSON(cJSON *v1_pod_affinityJSON){ // v1_pod_affinity->required_during_scheduling_ignored_during_execution cJSON *required_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_affinityJSON, "requiredDuringSchedulingIgnoredDuringExecution"); + if (cJSON_IsNull(required_during_scheduling_ignored_during_execution)) { + required_during_scheduling_ignored_during_execution = NULL; + } if (required_during_scheduling_ignored_during_execution) { cJSON *required_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(required_during_scheduling_ignored_during_execution)){ @@ -145,7 +165,7 @@ v1_pod_affinity_t *v1_pod_affinity_parseFromJSON(cJSON *v1_pod_affinityJSON){ } - v1_pod_affinity_local_var = v1_pod_affinity_create ( + v1_pod_affinity_local_var = v1_pod_affinity_create_internal ( preferred_during_scheduling_ignored_during_execution ? preferred_during_scheduling_ignored_during_executionList : NULL, required_during_scheduling_ignored_during_execution ? required_during_scheduling_ignored_during_executionList : NULL ); diff --git a/kubernetes/model/v1_pod_affinity.h b/kubernetes/model/v1_pod_affinity.h index 13cb7adb..fa10c926 100644 --- a/kubernetes/model/v1_pod_affinity.h +++ b/kubernetes/model/v1_pod_affinity.h @@ -24,9 +24,10 @@ typedef struct v1_pod_affinity_t { list_t *preferred_during_scheduling_ignored_during_execution; //nonprimitive container list_t *required_during_scheduling_ignored_during_execution; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_affinity_t; -v1_pod_affinity_t *v1_pod_affinity_create( +__attribute__((deprecated)) v1_pod_affinity_t *v1_pod_affinity_create( list_t *preferred_during_scheduling_ignored_during_execution, list_t *required_during_scheduling_ignored_during_execution ); diff --git a/kubernetes/model/v1_pod_affinity_term.c b/kubernetes/model/v1_pod_affinity_term.c index 1a0b96e9..c06d1885 100644 --- a/kubernetes/model/v1_pod_affinity_term.c +++ b/kubernetes/model/v1_pod_affinity_term.c @@ -5,7 +5,7 @@ -v1_pod_affinity_term_t *v1_pod_affinity_term_create( +static v1_pod_affinity_term_t *v1_pod_affinity_term_create_internal( v1_label_selector_t *label_selector, list_t *match_label_keys, list_t *mismatch_label_keys, @@ -24,14 +24,36 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_create( v1_pod_affinity_term_local_var->namespaces = namespaces; v1_pod_affinity_term_local_var->topology_key = topology_key; + v1_pod_affinity_term_local_var->_library_owned = 1; return v1_pod_affinity_term_local_var; } +__attribute__((deprecated)) v1_pod_affinity_term_t *v1_pod_affinity_term_create( + v1_label_selector_t *label_selector, + list_t *match_label_keys, + list_t *mismatch_label_keys, + v1_label_selector_t *namespace_selector, + list_t *namespaces, + char *topology_key + ) { + return v1_pod_affinity_term_create_internal ( + label_selector, + match_label_keys, + mismatch_label_keys, + namespace_selector, + namespaces, + topology_key + ); +} void v1_pod_affinity_term_free(v1_pod_affinity_term_t *v1_pod_affinity_term) { if(NULL == v1_pod_affinity_term){ return ; } + if(v1_pod_affinity_term->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_affinity_term_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_affinity_term->label_selector) { v1_label_selector_free(v1_pod_affinity_term->label_selector); @@ -94,7 +116,7 @@ cJSON *v1_pod_affinity_term_convertToJSON(v1_pod_affinity_term_t *v1_pod_affinit listEntry_t *match_label_keysListEntry; list_ForEach(match_label_keysListEntry, v1_pod_affinity_term->match_label_keys) { - if(cJSON_AddStringToObject(match_label_keys, "", (char*)match_label_keysListEntry->data) == NULL) + if(cJSON_AddStringToObject(match_label_keys, "", match_label_keysListEntry->data) == NULL) { goto fail; } @@ -111,7 +133,7 @@ cJSON *v1_pod_affinity_term_convertToJSON(v1_pod_affinity_term_t *v1_pod_affinit listEntry_t *mismatch_label_keysListEntry; list_ForEach(mismatch_label_keysListEntry, v1_pod_affinity_term->mismatch_label_keys) { - if(cJSON_AddStringToObject(mismatch_label_keys, "", (char*)mismatch_label_keysListEntry->data) == NULL) + if(cJSON_AddStringToObject(mismatch_label_keys, "", mismatch_label_keysListEntry->data) == NULL) { goto fail; } @@ -141,7 +163,7 @@ cJSON *v1_pod_affinity_term_convertToJSON(v1_pod_affinity_term_t *v1_pod_affinit listEntry_t *namespacesListEntry; list_ForEach(namespacesListEntry, v1_pod_affinity_term->namespaces) { - if(cJSON_AddStringToObject(namespaces, "", (char*)namespacesListEntry->data) == NULL) + if(cJSON_AddStringToObject(namespaces, "", namespacesListEntry->data) == NULL) { goto fail; } @@ -186,12 +208,18 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit // v1_pod_affinity_term->label_selector cJSON *label_selector = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "labelSelector"); + if (cJSON_IsNull(label_selector)) { + label_selector = NULL; + } if (label_selector) { label_selector_local_nonprim = v1_label_selector_parseFromJSON(label_selector); //nonprimitive } // v1_pod_affinity_term->match_label_keys cJSON *match_label_keys = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "matchLabelKeys"); + if (cJSON_IsNull(match_label_keys)) { + match_label_keys = NULL; + } if (match_label_keys) { cJSON *match_label_keys_local = NULL; if(!cJSON_IsArray(match_label_keys)) { @@ -211,6 +239,9 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit // v1_pod_affinity_term->mismatch_label_keys cJSON *mismatch_label_keys = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "mismatchLabelKeys"); + if (cJSON_IsNull(mismatch_label_keys)) { + mismatch_label_keys = NULL; + } if (mismatch_label_keys) { cJSON *mismatch_label_keys_local = NULL; if(!cJSON_IsArray(mismatch_label_keys)) { @@ -230,12 +261,18 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit // v1_pod_affinity_term->namespace_selector cJSON *namespace_selector = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "namespaceSelector"); + if (cJSON_IsNull(namespace_selector)) { + namespace_selector = NULL; + } if (namespace_selector) { namespace_selector_local_nonprim = v1_label_selector_parseFromJSON(namespace_selector); //nonprimitive } // v1_pod_affinity_term->namespaces cJSON *namespaces = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "namespaces"); + if (cJSON_IsNull(namespaces)) { + namespaces = NULL; + } if (namespaces) { cJSON *namespaces_local = NULL; if(!cJSON_IsArray(namespaces)) { @@ -255,6 +292,9 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit // v1_pod_affinity_term->topology_key cJSON *topology_key = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "topologyKey"); + if (cJSON_IsNull(topology_key)) { + topology_key = NULL; + } if (!topology_key) { goto end; } @@ -266,7 +306,7 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit } - v1_pod_affinity_term_local_var = v1_pod_affinity_term_create ( + v1_pod_affinity_term_local_var = v1_pod_affinity_term_create_internal ( label_selector ? label_selector_local_nonprim : NULL, match_label_keys ? match_label_keysList : NULL, mismatch_label_keys ? mismatch_label_keysList : NULL, diff --git a/kubernetes/model/v1_pod_affinity_term.h b/kubernetes/model/v1_pod_affinity_term.h index 5b737535..108a475c 100644 --- a/kubernetes/model/v1_pod_affinity_term.h +++ b/kubernetes/model/v1_pod_affinity_term.h @@ -27,9 +27,10 @@ typedef struct v1_pod_affinity_term_t { list_t *namespaces; //primitive container char *topology_key; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_affinity_term_t; -v1_pod_affinity_term_t *v1_pod_affinity_term_create( +__attribute__((deprecated)) v1_pod_affinity_term_t *v1_pod_affinity_term_create( v1_label_selector_t *label_selector, list_t *match_label_keys, list_t *mismatch_label_keys, diff --git a/kubernetes/model/v1_pod_anti_affinity.c b/kubernetes/model/v1_pod_anti_affinity.c index 19dcbac4..f45f7c12 100644 --- a/kubernetes/model/v1_pod_anti_affinity.c +++ b/kubernetes/model/v1_pod_anti_affinity.c @@ -5,7 +5,7 @@ -v1_pod_anti_affinity_t *v1_pod_anti_affinity_create( +static v1_pod_anti_affinity_t *v1_pod_anti_affinity_create_internal( list_t *preferred_during_scheduling_ignored_during_execution, list_t *required_during_scheduling_ignored_during_execution ) { @@ -16,14 +16,28 @@ v1_pod_anti_affinity_t *v1_pod_anti_affinity_create( v1_pod_anti_affinity_local_var->preferred_during_scheduling_ignored_during_execution = preferred_during_scheduling_ignored_during_execution; v1_pod_anti_affinity_local_var->required_during_scheduling_ignored_during_execution = required_during_scheduling_ignored_during_execution; + v1_pod_anti_affinity_local_var->_library_owned = 1; return v1_pod_anti_affinity_local_var; } +__attribute__((deprecated)) v1_pod_anti_affinity_t *v1_pod_anti_affinity_create( + list_t *preferred_during_scheduling_ignored_during_execution, + list_t *required_during_scheduling_ignored_during_execution + ) { + return v1_pod_anti_affinity_create_internal ( + preferred_during_scheduling_ignored_during_execution, + required_during_scheduling_ignored_during_execution + ); +} void v1_pod_anti_affinity_free(v1_pod_anti_affinity_t *v1_pod_anti_affinity) { if(NULL == v1_pod_anti_affinity){ return ; } + if(v1_pod_anti_affinity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_anti_affinity_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_anti_affinity->preferred_during_scheduling_ignored_during_execution) { list_ForEach(listEntry, v1_pod_anti_affinity->preferred_during_scheduling_ignored_during_execution) { @@ -104,6 +118,9 @@ v1_pod_anti_affinity_t *v1_pod_anti_affinity_parseFromJSON(cJSON *v1_pod_anti_af // v1_pod_anti_affinity->preferred_during_scheduling_ignored_during_execution cJSON *preferred_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_anti_affinityJSON, "preferredDuringSchedulingIgnoredDuringExecution"); + if (cJSON_IsNull(preferred_during_scheduling_ignored_during_execution)) { + preferred_during_scheduling_ignored_during_execution = NULL; + } if (preferred_during_scheduling_ignored_during_execution) { cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(preferred_during_scheduling_ignored_during_execution)){ @@ -125,6 +142,9 @@ v1_pod_anti_affinity_t *v1_pod_anti_affinity_parseFromJSON(cJSON *v1_pod_anti_af // v1_pod_anti_affinity->required_during_scheduling_ignored_during_execution cJSON *required_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_anti_affinityJSON, "requiredDuringSchedulingIgnoredDuringExecution"); + if (cJSON_IsNull(required_during_scheduling_ignored_during_execution)) { + required_during_scheduling_ignored_during_execution = NULL; + } if (required_during_scheduling_ignored_during_execution) { cJSON *required_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(required_during_scheduling_ignored_during_execution)){ @@ -145,7 +165,7 @@ v1_pod_anti_affinity_t *v1_pod_anti_affinity_parseFromJSON(cJSON *v1_pod_anti_af } - v1_pod_anti_affinity_local_var = v1_pod_anti_affinity_create ( + v1_pod_anti_affinity_local_var = v1_pod_anti_affinity_create_internal ( preferred_during_scheduling_ignored_during_execution ? preferred_during_scheduling_ignored_during_executionList : NULL, required_during_scheduling_ignored_during_execution ? required_during_scheduling_ignored_during_executionList : NULL ); diff --git a/kubernetes/model/v1_pod_anti_affinity.h b/kubernetes/model/v1_pod_anti_affinity.h index 15cb8b18..e68b20e0 100644 --- a/kubernetes/model/v1_pod_anti_affinity.h +++ b/kubernetes/model/v1_pod_anti_affinity.h @@ -24,9 +24,10 @@ typedef struct v1_pod_anti_affinity_t { list_t *preferred_during_scheduling_ignored_during_execution; //nonprimitive container list_t *required_during_scheduling_ignored_during_execution; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_anti_affinity_t; -v1_pod_anti_affinity_t *v1_pod_anti_affinity_create( +__attribute__((deprecated)) v1_pod_anti_affinity_t *v1_pod_anti_affinity_create( list_t *preferred_during_scheduling_ignored_during_execution, list_t *required_during_scheduling_ignored_during_execution ); diff --git a/kubernetes/model/v1_pod_certificate_projection.c b/kubernetes/model/v1_pod_certificate_projection.c new file mode 100644 index 00000000..9b0166ee --- /dev/null +++ b/kubernetes/model/v1_pod_certificate_projection.c @@ -0,0 +1,237 @@ +#include +#include +#include +#include "v1_pod_certificate_projection.h" + + + +static v1_pod_certificate_projection_t *v1_pod_certificate_projection_create_internal( + char *certificate_chain_path, + char *credential_bundle_path, + char *key_path, + char *key_type, + int max_expiration_seconds, + char *signer_name + ) { + v1_pod_certificate_projection_t *v1_pod_certificate_projection_local_var = malloc(sizeof(v1_pod_certificate_projection_t)); + if (!v1_pod_certificate_projection_local_var) { + return NULL; + } + v1_pod_certificate_projection_local_var->certificate_chain_path = certificate_chain_path; + v1_pod_certificate_projection_local_var->credential_bundle_path = credential_bundle_path; + v1_pod_certificate_projection_local_var->key_path = key_path; + v1_pod_certificate_projection_local_var->key_type = key_type; + v1_pod_certificate_projection_local_var->max_expiration_seconds = max_expiration_seconds; + v1_pod_certificate_projection_local_var->signer_name = signer_name; + + v1_pod_certificate_projection_local_var->_library_owned = 1; + return v1_pod_certificate_projection_local_var; +} + +__attribute__((deprecated)) v1_pod_certificate_projection_t *v1_pod_certificate_projection_create( + char *certificate_chain_path, + char *credential_bundle_path, + char *key_path, + char *key_type, + int max_expiration_seconds, + char *signer_name + ) { + return v1_pod_certificate_projection_create_internal ( + certificate_chain_path, + credential_bundle_path, + key_path, + key_type, + max_expiration_seconds, + signer_name + ); +} + +void v1_pod_certificate_projection_free(v1_pod_certificate_projection_t *v1_pod_certificate_projection) { + if(NULL == v1_pod_certificate_projection){ + return ; + } + if(v1_pod_certificate_projection->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_certificate_projection_free"); + return ; + } + listEntry_t *listEntry; + if (v1_pod_certificate_projection->certificate_chain_path) { + free(v1_pod_certificate_projection->certificate_chain_path); + v1_pod_certificate_projection->certificate_chain_path = NULL; + } + if (v1_pod_certificate_projection->credential_bundle_path) { + free(v1_pod_certificate_projection->credential_bundle_path); + v1_pod_certificate_projection->credential_bundle_path = NULL; + } + if (v1_pod_certificate_projection->key_path) { + free(v1_pod_certificate_projection->key_path); + v1_pod_certificate_projection->key_path = NULL; + } + if (v1_pod_certificate_projection->key_type) { + free(v1_pod_certificate_projection->key_type); + v1_pod_certificate_projection->key_type = NULL; + } + if (v1_pod_certificate_projection->signer_name) { + free(v1_pod_certificate_projection->signer_name); + v1_pod_certificate_projection->signer_name = NULL; + } + free(v1_pod_certificate_projection); +} + +cJSON *v1_pod_certificate_projection_convertToJSON(v1_pod_certificate_projection_t *v1_pod_certificate_projection) { + cJSON *item = cJSON_CreateObject(); + + // v1_pod_certificate_projection->certificate_chain_path + if(v1_pod_certificate_projection->certificate_chain_path) { + if(cJSON_AddStringToObject(item, "certificateChainPath", v1_pod_certificate_projection->certificate_chain_path) == NULL) { + goto fail; //String + } + } + + + // v1_pod_certificate_projection->credential_bundle_path + if(v1_pod_certificate_projection->credential_bundle_path) { + if(cJSON_AddStringToObject(item, "credentialBundlePath", v1_pod_certificate_projection->credential_bundle_path) == NULL) { + goto fail; //String + } + } + + + // v1_pod_certificate_projection->key_path + if(v1_pod_certificate_projection->key_path) { + if(cJSON_AddStringToObject(item, "keyPath", v1_pod_certificate_projection->key_path) == NULL) { + goto fail; //String + } + } + + + // v1_pod_certificate_projection->key_type + if (!v1_pod_certificate_projection->key_type) { + goto fail; + } + if(cJSON_AddStringToObject(item, "keyType", v1_pod_certificate_projection->key_type) == NULL) { + goto fail; //String + } + + + // v1_pod_certificate_projection->max_expiration_seconds + if(v1_pod_certificate_projection->max_expiration_seconds) { + if(cJSON_AddNumberToObject(item, "maxExpirationSeconds", v1_pod_certificate_projection->max_expiration_seconds) == NULL) { + goto fail; //Numeric + } + } + + + // v1_pod_certificate_projection->signer_name + if (!v1_pod_certificate_projection->signer_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "signerName", v1_pod_certificate_projection->signer_name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_pod_certificate_projection_t *v1_pod_certificate_projection_parseFromJSON(cJSON *v1_pod_certificate_projectionJSON){ + + v1_pod_certificate_projection_t *v1_pod_certificate_projection_local_var = NULL; + + // v1_pod_certificate_projection->certificate_chain_path + cJSON *certificate_chain_path = cJSON_GetObjectItemCaseSensitive(v1_pod_certificate_projectionJSON, "certificateChainPath"); + if (cJSON_IsNull(certificate_chain_path)) { + certificate_chain_path = NULL; + } + if (certificate_chain_path) { + if(!cJSON_IsString(certificate_chain_path) && !cJSON_IsNull(certificate_chain_path)) + { + goto end; //String + } + } + + // v1_pod_certificate_projection->credential_bundle_path + cJSON *credential_bundle_path = cJSON_GetObjectItemCaseSensitive(v1_pod_certificate_projectionJSON, "credentialBundlePath"); + if (cJSON_IsNull(credential_bundle_path)) { + credential_bundle_path = NULL; + } + if (credential_bundle_path) { + if(!cJSON_IsString(credential_bundle_path) && !cJSON_IsNull(credential_bundle_path)) + { + goto end; //String + } + } + + // v1_pod_certificate_projection->key_path + cJSON *key_path = cJSON_GetObjectItemCaseSensitive(v1_pod_certificate_projectionJSON, "keyPath"); + if (cJSON_IsNull(key_path)) { + key_path = NULL; + } + if (key_path) { + if(!cJSON_IsString(key_path) && !cJSON_IsNull(key_path)) + { + goto end; //String + } + } + + // v1_pod_certificate_projection->key_type + cJSON *key_type = cJSON_GetObjectItemCaseSensitive(v1_pod_certificate_projectionJSON, "keyType"); + if (cJSON_IsNull(key_type)) { + key_type = NULL; + } + if (!key_type) { + goto end; + } + + + if(!cJSON_IsString(key_type)) + { + goto end; //String + } + + // v1_pod_certificate_projection->max_expiration_seconds + cJSON *max_expiration_seconds = cJSON_GetObjectItemCaseSensitive(v1_pod_certificate_projectionJSON, "maxExpirationSeconds"); + if (cJSON_IsNull(max_expiration_seconds)) { + max_expiration_seconds = NULL; + } + if (max_expiration_seconds) { + if(!cJSON_IsNumber(max_expiration_seconds)) + { + goto end; //Numeric + } + } + + // v1_pod_certificate_projection->signer_name + cJSON *signer_name = cJSON_GetObjectItemCaseSensitive(v1_pod_certificate_projectionJSON, "signerName"); + if (cJSON_IsNull(signer_name)) { + signer_name = NULL; + } + if (!signer_name) { + goto end; + } + + + if(!cJSON_IsString(signer_name)) + { + goto end; //String + } + + + v1_pod_certificate_projection_local_var = v1_pod_certificate_projection_create_internal ( + certificate_chain_path && !cJSON_IsNull(certificate_chain_path) ? strdup(certificate_chain_path->valuestring) : NULL, + credential_bundle_path && !cJSON_IsNull(credential_bundle_path) ? strdup(credential_bundle_path->valuestring) : NULL, + key_path && !cJSON_IsNull(key_path) ? strdup(key_path->valuestring) : NULL, + strdup(key_type->valuestring), + max_expiration_seconds ? max_expiration_seconds->valuedouble : 0, + strdup(signer_name->valuestring) + ); + + return v1_pod_certificate_projection_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_pod_certificate_projection.h b/kubernetes/model/v1_pod_certificate_projection.h new file mode 100644 index 00000000..83c5a9d6 --- /dev/null +++ b/kubernetes/model/v1_pod_certificate_projection.h @@ -0,0 +1,48 @@ +/* + * v1_pod_certificate_projection.h + * + * PodCertificateProjection provides a private key and X.509 certificate in the pod filesystem. + */ + +#ifndef _v1_pod_certificate_projection_H_ +#define _v1_pod_certificate_projection_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_pod_certificate_projection_t v1_pod_certificate_projection_t; + + + + +typedef struct v1_pod_certificate_projection_t { + char *certificate_chain_path; // string + char *credential_bundle_path; // string + char *key_path; // string + char *key_type; // string + int max_expiration_seconds; //numeric + char *signer_name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_pod_certificate_projection_t; + +__attribute__((deprecated)) v1_pod_certificate_projection_t *v1_pod_certificate_projection_create( + char *certificate_chain_path, + char *credential_bundle_path, + char *key_path, + char *key_type, + int max_expiration_seconds, + char *signer_name +); + +void v1_pod_certificate_projection_free(v1_pod_certificate_projection_t *v1_pod_certificate_projection); + +v1_pod_certificate_projection_t *v1_pod_certificate_projection_parseFromJSON(cJSON *v1_pod_certificate_projectionJSON); + +cJSON *v1_pod_certificate_projection_convertToJSON(v1_pod_certificate_projection_t *v1_pod_certificate_projection); + +#endif /* _v1_pod_certificate_projection_H_ */ + diff --git a/kubernetes/model/v1_pod_condition.c b/kubernetes/model/v1_pod_condition.c index 54a34b8f..5438b8da 100644 --- a/kubernetes/model/v1_pod_condition.c +++ b/kubernetes/model/v1_pod_condition.c @@ -5,10 +5,11 @@ -v1_pod_condition_t *v1_pod_condition_create( +static v1_pod_condition_t *v1_pod_condition_create_internal( char *last_probe_time, char *last_transition_time, char *message, + long observed_generation, char *reason, char *status, char *type @@ -20,18 +21,43 @@ v1_pod_condition_t *v1_pod_condition_create( v1_pod_condition_local_var->last_probe_time = last_probe_time; v1_pod_condition_local_var->last_transition_time = last_transition_time; v1_pod_condition_local_var->message = message; + v1_pod_condition_local_var->observed_generation = observed_generation; v1_pod_condition_local_var->reason = reason; v1_pod_condition_local_var->status = status; v1_pod_condition_local_var->type = type; + v1_pod_condition_local_var->_library_owned = 1; return v1_pod_condition_local_var; } +__attribute__((deprecated)) v1_pod_condition_t *v1_pod_condition_create( + char *last_probe_time, + char *last_transition_time, + char *message, + long observed_generation, + char *reason, + char *status, + char *type + ) { + return v1_pod_condition_create_internal ( + last_probe_time, + last_transition_time, + message, + observed_generation, + reason, + status, + type + ); +} void v1_pod_condition_free(v1_pod_condition_t *v1_pod_condition) { if(NULL == v1_pod_condition){ return ; } + if(v1_pod_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_condition->last_probe_time) { free(v1_pod_condition->last_probe_time); @@ -87,6 +113,14 @@ cJSON *v1_pod_condition_convertToJSON(v1_pod_condition_t *v1_pod_condition) { } + // v1_pod_condition->observed_generation + if(v1_pod_condition->observed_generation) { + if(cJSON_AddNumberToObject(item, "observedGeneration", v1_pod_condition->observed_generation) == NULL) { + goto fail; //Numeric + } + } + + // v1_pod_condition->reason if(v1_pod_condition->reason) { if(cJSON_AddStringToObject(item, "reason", v1_pod_condition->reason) == NULL) { @@ -126,6 +160,9 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ // v1_pod_condition->last_probe_time cJSON *last_probe_time = cJSON_GetObjectItemCaseSensitive(v1_pod_conditionJSON, "lastProbeTime"); + if (cJSON_IsNull(last_probe_time)) { + last_probe_time = NULL; + } if (last_probe_time) { if(!cJSON_IsString(last_probe_time) && !cJSON_IsNull(last_probe_time)) { @@ -135,6 +172,9 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ // v1_pod_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_pod_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -144,6 +184,9 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ // v1_pod_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_pod_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -151,8 +194,23 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ } } + // v1_pod_condition->observed_generation + cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_pod_conditionJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } + if (observed_generation) { + if(!cJSON_IsNumber(observed_generation)) + { + goto end; //Numeric + } + } + // v1_pod_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_pod_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -162,6 +220,9 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ // v1_pod_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_pod_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -174,6 +235,9 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ // v1_pod_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_pod_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -185,10 +249,11 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ } - v1_pod_condition_local_var = v1_pod_condition_create ( + v1_pod_condition_local_var = v1_pod_condition_create_internal ( last_probe_time && !cJSON_IsNull(last_probe_time) ? strdup(last_probe_time->valuestring) : NULL, last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, + observed_generation ? observed_generation->valuedouble : 0, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, strdup(status->valuestring), strdup(type->valuestring) diff --git a/kubernetes/model/v1_pod_condition.h b/kubernetes/model/v1_pod_condition.h index da2e2674..573e687b 100644 --- a/kubernetes/model/v1_pod_condition.h +++ b/kubernetes/model/v1_pod_condition.h @@ -22,16 +22,19 @@ typedef struct v1_pod_condition_t { char *last_probe_time; //date time char *last_transition_time; //date time char *message; // string + long observed_generation; //numeric char *reason; // string char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_condition_t; -v1_pod_condition_t *v1_pod_condition_create( +__attribute__((deprecated)) v1_pod_condition_t *v1_pod_condition_create( char *last_probe_time, char *last_transition_time, char *message, + long observed_generation, char *reason, char *status, char *type diff --git a/kubernetes/model/v1_pod_disruption_budget.c b/kubernetes/model/v1_pod_disruption_budget.c index ea7c6567..1a71512e 100644 --- a/kubernetes/model/v1_pod_disruption_budget.c +++ b/kubernetes/model/v1_pod_disruption_budget.c @@ -5,7 +5,7 @@ -v1_pod_disruption_budget_t *v1_pod_disruption_budget_create( +static v1_pod_disruption_budget_t *v1_pod_disruption_budget_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_pod_disruption_budget_t *v1_pod_disruption_budget_create( v1_pod_disruption_budget_local_var->spec = spec; v1_pod_disruption_budget_local_var->status = status; + v1_pod_disruption_budget_local_var->_library_owned = 1; return v1_pod_disruption_budget_local_var; } +__attribute__((deprecated)) v1_pod_disruption_budget_t *v1_pod_disruption_budget_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_pod_disruption_budget_spec_t *spec, + v1_pod_disruption_budget_status_t *status + ) { + return v1_pod_disruption_budget_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_pod_disruption_budget_free(v1_pod_disruption_budget_t *v1_pod_disruption_budget) { if(NULL == v1_pod_disruption_budget){ return ; } + if(v1_pod_disruption_budget->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_disruption_budget_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_disruption_budget->api_version) { free(v1_pod_disruption_budget->api_version); @@ -134,6 +154,9 @@ v1_pod_disruption_budget_t *v1_pod_disruption_budget_parseFromJSON(cJSON *v1_pod // v1_pod_disruption_budget->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budgetJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_pod_disruption_budget_t *v1_pod_disruption_budget_parseFromJSON(cJSON *v1_pod // v1_pod_disruption_budget->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budgetJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_pod_disruption_budget_t *v1_pod_disruption_budget_parseFromJSON(cJSON *v1_pod // v1_pod_disruption_budget->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budgetJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_pod_disruption_budget->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budgetJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_pod_disruption_budget_spec_parseFromJSON(spec); //nonprimitive } // v1_pod_disruption_budget->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budgetJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_pod_disruption_budget_status_parseFromJSON(status); //nonprimitive } - v1_pod_disruption_budget_local_var = v1_pod_disruption_budget_create ( + v1_pod_disruption_budget_local_var = v1_pod_disruption_budget_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_pod_disruption_budget.h b/kubernetes/model/v1_pod_disruption_budget.h index 0f9543d5..4dbfab3e 100644 --- a/kubernetes/model/v1_pod_disruption_budget.h +++ b/kubernetes/model/v1_pod_disruption_budget.h @@ -28,9 +28,10 @@ typedef struct v1_pod_disruption_budget_t { struct v1_pod_disruption_budget_spec_t *spec; //model struct v1_pod_disruption_budget_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_disruption_budget_t; -v1_pod_disruption_budget_t *v1_pod_disruption_budget_create( +__attribute__((deprecated)) v1_pod_disruption_budget_t *v1_pod_disruption_budget_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_pod_disruption_budget_list.c b/kubernetes/model/v1_pod_disruption_budget_list.c index 40326de6..bfaf6966 100644 --- a/kubernetes/model/v1_pod_disruption_budget_list.c +++ b/kubernetes/model/v1_pod_disruption_budget_list.c @@ -5,7 +5,7 @@ -v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_create( +static v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_create( v1_pod_disruption_budget_list_local_var->kind = kind; v1_pod_disruption_budget_list_local_var->metadata = metadata; + v1_pod_disruption_budget_list_local_var->_library_owned = 1; return v1_pod_disruption_budget_list_local_var; } +__attribute__((deprecated)) v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_pod_disruption_budget_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_pod_disruption_budget_list_free(v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list) { if(NULL == v1_pod_disruption_budget_list){ return ; } + if(v1_pod_disruption_budget_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_disruption_budget_list_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_disruption_budget_list->api_version) { free(v1_pod_disruption_budget_list->api_version); @@ -123,6 +141,9 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_parseFromJSON(cJS // v1_pod_disruption_budget_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_parseFromJSON(cJS // v1_pod_disruption_budget_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_parseFromJSON(cJS // v1_pod_disruption_budget_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_parseFromJSON(cJS // v1_pod_disruption_budget_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_pod_disruption_budget_list_local_var = v1_pod_disruption_budget_list_create ( + v1_pod_disruption_budget_list_local_var = v1_pod_disruption_budget_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_pod_disruption_budget_list.h b/kubernetes/model/v1_pod_disruption_budget_list.h index 085cf23d..c0d2348d 100644 --- a/kubernetes/model/v1_pod_disruption_budget_list.h +++ b/kubernetes/model/v1_pod_disruption_budget_list.h @@ -26,9 +26,10 @@ typedef struct v1_pod_disruption_budget_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_disruption_budget_list_t; -v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_create( +__attribute__((deprecated)) v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_pod_disruption_budget_spec.c b/kubernetes/model/v1_pod_disruption_budget_spec.c index 30747687..a7a56154 100644 --- a/kubernetes/model/v1_pod_disruption_budget_spec.c +++ b/kubernetes/model/v1_pod_disruption_budget_spec.c @@ -5,7 +5,7 @@ -v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_create( +static v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_create_internal( int_or_string_t *max_unavailable, int_or_string_t *min_available, v1_label_selector_t *selector, @@ -20,14 +20,32 @@ v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_create( v1_pod_disruption_budget_spec_local_var->selector = selector; v1_pod_disruption_budget_spec_local_var->unhealthy_pod_eviction_policy = unhealthy_pod_eviction_policy; + v1_pod_disruption_budget_spec_local_var->_library_owned = 1; return v1_pod_disruption_budget_spec_local_var; } +__attribute__((deprecated)) v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_create( + int_or_string_t *max_unavailable, + int_or_string_t *min_available, + v1_label_selector_t *selector, + char *unhealthy_pod_eviction_policy + ) { + return v1_pod_disruption_budget_spec_create_internal ( + max_unavailable, + min_available, + selector, + unhealthy_pod_eviction_policy + ); +} void v1_pod_disruption_budget_spec_free(v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec) { if(NULL == v1_pod_disruption_budget_spec){ return ; } + if(v1_pod_disruption_budget_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_disruption_budget_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_disruption_budget_spec->max_unavailable) { int_or_string_free(v1_pod_disruption_budget_spec->max_unavailable); @@ -120,24 +138,36 @@ v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_parseFromJSON(cJS // v1_pod_disruption_budget_spec->max_unavailable cJSON *max_unavailable = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_specJSON, "maxUnavailable"); + if (cJSON_IsNull(max_unavailable)) { + max_unavailable = NULL; + } if (max_unavailable) { max_unavailable_local_nonprim = int_or_string_parseFromJSON(max_unavailable); //custom } // v1_pod_disruption_budget_spec->min_available cJSON *min_available = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_specJSON, "minAvailable"); + if (cJSON_IsNull(min_available)) { + min_available = NULL; + } if (min_available) { min_available_local_nonprim = int_or_string_parseFromJSON(min_available); //custom } // v1_pod_disruption_budget_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { selector_local_nonprim = v1_label_selector_parseFromJSON(selector); //nonprimitive } // v1_pod_disruption_budget_spec->unhealthy_pod_eviction_policy cJSON *unhealthy_pod_eviction_policy = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_specJSON, "unhealthyPodEvictionPolicy"); + if (cJSON_IsNull(unhealthy_pod_eviction_policy)) { + unhealthy_pod_eviction_policy = NULL; + } if (unhealthy_pod_eviction_policy) { if(!cJSON_IsString(unhealthy_pod_eviction_policy) && !cJSON_IsNull(unhealthy_pod_eviction_policy)) { @@ -146,7 +176,7 @@ v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_parseFromJSON(cJS } - v1_pod_disruption_budget_spec_local_var = v1_pod_disruption_budget_spec_create ( + v1_pod_disruption_budget_spec_local_var = v1_pod_disruption_budget_spec_create_internal ( max_unavailable ? max_unavailable_local_nonprim : NULL, min_available ? min_available_local_nonprim : NULL, selector ? selector_local_nonprim : NULL, diff --git a/kubernetes/model/v1_pod_disruption_budget_spec.h b/kubernetes/model/v1_pod_disruption_budget_spec.h index d751e8e2..7b27ba2d 100644 --- a/kubernetes/model/v1_pod_disruption_budget_spec.h +++ b/kubernetes/model/v1_pod_disruption_budget_spec.h @@ -26,9 +26,10 @@ typedef struct v1_pod_disruption_budget_spec_t { struct v1_label_selector_t *selector; //model char *unhealthy_pod_eviction_policy; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_disruption_budget_spec_t; -v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_create( +__attribute__((deprecated)) v1_pod_disruption_budget_spec_t *v1_pod_disruption_budget_spec_create( int_or_string_t *max_unavailable, int_or_string_t *min_available, v1_label_selector_t *selector, diff --git a/kubernetes/model/v1_pod_disruption_budget_status.c b/kubernetes/model/v1_pod_disruption_budget_status.c index 9ef32fd9..f18950c3 100644 --- a/kubernetes/model/v1_pod_disruption_budget_status.c +++ b/kubernetes/model/v1_pod_disruption_budget_status.c @@ -5,7 +5,7 @@ -v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_create( +static v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_create_internal( list_t *conditions, int current_healthy, int desired_healthy, @@ -26,14 +26,38 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_create( v1_pod_disruption_budget_status_local_var->expected_pods = expected_pods; v1_pod_disruption_budget_status_local_var->observed_generation = observed_generation; + v1_pod_disruption_budget_status_local_var->_library_owned = 1; return v1_pod_disruption_budget_status_local_var; } +__attribute__((deprecated)) v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_create( + list_t *conditions, + int current_healthy, + int desired_healthy, + list_t* disrupted_pods, + int disruptions_allowed, + int expected_pods, + long observed_generation + ) { + return v1_pod_disruption_budget_status_create_internal ( + conditions, + current_healthy, + desired_healthy, + disrupted_pods, + disruptions_allowed, + expected_pods, + observed_generation + ); +} void v1_pod_disruption_budget_status_free(v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status) { if(NULL == v1_pod_disruption_budget_status){ return ; } + if(v1_pod_disruption_budget_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_disruption_budget_status_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_disruption_budget_status->conditions) { list_ForEach(listEntry, v1_pod_disruption_budget_status->conditions) { @@ -44,7 +68,7 @@ void v1_pod_disruption_budget_status_free(v1_pod_disruption_budget_status_t *v1_ } if (v1_pod_disruption_budget_status->disrupted_pods) { list_ForEach(listEntry, v1_pod_disruption_budget_status->disrupted_pods) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -106,7 +130,7 @@ cJSON *v1_pod_disruption_budget_status_convertToJSON(v1_pod_disruption_budget_st listEntry_t *disrupted_podsListEntry; if (v1_pod_disruption_budget_status->disrupted_pods) { list_ForEach(disrupted_podsListEntry, v1_pod_disruption_budget_status->disrupted_pods) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)disrupted_podsListEntry->data; + keyValuePair_t *localKeyValue = disrupted_podsListEntry->data; } } } @@ -157,6 +181,9 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -178,6 +205,9 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->current_healthy cJSON *current_healthy = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "currentHealthy"); + if (cJSON_IsNull(current_healthy)) { + current_healthy = NULL; + } if (!current_healthy) { goto end; } @@ -190,6 +220,9 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->desired_healthy cJSON *desired_healthy = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "desiredHealthy"); + if (cJSON_IsNull(desired_healthy)) { + desired_healthy = NULL; + } if (!desired_healthy) { goto end; } @@ -202,6 +235,9 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->disrupted_pods cJSON *disrupted_pods = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "disruptedPods"); + if (cJSON_IsNull(disrupted_pods)) { + disrupted_pods = NULL; + } if (disrupted_pods) { cJSON *disrupted_pods_local_map = NULL; if(!cJSON_IsObject(disrupted_pods) && !cJSON_IsNull(disrupted_pods)) @@ -222,6 +258,9 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->disruptions_allowed cJSON *disruptions_allowed = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "disruptionsAllowed"); + if (cJSON_IsNull(disruptions_allowed)) { + disruptions_allowed = NULL; + } if (!disruptions_allowed) { goto end; } @@ -234,6 +273,9 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->expected_pods cJSON *expected_pods = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "expectedPods"); + if (cJSON_IsNull(expected_pods)) { + expected_pods = NULL; + } if (!expected_pods) { goto end; } @@ -246,6 +288,9 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -254,7 +299,7 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON } - v1_pod_disruption_budget_status_local_var = v1_pod_disruption_budget_status_create ( + v1_pod_disruption_budget_status_local_var = v1_pod_disruption_budget_status_create_internal ( conditions ? conditionsList : NULL, current_healthy->valuedouble, desired_healthy->valuedouble, @@ -278,7 +323,7 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON if (disrupted_podsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, disrupted_podsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; keyValuePair_free(localKeyValue); diff --git a/kubernetes/model/v1_pod_disruption_budget_status.h b/kubernetes/model/v1_pod_disruption_budget_status.h index 8dcac989..0bcdca2b 100644 --- a/kubernetes/model/v1_pod_disruption_budget_status.h +++ b/kubernetes/model/v1_pod_disruption_budget_status.h @@ -28,9 +28,10 @@ typedef struct v1_pod_disruption_budget_status_t { int expected_pods; //numeric long observed_generation; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_disruption_budget_status_t; -v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_create( +__attribute__((deprecated)) v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_create( list_t *conditions, int current_healthy, int desired_healthy, diff --git a/kubernetes/model/v1_pod_dns_config.c b/kubernetes/model/v1_pod_dns_config.c index 9b0ee401..65e99f20 100644 --- a/kubernetes/model/v1_pod_dns_config.c +++ b/kubernetes/model/v1_pod_dns_config.c @@ -5,7 +5,7 @@ -v1_pod_dns_config_t *v1_pod_dns_config_create( +static v1_pod_dns_config_t *v1_pod_dns_config_create_internal( list_t *nameservers, list_t *options, list_t *searches @@ -18,14 +18,30 @@ v1_pod_dns_config_t *v1_pod_dns_config_create( v1_pod_dns_config_local_var->options = options; v1_pod_dns_config_local_var->searches = searches; + v1_pod_dns_config_local_var->_library_owned = 1; return v1_pod_dns_config_local_var; } +__attribute__((deprecated)) v1_pod_dns_config_t *v1_pod_dns_config_create( + list_t *nameservers, + list_t *options, + list_t *searches + ) { + return v1_pod_dns_config_create_internal ( + nameservers, + options, + searches + ); +} void v1_pod_dns_config_free(v1_pod_dns_config_t *v1_pod_dns_config) { if(NULL == v1_pod_dns_config){ return ; } + if(v1_pod_dns_config->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_dns_config_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_dns_config->nameservers) { list_ForEach(listEntry, v1_pod_dns_config->nameservers) { @@ -63,7 +79,7 @@ cJSON *v1_pod_dns_config_convertToJSON(v1_pod_dns_config_t *v1_pod_dns_config) { listEntry_t *nameserversListEntry; list_ForEach(nameserversListEntry, v1_pod_dns_config->nameservers) { - if(cJSON_AddStringToObject(nameservers, "", (char*)nameserversListEntry->data) == NULL) + if(cJSON_AddStringToObject(nameservers, "", nameserversListEntry->data) == NULL) { goto fail; } @@ -100,7 +116,7 @@ cJSON *v1_pod_dns_config_convertToJSON(v1_pod_dns_config_t *v1_pod_dns_config) { listEntry_t *searchesListEntry; list_ForEach(searchesListEntry, v1_pod_dns_config->searches) { - if(cJSON_AddStringToObject(searches, "", (char*)searchesListEntry->data) == NULL) + if(cJSON_AddStringToObject(searches, "", searchesListEntry->data) == NULL) { goto fail; } @@ -130,6 +146,9 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO // v1_pod_dns_config->nameservers cJSON *nameservers = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_configJSON, "nameservers"); + if (cJSON_IsNull(nameservers)) { + nameservers = NULL; + } if (nameservers) { cJSON *nameservers_local = NULL; if(!cJSON_IsArray(nameservers)) { @@ -149,6 +168,9 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO // v1_pod_dns_config->options cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_configJSON, "options"); + if (cJSON_IsNull(options)) { + options = NULL; + } if (options) { cJSON *options_local_nonprimitive = NULL; if(!cJSON_IsArray(options)){ @@ -170,6 +192,9 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO // v1_pod_dns_config->searches cJSON *searches = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_configJSON, "searches"); + if (cJSON_IsNull(searches)) { + searches = NULL; + } if (searches) { cJSON *searches_local = NULL; if(!cJSON_IsArray(searches)) { @@ -188,7 +213,7 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO } - v1_pod_dns_config_local_var = v1_pod_dns_config_create ( + v1_pod_dns_config_local_var = v1_pod_dns_config_create_internal ( nameservers ? nameserversList : NULL, options ? optionsList : NULL, searches ? searchesList : NULL diff --git a/kubernetes/model/v1_pod_dns_config.h b/kubernetes/model/v1_pod_dns_config.h index 442560e8..f82c4106 100644 --- a/kubernetes/model/v1_pod_dns_config.h +++ b/kubernetes/model/v1_pod_dns_config.h @@ -24,9 +24,10 @@ typedef struct v1_pod_dns_config_t { list_t *options; //nonprimitive container list_t *searches; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_dns_config_t; -v1_pod_dns_config_t *v1_pod_dns_config_create( +__attribute__((deprecated)) v1_pod_dns_config_t *v1_pod_dns_config_create( list_t *nameservers, list_t *options, list_t *searches diff --git a/kubernetes/model/v1_pod_dns_config_option.c b/kubernetes/model/v1_pod_dns_config_option.c index ccfd0351..6ca25545 100644 --- a/kubernetes/model/v1_pod_dns_config_option.c +++ b/kubernetes/model/v1_pod_dns_config_option.c @@ -5,7 +5,7 @@ -v1_pod_dns_config_option_t *v1_pod_dns_config_option_create( +static v1_pod_dns_config_option_t *v1_pod_dns_config_option_create_internal( char *name, char *value ) { @@ -16,14 +16,28 @@ v1_pod_dns_config_option_t *v1_pod_dns_config_option_create( v1_pod_dns_config_option_local_var->name = name; v1_pod_dns_config_option_local_var->value = value; + v1_pod_dns_config_option_local_var->_library_owned = 1; return v1_pod_dns_config_option_local_var; } +__attribute__((deprecated)) v1_pod_dns_config_option_t *v1_pod_dns_config_option_create( + char *name, + char *value + ) { + return v1_pod_dns_config_option_create_internal ( + name, + value + ); +} void v1_pod_dns_config_option_free(v1_pod_dns_config_option_t *v1_pod_dns_config_option) { if(NULL == v1_pod_dns_config_option){ return ; } + if(v1_pod_dns_config_option->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_dns_config_option_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_dns_config_option->name) { free(v1_pod_dns_config_option->name); @@ -68,6 +82,9 @@ v1_pod_dns_config_option_t *v1_pod_dns_config_option_parseFromJSON(cJSON *v1_pod // v1_pod_dns_config_option->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_config_optionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -77,6 +94,9 @@ v1_pod_dns_config_option_t *v1_pod_dns_config_option_parseFromJSON(cJSON *v1_pod // v1_pod_dns_config_option->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_config_optionJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (value) { if(!cJSON_IsString(value) && !cJSON_IsNull(value)) { @@ -85,7 +105,7 @@ v1_pod_dns_config_option_t *v1_pod_dns_config_option_parseFromJSON(cJSON *v1_pod } - v1_pod_dns_config_option_local_var = v1_pod_dns_config_option_create ( + v1_pod_dns_config_option_local_var = v1_pod_dns_config_option_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL ); diff --git a/kubernetes/model/v1_pod_dns_config_option.h b/kubernetes/model/v1_pod_dns_config_option.h index a2a9d283..7e89fd9f 100644 --- a/kubernetes/model/v1_pod_dns_config_option.h +++ b/kubernetes/model/v1_pod_dns_config_option.h @@ -22,9 +22,10 @@ typedef struct v1_pod_dns_config_option_t { char *name; // string char *value; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_dns_config_option_t; -v1_pod_dns_config_option_t *v1_pod_dns_config_option_create( +__attribute__((deprecated)) v1_pod_dns_config_option_t *v1_pod_dns_config_option_create( char *name, char *value ); diff --git a/kubernetes/model/v1_pod_extended_resource_claim_status.c b/kubernetes/model/v1_pod_extended_resource_claim_status.c new file mode 100644 index 00000000..5fe5d43e --- /dev/null +++ b/kubernetes/model/v1_pod_extended_resource_claim_status.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include "v1_pod_extended_resource_claim_status.h" + + + +static v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status_create_internal( + list_t *request_mappings, + char *resource_claim_name + ) { + v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status_local_var = malloc(sizeof(v1_pod_extended_resource_claim_status_t)); + if (!v1_pod_extended_resource_claim_status_local_var) { + return NULL; + } + v1_pod_extended_resource_claim_status_local_var->request_mappings = request_mappings; + v1_pod_extended_resource_claim_status_local_var->resource_claim_name = resource_claim_name; + + v1_pod_extended_resource_claim_status_local_var->_library_owned = 1; + return v1_pod_extended_resource_claim_status_local_var; +} + +__attribute__((deprecated)) v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status_create( + list_t *request_mappings, + char *resource_claim_name + ) { + return v1_pod_extended_resource_claim_status_create_internal ( + request_mappings, + resource_claim_name + ); +} + +void v1_pod_extended_resource_claim_status_free(v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status) { + if(NULL == v1_pod_extended_resource_claim_status){ + return ; + } + if(v1_pod_extended_resource_claim_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_extended_resource_claim_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1_pod_extended_resource_claim_status->request_mappings) { + list_ForEach(listEntry, v1_pod_extended_resource_claim_status->request_mappings) { + v1_container_extended_resource_request_free(listEntry->data); + } + list_freeList(v1_pod_extended_resource_claim_status->request_mappings); + v1_pod_extended_resource_claim_status->request_mappings = NULL; + } + if (v1_pod_extended_resource_claim_status->resource_claim_name) { + free(v1_pod_extended_resource_claim_status->resource_claim_name); + v1_pod_extended_resource_claim_status->resource_claim_name = NULL; + } + free(v1_pod_extended_resource_claim_status); +} + +cJSON *v1_pod_extended_resource_claim_status_convertToJSON(v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status) { + cJSON *item = cJSON_CreateObject(); + + // v1_pod_extended_resource_claim_status->request_mappings + if (!v1_pod_extended_resource_claim_status->request_mappings) { + goto fail; + } + cJSON *request_mappings = cJSON_AddArrayToObject(item, "requestMappings"); + if(request_mappings == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *request_mappingsListEntry; + if (v1_pod_extended_resource_claim_status->request_mappings) { + list_ForEach(request_mappingsListEntry, v1_pod_extended_resource_claim_status->request_mappings) { + cJSON *itemLocal = v1_container_extended_resource_request_convertToJSON(request_mappingsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(request_mappings, itemLocal); + } + } + + + // v1_pod_extended_resource_claim_status->resource_claim_name + if (!v1_pod_extended_resource_claim_status->resource_claim_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resourceClaimName", v1_pod_extended_resource_claim_status->resource_claim_name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status_parseFromJSON(cJSON *v1_pod_extended_resource_claim_statusJSON){ + + v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status_local_var = NULL; + + // define the local list for v1_pod_extended_resource_claim_status->request_mappings + list_t *request_mappingsList = NULL; + + // v1_pod_extended_resource_claim_status->request_mappings + cJSON *request_mappings = cJSON_GetObjectItemCaseSensitive(v1_pod_extended_resource_claim_statusJSON, "requestMappings"); + if (cJSON_IsNull(request_mappings)) { + request_mappings = NULL; + } + if (!request_mappings) { + goto end; + } + + + cJSON *request_mappings_local_nonprimitive = NULL; + if(!cJSON_IsArray(request_mappings)){ + goto end; //nonprimitive container + } + + request_mappingsList = list_createList(); + + cJSON_ArrayForEach(request_mappings_local_nonprimitive,request_mappings ) + { + if(!cJSON_IsObject(request_mappings_local_nonprimitive)){ + goto end; + } + v1_container_extended_resource_request_t *request_mappingsItem = v1_container_extended_resource_request_parseFromJSON(request_mappings_local_nonprimitive); + + list_addElement(request_mappingsList, request_mappingsItem); + } + + // v1_pod_extended_resource_claim_status->resource_claim_name + cJSON *resource_claim_name = cJSON_GetObjectItemCaseSensitive(v1_pod_extended_resource_claim_statusJSON, "resourceClaimName"); + if (cJSON_IsNull(resource_claim_name)) { + resource_claim_name = NULL; + } + if (!resource_claim_name) { + goto end; + } + + + if(!cJSON_IsString(resource_claim_name)) + { + goto end; //String + } + + + v1_pod_extended_resource_claim_status_local_var = v1_pod_extended_resource_claim_status_create_internal ( + request_mappingsList, + strdup(resource_claim_name->valuestring) + ); + + return v1_pod_extended_resource_claim_status_local_var; +end: + if (request_mappingsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, request_mappingsList) { + v1_container_extended_resource_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(request_mappingsList); + request_mappingsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_pod_extended_resource_claim_status.h b/kubernetes/model/v1_pod_extended_resource_claim_status.h new file mode 100644 index 00000000..65e97f94 --- /dev/null +++ b/kubernetes/model/v1_pod_extended_resource_claim_status.h @@ -0,0 +1,41 @@ +/* + * v1_pod_extended_resource_claim_status.h + * + * PodExtendedResourceClaimStatus is stored in the PodStatus for the extended resource requests backed by DRA. It stores the generated name for the corresponding special ResourceClaim created by the scheduler. + */ + +#ifndef _v1_pod_extended_resource_claim_status_H_ +#define _v1_pod_extended_resource_claim_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_pod_extended_resource_claim_status_t v1_pod_extended_resource_claim_status_t; + +#include "v1_container_extended_resource_request.h" + + + +typedef struct v1_pod_extended_resource_claim_status_t { + list_t *request_mappings; //nonprimitive container + char *resource_claim_name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_pod_extended_resource_claim_status_t; + +__attribute__((deprecated)) v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status_create( + list_t *request_mappings, + char *resource_claim_name +); + +void v1_pod_extended_resource_claim_status_free(v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status); + +v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status_parseFromJSON(cJSON *v1_pod_extended_resource_claim_statusJSON); + +cJSON *v1_pod_extended_resource_claim_status_convertToJSON(v1_pod_extended_resource_claim_status_t *v1_pod_extended_resource_claim_status); + +#endif /* _v1_pod_extended_resource_claim_status_H_ */ + diff --git a/kubernetes/model/v1_pod_failure_policy.c b/kubernetes/model/v1_pod_failure_policy.c index ca9272f8..2b8fb907 100644 --- a/kubernetes/model/v1_pod_failure_policy.c +++ b/kubernetes/model/v1_pod_failure_policy.c @@ -5,7 +5,7 @@ -v1_pod_failure_policy_t *v1_pod_failure_policy_create( +static v1_pod_failure_policy_t *v1_pod_failure_policy_create_internal( list_t *rules ) { v1_pod_failure_policy_t *v1_pod_failure_policy_local_var = malloc(sizeof(v1_pod_failure_policy_t)); @@ -14,14 +14,26 @@ v1_pod_failure_policy_t *v1_pod_failure_policy_create( } v1_pod_failure_policy_local_var->rules = rules; + v1_pod_failure_policy_local_var->_library_owned = 1; return v1_pod_failure_policy_local_var; } +__attribute__((deprecated)) v1_pod_failure_policy_t *v1_pod_failure_policy_create( + list_t *rules + ) { + return v1_pod_failure_policy_create_internal ( + rules + ); +} void v1_pod_failure_policy_free(v1_pod_failure_policy_t *v1_pod_failure_policy) { if(NULL == v1_pod_failure_policy){ return ; } + if(v1_pod_failure_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_failure_policy_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_failure_policy->rules) { list_ForEach(listEntry, v1_pod_failure_policy->rules) { @@ -73,6 +85,9 @@ v1_pod_failure_policy_t *v1_pod_failure_policy_parseFromJSON(cJSON *v1_pod_failu // v1_pod_failure_policy->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policyJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (!rules) { goto end; } @@ -96,7 +111,7 @@ v1_pod_failure_policy_t *v1_pod_failure_policy_parseFromJSON(cJSON *v1_pod_failu } - v1_pod_failure_policy_local_var = v1_pod_failure_policy_create ( + v1_pod_failure_policy_local_var = v1_pod_failure_policy_create_internal ( rulesList ); diff --git a/kubernetes/model/v1_pod_failure_policy.h b/kubernetes/model/v1_pod_failure_policy.h index c01f4879..29beb825 100644 --- a/kubernetes/model/v1_pod_failure_policy.h +++ b/kubernetes/model/v1_pod_failure_policy.h @@ -22,9 +22,10 @@ typedef struct v1_pod_failure_policy_t v1_pod_failure_policy_t; typedef struct v1_pod_failure_policy_t { list_t *rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_failure_policy_t; -v1_pod_failure_policy_t *v1_pod_failure_policy_create( +__attribute__((deprecated)) v1_pod_failure_policy_t *v1_pod_failure_policy_create( list_t *rules ); diff --git a/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.c b/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.c index 2c90884b..8144bcc0 100644 --- a/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.c +++ b/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.c @@ -5,7 +5,7 @@ -v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit_codes_requirement_create( +static v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit_codes_requirement_create_internal( char *container_name, char *_operator, list_t *values @@ -18,14 +18,30 @@ v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit v1_pod_failure_policy_on_exit_codes_requirement_local_var->_operator = _operator; v1_pod_failure_policy_on_exit_codes_requirement_local_var->values = values; + v1_pod_failure_policy_on_exit_codes_requirement_local_var->_library_owned = 1; return v1_pod_failure_policy_on_exit_codes_requirement_local_var; } +__attribute__((deprecated)) v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit_codes_requirement_create( + char *container_name, + char *_operator, + list_t *values + ) { + return v1_pod_failure_policy_on_exit_codes_requirement_create_internal ( + container_name, + _operator, + values + ); +} void v1_pod_failure_policy_on_exit_codes_requirement_free(v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit_codes_requirement) { if(NULL == v1_pod_failure_policy_on_exit_codes_requirement){ return ; } + if(v1_pod_failure_policy_on_exit_codes_requirement->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_failure_policy_on_exit_codes_requirement_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_failure_policy_on_exit_codes_requirement->container_name) { free(v1_pod_failure_policy_on_exit_codes_requirement->container_name); @@ -99,6 +115,9 @@ v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit // v1_pod_failure_policy_on_exit_codes_requirement->container_name cJSON *container_name = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_on_exit_codes_requirementJSON, "containerName"); + if (cJSON_IsNull(container_name)) { + container_name = NULL; + } if (container_name) { if(!cJSON_IsString(container_name) && !cJSON_IsNull(container_name)) { @@ -108,6 +127,9 @@ v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit // v1_pod_failure_policy_on_exit_codes_requirement->_operator cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_on_exit_codes_requirementJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } if (!_operator) { goto end; } @@ -120,6 +142,9 @@ v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit // v1_pod_failure_policy_on_exit_codes_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_on_exit_codes_requirementJSON, "values"); + if (cJSON_IsNull(values)) { + values = NULL; + } if (!values) { goto end; } @@ -137,7 +162,7 @@ v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit { goto end; } - double *values_local_value = (double *)calloc(1, sizeof(double)); + double *values_local_value = calloc(1, sizeof(double)); if(!values_local_value) { goto end; @@ -147,7 +172,7 @@ v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit } - v1_pod_failure_policy_on_exit_codes_requirement_local_var = v1_pod_failure_policy_on_exit_codes_requirement_create ( + v1_pod_failure_policy_on_exit_codes_requirement_local_var = v1_pod_failure_policy_on_exit_codes_requirement_create_internal ( container_name && !cJSON_IsNull(container_name) ? strdup(container_name->valuestring) : NULL, strdup(_operator->valuestring), valuesList diff --git a/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.h b/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.h index 6de60706..d7d17747 100644 --- a/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.h +++ b/kubernetes/model/v1_pod_failure_policy_on_exit_codes_requirement.h @@ -23,9 +23,10 @@ typedef struct v1_pod_failure_policy_on_exit_codes_requirement_t { char *_operator; // string list_t *values; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_failure_policy_on_exit_codes_requirement_t; -v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit_codes_requirement_create( +__attribute__((deprecated)) v1_pod_failure_policy_on_exit_codes_requirement_t *v1_pod_failure_policy_on_exit_codes_requirement_create( char *container_name, char *_operator, list_t *values diff --git a/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.c b/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.c index 25f00a27..be71b415 100644 --- a/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.c +++ b/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.c @@ -5,7 +5,7 @@ -v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_conditions_pattern_create( +static v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_conditions_pattern_create_internal( char *status, char *type ) { @@ -16,14 +16,28 @@ v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_ v1_pod_failure_policy_on_pod_conditions_pattern_local_var->status = status; v1_pod_failure_policy_on_pod_conditions_pattern_local_var->type = type; + v1_pod_failure_policy_on_pod_conditions_pattern_local_var->_library_owned = 1; return v1_pod_failure_policy_on_pod_conditions_pattern_local_var; } +__attribute__((deprecated)) v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_conditions_pattern_create( + char *status, + char *type + ) { + return v1_pod_failure_policy_on_pod_conditions_pattern_create_internal ( + status, + type + ); +} void v1_pod_failure_policy_on_pod_conditions_pattern_free(v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_conditions_pattern) { if(NULL == v1_pod_failure_policy_on_pod_conditions_pattern){ return ; } + if(v1_pod_failure_policy_on_pod_conditions_pattern->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_failure_policy_on_pod_conditions_pattern_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_failure_policy_on_pod_conditions_pattern->status) { free(v1_pod_failure_policy_on_pod_conditions_pattern->status); @@ -70,6 +84,9 @@ v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_ // v1_pod_failure_policy_on_pod_conditions_pattern->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_on_pod_conditions_patternJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -82,6 +99,9 @@ v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_ // v1_pod_failure_policy_on_pod_conditions_pattern->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_on_pod_conditions_patternJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -93,7 +113,7 @@ v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_ } - v1_pod_failure_policy_on_pod_conditions_pattern_local_var = v1_pod_failure_policy_on_pod_conditions_pattern_create ( + v1_pod_failure_policy_on_pod_conditions_pattern_local_var = v1_pod_failure_policy_on_pod_conditions_pattern_create_internal ( strdup(status->valuestring), strdup(type->valuestring) ); diff --git a/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.h b/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.h index ff04440e..d4574d41 100644 --- a/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.h +++ b/kubernetes/model/v1_pod_failure_policy_on_pod_conditions_pattern.h @@ -22,9 +22,10 @@ typedef struct v1_pod_failure_policy_on_pod_conditions_pattern_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_failure_policy_on_pod_conditions_pattern_t; -v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_conditions_pattern_create( +__attribute__((deprecated)) v1_pod_failure_policy_on_pod_conditions_pattern_t *v1_pod_failure_policy_on_pod_conditions_pattern_create( char *status, char *type ); diff --git a/kubernetes/model/v1_pod_failure_policy_rule.c b/kubernetes/model/v1_pod_failure_policy_rule.c index 24cfcaf7..71f22187 100644 --- a/kubernetes/model/v1_pod_failure_policy_rule.c +++ b/kubernetes/model/v1_pod_failure_policy_rule.c @@ -5,7 +5,7 @@ -v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_create( +static v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_create_internal( char *action, v1_pod_failure_policy_on_exit_codes_requirement_t *on_exit_codes, list_t *on_pod_conditions @@ -18,14 +18,30 @@ v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_create( v1_pod_failure_policy_rule_local_var->on_exit_codes = on_exit_codes; v1_pod_failure_policy_rule_local_var->on_pod_conditions = on_pod_conditions; + v1_pod_failure_policy_rule_local_var->_library_owned = 1; return v1_pod_failure_policy_rule_local_var; } +__attribute__((deprecated)) v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_create( + char *action, + v1_pod_failure_policy_on_exit_codes_requirement_t *on_exit_codes, + list_t *on_pod_conditions + ) { + return v1_pod_failure_policy_rule_create_internal ( + action, + on_exit_codes, + on_pod_conditions + ); +} void v1_pod_failure_policy_rule_free(v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule) { if(NULL == v1_pod_failure_policy_rule){ return ; } + if(v1_pod_failure_policy_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_failure_policy_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_failure_policy_rule->action) { free(v1_pod_failure_policy_rule->action); @@ -109,6 +125,9 @@ v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_parseFromJSON(cJSON *v1 // v1_pod_failure_policy_rule->action cJSON *action = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_ruleJSON, "action"); + if (cJSON_IsNull(action)) { + action = NULL; + } if (!action) { goto end; } @@ -121,12 +140,18 @@ v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_parseFromJSON(cJSON *v1 // v1_pod_failure_policy_rule->on_exit_codes cJSON *on_exit_codes = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_ruleJSON, "onExitCodes"); + if (cJSON_IsNull(on_exit_codes)) { + on_exit_codes = NULL; + } if (on_exit_codes) { on_exit_codes_local_nonprim = v1_pod_failure_policy_on_exit_codes_requirement_parseFromJSON(on_exit_codes); //nonprimitive } // v1_pod_failure_policy_rule->on_pod_conditions cJSON *on_pod_conditions = cJSON_GetObjectItemCaseSensitive(v1_pod_failure_policy_ruleJSON, "onPodConditions"); + if (cJSON_IsNull(on_pod_conditions)) { + on_pod_conditions = NULL; + } if (on_pod_conditions) { cJSON *on_pod_conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(on_pod_conditions)){ @@ -147,7 +172,7 @@ v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_parseFromJSON(cJSON *v1 } - v1_pod_failure_policy_rule_local_var = v1_pod_failure_policy_rule_create ( + v1_pod_failure_policy_rule_local_var = v1_pod_failure_policy_rule_create_internal ( strdup(action->valuestring), on_exit_codes ? on_exit_codes_local_nonprim : NULL, on_pod_conditions ? on_pod_conditionsList : NULL diff --git a/kubernetes/model/v1_pod_failure_policy_rule.h b/kubernetes/model/v1_pod_failure_policy_rule.h index ac414aab..d5dd40e6 100644 --- a/kubernetes/model/v1_pod_failure_policy_rule.h +++ b/kubernetes/model/v1_pod_failure_policy_rule.h @@ -25,9 +25,10 @@ typedef struct v1_pod_failure_policy_rule_t { struct v1_pod_failure_policy_on_exit_codes_requirement_t *on_exit_codes; //model list_t *on_pod_conditions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_failure_policy_rule_t; -v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_create( +__attribute__((deprecated)) v1_pod_failure_policy_rule_t *v1_pod_failure_policy_rule_create( char *action, v1_pod_failure_policy_on_exit_codes_requirement_t *on_exit_codes, list_t *on_pod_conditions diff --git a/kubernetes/model/v1_pod_ip.c b/kubernetes/model/v1_pod_ip.c index 6c4615bf..4e7577ac 100644 --- a/kubernetes/model/v1_pod_ip.c +++ b/kubernetes/model/v1_pod_ip.c @@ -5,7 +5,7 @@ -v1_pod_ip_t *v1_pod_ip_create( +static v1_pod_ip_t *v1_pod_ip_create_internal( char *ip ) { v1_pod_ip_t *v1_pod_ip_local_var = malloc(sizeof(v1_pod_ip_t)); @@ -14,14 +14,26 @@ v1_pod_ip_t *v1_pod_ip_create( } v1_pod_ip_local_var->ip = ip; + v1_pod_ip_local_var->_library_owned = 1; return v1_pod_ip_local_var; } +__attribute__((deprecated)) v1_pod_ip_t *v1_pod_ip_create( + char *ip + ) { + return v1_pod_ip_create_internal ( + ip + ); +} void v1_pod_ip_free(v1_pod_ip_t *v1_pod_ip) { if(NULL == v1_pod_ip){ return ; } + if(v1_pod_ip->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_ip_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_ip->ip) { free(v1_pod_ip->ip); @@ -34,11 +46,12 @@ cJSON *v1_pod_ip_convertToJSON(v1_pod_ip_t *v1_pod_ip) { cJSON *item = cJSON_CreateObject(); // v1_pod_ip->ip - if(v1_pod_ip->ip) { + if (!v1_pod_ip->ip) { + goto fail; + } if(cJSON_AddStringToObject(item, "ip", v1_pod_ip->ip) == NULL) { goto fail; //String } - } return item; fail: @@ -54,16 +67,22 @@ v1_pod_ip_t *v1_pod_ip_parseFromJSON(cJSON *v1_pod_ipJSON){ // v1_pod_ip->ip cJSON *ip = cJSON_GetObjectItemCaseSensitive(v1_pod_ipJSON, "ip"); - if (ip) { - if(!cJSON_IsString(ip) && !cJSON_IsNull(ip)) + if (cJSON_IsNull(ip)) { + ip = NULL; + } + if (!ip) { + goto end; + } + + + if(!cJSON_IsString(ip)) { goto end; //String } - } - v1_pod_ip_local_var = v1_pod_ip_create ( - ip && !cJSON_IsNull(ip) ? strdup(ip->valuestring) : NULL + v1_pod_ip_local_var = v1_pod_ip_create_internal ( + strdup(ip->valuestring) ); return v1_pod_ip_local_var; diff --git a/kubernetes/model/v1_pod_ip.h b/kubernetes/model/v1_pod_ip.h index 8bbf1813..d9e2a360 100644 --- a/kubernetes/model/v1_pod_ip.h +++ b/kubernetes/model/v1_pod_ip.h @@ -21,9 +21,10 @@ typedef struct v1_pod_ip_t v1_pod_ip_t; typedef struct v1_pod_ip_t { char *ip; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_ip_t; -v1_pod_ip_t *v1_pod_ip_create( +__attribute__((deprecated)) v1_pod_ip_t *v1_pod_ip_create( char *ip ); diff --git a/kubernetes/model/v1_pod_list.c b/kubernetes/model/v1_pod_list.c index c72e55b9..70a39e63 100644 --- a/kubernetes/model/v1_pod_list.c +++ b/kubernetes/model/v1_pod_list.c @@ -5,7 +5,7 @@ -v1_pod_list_t *v1_pod_list_create( +static v1_pod_list_t *v1_pod_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_pod_list_t *v1_pod_list_create( v1_pod_list_local_var->kind = kind; v1_pod_list_local_var->metadata = metadata; + v1_pod_list_local_var->_library_owned = 1; return v1_pod_list_local_var; } +__attribute__((deprecated)) v1_pod_list_t *v1_pod_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_pod_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_pod_list_free(v1_pod_list_t *v1_pod_list) { if(NULL == v1_pod_list){ return ; } + if(v1_pod_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_list_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_list->api_version) { free(v1_pod_list->api_version); @@ -123,6 +141,9 @@ v1_pod_list_t *v1_pod_list_parseFromJSON(cJSON *v1_pod_listJSON){ // v1_pod_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_pod_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_pod_list_t *v1_pod_list_parseFromJSON(cJSON *v1_pod_listJSON){ // v1_pod_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_pod_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_pod_list_t *v1_pod_list_parseFromJSON(cJSON *v1_pod_listJSON){ // v1_pod_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_pod_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_pod_list_t *v1_pod_list_parseFromJSON(cJSON *v1_pod_listJSON){ // v1_pod_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_pod_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_pod_list_local_var = v1_pod_list_create ( + v1_pod_list_local_var = v1_pod_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_pod_list.h b/kubernetes/model/v1_pod_list.h index 3135c3f3..b8346cbd 100644 --- a/kubernetes/model/v1_pod_list.h +++ b/kubernetes/model/v1_pod_list.h @@ -26,9 +26,10 @@ typedef struct v1_pod_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_list_t; -v1_pod_list_t *v1_pod_list_create( +__attribute__((deprecated)) v1_pod_list_t *v1_pod_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_pod_os.c b/kubernetes/model/v1_pod_os.c index 0c4208e1..a8322251 100644 --- a/kubernetes/model/v1_pod_os.c +++ b/kubernetes/model/v1_pod_os.c @@ -5,7 +5,7 @@ -v1_pod_os_t *v1_pod_os_create( +static v1_pod_os_t *v1_pod_os_create_internal( char *name ) { v1_pod_os_t *v1_pod_os_local_var = malloc(sizeof(v1_pod_os_t)); @@ -14,14 +14,26 @@ v1_pod_os_t *v1_pod_os_create( } v1_pod_os_local_var->name = name; + v1_pod_os_local_var->_library_owned = 1; return v1_pod_os_local_var; } +__attribute__((deprecated)) v1_pod_os_t *v1_pod_os_create( + char *name + ) { + return v1_pod_os_create_internal ( + name + ); +} void v1_pod_os_free(v1_pod_os_t *v1_pod_os) { if(NULL == v1_pod_os){ return ; } + if(v1_pod_os->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_os_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_os->name) { free(v1_pod_os->name); @@ -55,6 +67,9 @@ v1_pod_os_t *v1_pod_os_parseFromJSON(cJSON *v1_pod_osJSON){ // v1_pod_os->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_pod_osJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -66,7 +81,7 @@ v1_pod_os_t *v1_pod_os_parseFromJSON(cJSON *v1_pod_osJSON){ } - v1_pod_os_local_var = v1_pod_os_create ( + v1_pod_os_local_var = v1_pod_os_create_internal ( strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_pod_os.h b/kubernetes/model/v1_pod_os.h index 4de26ee4..fb797ad3 100644 --- a/kubernetes/model/v1_pod_os.h +++ b/kubernetes/model/v1_pod_os.h @@ -21,9 +21,10 @@ typedef struct v1_pod_os_t v1_pod_os_t; typedef struct v1_pod_os_t { char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_os_t; -v1_pod_os_t *v1_pod_os_create( +__attribute__((deprecated)) v1_pod_os_t *v1_pod_os_create( char *name ); diff --git a/kubernetes/model/v1_pod_readiness_gate.c b/kubernetes/model/v1_pod_readiness_gate.c index 595d4e2f..71443f63 100644 --- a/kubernetes/model/v1_pod_readiness_gate.c +++ b/kubernetes/model/v1_pod_readiness_gate.c @@ -5,7 +5,7 @@ -v1_pod_readiness_gate_t *v1_pod_readiness_gate_create( +static v1_pod_readiness_gate_t *v1_pod_readiness_gate_create_internal( char *condition_type ) { v1_pod_readiness_gate_t *v1_pod_readiness_gate_local_var = malloc(sizeof(v1_pod_readiness_gate_t)); @@ -14,14 +14,26 @@ v1_pod_readiness_gate_t *v1_pod_readiness_gate_create( } v1_pod_readiness_gate_local_var->condition_type = condition_type; + v1_pod_readiness_gate_local_var->_library_owned = 1; return v1_pod_readiness_gate_local_var; } +__attribute__((deprecated)) v1_pod_readiness_gate_t *v1_pod_readiness_gate_create( + char *condition_type + ) { + return v1_pod_readiness_gate_create_internal ( + condition_type + ); +} void v1_pod_readiness_gate_free(v1_pod_readiness_gate_t *v1_pod_readiness_gate) { if(NULL == v1_pod_readiness_gate){ return ; } + if(v1_pod_readiness_gate->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_readiness_gate_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_readiness_gate->condition_type) { free(v1_pod_readiness_gate->condition_type); @@ -55,6 +67,9 @@ v1_pod_readiness_gate_t *v1_pod_readiness_gate_parseFromJSON(cJSON *v1_pod_readi // v1_pod_readiness_gate->condition_type cJSON *condition_type = cJSON_GetObjectItemCaseSensitive(v1_pod_readiness_gateJSON, "conditionType"); + if (cJSON_IsNull(condition_type)) { + condition_type = NULL; + } if (!condition_type) { goto end; } @@ -66,7 +81,7 @@ v1_pod_readiness_gate_t *v1_pod_readiness_gate_parseFromJSON(cJSON *v1_pod_readi } - v1_pod_readiness_gate_local_var = v1_pod_readiness_gate_create ( + v1_pod_readiness_gate_local_var = v1_pod_readiness_gate_create_internal ( strdup(condition_type->valuestring) ); diff --git a/kubernetes/model/v1_pod_readiness_gate.h b/kubernetes/model/v1_pod_readiness_gate.h index 97438eb5..a44573c4 100644 --- a/kubernetes/model/v1_pod_readiness_gate.h +++ b/kubernetes/model/v1_pod_readiness_gate.h @@ -21,9 +21,10 @@ typedef struct v1_pod_readiness_gate_t v1_pod_readiness_gate_t; typedef struct v1_pod_readiness_gate_t { char *condition_type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_readiness_gate_t; -v1_pod_readiness_gate_t *v1_pod_readiness_gate_create( +__attribute__((deprecated)) v1_pod_readiness_gate_t *v1_pod_readiness_gate_create( char *condition_type ); diff --git a/kubernetes/model/v1_pod_resource_claim.c b/kubernetes/model/v1_pod_resource_claim.c index 94113396..04774110 100644 --- a/kubernetes/model/v1_pod_resource_claim.c +++ b/kubernetes/model/v1_pod_resource_claim.c @@ -5,33 +5,55 @@ -v1_pod_resource_claim_t *v1_pod_resource_claim_create( +static v1_pod_resource_claim_t *v1_pod_resource_claim_create_internal( char *name, - v1_claim_source_t *source + char *resource_claim_name, + char *resource_claim_template_name ) { v1_pod_resource_claim_t *v1_pod_resource_claim_local_var = malloc(sizeof(v1_pod_resource_claim_t)); if (!v1_pod_resource_claim_local_var) { return NULL; } v1_pod_resource_claim_local_var->name = name; - v1_pod_resource_claim_local_var->source = source; + v1_pod_resource_claim_local_var->resource_claim_name = resource_claim_name; + v1_pod_resource_claim_local_var->resource_claim_template_name = resource_claim_template_name; + v1_pod_resource_claim_local_var->_library_owned = 1; return v1_pod_resource_claim_local_var; } +__attribute__((deprecated)) v1_pod_resource_claim_t *v1_pod_resource_claim_create( + char *name, + char *resource_claim_name, + char *resource_claim_template_name + ) { + return v1_pod_resource_claim_create_internal ( + name, + resource_claim_name, + resource_claim_template_name + ); +} void v1_pod_resource_claim_free(v1_pod_resource_claim_t *v1_pod_resource_claim) { if(NULL == v1_pod_resource_claim){ return ; } + if(v1_pod_resource_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_resource_claim_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_resource_claim->name) { free(v1_pod_resource_claim->name); v1_pod_resource_claim->name = NULL; } - if (v1_pod_resource_claim->source) { - v1_claim_source_free(v1_pod_resource_claim->source); - v1_pod_resource_claim->source = NULL; + if (v1_pod_resource_claim->resource_claim_name) { + free(v1_pod_resource_claim->resource_claim_name); + v1_pod_resource_claim->resource_claim_name = NULL; + } + if (v1_pod_resource_claim->resource_claim_template_name) { + free(v1_pod_resource_claim->resource_claim_template_name); + v1_pod_resource_claim->resource_claim_template_name = NULL; } free(v1_pod_resource_claim); } @@ -48,15 +70,18 @@ cJSON *v1_pod_resource_claim_convertToJSON(v1_pod_resource_claim_t *v1_pod_resou } - // v1_pod_resource_claim->source - if(v1_pod_resource_claim->source) { - cJSON *source_local_JSON = v1_claim_source_convertToJSON(v1_pod_resource_claim->source); - if(source_local_JSON == NULL) { - goto fail; //model + // v1_pod_resource_claim->resource_claim_name + if(v1_pod_resource_claim->resource_claim_name) { + if(cJSON_AddStringToObject(item, "resourceClaimName", v1_pod_resource_claim->resource_claim_name) == NULL) { + goto fail; //String + } } - cJSON_AddItemToObject(item, "source", source_local_JSON); - if(item->child == NULL) { - goto fail; + + + // v1_pod_resource_claim->resource_claim_template_name + if(v1_pod_resource_claim->resource_claim_template_name) { + if(cJSON_AddStringToObject(item, "resourceClaimTemplateName", v1_pod_resource_claim->resource_claim_template_name) == NULL) { + goto fail; //String } } @@ -72,11 +97,11 @@ v1_pod_resource_claim_t *v1_pod_resource_claim_parseFromJSON(cJSON *v1_pod_resou v1_pod_resource_claim_t *v1_pod_resource_claim_local_var = NULL; - // define the local variable for v1_pod_resource_claim->source - v1_claim_source_t *source_local_nonprim = NULL; - // v1_pod_resource_claim->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_pod_resource_claimJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -87,24 +112,39 @@ v1_pod_resource_claim_t *v1_pod_resource_claim_parseFromJSON(cJSON *v1_pod_resou goto end; //String } - // v1_pod_resource_claim->source - cJSON *source = cJSON_GetObjectItemCaseSensitive(v1_pod_resource_claimJSON, "source"); - if (source) { - source_local_nonprim = v1_claim_source_parseFromJSON(source); //nonprimitive + // v1_pod_resource_claim->resource_claim_name + cJSON *resource_claim_name = cJSON_GetObjectItemCaseSensitive(v1_pod_resource_claimJSON, "resourceClaimName"); + if (cJSON_IsNull(resource_claim_name)) { + resource_claim_name = NULL; + } + if (resource_claim_name) { + if(!cJSON_IsString(resource_claim_name) && !cJSON_IsNull(resource_claim_name)) + { + goto end; //String + } + } + + // v1_pod_resource_claim->resource_claim_template_name + cJSON *resource_claim_template_name = cJSON_GetObjectItemCaseSensitive(v1_pod_resource_claimJSON, "resourceClaimTemplateName"); + if (cJSON_IsNull(resource_claim_template_name)) { + resource_claim_template_name = NULL; + } + if (resource_claim_template_name) { + if(!cJSON_IsString(resource_claim_template_name) && !cJSON_IsNull(resource_claim_template_name)) + { + goto end; //String + } } - v1_pod_resource_claim_local_var = v1_pod_resource_claim_create ( + v1_pod_resource_claim_local_var = v1_pod_resource_claim_create_internal ( strdup(name->valuestring), - source ? source_local_nonprim : NULL + resource_claim_name && !cJSON_IsNull(resource_claim_name) ? strdup(resource_claim_name->valuestring) : NULL, + resource_claim_template_name && !cJSON_IsNull(resource_claim_template_name) ? strdup(resource_claim_template_name->valuestring) : NULL ); return v1_pod_resource_claim_local_var; end: - if (source_local_nonprim) { - v1_claim_source_free(source_local_nonprim); - source_local_nonprim = NULL; - } return NULL; } diff --git a/kubernetes/model/v1_pod_resource_claim.h b/kubernetes/model/v1_pod_resource_claim.h index 6c1b0cb1..397776eb 100644 --- a/kubernetes/model/v1_pod_resource_claim.h +++ b/kubernetes/model/v1_pod_resource_claim.h @@ -1,7 +1,7 @@ /* * v1_pod_resource_claim.h * - * PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. + * PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. */ #ifndef _v1_pod_resource_claim_H_ @@ -15,19 +15,21 @@ typedef struct v1_pod_resource_claim_t v1_pod_resource_claim_t; -#include "v1_claim_source.h" typedef struct v1_pod_resource_claim_t { char *name; // string - struct v1_claim_source_t *source; //model + char *resource_claim_name; // string + char *resource_claim_template_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_resource_claim_t; -v1_pod_resource_claim_t *v1_pod_resource_claim_create( +__attribute__((deprecated)) v1_pod_resource_claim_t *v1_pod_resource_claim_create( char *name, - v1_claim_source_t *source + char *resource_claim_name, + char *resource_claim_template_name ); void v1_pod_resource_claim_free(v1_pod_resource_claim_t *v1_pod_resource_claim); diff --git a/kubernetes/model/v1_pod_resource_claim_status.c b/kubernetes/model/v1_pod_resource_claim_status.c index 2ee0363b..e5473b6d 100644 --- a/kubernetes/model/v1_pod_resource_claim_status.c +++ b/kubernetes/model/v1_pod_resource_claim_status.c @@ -5,7 +5,7 @@ -v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_create( +static v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_create_internal( char *name, char *resource_claim_name ) { @@ -16,14 +16,28 @@ v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_create( v1_pod_resource_claim_status_local_var->name = name; v1_pod_resource_claim_status_local_var->resource_claim_name = resource_claim_name; + v1_pod_resource_claim_status_local_var->_library_owned = 1; return v1_pod_resource_claim_status_local_var; } +__attribute__((deprecated)) v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_create( + char *name, + char *resource_claim_name + ) { + return v1_pod_resource_claim_status_create_internal ( + name, + resource_claim_name + ); +} void v1_pod_resource_claim_status_free(v1_pod_resource_claim_status_t *v1_pod_resource_claim_status) { if(NULL == v1_pod_resource_claim_status){ return ; } + if(v1_pod_resource_claim_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_resource_claim_status_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_resource_claim_status->name) { free(v1_pod_resource_claim_status->name); @@ -69,6 +83,9 @@ v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_parseFromJSON(cJSON // v1_pod_resource_claim_status->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_pod_resource_claim_statusJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -81,6 +98,9 @@ v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_parseFromJSON(cJSON // v1_pod_resource_claim_status->resource_claim_name cJSON *resource_claim_name = cJSON_GetObjectItemCaseSensitive(v1_pod_resource_claim_statusJSON, "resourceClaimName"); + if (cJSON_IsNull(resource_claim_name)) { + resource_claim_name = NULL; + } if (resource_claim_name) { if(!cJSON_IsString(resource_claim_name) && !cJSON_IsNull(resource_claim_name)) { @@ -89,7 +109,7 @@ v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_parseFromJSON(cJSON } - v1_pod_resource_claim_status_local_var = v1_pod_resource_claim_status_create ( + v1_pod_resource_claim_status_local_var = v1_pod_resource_claim_status_create_internal ( strdup(name->valuestring), resource_claim_name && !cJSON_IsNull(resource_claim_name) ? strdup(resource_claim_name->valuestring) : NULL ); diff --git a/kubernetes/model/v1_pod_resource_claim_status.h b/kubernetes/model/v1_pod_resource_claim_status.h index 2abf7ea1..5b120a42 100644 --- a/kubernetes/model/v1_pod_resource_claim_status.h +++ b/kubernetes/model/v1_pod_resource_claim_status.h @@ -22,9 +22,10 @@ typedef struct v1_pod_resource_claim_status_t { char *name; // string char *resource_claim_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_resource_claim_status_t; -v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_create( +__attribute__((deprecated)) v1_pod_resource_claim_status_t *v1_pod_resource_claim_status_create( char *name, char *resource_claim_name ); diff --git a/kubernetes/model/v1_pod_scheduling_gate.c b/kubernetes/model/v1_pod_scheduling_gate.c index e851a8ff..2325adb5 100644 --- a/kubernetes/model/v1_pod_scheduling_gate.c +++ b/kubernetes/model/v1_pod_scheduling_gate.c @@ -5,7 +5,7 @@ -v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_create( +static v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_create_internal( char *name ) { v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_local_var = malloc(sizeof(v1_pod_scheduling_gate_t)); @@ -14,14 +14,26 @@ v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_create( } v1_pod_scheduling_gate_local_var->name = name; + v1_pod_scheduling_gate_local_var->_library_owned = 1; return v1_pod_scheduling_gate_local_var; } +__attribute__((deprecated)) v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_create( + char *name + ) { + return v1_pod_scheduling_gate_create_internal ( + name + ); +} void v1_pod_scheduling_gate_free(v1_pod_scheduling_gate_t *v1_pod_scheduling_gate) { if(NULL == v1_pod_scheduling_gate){ return ; } + if(v1_pod_scheduling_gate->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_scheduling_gate_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_scheduling_gate->name) { free(v1_pod_scheduling_gate->name); @@ -55,6 +67,9 @@ v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_parseFromJSON(cJSON *v1_pod_sch // v1_pod_scheduling_gate->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_pod_scheduling_gateJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -66,7 +81,7 @@ v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_parseFromJSON(cJSON *v1_pod_sch } - v1_pod_scheduling_gate_local_var = v1_pod_scheduling_gate_create ( + v1_pod_scheduling_gate_local_var = v1_pod_scheduling_gate_create_internal ( strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_pod_scheduling_gate.h b/kubernetes/model/v1_pod_scheduling_gate.h index d46b953c..13738de3 100644 --- a/kubernetes/model/v1_pod_scheduling_gate.h +++ b/kubernetes/model/v1_pod_scheduling_gate.h @@ -21,9 +21,10 @@ typedef struct v1_pod_scheduling_gate_t v1_pod_scheduling_gate_t; typedef struct v1_pod_scheduling_gate_t { char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_scheduling_gate_t; -v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_create( +__attribute__((deprecated)) v1_pod_scheduling_gate_t *v1_pod_scheduling_gate_create( char *name ); diff --git a/kubernetes/model/v1_pod_security_context.c b/kubernetes/model/v1_pod_security_context.c index fb4aa9c8..22828fc7 100644 --- a/kubernetes/model/v1_pod_security_context.c +++ b/kubernetes/model/v1_pod_security_context.c @@ -5,16 +5,18 @@ -v1_pod_security_context_t *v1_pod_security_context_create( +static v1_pod_security_context_t *v1_pod_security_context_create_internal( v1_app_armor_profile_t *app_armor_profile, long fs_group, char *fs_group_change_policy, long run_as_group, int run_as_non_root, long run_as_user, + char *se_linux_change_policy, v1_se_linux_options_t *se_linux_options, v1_seccomp_profile_t *seccomp_profile, list_t *supplemental_groups, + char *supplemental_groups_policy, list_t *sysctls, v1_windows_security_context_options_t *windows_options ) { @@ -28,20 +30,58 @@ v1_pod_security_context_t *v1_pod_security_context_create( v1_pod_security_context_local_var->run_as_group = run_as_group; v1_pod_security_context_local_var->run_as_non_root = run_as_non_root; v1_pod_security_context_local_var->run_as_user = run_as_user; + v1_pod_security_context_local_var->se_linux_change_policy = se_linux_change_policy; v1_pod_security_context_local_var->se_linux_options = se_linux_options; v1_pod_security_context_local_var->seccomp_profile = seccomp_profile; v1_pod_security_context_local_var->supplemental_groups = supplemental_groups; + v1_pod_security_context_local_var->supplemental_groups_policy = supplemental_groups_policy; v1_pod_security_context_local_var->sysctls = sysctls; v1_pod_security_context_local_var->windows_options = windows_options; + v1_pod_security_context_local_var->_library_owned = 1; return v1_pod_security_context_local_var; } +__attribute__((deprecated)) v1_pod_security_context_t *v1_pod_security_context_create( + v1_app_armor_profile_t *app_armor_profile, + long fs_group, + char *fs_group_change_policy, + long run_as_group, + int run_as_non_root, + long run_as_user, + char *se_linux_change_policy, + v1_se_linux_options_t *se_linux_options, + v1_seccomp_profile_t *seccomp_profile, + list_t *supplemental_groups, + char *supplemental_groups_policy, + list_t *sysctls, + v1_windows_security_context_options_t *windows_options + ) { + return v1_pod_security_context_create_internal ( + app_armor_profile, + fs_group, + fs_group_change_policy, + run_as_group, + run_as_non_root, + run_as_user, + se_linux_change_policy, + se_linux_options, + seccomp_profile, + supplemental_groups, + supplemental_groups_policy, + sysctls, + windows_options + ); +} void v1_pod_security_context_free(v1_pod_security_context_t *v1_pod_security_context) { if(NULL == v1_pod_security_context){ return ; } + if(v1_pod_security_context->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_security_context_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_security_context->app_armor_profile) { v1_app_armor_profile_free(v1_pod_security_context->app_armor_profile); @@ -51,6 +91,10 @@ void v1_pod_security_context_free(v1_pod_security_context_t *v1_pod_security_con free(v1_pod_security_context->fs_group_change_policy); v1_pod_security_context->fs_group_change_policy = NULL; } + if (v1_pod_security_context->se_linux_change_policy) { + free(v1_pod_security_context->se_linux_change_policy); + v1_pod_security_context->se_linux_change_policy = NULL; + } if (v1_pod_security_context->se_linux_options) { v1_se_linux_options_free(v1_pod_security_context->se_linux_options); v1_pod_security_context->se_linux_options = NULL; @@ -66,6 +110,10 @@ void v1_pod_security_context_free(v1_pod_security_context_t *v1_pod_security_con list_freeList(v1_pod_security_context->supplemental_groups); v1_pod_security_context->supplemental_groups = NULL; } + if (v1_pod_security_context->supplemental_groups_policy) { + free(v1_pod_security_context->supplemental_groups_policy); + v1_pod_security_context->supplemental_groups_policy = NULL; + } if (v1_pod_security_context->sysctls) { list_ForEach(listEntry, v1_pod_security_context->sysctls) { v1_sysctl_free(listEntry->data); @@ -136,6 +184,14 @@ cJSON *v1_pod_security_context_convertToJSON(v1_pod_security_context_t *v1_pod_s } + // v1_pod_security_context->se_linux_change_policy + if(v1_pod_security_context->se_linux_change_policy) { + if(cJSON_AddStringToObject(item, "seLinuxChangePolicy", v1_pod_security_context->se_linux_change_policy) == NULL) { + goto fail; //String + } + } + + // v1_pod_security_context->se_linux_options if(v1_pod_security_context->se_linux_options) { cJSON *se_linux_options_local_JSON = v1_se_linux_options_convertToJSON(v1_pod_security_context->se_linux_options); @@ -179,6 +235,14 @@ cJSON *v1_pod_security_context_convertToJSON(v1_pod_security_context_t *v1_pod_s } + // v1_pod_security_context->supplemental_groups_policy + if(v1_pod_security_context->supplemental_groups_policy) { + if(cJSON_AddStringToObject(item, "supplementalGroupsPolicy", v1_pod_security_context->supplemental_groups_policy) == NULL) { + goto fail; //String + } + } + + // v1_pod_security_context->sysctls if(v1_pod_security_context->sysctls) { cJSON *sysctls = cJSON_AddArrayToObject(item, "sysctls"); @@ -243,12 +307,18 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->app_armor_profile cJSON *app_armor_profile = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "appArmorProfile"); + if (cJSON_IsNull(app_armor_profile)) { + app_armor_profile = NULL; + } if (app_armor_profile) { app_armor_profile_local_nonprim = v1_app_armor_profile_parseFromJSON(app_armor_profile); //nonprimitive } // v1_pod_security_context->fs_group cJSON *fs_group = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "fsGroup"); + if (cJSON_IsNull(fs_group)) { + fs_group = NULL; + } if (fs_group) { if(!cJSON_IsNumber(fs_group)) { @@ -258,6 +328,9 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->fs_group_change_policy cJSON *fs_group_change_policy = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "fsGroupChangePolicy"); + if (cJSON_IsNull(fs_group_change_policy)) { + fs_group_change_policy = NULL; + } if (fs_group_change_policy) { if(!cJSON_IsString(fs_group_change_policy) && !cJSON_IsNull(fs_group_change_policy)) { @@ -267,6 +340,9 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->run_as_group cJSON *run_as_group = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "runAsGroup"); + if (cJSON_IsNull(run_as_group)) { + run_as_group = NULL; + } if (run_as_group) { if(!cJSON_IsNumber(run_as_group)) { @@ -276,6 +352,9 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->run_as_non_root cJSON *run_as_non_root = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "runAsNonRoot"); + if (cJSON_IsNull(run_as_non_root)) { + run_as_non_root = NULL; + } if (run_as_non_root) { if(!cJSON_IsBool(run_as_non_root)) { @@ -285,6 +364,9 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->run_as_user cJSON *run_as_user = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "runAsUser"); + if (cJSON_IsNull(run_as_user)) { + run_as_user = NULL; + } if (run_as_user) { if(!cJSON_IsNumber(run_as_user)) { @@ -292,20 +374,41 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s } } + // v1_pod_security_context->se_linux_change_policy + cJSON *se_linux_change_policy = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "seLinuxChangePolicy"); + if (cJSON_IsNull(se_linux_change_policy)) { + se_linux_change_policy = NULL; + } + if (se_linux_change_policy) { + if(!cJSON_IsString(se_linux_change_policy) && !cJSON_IsNull(se_linux_change_policy)) + { + goto end; //String + } + } + // v1_pod_security_context->se_linux_options cJSON *se_linux_options = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "seLinuxOptions"); + if (cJSON_IsNull(se_linux_options)) { + se_linux_options = NULL; + } if (se_linux_options) { se_linux_options_local_nonprim = v1_se_linux_options_parseFromJSON(se_linux_options); //nonprimitive } // v1_pod_security_context->seccomp_profile cJSON *seccomp_profile = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "seccompProfile"); + if (cJSON_IsNull(seccomp_profile)) { + seccomp_profile = NULL; + } if (seccomp_profile) { seccomp_profile_local_nonprim = v1_seccomp_profile_parseFromJSON(seccomp_profile); //nonprimitive } // v1_pod_security_context->supplemental_groups cJSON *supplemental_groups = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "supplementalGroups"); + if (cJSON_IsNull(supplemental_groups)) { + supplemental_groups = NULL; + } if (supplemental_groups) { cJSON *supplemental_groups_local = NULL; if(!cJSON_IsArray(supplemental_groups)) { @@ -319,7 +422,7 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s { goto end; } - double *supplemental_groups_local_value = (double *)calloc(1, sizeof(double)); + double *supplemental_groups_local_value = calloc(1, sizeof(double)); if(!supplemental_groups_local_value) { goto end; @@ -329,8 +432,23 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s } } + // v1_pod_security_context->supplemental_groups_policy + cJSON *supplemental_groups_policy = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "supplementalGroupsPolicy"); + if (cJSON_IsNull(supplemental_groups_policy)) { + supplemental_groups_policy = NULL; + } + if (supplemental_groups_policy) { + if(!cJSON_IsString(supplemental_groups_policy) && !cJSON_IsNull(supplemental_groups_policy)) + { + goto end; //String + } + } + // v1_pod_security_context->sysctls cJSON *sysctls = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "sysctls"); + if (cJSON_IsNull(sysctls)) { + sysctls = NULL; + } if (sysctls) { cJSON *sysctls_local_nonprimitive = NULL; if(!cJSON_IsArray(sysctls)){ @@ -352,21 +470,26 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->windows_options cJSON *windows_options = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "windowsOptions"); + if (cJSON_IsNull(windows_options)) { + windows_options = NULL; + } if (windows_options) { windows_options_local_nonprim = v1_windows_security_context_options_parseFromJSON(windows_options); //nonprimitive } - v1_pod_security_context_local_var = v1_pod_security_context_create ( + v1_pod_security_context_local_var = v1_pod_security_context_create_internal ( app_armor_profile ? app_armor_profile_local_nonprim : NULL, fs_group ? fs_group->valuedouble : 0, fs_group_change_policy && !cJSON_IsNull(fs_group_change_policy) ? strdup(fs_group_change_policy->valuestring) : NULL, run_as_group ? run_as_group->valuedouble : 0, run_as_non_root ? run_as_non_root->valueint : 0, run_as_user ? run_as_user->valuedouble : 0, + se_linux_change_policy && !cJSON_IsNull(se_linux_change_policy) ? strdup(se_linux_change_policy->valuestring) : NULL, se_linux_options ? se_linux_options_local_nonprim : NULL, seccomp_profile ? seccomp_profile_local_nonprim : NULL, supplemental_groups ? supplemental_groupsList : NULL, + supplemental_groups_policy && !cJSON_IsNull(supplemental_groups_policy) ? strdup(supplemental_groups_policy->valuestring) : NULL, sysctls ? sysctlsList : NULL, windows_options ? windows_options_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_pod_security_context.h b/kubernetes/model/v1_pod_security_context.h index d7368625..fbe3a0b4 100644 --- a/kubernetes/model/v1_pod_security_context.h +++ b/kubernetes/model/v1_pod_security_context.h @@ -30,24 +30,29 @@ typedef struct v1_pod_security_context_t { long run_as_group; //numeric int run_as_non_root; //boolean long run_as_user; //numeric + char *se_linux_change_policy; // string struct v1_se_linux_options_t *se_linux_options; //model struct v1_seccomp_profile_t *seccomp_profile; //model list_t *supplemental_groups; //primitive container + char *supplemental_groups_policy; // string list_t *sysctls; //nonprimitive container struct v1_windows_security_context_options_t *windows_options; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_security_context_t; -v1_pod_security_context_t *v1_pod_security_context_create( +__attribute__((deprecated)) v1_pod_security_context_t *v1_pod_security_context_create( v1_app_armor_profile_t *app_armor_profile, long fs_group, char *fs_group_change_policy, long run_as_group, int run_as_non_root, long run_as_user, + char *se_linux_change_policy, v1_se_linux_options_t *se_linux_options, v1_seccomp_profile_t *seccomp_profile, list_t *supplemental_groups, + char *supplemental_groups_policy, list_t *sysctls, v1_windows_security_context_options_t *windows_options ); diff --git a/kubernetes/model/v1_pod_spec.c b/kubernetes/model/v1_pod_spec.c index 6fc38b71..50dfc92a 100644 --- a/kubernetes/model/v1_pod_spec.c +++ b/kubernetes/model/v1_pod_spec.c @@ -5,7 +5,7 @@ -v1_pod_spec_t *v1_pod_spec_create( +static v1_pod_spec_t *v1_pod_spec_create_internal( long active_deadline_seconds, v1_affinity_t *affinity, int automount_service_account_token, @@ -20,6 +20,7 @@ v1_pod_spec_t *v1_pod_spec_create( int host_pid, int host_users, char *hostname, + char *hostname_override, list_t *image_pull_secrets, list_t *init_containers, char *node_name, @@ -31,6 +32,7 @@ v1_pod_spec_t *v1_pod_spec_create( char *priority_class_name, list_t *readiness_gates, list_t *resource_claims, + v1_resource_requirements_t *resources, char *restart_policy, char *runtime_class_name, char *scheduler_name, @@ -64,6 +66,7 @@ v1_pod_spec_t *v1_pod_spec_create( v1_pod_spec_local_var->host_pid = host_pid; v1_pod_spec_local_var->host_users = host_users; v1_pod_spec_local_var->hostname = hostname; + v1_pod_spec_local_var->hostname_override = hostname_override; v1_pod_spec_local_var->image_pull_secrets = image_pull_secrets; v1_pod_spec_local_var->init_containers = init_containers; v1_pod_spec_local_var->node_name = node_name; @@ -75,6 +78,7 @@ v1_pod_spec_t *v1_pod_spec_create( v1_pod_spec_local_var->priority_class_name = priority_class_name; v1_pod_spec_local_var->readiness_gates = readiness_gates; v1_pod_spec_local_var->resource_claims = resource_claims; + v1_pod_spec_local_var->resources = resources; v1_pod_spec_local_var->restart_policy = restart_policy; v1_pod_spec_local_var->runtime_class_name = runtime_class_name; v1_pod_spec_local_var->scheduler_name = scheduler_name; @@ -90,14 +94,106 @@ v1_pod_spec_t *v1_pod_spec_create( v1_pod_spec_local_var->topology_spread_constraints = topology_spread_constraints; v1_pod_spec_local_var->volumes = volumes; + v1_pod_spec_local_var->_library_owned = 1; return v1_pod_spec_local_var; } +__attribute__((deprecated)) v1_pod_spec_t *v1_pod_spec_create( + long active_deadline_seconds, + v1_affinity_t *affinity, + int automount_service_account_token, + list_t *containers, + v1_pod_dns_config_t *dns_config, + char *dns_policy, + int enable_service_links, + list_t *ephemeral_containers, + list_t *host_aliases, + int host_ipc, + int host_network, + int host_pid, + int host_users, + char *hostname, + char *hostname_override, + list_t *image_pull_secrets, + list_t *init_containers, + char *node_name, + list_t* node_selector, + v1_pod_os_t *os, + list_t* overhead, + char *preemption_policy, + int priority, + char *priority_class_name, + list_t *readiness_gates, + list_t *resource_claims, + v1_resource_requirements_t *resources, + char *restart_policy, + char *runtime_class_name, + char *scheduler_name, + list_t *scheduling_gates, + v1_pod_security_context_t *security_context, + char *service_account, + char *service_account_name, + int set_hostname_as_fqdn, + int share_process_namespace, + char *subdomain, + long termination_grace_period_seconds, + list_t *tolerations, + list_t *topology_spread_constraints, + list_t *volumes + ) { + return v1_pod_spec_create_internal ( + active_deadline_seconds, + affinity, + automount_service_account_token, + containers, + dns_config, + dns_policy, + enable_service_links, + ephemeral_containers, + host_aliases, + host_ipc, + host_network, + host_pid, + host_users, + hostname, + hostname_override, + image_pull_secrets, + init_containers, + node_name, + node_selector, + os, + overhead, + preemption_policy, + priority, + priority_class_name, + readiness_gates, + resource_claims, + resources, + restart_policy, + runtime_class_name, + scheduler_name, + scheduling_gates, + security_context, + service_account, + service_account_name, + set_hostname_as_fqdn, + share_process_namespace, + subdomain, + termination_grace_period_seconds, + tolerations, + topology_spread_constraints, + volumes + ); +} void v1_pod_spec_free(v1_pod_spec_t *v1_pod_spec) { if(NULL == v1_pod_spec){ return ; } + if(v1_pod_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_spec->affinity) { v1_affinity_free(v1_pod_spec->affinity); @@ -136,6 +232,10 @@ void v1_pod_spec_free(v1_pod_spec_t *v1_pod_spec) { free(v1_pod_spec->hostname); v1_pod_spec->hostname = NULL; } + if (v1_pod_spec->hostname_override) { + free(v1_pod_spec->hostname_override); + v1_pod_spec->hostname_override = NULL; + } if (v1_pod_spec->image_pull_secrets) { list_ForEach(listEntry, v1_pod_spec->image_pull_secrets) { v1_local_object_reference_free(listEntry->data); @@ -156,7 +256,7 @@ void v1_pod_spec_free(v1_pod_spec_t *v1_pod_spec) { } if (v1_pod_spec->node_selector) { list_ForEach(listEntry, v1_pod_spec->node_selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -170,7 +270,7 @@ void v1_pod_spec_free(v1_pod_spec_t *v1_pod_spec) { } if (v1_pod_spec->overhead) { list_ForEach(listEntry, v1_pod_spec->overhead) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -200,6 +300,10 @@ void v1_pod_spec_free(v1_pod_spec_t *v1_pod_spec) { list_freeList(v1_pod_spec->resource_claims); v1_pod_spec->resource_claims = NULL; } + if (v1_pod_spec->resources) { + v1_resource_requirements_free(v1_pod_spec->resources); + v1_pod_spec->resources = NULL; + } if (v1_pod_spec->restart_policy) { free(v1_pod_spec->restart_policy); v1_pod_spec->restart_policy = NULL; @@ -421,6 +525,14 @@ cJSON *v1_pod_spec_convertToJSON(v1_pod_spec_t *v1_pod_spec) { } + // v1_pod_spec->hostname_override + if(v1_pod_spec->hostname_override) { + if(cJSON_AddStringToObject(item, "hostnameOverride", v1_pod_spec->hostname_override) == NULL) { + goto fail; //String + } + } + + // v1_pod_spec->image_pull_secrets if(v1_pod_spec->image_pull_secrets) { cJSON *image_pull_secrets = cJSON_AddArrayToObject(item, "imagePullSecrets"); @@ -479,8 +591,8 @@ cJSON *v1_pod_spec_convertToJSON(v1_pod_spec_t *v1_pod_spec) { listEntry_t *node_selectorListEntry; if (v1_pod_spec->node_selector) { list_ForEach(node_selectorListEntry, v1_pod_spec->node_selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)node_selectorListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = node_selectorListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -512,8 +624,8 @@ cJSON *v1_pod_spec_convertToJSON(v1_pod_spec_t *v1_pod_spec) { listEntry_t *overheadListEntry; if (v1_pod_spec->overhead) { list_ForEach(overheadListEntry, v1_pod_spec->overhead) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)overheadListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = overheadListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -586,6 +698,19 @@ cJSON *v1_pod_spec_convertToJSON(v1_pod_spec_t *v1_pod_spec) { } + // v1_pod_spec->resources + if(v1_pod_spec->resources) { + cJSON *resources_local_JSON = v1_resource_requirements_convertToJSON(v1_pod_spec->resources); + if(resources_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "resources", resources_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_pod_spec->restart_policy if(v1_pod_spec->restart_policy) { if(cJSON_AddStringToObject(item, "restartPolicy", v1_pod_spec->restart_policy) == NULL) { @@ -798,6 +923,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // define the local list for v1_pod_spec->resource_claims list_t *resource_claimsList = NULL; + // define the local variable for v1_pod_spec->resources + v1_resource_requirements_t *resources_local_nonprim = NULL; + // define the local list for v1_pod_spec->scheduling_gates list_t *scheduling_gatesList = NULL; @@ -815,6 +943,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->active_deadline_seconds cJSON *active_deadline_seconds = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "activeDeadlineSeconds"); + if (cJSON_IsNull(active_deadline_seconds)) { + active_deadline_seconds = NULL; + } if (active_deadline_seconds) { if(!cJSON_IsNumber(active_deadline_seconds)) { @@ -824,12 +955,18 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->affinity cJSON *affinity = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "affinity"); + if (cJSON_IsNull(affinity)) { + affinity = NULL; + } if (affinity) { affinity_local_nonprim = v1_affinity_parseFromJSON(affinity); //nonprimitive } // v1_pod_spec->automount_service_account_token cJSON *automount_service_account_token = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "automountServiceAccountToken"); + if (cJSON_IsNull(automount_service_account_token)) { + automount_service_account_token = NULL; + } if (automount_service_account_token) { if(!cJSON_IsBool(automount_service_account_token)) { @@ -839,6 +976,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->containers cJSON *containers = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "containers"); + if (cJSON_IsNull(containers)) { + containers = NULL; + } if (!containers) { goto end; } @@ -863,12 +1003,18 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->dns_config cJSON *dns_config = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "dnsConfig"); + if (cJSON_IsNull(dns_config)) { + dns_config = NULL; + } if (dns_config) { dns_config_local_nonprim = v1_pod_dns_config_parseFromJSON(dns_config); //nonprimitive } // v1_pod_spec->dns_policy cJSON *dns_policy = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "dnsPolicy"); + if (cJSON_IsNull(dns_policy)) { + dns_policy = NULL; + } if (dns_policy) { if(!cJSON_IsString(dns_policy) && !cJSON_IsNull(dns_policy)) { @@ -878,6 +1024,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->enable_service_links cJSON *enable_service_links = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "enableServiceLinks"); + if (cJSON_IsNull(enable_service_links)) { + enable_service_links = NULL; + } if (enable_service_links) { if(!cJSON_IsBool(enable_service_links)) { @@ -887,6 +1036,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->ephemeral_containers cJSON *ephemeral_containers = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "ephemeralContainers"); + if (cJSON_IsNull(ephemeral_containers)) { + ephemeral_containers = NULL; + } if (ephemeral_containers) { cJSON *ephemeral_containers_local_nonprimitive = NULL; if(!cJSON_IsArray(ephemeral_containers)){ @@ -908,6 +1060,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->host_aliases cJSON *host_aliases = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostAliases"); + if (cJSON_IsNull(host_aliases)) { + host_aliases = NULL; + } if (host_aliases) { cJSON *host_aliases_local_nonprimitive = NULL; if(!cJSON_IsArray(host_aliases)){ @@ -929,6 +1084,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->host_ipc cJSON *host_ipc = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostIPC"); + if (cJSON_IsNull(host_ipc)) { + host_ipc = NULL; + } if (host_ipc) { if(!cJSON_IsBool(host_ipc)) { @@ -938,6 +1096,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->host_network cJSON *host_network = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostNetwork"); + if (cJSON_IsNull(host_network)) { + host_network = NULL; + } if (host_network) { if(!cJSON_IsBool(host_network)) { @@ -947,6 +1108,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->host_pid cJSON *host_pid = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostPID"); + if (cJSON_IsNull(host_pid)) { + host_pid = NULL; + } if (host_pid) { if(!cJSON_IsBool(host_pid)) { @@ -956,6 +1120,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->host_users cJSON *host_users = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostUsers"); + if (cJSON_IsNull(host_users)) { + host_users = NULL; + } if (host_users) { if(!cJSON_IsBool(host_users)) { @@ -965,6 +1132,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->hostname cJSON *hostname = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostname"); + if (cJSON_IsNull(hostname)) { + hostname = NULL; + } if (hostname) { if(!cJSON_IsString(hostname) && !cJSON_IsNull(hostname)) { @@ -972,8 +1142,23 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ } } + // v1_pod_spec->hostname_override + cJSON *hostname_override = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostnameOverride"); + if (cJSON_IsNull(hostname_override)) { + hostname_override = NULL; + } + if (hostname_override) { + if(!cJSON_IsString(hostname_override) && !cJSON_IsNull(hostname_override)) + { + goto end; //String + } + } + // v1_pod_spec->image_pull_secrets cJSON *image_pull_secrets = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "imagePullSecrets"); + if (cJSON_IsNull(image_pull_secrets)) { + image_pull_secrets = NULL; + } if (image_pull_secrets) { cJSON *image_pull_secrets_local_nonprimitive = NULL; if(!cJSON_IsArray(image_pull_secrets)){ @@ -995,6 +1180,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->init_containers cJSON *init_containers = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "initContainers"); + if (cJSON_IsNull(init_containers)) { + init_containers = NULL; + } if (init_containers) { cJSON *init_containers_local_nonprimitive = NULL; if(!cJSON_IsArray(init_containers)){ @@ -1016,6 +1204,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->node_name cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } if (node_name) { if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) { @@ -1025,6 +1216,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->node_selector cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } if (node_selector) { cJSON *node_selector_local_map = NULL; if(!cJSON_IsObject(node_selector) && !cJSON_IsNull(node_selector)) @@ -1050,12 +1244,18 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->os cJSON *os = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "os"); + if (cJSON_IsNull(os)) { + os = NULL; + } if (os) { os_local_nonprim = v1_pod_os_parseFromJSON(os); //nonprimitive } // v1_pod_spec->overhead cJSON *overhead = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "overhead"); + if (cJSON_IsNull(overhead)) { + overhead = NULL; + } if (overhead) { cJSON *overhead_local_map = NULL; if(!cJSON_IsObject(overhead) && !cJSON_IsNull(overhead)) @@ -1081,6 +1281,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->preemption_policy cJSON *preemption_policy = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "preemptionPolicy"); + if (cJSON_IsNull(preemption_policy)) { + preemption_policy = NULL; + } if (preemption_policy) { if(!cJSON_IsString(preemption_policy) && !cJSON_IsNull(preemption_policy)) { @@ -1090,6 +1293,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->priority cJSON *priority = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "priority"); + if (cJSON_IsNull(priority)) { + priority = NULL; + } if (priority) { if(!cJSON_IsNumber(priority)) { @@ -1099,6 +1305,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->priority_class_name cJSON *priority_class_name = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "priorityClassName"); + if (cJSON_IsNull(priority_class_name)) { + priority_class_name = NULL; + } if (priority_class_name) { if(!cJSON_IsString(priority_class_name) && !cJSON_IsNull(priority_class_name)) { @@ -1108,6 +1317,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->readiness_gates cJSON *readiness_gates = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "readinessGates"); + if (cJSON_IsNull(readiness_gates)) { + readiness_gates = NULL; + } if (readiness_gates) { cJSON *readiness_gates_local_nonprimitive = NULL; if(!cJSON_IsArray(readiness_gates)){ @@ -1129,6 +1341,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->resource_claims cJSON *resource_claims = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "resourceClaims"); + if (cJSON_IsNull(resource_claims)) { + resource_claims = NULL; + } if (resource_claims) { cJSON *resource_claims_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_claims)){ @@ -1148,8 +1363,20 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ } } + // v1_pod_spec->resources + cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } + if (resources) { + resources_local_nonprim = v1_resource_requirements_parseFromJSON(resources); //nonprimitive + } + // v1_pod_spec->restart_policy cJSON *restart_policy = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "restartPolicy"); + if (cJSON_IsNull(restart_policy)) { + restart_policy = NULL; + } if (restart_policy) { if(!cJSON_IsString(restart_policy) && !cJSON_IsNull(restart_policy)) { @@ -1159,6 +1386,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->runtime_class_name cJSON *runtime_class_name = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "runtimeClassName"); + if (cJSON_IsNull(runtime_class_name)) { + runtime_class_name = NULL; + } if (runtime_class_name) { if(!cJSON_IsString(runtime_class_name) && !cJSON_IsNull(runtime_class_name)) { @@ -1168,6 +1398,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->scheduler_name cJSON *scheduler_name = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "schedulerName"); + if (cJSON_IsNull(scheduler_name)) { + scheduler_name = NULL; + } if (scheduler_name) { if(!cJSON_IsString(scheduler_name) && !cJSON_IsNull(scheduler_name)) { @@ -1177,6 +1410,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->scheduling_gates cJSON *scheduling_gates = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "schedulingGates"); + if (cJSON_IsNull(scheduling_gates)) { + scheduling_gates = NULL; + } if (scheduling_gates) { cJSON *scheduling_gates_local_nonprimitive = NULL; if(!cJSON_IsArray(scheduling_gates)){ @@ -1198,12 +1434,18 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->security_context cJSON *security_context = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "securityContext"); + if (cJSON_IsNull(security_context)) { + security_context = NULL; + } if (security_context) { security_context_local_nonprim = v1_pod_security_context_parseFromJSON(security_context); //nonprimitive } // v1_pod_spec->service_account cJSON *service_account = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "serviceAccount"); + if (cJSON_IsNull(service_account)) { + service_account = NULL; + } if (service_account) { if(!cJSON_IsString(service_account) && !cJSON_IsNull(service_account)) { @@ -1213,6 +1455,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->service_account_name cJSON *service_account_name = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "serviceAccountName"); + if (cJSON_IsNull(service_account_name)) { + service_account_name = NULL; + } if (service_account_name) { if(!cJSON_IsString(service_account_name) && !cJSON_IsNull(service_account_name)) { @@ -1222,6 +1467,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->set_hostname_as_fqdn cJSON *set_hostname_as_fqdn = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "setHostnameAsFQDN"); + if (cJSON_IsNull(set_hostname_as_fqdn)) { + set_hostname_as_fqdn = NULL; + } if (set_hostname_as_fqdn) { if(!cJSON_IsBool(set_hostname_as_fqdn)) { @@ -1231,6 +1479,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->share_process_namespace cJSON *share_process_namespace = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "shareProcessNamespace"); + if (cJSON_IsNull(share_process_namespace)) { + share_process_namespace = NULL; + } if (share_process_namespace) { if(!cJSON_IsBool(share_process_namespace)) { @@ -1240,6 +1491,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->subdomain cJSON *subdomain = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "subdomain"); + if (cJSON_IsNull(subdomain)) { + subdomain = NULL; + } if (subdomain) { if(!cJSON_IsString(subdomain) && !cJSON_IsNull(subdomain)) { @@ -1249,6 +1503,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->termination_grace_period_seconds cJSON *termination_grace_period_seconds = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "terminationGracePeriodSeconds"); + if (cJSON_IsNull(termination_grace_period_seconds)) { + termination_grace_period_seconds = NULL; + } if (termination_grace_period_seconds) { if(!cJSON_IsNumber(termination_grace_period_seconds)) { @@ -1258,6 +1515,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->tolerations cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } if (tolerations) { cJSON *tolerations_local_nonprimitive = NULL; if(!cJSON_IsArray(tolerations)){ @@ -1279,6 +1539,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->topology_spread_constraints cJSON *topology_spread_constraints = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "topologySpreadConstraints"); + if (cJSON_IsNull(topology_spread_constraints)) { + topology_spread_constraints = NULL; + } if (topology_spread_constraints) { cJSON *topology_spread_constraints_local_nonprimitive = NULL; if(!cJSON_IsArray(topology_spread_constraints)){ @@ -1300,6 +1563,9 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->volumes cJSON *volumes = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "volumes"); + if (cJSON_IsNull(volumes)) { + volumes = NULL; + } if (volumes) { cJSON *volumes_local_nonprimitive = NULL; if(!cJSON_IsArray(volumes)){ @@ -1320,7 +1586,7 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ } - v1_pod_spec_local_var = v1_pod_spec_create ( + v1_pod_spec_local_var = v1_pod_spec_create_internal ( active_deadline_seconds ? active_deadline_seconds->valuedouble : 0, affinity ? affinity_local_nonprim : NULL, automount_service_account_token ? automount_service_account_token->valueint : 0, @@ -1335,6 +1601,7 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ host_pid ? host_pid->valueint : 0, host_users ? host_users->valueint : 0, hostname && !cJSON_IsNull(hostname) ? strdup(hostname->valuestring) : NULL, + hostname_override && !cJSON_IsNull(hostname_override) ? strdup(hostname_override->valuestring) : NULL, image_pull_secrets ? image_pull_secretsList : NULL, init_containers ? init_containersList : NULL, node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, @@ -1346,6 +1613,7 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ priority_class_name && !cJSON_IsNull(priority_class_name) ? strdup(priority_class_name->valuestring) : NULL, readiness_gates ? readiness_gatesList : NULL, resource_claims ? resource_claimsList : NULL, + resources ? resources_local_nonprim : NULL, restart_policy && !cJSON_IsNull(restart_policy) ? strdup(restart_policy->valuestring) : NULL, runtime_class_name && !cJSON_IsNull(runtime_class_name) ? strdup(runtime_class_name->valuestring) : NULL, scheduler_name && !cJSON_IsNull(scheduler_name) ? strdup(scheduler_name->valuestring) : NULL, @@ -1420,7 +1688,7 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ if (node_selectorList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, node_selectorList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -1438,7 +1706,7 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ if (overheadList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, overheadList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -1467,6 +1735,10 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ list_freeList(resource_claimsList); resource_claimsList = NULL; } + if (resources_local_nonprim) { + v1_resource_requirements_free(resources_local_nonprim); + resources_local_nonprim = NULL; + } if (scheduling_gatesList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, scheduling_gatesList) { diff --git a/kubernetes/model/v1_pod_spec.h b/kubernetes/model/v1_pod_spec.h index 7b9ea573..1b931f35 100644 --- a/kubernetes/model/v1_pod_spec.h +++ b/kubernetes/model/v1_pod_spec.h @@ -26,6 +26,7 @@ typedef struct v1_pod_spec_t v1_pod_spec_t; #include "v1_pod_resource_claim.h" #include "v1_pod_scheduling_gate.h" #include "v1_pod_security_context.h" +#include "v1_resource_requirements.h" #include "v1_toleration.h" #include "v1_topology_spread_constraint.h" #include "v1_volume.h" @@ -47,6 +48,7 @@ typedef struct v1_pod_spec_t { int host_pid; //boolean int host_users; //boolean char *hostname; // string + char *hostname_override; // string list_t *image_pull_secrets; //nonprimitive container list_t *init_containers; //nonprimitive container char *node_name; // string @@ -58,6 +60,7 @@ typedef struct v1_pod_spec_t { char *priority_class_name; // string list_t *readiness_gates; //nonprimitive container list_t *resource_claims; //nonprimitive container + struct v1_resource_requirements_t *resources; //model char *restart_policy; // string char *runtime_class_name; // string char *scheduler_name; // string @@ -73,9 +76,10 @@ typedef struct v1_pod_spec_t { list_t *topology_spread_constraints; //nonprimitive container list_t *volumes; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_spec_t; -v1_pod_spec_t *v1_pod_spec_create( +__attribute__((deprecated)) v1_pod_spec_t *v1_pod_spec_create( long active_deadline_seconds, v1_affinity_t *affinity, int automount_service_account_token, @@ -90,6 +94,7 @@ v1_pod_spec_t *v1_pod_spec_create( int host_pid, int host_users, char *hostname, + char *hostname_override, list_t *image_pull_secrets, list_t *init_containers, char *node_name, @@ -101,6 +106,7 @@ v1_pod_spec_t *v1_pod_spec_create( char *priority_class_name, list_t *readiness_gates, list_t *resource_claims, + v1_resource_requirements_t *resources, char *restart_policy, char *runtime_class_name, char *scheduler_name, diff --git a/kubernetes/model/v1_pod_status.c b/kubernetes/model/v1_pod_status.c index db09cf92..89ed65c8 100644 --- a/kubernetes/model/v1_pod_status.c +++ b/kubernetes/model/v1_pod_status.c @@ -5,15 +5,17 @@ -v1_pod_status_t *v1_pod_status_create( +static v1_pod_status_t *v1_pod_status_create_internal( list_t *conditions, list_t *container_statuses, list_t *ephemeral_container_statuses, + v1_pod_extended_resource_claim_status_t *extended_resource_claim_status, char *host_ip, list_t *host_ips, list_t *init_container_statuses, char *message, char *nominated_node_name, + long observed_generation, char *phase, char *pod_ip, list_t *pod_ips, @@ -30,11 +32,13 @@ v1_pod_status_t *v1_pod_status_create( v1_pod_status_local_var->conditions = conditions; v1_pod_status_local_var->container_statuses = container_statuses; v1_pod_status_local_var->ephemeral_container_statuses = ephemeral_container_statuses; + v1_pod_status_local_var->extended_resource_claim_status = extended_resource_claim_status; v1_pod_status_local_var->host_ip = host_ip; v1_pod_status_local_var->host_ips = host_ips; v1_pod_status_local_var->init_container_statuses = init_container_statuses; v1_pod_status_local_var->message = message; v1_pod_status_local_var->nominated_node_name = nominated_node_name; + v1_pod_status_local_var->observed_generation = observed_generation; v1_pod_status_local_var->phase = phase; v1_pod_status_local_var->pod_ip = pod_ip; v1_pod_status_local_var->pod_ips = pod_ips; @@ -44,14 +48,60 @@ v1_pod_status_t *v1_pod_status_create( v1_pod_status_local_var->resource_claim_statuses = resource_claim_statuses; v1_pod_status_local_var->start_time = start_time; + v1_pod_status_local_var->_library_owned = 1; return v1_pod_status_local_var; } +__attribute__((deprecated)) v1_pod_status_t *v1_pod_status_create( + list_t *conditions, + list_t *container_statuses, + list_t *ephemeral_container_statuses, + v1_pod_extended_resource_claim_status_t *extended_resource_claim_status, + char *host_ip, + list_t *host_ips, + list_t *init_container_statuses, + char *message, + char *nominated_node_name, + long observed_generation, + char *phase, + char *pod_ip, + list_t *pod_ips, + char *qos_class, + char *reason, + char *resize, + list_t *resource_claim_statuses, + char *start_time + ) { + return v1_pod_status_create_internal ( + conditions, + container_statuses, + ephemeral_container_statuses, + extended_resource_claim_status, + host_ip, + host_ips, + init_container_statuses, + message, + nominated_node_name, + observed_generation, + phase, + pod_ip, + pod_ips, + qos_class, + reason, + resize, + resource_claim_statuses, + start_time + ); +} void v1_pod_status_free(v1_pod_status_t *v1_pod_status) { if(NULL == v1_pod_status){ return ; } + if(v1_pod_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_status_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_status->conditions) { list_ForEach(listEntry, v1_pod_status->conditions) { @@ -74,6 +124,10 @@ void v1_pod_status_free(v1_pod_status_t *v1_pod_status) { list_freeList(v1_pod_status->ephemeral_container_statuses); v1_pod_status->ephemeral_container_statuses = NULL; } + if (v1_pod_status->extended_resource_claim_status) { + v1_pod_extended_resource_claim_status_free(v1_pod_status->extended_resource_claim_status); + v1_pod_status->extended_resource_claim_status = NULL; + } if (v1_pod_status->host_ip) { free(v1_pod_status->host_ip); v1_pod_status->host_ip = NULL; @@ -204,6 +258,19 @@ cJSON *v1_pod_status_convertToJSON(v1_pod_status_t *v1_pod_status) { } + // v1_pod_status->extended_resource_claim_status + if(v1_pod_status->extended_resource_claim_status) { + cJSON *extended_resource_claim_status_local_JSON = v1_pod_extended_resource_claim_status_convertToJSON(v1_pod_status->extended_resource_claim_status); + if(extended_resource_claim_status_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "extendedResourceClaimStatus", extended_resource_claim_status_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_pod_status->host_ip if(v1_pod_status->host_ip) { if(cJSON_AddStringToObject(item, "hostIP", v1_pod_status->host_ip) == NULL) { @@ -268,6 +335,14 @@ cJSON *v1_pod_status_convertToJSON(v1_pod_status_t *v1_pod_status) { } + // v1_pod_status->observed_generation + if(v1_pod_status->observed_generation) { + if(cJSON_AddNumberToObject(item, "observedGeneration", v1_pod_status->observed_generation) == NULL) { + goto fail; //Numeric + } + } + + // v1_pod_status->phase if(v1_pod_status->phase) { if(cJSON_AddStringToObject(item, "phase", v1_pod_status->phase) == NULL) { @@ -376,6 +451,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // define the local list for v1_pod_status->ephemeral_container_statuses list_t *ephemeral_container_statusesList = NULL; + // define the local variable for v1_pod_status->extended_resource_claim_status + v1_pod_extended_resource_claim_status_t *extended_resource_claim_status_local_nonprim = NULL; + // define the local list for v1_pod_status->host_ips list_t *host_ipsList = NULL; @@ -390,6 +468,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -411,6 +492,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->container_statuses cJSON *container_statuses = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "containerStatuses"); + if (cJSON_IsNull(container_statuses)) { + container_statuses = NULL; + } if (container_statuses) { cJSON *container_statuses_local_nonprimitive = NULL; if(!cJSON_IsArray(container_statuses)){ @@ -432,6 +516,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->ephemeral_container_statuses cJSON *ephemeral_container_statuses = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "ephemeralContainerStatuses"); + if (cJSON_IsNull(ephemeral_container_statuses)) { + ephemeral_container_statuses = NULL; + } if (ephemeral_container_statuses) { cJSON *ephemeral_container_statuses_local_nonprimitive = NULL; if(!cJSON_IsArray(ephemeral_container_statuses)){ @@ -451,8 +538,20 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ } } + // v1_pod_status->extended_resource_claim_status + cJSON *extended_resource_claim_status = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "extendedResourceClaimStatus"); + if (cJSON_IsNull(extended_resource_claim_status)) { + extended_resource_claim_status = NULL; + } + if (extended_resource_claim_status) { + extended_resource_claim_status_local_nonprim = v1_pod_extended_resource_claim_status_parseFromJSON(extended_resource_claim_status); //nonprimitive + } + // v1_pod_status->host_ip cJSON *host_ip = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "hostIP"); + if (cJSON_IsNull(host_ip)) { + host_ip = NULL; + } if (host_ip) { if(!cJSON_IsString(host_ip) && !cJSON_IsNull(host_ip)) { @@ -462,6 +561,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->host_ips cJSON *host_ips = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "hostIPs"); + if (cJSON_IsNull(host_ips)) { + host_ips = NULL; + } if (host_ips) { cJSON *host_ips_local_nonprimitive = NULL; if(!cJSON_IsArray(host_ips)){ @@ -483,6 +585,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->init_container_statuses cJSON *init_container_statuses = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "initContainerStatuses"); + if (cJSON_IsNull(init_container_statuses)) { + init_container_statuses = NULL; + } if (init_container_statuses) { cJSON *init_container_statuses_local_nonprimitive = NULL; if(!cJSON_IsArray(init_container_statuses)){ @@ -504,6 +609,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -513,6 +621,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->nominated_node_name cJSON *nominated_node_name = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "nominatedNodeName"); + if (cJSON_IsNull(nominated_node_name)) { + nominated_node_name = NULL; + } if (nominated_node_name) { if(!cJSON_IsString(nominated_node_name) && !cJSON_IsNull(nominated_node_name)) { @@ -520,8 +631,23 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ } } + // v1_pod_status->observed_generation + cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } + if (observed_generation) { + if(!cJSON_IsNumber(observed_generation)) + { + goto end; //Numeric + } + } + // v1_pod_status->phase cJSON *phase = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "phase"); + if (cJSON_IsNull(phase)) { + phase = NULL; + } if (phase) { if(!cJSON_IsString(phase) && !cJSON_IsNull(phase)) { @@ -531,6 +657,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->pod_ip cJSON *pod_ip = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "podIP"); + if (cJSON_IsNull(pod_ip)) { + pod_ip = NULL; + } if (pod_ip) { if(!cJSON_IsString(pod_ip) && !cJSON_IsNull(pod_ip)) { @@ -540,6 +669,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->pod_ips cJSON *pod_ips = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "podIPs"); + if (cJSON_IsNull(pod_ips)) { + pod_ips = NULL; + } if (pod_ips) { cJSON *pod_ips_local_nonprimitive = NULL; if(!cJSON_IsArray(pod_ips)){ @@ -561,6 +693,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->qos_class cJSON *qos_class = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "qosClass"); + if (cJSON_IsNull(qos_class)) { + qos_class = NULL; + } if (qos_class) { if(!cJSON_IsString(qos_class) && !cJSON_IsNull(qos_class)) { @@ -570,6 +705,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -579,6 +717,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->resize cJSON *resize = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "resize"); + if (cJSON_IsNull(resize)) { + resize = NULL; + } if (resize) { if(!cJSON_IsString(resize) && !cJSON_IsNull(resize)) { @@ -588,6 +729,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->resource_claim_statuses cJSON *resource_claim_statuses = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "resourceClaimStatuses"); + if (cJSON_IsNull(resource_claim_statuses)) { + resource_claim_statuses = NULL; + } if (resource_claim_statuses) { cJSON *resource_claim_statuses_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_claim_statuses)){ @@ -609,6 +753,9 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->start_time cJSON *start_time = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "startTime"); + if (cJSON_IsNull(start_time)) { + start_time = NULL; + } if (start_time) { if(!cJSON_IsString(start_time) && !cJSON_IsNull(start_time)) { @@ -617,15 +764,17 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ } - v1_pod_status_local_var = v1_pod_status_create ( + v1_pod_status_local_var = v1_pod_status_create_internal ( conditions ? conditionsList : NULL, container_statuses ? container_statusesList : NULL, ephemeral_container_statuses ? ephemeral_container_statusesList : NULL, + extended_resource_claim_status ? extended_resource_claim_status_local_nonprim : NULL, host_ip && !cJSON_IsNull(host_ip) ? strdup(host_ip->valuestring) : NULL, host_ips ? host_ipsList : NULL, init_container_statuses ? init_container_statusesList : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, nominated_node_name && !cJSON_IsNull(nominated_node_name) ? strdup(nominated_node_name->valuestring) : NULL, + observed_generation ? observed_generation->valuedouble : 0, phase && !cJSON_IsNull(phase) ? strdup(phase->valuestring) : NULL, pod_ip && !cJSON_IsNull(pod_ip) ? strdup(pod_ip->valuestring) : NULL, pod_ips ? pod_ipsList : NULL, @@ -665,6 +814,10 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ list_freeList(ephemeral_container_statusesList); ephemeral_container_statusesList = NULL; } + if (extended_resource_claim_status_local_nonprim) { + v1_pod_extended_resource_claim_status_free(extended_resource_claim_status_local_nonprim); + extended_resource_claim_status_local_nonprim = NULL; + } if (host_ipsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, host_ipsList) { diff --git a/kubernetes/model/v1_pod_status.h b/kubernetes/model/v1_pod_status.h index 2072fd0d..e8b4ec8c 100644 --- a/kubernetes/model/v1_pod_status.h +++ b/kubernetes/model/v1_pod_status.h @@ -18,6 +18,7 @@ typedef struct v1_pod_status_t v1_pod_status_t; #include "v1_container_status.h" #include "v1_host_ip.h" #include "v1_pod_condition.h" +#include "v1_pod_extended_resource_claim_status.h" #include "v1_pod_ip.h" #include "v1_pod_resource_claim_status.h" @@ -27,11 +28,13 @@ typedef struct v1_pod_status_t { list_t *conditions; //nonprimitive container list_t *container_statuses; //nonprimitive container list_t *ephemeral_container_statuses; //nonprimitive container + struct v1_pod_extended_resource_claim_status_t *extended_resource_claim_status; //model char *host_ip; // string list_t *host_ips; //nonprimitive container list_t *init_container_statuses; //nonprimitive container char *message; // string char *nominated_node_name; // string + long observed_generation; //numeric char *phase; // string char *pod_ip; // string list_t *pod_ips; //nonprimitive container @@ -41,17 +44,20 @@ typedef struct v1_pod_status_t { list_t *resource_claim_statuses; //nonprimitive container char *start_time; //date time + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_status_t; -v1_pod_status_t *v1_pod_status_create( +__attribute__((deprecated)) v1_pod_status_t *v1_pod_status_create( list_t *conditions, list_t *container_statuses, list_t *ephemeral_container_statuses, + v1_pod_extended_resource_claim_status_t *extended_resource_claim_status, char *host_ip, list_t *host_ips, list_t *init_container_statuses, char *message, char *nominated_node_name, + long observed_generation, char *phase, char *pod_ip, list_t *pod_ips, diff --git a/kubernetes/model/v1_pod_template.c b/kubernetes/model/v1_pod_template.c index fe2d89b2..8e3b6180 100644 --- a/kubernetes/model/v1_pod_template.c +++ b/kubernetes/model/v1_pod_template.c @@ -5,7 +5,7 @@ -v1_pod_template_t *v1_pod_template_create( +static v1_pod_template_t *v1_pod_template_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_pod_template_t *v1_pod_template_create( v1_pod_template_local_var->metadata = metadata; v1_pod_template_local_var->_template = _template; + v1_pod_template_local_var->_library_owned = 1; return v1_pod_template_local_var; } +__attribute__((deprecated)) v1_pod_template_t *v1_pod_template_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_pod_template_spec_t *_template + ) { + return v1_pod_template_create_internal ( + api_version, + kind, + metadata, + _template + ); +} void v1_pod_template_free(v1_pod_template_t *v1_pod_template) { if(NULL == v1_pod_template){ return ; } + if(v1_pod_template->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_template_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_template->api_version) { free(v1_pod_template->api_version); @@ -112,6 +130,9 @@ v1_pod_template_t *v1_pod_template_parseFromJSON(cJSON *v1_pod_templateJSON){ // v1_pod_template->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_pod_templateJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,6 +142,9 @@ v1_pod_template_t *v1_pod_template_parseFromJSON(cJSON *v1_pod_templateJSON){ // v1_pod_template->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_pod_templateJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -130,18 +154,24 @@ v1_pod_template_t *v1_pod_template_parseFromJSON(cJSON *v1_pod_templateJSON){ // v1_pod_template->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_pod_templateJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_pod_template->_template cJSON *_template = cJSON_GetObjectItemCaseSensitive(v1_pod_templateJSON, "template"); + if (cJSON_IsNull(_template)) { + _template = NULL; + } if (_template) { _template_local_nonprim = v1_pod_template_spec_parseFromJSON(_template); //nonprimitive } - v1_pod_template_local_var = v1_pod_template_create ( + v1_pod_template_local_var = v1_pod_template_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_pod_template.h b/kubernetes/model/v1_pod_template.h index 7fc721a9..8c818b9b 100644 --- a/kubernetes/model/v1_pod_template.h +++ b/kubernetes/model/v1_pod_template.h @@ -26,9 +26,10 @@ typedef struct v1_pod_template_t { struct v1_object_meta_t *metadata; //model struct v1_pod_template_spec_t *_template; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_template_t; -v1_pod_template_t *v1_pod_template_create( +__attribute__((deprecated)) v1_pod_template_t *v1_pod_template_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_pod_template_list.c b/kubernetes/model/v1_pod_template_list.c index 8e24e8f5..ff9e9867 100644 --- a/kubernetes/model/v1_pod_template_list.c +++ b/kubernetes/model/v1_pod_template_list.c @@ -5,7 +5,7 @@ -v1_pod_template_list_t *v1_pod_template_list_create( +static v1_pod_template_list_t *v1_pod_template_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_pod_template_list_t *v1_pod_template_list_create( v1_pod_template_list_local_var->kind = kind; v1_pod_template_list_local_var->metadata = metadata; + v1_pod_template_list_local_var->_library_owned = 1; return v1_pod_template_list_local_var; } +__attribute__((deprecated)) v1_pod_template_list_t *v1_pod_template_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_pod_template_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_pod_template_list_free(v1_pod_template_list_t *v1_pod_template_list) { if(NULL == v1_pod_template_list){ return ; } + if(v1_pod_template_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_template_list_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_template_list->api_version) { free(v1_pod_template_list->api_version); @@ -123,6 +141,9 @@ v1_pod_template_list_t *v1_pod_template_list_parseFromJSON(cJSON *v1_pod_templat // v1_pod_template_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_pod_template_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_pod_template_list_t *v1_pod_template_list_parseFromJSON(cJSON *v1_pod_templat // v1_pod_template_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_pod_template_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_pod_template_list_t *v1_pod_template_list_parseFromJSON(cJSON *v1_pod_templat // v1_pod_template_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_pod_template_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_pod_template_list_t *v1_pod_template_list_parseFromJSON(cJSON *v1_pod_templat // v1_pod_template_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_pod_template_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_pod_template_list_local_var = v1_pod_template_list_create ( + v1_pod_template_list_local_var = v1_pod_template_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_pod_template_list.h b/kubernetes/model/v1_pod_template_list.h index acff71e6..b939db52 100644 --- a/kubernetes/model/v1_pod_template_list.h +++ b/kubernetes/model/v1_pod_template_list.h @@ -26,9 +26,10 @@ typedef struct v1_pod_template_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_template_list_t; -v1_pod_template_list_t *v1_pod_template_list_create( +__attribute__((deprecated)) v1_pod_template_list_t *v1_pod_template_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_pod_template_spec.c b/kubernetes/model/v1_pod_template_spec.c index ed1b8669..27a77752 100644 --- a/kubernetes/model/v1_pod_template_spec.c +++ b/kubernetes/model/v1_pod_template_spec.c @@ -5,7 +5,7 @@ -v1_pod_template_spec_t *v1_pod_template_spec_create( +static v1_pod_template_spec_t *v1_pod_template_spec_create_internal( v1_object_meta_t *metadata, v1_pod_spec_t *spec ) { @@ -16,14 +16,28 @@ v1_pod_template_spec_t *v1_pod_template_spec_create( v1_pod_template_spec_local_var->metadata = metadata; v1_pod_template_spec_local_var->spec = spec; + v1_pod_template_spec_local_var->_library_owned = 1; return v1_pod_template_spec_local_var; } +__attribute__((deprecated)) v1_pod_template_spec_t *v1_pod_template_spec_create( + v1_object_meta_t *metadata, + v1_pod_spec_t *spec + ) { + return v1_pod_template_spec_create_internal ( + metadata, + spec + ); +} void v1_pod_template_spec_free(v1_pod_template_spec_t *v1_pod_template_spec) { if(NULL == v1_pod_template_spec){ return ; } + if(v1_pod_template_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_pod_template_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_pod_template_spec->metadata) { v1_object_meta_free(v1_pod_template_spec->metadata); @@ -84,18 +98,24 @@ v1_pod_template_spec_t *v1_pod_template_spec_parseFromJSON(cJSON *v1_pod_templat // v1_pod_template_spec->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_pod_template_specJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_pod_template_spec->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_pod_template_specJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_pod_spec_parseFromJSON(spec); //nonprimitive } - v1_pod_template_spec_local_var = v1_pod_template_spec_create ( + v1_pod_template_spec_local_var = v1_pod_template_spec_create_internal ( metadata ? metadata_local_nonprim : NULL, spec ? spec_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_pod_template_spec.h b/kubernetes/model/v1_pod_template_spec.h index 4c3f4006..0e441608 100644 --- a/kubernetes/model/v1_pod_template_spec.h +++ b/kubernetes/model/v1_pod_template_spec.h @@ -24,9 +24,10 @@ typedef struct v1_pod_template_spec_t { struct v1_object_meta_t *metadata; //model struct v1_pod_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_pod_template_spec_t; -v1_pod_template_spec_t *v1_pod_template_spec_create( +__attribute__((deprecated)) v1_pod_template_spec_t *v1_pod_template_spec_create( v1_object_meta_t *metadata, v1_pod_spec_t *spec ); diff --git a/kubernetes/model/v1_policy_rule.c b/kubernetes/model/v1_policy_rule.c index 33bb9d0a..cdc5bfd2 100644 --- a/kubernetes/model/v1_policy_rule.c +++ b/kubernetes/model/v1_policy_rule.c @@ -5,7 +5,7 @@ -v1_policy_rule_t *v1_policy_rule_create( +static v1_policy_rule_t *v1_policy_rule_create_internal( list_t *api_groups, list_t *non_resource_urls, list_t *resource_names, @@ -22,14 +22,34 @@ v1_policy_rule_t *v1_policy_rule_create( v1_policy_rule_local_var->resources = resources; v1_policy_rule_local_var->verbs = verbs; + v1_policy_rule_local_var->_library_owned = 1; return v1_policy_rule_local_var; } +__attribute__((deprecated)) v1_policy_rule_t *v1_policy_rule_create( + list_t *api_groups, + list_t *non_resource_urls, + list_t *resource_names, + list_t *resources, + list_t *verbs + ) { + return v1_policy_rule_create_internal ( + api_groups, + non_resource_urls, + resource_names, + resources, + verbs + ); +} void v1_policy_rule_free(v1_policy_rule_t *v1_policy_rule) { if(NULL == v1_policy_rule){ return ; } + if(v1_policy_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_policy_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_policy_rule->api_groups) { list_ForEach(listEntry, v1_policy_rule->api_groups) { @@ -81,7 +101,7 @@ cJSON *v1_policy_rule_convertToJSON(v1_policy_rule_t *v1_policy_rule) { listEntry_t *api_groupsListEntry; list_ForEach(api_groupsListEntry, v1_policy_rule->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_groups, "", api_groupsListEntry->data) == NULL) { goto fail; } @@ -98,7 +118,7 @@ cJSON *v1_policy_rule_convertToJSON(v1_policy_rule_t *v1_policy_rule) { listEntry_t *non_resource_urlsListEntry; list_ForEach(non_resource_urlsListEntry, v1_policy_rule->non_resource_urls) { - if(cJSON_AddStringToObject(non_resource_urls, "", (char*)non_resource_urlsListEntry->data) == NULL) + if(cJSON_AddStringToObject(non_resource_urls, "", non_resource_urlsListEntry->data) == NULL) { goto fail; } @@ -115,7 +135,7 @@ cJSON *v1_policy_rule_convertToJSON(v1_policy_rule_t *v1_policy_rule) { listEntry_t *resource_namesListEntry; list_ForEach(resource_namesListEntry, v1_policy_rule->resource_names) { - if(cJSON_AddStringToObject(resource_names, "", (char*)resource_namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resource_names, "", resource_namesListEntry->data) == NULL) { goto fail; } @@ -132,7 +152,7 @@ cJSON *v1_policy_rule_convertToJSON(v1_policy_rule_t *v1_policy_rule) { listEntry_t *resourcesListEntry; list_ForEach(resourcesListEntry, v1_policy_rule->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resources, "", resourcesListEntry->data) == NULL) { goto fail; } @@ -151,7 +171,7 @@ cJSON *v1_policy_rule_convertToJSON(v1_policy_rule_t *v1_policy_rule) { listEntry_t *verbsListEntry; list_ForEach(verbsListEntry, v1_policy_rule->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) + if(cJSON_AddStringToObject(verbs, "", verbsListEntry->data) == NULL) { goto fail; } @@ -186,6 +206,9 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "apiGroups"); + if (cJSON_IsNull(api_groups)) { + api_groups = NULL; + } if (api_groups) { cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { @@ -205,6 +228,9 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->non_resource_urls cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "nonResourceURLs"); + if (cJSON_IsNull(non_resource_urls)) { + non_resource_urls = NULL; + } if (non_resource_urls) { cJSON *non_resource_urls_local = NULL; if(!cJSON_IsArray(non_resource_urls)) { @@ -224,6 +250,9 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "resourceNames"); + if (cJSON_IsNull(resource_names)) { + resource_names = NULL; + } if (resource_names) { cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { @@ -243,6 +272,9 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { @@ -262,6 +294,9 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->verbs cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "verbs"); + if (cJSON_IsNull(verbs)) { + verbs = NULL; + } if (!verbs) { goto end; } @@ -283,7 +318,7 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ } - v1_policy_rule_local_var = v1_policy_rule_create ( + v1_policy_rule_local_var = v1_policy_rule_create_internal ( api_groups ? api_groupsList : NULL, non_resource_urls ? non_resource_urlsList : NULL, resource_names ? resource_namesList : NULL, diff --git a/kubernetes/model/v1_policy_rule.h b/kubernetes/model/v1_policy_rule.h index 9a15f372..36fbb123 100644 --- a/kubernetes/model/v1_policy_rule.h +++ b/kubernetes/model/v1_policy_rule.h @@ -25,9 +25,10 @@ typedef struct v1_policy_rule_t { list_t *resources; //primitive container list_t *verbs; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_policy_rule_t; -v1_policy_rule_t *v1_policy_rule_create( +__attribute__((deprecated)) v1_policy_rule_t *v1_policy_rule_create( list_t *api_groups, list_t *non_resource_urls, list_t *resource_names, diff --git a/kubernetes/model/v1_policy_rules_with_subjects.c b/kubernetes/model/v1_policy_rules_with_subjects.c index a1cf218a..1aac32dc 100644 --- a/kubernetes/model/v1_policy_rules_with_subjects.c +++ b/kubernetes/model/v1_policy_rules_with_subjects.c @@ -5,7 +5,7 @@ -v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_create( +static v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_create_internal( list_t *non_resource_rules, list_t *resource_rules, list_t *subjects @@ -18,14 +18,30 @@ v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_create( v1_policy_rules_with_subjects_local_var->resource_rules = resource_rules; v1_policy_rules_with_subjects_local_var->subjects = subjects; + v1_policy_rules_with_subjects_local_var->_library_owned = 1; return v1_policy_rules_with_subjects_local_var; } +__attribute__((deprecated)) v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_create( + list_t *non_resource_rules, + list_t *resource_rules, + list_t *subjects + ) { + return v1_policy_rules_with_subjects_create_internal ( + non_resource_rules, + resource_rules, + subjects + ); +} void v1_policy_rules_with_subjects_free(v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects) { if(NULL == v1_policy_rules_with_subjects){ return ; } + if(v1_policy_rules_with_subjects->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_policy_rules_with_subjects_free"); + return ; + } listEntry_t *listEntry; if (v1_policy_rules_with_subjects->non_resource_rules) { list_ForEach(listEntry, v1_policy_rules_with_subjects->non_resource_rules) { @@ -137,6 +153,9 @@ v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_parseFromJSON(cJS // v1_policy_rules_with_subjects->non_resource_rules cJSON *non_resource_rules = cJSON_GetObjectItemCaseSensitive(v1_policy_rules_with_subjectsJSON, "nonResourceRules"); + if (cJSON_IsNull(non_resource_rules)) { + non_resource_rules = NULL; + } if (non_resource_rules) { cJSON *non_resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(non_resource_rules)){ @@ -158,6 +177,9 @@ v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_parseFromJSON(cJS // v1_policy_rules_with_subjects->resource_rules cJSON *resource_rules = cJSON_GetObjectItemCaseSensitive(v1_policy_rules_with_subjectsJSON, "resourceRules"); + if (cJSON_IsNull(resource_rules)) { + resource_rules = NULL; + } if (resource_rules) { cJSON *resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_rules)){ @@ -179,6 +201,9 @@ v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_parseFromJSON(cJS // v1_policy_rules_with_subjects->subjects cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1_policy_rules_with_subjectsJSON, "subjects"); + if (cJSON_IsNull(subjects)) { + subjects = NULL; + } if (!subjects) { goto end; } @@ -202,7 +227,7 @@ v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_parseFromJSON(cJS } - v1_policy_rules_with_subjects_local_var = v1_policy_rules_with_subjects_create ( + v1_policy_rules_with_subjects_local_var = v1_policy_rules_with_subjects_create_internal ( non_resource_rules ? non_resource_rulesList : NULL, resource_rules ? resource_rulesList : NULL, subjectsList diff --git a/kubernetes/model/v1_policy_rules_with_subjects.h b/kubernetes/model/v1_policy_rules_with_subjects.h index d0dcceff..535d4e98 100644 --- a/kubernetes/model/v1_policy_rules_with_subjects.h +++ b/kubernetes/model/v1_policy_rules_with_subjects.h @@ -26,9 +26,10 @@ typedef struct v1_policy_rules_with_subjects_t { list_t *resource_rules; //nonprimitive container list_t *subjects; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_policy_rules_with_subjects_t; -v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_create( +__attribute__((deprecated)) v1_policy_rules_with_subjects_t *v1_policy_rules_with_subjects_create( list_t *non_resource_rules, list_t *resource_rules, list_t *subjects diff --git a/kubernetes/model/v1_port_status.c b/kubernetes/model/v1_port_status.c index 6aa5abae..c0c9ade1 100644 --- a/kubernetes/model/v1_port_status.c +++ b/kubernetes/model/v1_port_status.c @@ -5,7 +5,7 @@ -v1_port_status_t *v1_port_status_create( +static v1_port_status_t *v1_port_status_create_internal( char *error, int port, char *protocol @@ -18,14 +18,30 @@ v1_port_status_t *v1_port_status_create( v1_port_status_local_var->port = port; v1_port_status_local_var->protocol = protocol; + v1_port_status_local_var->_library_owned = 1; return v1_port_status_local_var; } +__attribute__((deprecated)) v1_port_status_t *v1_port_status_create( + char *error, + int port, + char *protocol + ) { + return v1_port_status_create_internal ( + error, + port, + protocol + ); +} void v1_port_status_free(v1_port_status_t *v1_port_status) { if(NULL == v1_port_status){ return ; } + if(v1_port_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_port_status_free"); + return ; + } listEntry_t *listEntry; if (v1_port_status->error) { free(v1_port_status->error); @@ -80,6 +96,9 @@ v1_port_status_t *v1_port_status_parseFromJSON(cJSON *v1_port_statusJSON){ // v1_port_status->error cJSON *error = cJSON_GetObjectItemCaseSensitive(v1_port_statusJSON, "error"); + if (cJSON_IsNull(error)) { + error = NULL; + } if (error) { if(!cJSON_IsString(error) && !cJSON_IsNull(error)) { @@ -89,6 +108,9 @@ v1_port_status_t *v1_port_status_parseFromJSON(cJSON *v1_port_statusJSON){ // v1_port_status->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_port_statusJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -101,6 +123,9 @@ v1_port_status_t *v1_port_status_parseFromJSON(cJSON *v1_port_statusJSON){ // v1_port_status->protocol cJSON *protocol = cJSON_GetObjectItemCaseSensitive(v1_port_statusJSON, "protocol"); + if (cJSON_IsNull(protocol)) { + protocol = NULL; + } if (!protocol) { goto end; } @@ -112,7 +137,7 @@ v1_port_status_t *v1_port_status_parseFromJSON(cJSON *v1_port_statusJSON){ } - v1_port_status_local_var = v1_port_status_create ( + v1_port_status_local_var = v1_port_status_create_internal ( error && !cJSON_IsNull(error) ? strdup(error->valuestring) : NULL, port->valuedouble, strdup(protocol->valuestring) diff --git a/kubernetes/model/v1_port_status.h b/kubernetes/model/v1_port_status.h index 3f4f4039..fcc1db64 100644 --- a/kubernetes/model/v1_port_status.h +++ b/kubernetes/model/v1_port_status.h @@ -1,7 +1,7 @@ /* * v1_port_status.h * - * + * PortStatus represents the error condition of a service port */ #ifndef _v1_port_status_H_ @@ -23,9 +23,10 @@ typedef struct v1_port_status_t { int port; //numeric char *protocol; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_port_status_t; -v1_port_status_t *v1_port_status_create( +__attribute__((deprecated)) v1_port_status_t *v1_port_status_create( char *error, int port, char *protocol diff --git a/kubernetes/model/v1_portworx_volume_source.c b/kubernetes/model/v1_portworx_volume_source.c index 973f2cbf..8ccb0a3f 100644 --- a/kubernetes/model/v1_portworx_volume_source.c +++ b/kubernetes/model/v1_portworx_volume_source.c @@ -5,7 +5,7 @@ -v1_portworx_volume_source_t *v1_portworx_volume_source_create( +static v1_portworx_volume_source_t *v1_portworx_volume_source_create_internal( char *fs_type, int read_only, char *volume_id @@ -18,14 +18,30 @@ v1_portworx_volume_source_t *v1_portworx_volume_source_create( v1_portworx_volume_source_local_var->read_only = read_only; v1_portworx_volume_source_local_var->volume_id = volume_id; + v1_portworx_volume_source_local_var->_library_owned = 1; return v1_portworx_volume_source_local_var; } +__attribute__((deprecated)) v1_portworx_volume_source_t *v1_portworx_volume_source_create( + char *fs_type, + int read_only, + char *volume_id + ) { + return v1_portworx_volume_source_create_internal ( + fs_type, + read_only, + volume_id + ); +} void v1_portworx_volume_source_free(v1_portworx_volume_source_t *v1_portworx_volume_source) { if(NULL == v1_portworx_volume_source){ return ; } + if(v1_portworx_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_portworx_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_portworx_volume_source->fs_type) { free(v1_portworx_volume_source->fs_type); @@ -79,6 +95,9 @@ v1_portworx_volume_source_t *v1_portworx_volume_source_parseFromJSON(cJSON *v1_p // v1_portworx_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_portworx_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -88,6 +107,9 @@ v1_portworx_volume_source_t *v1_portworx_volume_source_parseFromJSON(cJSON *v1_p // v1_portworx_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_portworx_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -97,6 +119,9 @@ v1_portworx_volume_source_t *v1_portworx_volume_source_parseFromJSON(cJSON *v1_p // v1_portworx_volume_source->volume_id cJSON *volume_id = cJSON_GetObjectItemCaseSensitive(v1_portworx_volume_sourceJSON, "volumeID"); + if (cJSON_IsNull(volume_id)) { + volume_id = NULL; + } if (!volume_id) { goto end; } @@ -108,7 +133,7 @@ v1_portworx_volume_source_t *v1_portworx_volume_source_parseFromJSON(cJSON *v1_p } - v1_portworx_volume_source_local_var = v1_portworx_volume_source_create ( + v1_portworx_volume_source_local_var = v1_portworx_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, read_only ? read_only->valueint : 0, strdup(volume_id->valuestring) diff --git a/kubernetes/model/v1_portworx_volume_source.h b/kubernetes/model/v1_portworx_volume_source.h index d6ecdf61..35a258a3 100644 --- a/kubernetes/model/v1_portworx_volume_source.h +++ b/kubernetes/model/v1_portworx_volume_source.h @@ -23,9 +23,10 @@ typedef struct v1_portworx_volume_source_t { int read_only; //boolean char *volume_id; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_portworx_volume_source_t; -v1_portworx_volume_source_t *v1_portworx_volume_source_create( +__attribute__((deprecated)) v1_portworx_volume_source_t *v1_portworx_volume_source_create( char *fs_type, int read_only, char *volume_id diff --git a/kubernetes/model/v1_preconditions.c b/kubernetes/model/v1_preconditions.c index 1102e90f..47536fe0 100644 --- a/kubernetes/model/v1_preconditions.c +++ b/kubernetes/model/v1_preconditions.c @@ -5,7 +5,7 @@ -v1_preconditions_t *v1_preconditions_create( +static v1_preconditions_t *v1_preconditions_create_internal( char *resource_version, char *uid ) { @@ -16,14 +16,28 @@ v1_preconditions_t *v1_preconditions_create( v1_preconditions_local_var->resource_version = resource_version; v1_preconditions_local_var->uid = uid; + v1_preconditions_local_var->_library_owned = 1; return v1_preconditions_local_var; } +__attribute__((deprecated)) v1_preconditions_t *v1_preconditions_create( + char *resource_version, + char *uid + ) { + return v1_preconditions_create_internal ( + resource_version, + uid + ); +} void v1_preconditions_free(v1_preconditions_t *v1_preconditions) { if(NULL == v1_preconditions){ return ; } + if(v1_preconditions->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_preconditions_free"); + return ; + } listEntry_t *listEntry; if (v1_preconditions->resource_version) { free(v1_preconditions->resource_version); @@ -68,6 +82,9 @@ v1_preconditions_t *v1_preconditions_parseFromJSON(cJSON *v1_preconditionsJSON){ // v1_preconditions->resource_version cJSON *resource_version = cJSON_GetObjectItemCaseSensitive(v1_preconditionsJSON, "resourceVersion"); + if (cJSON_IsNull(resource_version)) { + resource_version = NULL; + } if (resource_version) { if(!cJSON_IsString(resource_version) && !cJSON_IsNull(resource_version)) { @@ -77,6 +94,9 @@ v1_preconditions_t *v1_preconditions_parseFromJSON(cJSON *v1_preconditionsJSON){ // v1_preconditions->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_preconditionsJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -85,7 +105,7 @@ v1_preconditions_t *v1_preconditions_parseFromJSON(cJSON *v1_preconditionsJSON){ } - v1_preconditions_local_var = v1_preconditions_create ( + v1_preconditions_local_var = v1_preconditions_create_internal ( resource_version && !cJSON_IsNull(resource_version) ? strdup(resource_version->valuestring) : NULL, uid && !cJSON_IsNull(uid) ? strdup(uid->valuestring) : NULL ); diff --git a/kubernetes/model/v1_preconditions.h b/kubernetes/model/v1_preconditions.h index cf197749..4f8078bc 100644 --- a/kubernetes/model/v1_preconditions.h +++ b/kubernetes/model/v1_preconditions.h @@ -22,9 +22,10 @@ typedef struct v1_preconditions_t { char *resource_version; // string char *uid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_preconditions_t; -v1_preconditions_t *v1_preconditions_create( +__attribute__((deprecated)) v1_preconditions_t *v1_preconditions_create( char *resource_version, char *uid ); diff --git a/kubernetes/model/v1_preferred_scheduling_term.c b/kubernetes/model/v1_preferred_scheduling_term.c index 478de8ce..b8e7f2a0 100644 --- a/kubernetes/model/v1_preferred_scheduling_term.c +++ b/kubernetes/model/v1_preferred_scheduling_term.c @@ -5,7 +5,7 @@ -v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_create( +static v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_create_internal( v1_node_selector_term_t *preference, int weight ) { @@ -16,14 +16,28 @@ v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_create( v1_preferred_scheduling_term_local_var->preference = preference; v1_preferred_scheduling_term_local_var->weight = weight; + v1_preferred_scheduling_term_local_var->_library_owned = 1; return v1_preferred_scheduling_term_local_var; } +__attribute__((deprecated)) v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_create( + v1_node_selector_term_t *preference, + int weight + ) { + return v1_preferred_scheduling_term_create_internal ( + preference, + weight + ); +} void v1_preferred_scheduling_term_free(v1_preferred_scheduling_term_t *v1_preferred_scheduling_term) { if(NULL == v1_preferred_scheduling_term){ return ; } + if(v1_preferred_scheduling_term->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_preferred_scheduling_term_free"); + return ; + } listEntry_t *listEntry; if (v1_preferred_scheduling_term->preference) { v1_node_selector_term_free(v1_preferred_scheduling_term->preference); @@ -74,6 +88,9 @@ v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_parseFromJSON(cJSON // v1_preferred_scheduling_term->preference cJSON *preference = cJSON_GetObjectItemCaseSensitive(v1_preferred_scheduling_termJSON, "preference"); + if (cJSON_IsNull(preference)) { + preference = NULL; + } if (!preference) { goto end; } @@ -83,6 +100,9 @@ v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_parseFromJSON(cJSON // v1_preferred_scheduling_term->weight cJSON *weight = cJSON_GetObjectItemCaseSensitive(v1_preferred_scheduling_termJSON, "weight"); + if (cJSON_IsNull(weight)) { + weight = NULL; + } if (!weight) { goto end; } @@ -94,7 +114,7 @@ v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_parseFromJSON(cJSON } - v1_preferred_scheduling_term_local_var = v1_preferred_scheduling_term_create ( + v1_preferred_scheduling_term_local_var = v1_preferred_scheduling_term_create_internal ( preference_local_nonprim, weight->valuedouble ); diff --git a/kubernetes/model/v1_preferred_scheduling_term.h b/kubernetes/model/v1_preferred_scheduling_term.h index e6b797f7..bcabc491 100644 --- a/kubernetes/model/v1_preferred_scheduling_term.h +++ b/kubernetes/model/v1_preferred_scheduling_term.h @@ -23,9 +23,10 @@ typedef struct v1_preferred_scheduling_term_t { struct v1_node_selector_term_t *preference; //model int weight; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_preferred_scheduling_term_t; -v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_create( +__attribute__((deprecated)) v1_preferred_scheduling_term_t *v1_preferred_scheduling_term_create( v1_node_selector_term_t *preference, int weight ); diff --git a/kubernetes/model/v1_priority_class.c b/kubernetes/model/v1_priority_class.c index 2a76a297..fd010e2e 100644 --- a/kubernetes/model/v1_priority_class.c +++ b/kubernetes/model/v1_priority_class.c @@ -5,7 +5,7 @@ -v1_priority_class_t *v1_priority_class_create( +static v1_priority_class_t *v1_priority_class_create_internal( char *api_version, char *description, int global_default, @@ -26,14 +26,38 @@ v1_priority_class_t *v1_priority_class_create( v1_priority_class_local_var->preemption_policy = preemption_policy; v1_priority_class_local_var->value = value; + v1_priority_class_local_var->_library_owned = 1; return v1_priority_class_local_var; } +__attribute__((deprecated)) v1_priority_class_t *v1_priority_class_create( + char *api_version, + char *description, + int global_default, + char *kind, + v1_object_meta_t *metadata, + char *preemption_policy, + int value + ) { + return v1_priority_class_create_internal ( + api_version, + description, + global_default, + kind, + metadata, + preemption_policy, + value + ); +} void v1_priority_class_free(v1_priority_class_t *v1_priority_class) { if(NULL == v1_priority_class){ return ; } + if(v1_priority_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_class_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_class->api_version) { free(v1_priority_class->api_version); @@ -139,6 +163,9 @@ v1_priority_class_t *v1_priority_class_parseFromJSON(cJSON *v1_priority_classJSO // v1_priority_class->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_priority_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -148,6 +175,9 @@ v1_priority_class_t *v1_priority_class_parseFromJSON(cJSON *v1_priority_classJSO // v1_priority_class->description cJSON *description = cJSON_GetObjectItemCaseSensitive(v1_priority_classJSON, "description"); + if (cJSON_IsNull(description)) { + description = NULL; + } if (description) { if(!cJSON_IsString(description) && !cJSON_IsNull(description)) { @@ -157,6 +187,9 @@ v1_priority_class_t *v1_priority_class_parseFromJSON(cJSON *v1_priority_classJSO // v1_priority_class->global_default cJSON *global_default = cJSON_GetObjectItemCaseSensitive(v1_priority_classJSON, "globalDefault"); + if (cJSON_IsNull(global_default)) { + global_default = NULL; + } if (global_default) { if(!cJSON_IsBool(global_default)) { @@ -166,6 +199,9 @@ v1_priority_class_t *v1_priority_class_parseFromJSON(cJSON *v1_priority_classJSO // v1_priority_class->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_priority_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -175,12 +211,18 @@ v1_priority_class_t *v1_priority_class_parseFromJSON(cJSON *v1_priority_classJSO // v1_priority_class->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_priority_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_priority_class->preemption_policy cJSON *preemption_policy = cJSON_GetObjectItemCaseSensitive(v1_priority_classJSON, "preemptionPolicy"); + if (cJSON_IsNull(preemption_policy)) { + preemption_policy = NULL; + } if (preemption_policy) { if(!cJSON_IsString(preemption_policy) && !cJSON_IsNull(preemption_policy)) { @@ -190,6 +232,9 @@ v1_priority_class_t *v1_priority_class_parseFromJSON(cJSON *v1_priority_classJSO // v1_priority_class->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_priority_classJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (!value) { goto end; } @@ -201,7 +246,7 @@ v1_priority_class_t *v1_priority_class_parseFromJSON(cJSON *v1_priority_classJSO } - v1_priority_class_local_var = v1_priority_class_create ( + v1_priority_class_local_var = v1_priority_class_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, description && !cJSON_IsNull(description) ? strdup(description->valuestring) : NULL, global_default ? global_default->valueint : 0, diff --git a/kubernetes/model/v1_priority_class.h b/kubernetes/model/v1_priority_class.h index 100376f2..419e9b29 100644 --- a/kubernetes/model/v1_priority_class.h +++ b/kubernetes/model/v1_priority_class.h @@ -28,9 +28,10 @@ typedef struct v1_priority_class_t { char *preemption_policy; // string int value; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_class_t; -v1_priority_class_t *v1_priority_class_create( +__attribute__((deprecated)) v1_priority_class_t *v1_priority_class_create( char *api_version, char *description, int global_default, diff --git a/kubernetes/model/v1_priority_class_list.c b/kubernetes/model/v1_priority_class_list.c index a52b06dd..0983546e 100644 --- a/kubernetes/model/v1_priority_class_list.c +++ b/kubernetes/model/v1_priority_class_list.c @@ -5,7 +5,7 @@ -v1_priority_class_list_t *v1_priority_class_list_create( +static v1_priority_class_list_t *v1_priority_class_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_priority_class_list_t *v1_priority_class_list_create( v1_priority_class_list_local_var->kind = kind; v1_priority_class_list_local_var->metadata = metadata; + v1_priority_class_list_local_var->_library_owned = 1; return v1_priority_class_list_local_var; } +__attribute__((deprecated)) v1_priority_class_list_t *v1_priority_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_priority_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_priority_class_list_free(v1_priority_class_list_t *v1_priority_class_list) { if(NULL == v1_priority_class_list){ return ; } + if(v1_priority_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_class_list_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_class_list->api_version) { free(v1_priority_class_list->api_version); @@ -123,6 +141,9 @@ v1_priority_class_list_t *v1_priority_class_list_parseFromJSON(cJSON *v1_priorit // v1_priority_class_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_priority_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_priority_class_list_t *v1_priority_class_list_parseFromJSON(cJSON *v1_priorit // v1_priority_class_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_priority_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_priority_class_list_t *v1_priority_class_list_parseFromJSON(cJSON *v1_priorit // v1_priority_class_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_priority_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_priority_class_list_t *v1_priority_class_list_parseFromJSON(cJSON *v1_priorit // v1_priority_class_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_priority_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_priority_class_list_local_var = v1_priority_class_list_create ( + v1_priority_class_list_local_var = v1_priority_class_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_priority_class_list.h b/kubernetes/model/v1_priority_class_list.h index 68549a86..a905bc7a 100644 --- a/kubernetes/model/v1_priority_class_list.h +++ b/kubernetes/model/v1_priority_class_list.h @@ -26,9 +26,10 @@ typedef struct v1_priority_class_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_class_list_t; -v1_priority_class_list_t *v1_priority_class_list_create( +__attribute__((deprecated)) v1_priority_class_list_t *v1_priority_class_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_priority_level_configuration.c b/kubernetes/model/v1_priority_level_configuration.c index 44466d7d..fe8e19aa 100644 --- a/kubernetes/model/v1_priority_level_configuration.c +++ b/kubernetes/model/v1_priority_level_configuration.c @@ -5,7 +5,7 @@ -v1_priority_level_configuration_t *v1_priority_level_configuration_create( +static v1_priority_level_configuration_t *v1_priority_level_configuration_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_priority_level_configuration_t *v1_priority_level_configuration_create( v1_priority_level_configuration_local_var->spec = spec; v1_priority_level_configuration_local_var->status = status; + v1_priority_level_configuration_local_var->_library_owned = 1; return v1_priority_level_configuration_local_var; } +__attribute__((deprecated)) v1_priority_level_configuration_t *v1_priority_level_configuration_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_priority_level_configuration_spec_t *spec, + v1_priority_level_configuration_status_t *status + ) { + return v1_priority_level_configuration_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_priority_level_configuration_free(v1_priority_level_configuration_t *v1_priority_level_configuration) { if(NULL == v1_priority_level_configuration){ return ; } + if(v1_priority_level_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_level_configuration_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_level_configuration->api_version) { free(v1_priority_level_configuration->api_version); @@ -134,6 +154,9 @@ v1_priority_level_configuration_t *v1_priority_level_configuration_parseFromJSON // v1_priority_level_configuration->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configurationJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_priority_level_configuration_t *v1_priority_level_configuration_parseFromJSON // v1_priority_level_configuration->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configurationJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_priority_level_configuration_t *v1_priority_level_configuration_parseFromJSON // v1_priority_level_configuration->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configurationJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_priority_level_configuration->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configurationJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_priority_level_configuration_spec_parseFromJSON(spec); //nonprimitive } // v1_priority_level_configuration->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configurationJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_priority_level_configuration_status_parseFromJSON(status); //nonprimitive } - v1_priority_level_configuration_local_var = v1_priority_level_configuration_create ( + v1_priority_level_configuration_local_var = v1_priority_level_configuration_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_priority_level_configuration.h b/kubernetes/model/v1_priority_level_configuration.h index fd815882..57824db6 100644 --- a/kubernetes/model/v1_priority_level_configuration.h +++ b/kubernetes/model/v1_priority_level_configuration.h @@ -28,9 +28,10 @@ typedef struct v1_priority_level_configuration_t { struct v1_priority_level_configuration_spec_t *spec; //model struct v1_priority_level_configuration_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_level_configuration_t; -v1_priority_level_configuration_t *v1_priority_level_configuration_create( +__attribute__((deprecated)) v1_priority_level_configuration_t *v1_priority_level_configuration_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_priority_level_configuration_condition.c b/kubernetes/model/v1_priority_level_configuration_condition.c index 640a7b7d..8b05b480 100644 --- a/kubernetes/model/v1_priority_level_configuration_condition.c +++ b/kubernetes/model/v1_priority_level_configuration_condition.c @@ -5,7 +5,7 @@ -v1_priority_level_configuration_condition_t *v1_priority_level_configuration_condition_create( +static v1_priority_level_configuration_condition_t *v1_priority_level_configuration_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_priority_level_configuration_condition_t *v1_priority_level_configuration_con v1_priority_level_configuration_condition_local_var->status = status; v1_priority_level_configuration_condition_local_var->type = type; + v1_priority_level_configuration_condition_local_var->_library_owned = 1; return v1_priority_level_configuration_condition_local_var; } +__attribute__((deprecated)) v1_priority_level_configuration_condition_t *v1_priority_level_configuration_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_priority_level_configuration_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_priority_level_configuration_condition_free(v1_priority_level_configuration_condition_t *v1_priority_level_configuration_condition) { if(NULL == v1_priority_level_configuration_condition){ return ; } + if(v1_priority_level_configuration_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_level_configuration_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_level_configuration_condition->last_transition_time) { free(v1_priority_level_configuration_condition->last_transition_time); @@ -110,6 +130,9 @@ v1_priority_level_configuration_condition_t *v1_priority_level_configuration_con // v1_priority_level_configuration_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -119,6 +142,9 @@ v1_priority_level_configuration_condition_t *v1_priority_level_configuration_con // v1_priority_level_configuration_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -128,6 +154,9 @@ v1_priority_level_configuration_condition_t *v1_priority_level_configuration_con // v1_priority_level_configuration_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -137,6 +166,9 @@ v1_priority_level_configuration_condition_t *v1_priority_level_configuration_con // v1_priority_level_configuration_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { if(!cJSON_IsString(status) && !cJSON_IsNull(status)) { @@ -146,6 +178,9 @@ v1_priority_level_configuration_condition_t *v1_priority_level_configuration_con // v1_priority_level_configuration_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -154,7 +189,7 @@ v1_priority_level_configuration_condition_t *v1_priority_level_configuration_con } - v1_priority_level_configuration_condition_local_var = v1_priority_level_configuration_condition_create ( + v1_priority_level_configuration_condition_local_var = v1_priority_level_configuration_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_priority_level_configuration_condition.h b/kubernetes/model/v1_priority_level_configuration_condition.h index 9ad531ff..d3e9971a 100644 --- a/kubernetes/model/v1_priority_level_configuration_condition.h +++ b/kubernetes/model/v1_priority_level_configuration_condition.h @@ -25,9 +25,10 @@ typedef struct v1_priority_level_configuration_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_level_configuration_condition_t; -v1_priority_level_configuration_condition_t *v1_priority_level_configuration_condition_create( +__attribute__((deprecated)) v1_priority_level_configuration_condition_t *v1_priority_level_configuration_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_priority_level_configuration_list.c b/kubernetes/model/v1_priority_level_configuration_list.c index 934fcd1d..00e42c2b 100644 --- a/kubernetes/model/v1_priority_level_configuration_list.c +++ b/kubernetes/model/v1_priority_level_configuration_list.c @@ -5,7 +5,7 @@ -v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_create( +static v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_cre v1_priority_level_configuration_list_local_var->kind = kind; v1_priority_level_configuration_list_local_var->metadata = metadata; + v1_priority_level_configuration_list_local_var->_library_owned = 1; return v1_priority_level_configuration_list_local_var; } +__attribute__((deprecated)) v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_priority_level_configuration_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_priority_level_configuration_list_free(v1_priority_level_configuration_list_t *v1_priority_level_configuration_list) { if(NULL == v1_priority_level_configuration_list){ return ; } + if(v1_priority_level_configuration_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_level_configuration_list_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_level_configuration_list->api_version) { free(v1_priority_level_configuration_list->api_version); @@ -123,6 +141,9 @@ v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_par // v1_priority_level_configuration_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_par // v1_priority_level_configuration_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_par // v1_priority_level_configuration_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_par // v1_priority_level_configuration_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_priority_level_configuration_list_local_var = v1_priority_level_configuration_list_create ( + v1_priority_level_configuration_list_local_var = v1_priority_level_configuration_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_priority_level_configuration_list.h b/kubernetes/model/v1_priority_level_configuration_list.h index 7f1d391e..3c98dac3 100644 --- a/kubernetes/model/v1_priority_level_configuration_list.h +++ b/kubernetes/model/v1_priority_level_configuration_list.h @@ -26,9 +26,10 @@ typedef struct v1_priority_level_configuration_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_level_configuration_list_t; -v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_create( +__attribute__((deprecated)) v1_priority_level_configuration_list_t *v1_priority_level_configuration_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_priority_level_configuration_reference.c b/kubernetes/model/v1_priority_level_configuration_reference.c index c26680e8..76a74ebb 100644 --- a/kubernetes/model/v1_priority_level_configuration_reference.c +++ b/kubernetes/model/v1_priority_level_configuration_reference.c @@ -5,7 +5,7 @@ -v1_priority_level_configuration_reference_t *v1_priority_level_configuration_reference_create( +static v1_priority_level_configuration_reference_t *v1_priority_level_configuration_reference_create_internal( char *name ) { v1_priority_level_configuration_reference_t *v1_priority_level_configuration_reference_local_var = malloc(sizeof(v1_priority_level_configuration_reference_t)); @@ -14,14 +14,26 @@ v1_priority_level_configuration_reference_t *v1_priority_level_configuration_ref } v1_priority_level_configuration_reference_local_var->name = name; + v1_priority_level_configuration_reference_local_var->_library_owned = 1; return v1_priority_level_configuration_reference_local_var; } +__attribute__((deprecated)) v1_priority_level_configuration_reference_t *v1_priority_level_configuration_reference_create( + char *name + ) { + return v1_priority_level_configuration_reference_create_internal ( + name + ); +} void v1_priority_level_configuration_reference_free(v1_priority_level_configuration_reference_t *v1_priority_level_configuration_reference) { if(NULL == v1_priority_level_configuration_reference){ return ; } + if(v1_priority_level_configuration_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_level_configuration_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_level_configuration_reference->name) { free(v1_priority_level_configuration_reference->name); @@ -55,6 +67,9 @@ v1_priority_level_configuration_reference_t *v1_priority_level_configuration_ref // v1_priority_level_configuration_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -66,7 +81,7 @@ v1_priority_level_configuration_reference_t *v1_priority_level_configuration_ref } - v1_priority_level_configuration_reference_local_var = v1_priority_level_configuration_reference_create ( + v1_priority_level_configuration_reference_local_var = v1_priority_level_configuration_reference_create_internal ( strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_priority_level_configuration_reference.h b/kubernetes/model/v1_priority_level_configuration_reference.h index 04ba915b..0d2ec251 100644 --- a/kubernetes/model/v1_priority_level_configuration_reference.h +++ b/kubernetes/model/v1_priority_level_configuration_reference.h @@ -21,9 +21,10 @@ typedef struct v1_priority_level_configuration_reference_t v1_priority_level_con typedef struct v1_priority_level_configuration_reference_t { char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_level_configuration_reference_t; -v1_priority_level_configuration_reference_t *v1_priority_level_configuration_reference_create( +__attribute__((deprecated)) v1_priority_level_configuration_reference_t *v1_priority_level_configuration_reference_create( char *name ); diff --git a/kubernetes/model/v1_priority_level_configuration_spec.c b/kubernetes/model/v1_priority_level_configuration_spec.c index aef08b6f..f472d5ab 100644 --- a/kubernetes/model/v1_priority_level_configuration_spec.c +++ b/kubernetes/model/v1_priority_level_configuration_spec.c @@ -5,7 +5,7 @@ -v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_create( +static v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_create_internal( v1_exempt_priority_level_configuration_t *exempt, v1_limited_priority_level_configuration_t *limited, char *type @@ -18,14 +18,30 @@ v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_cre v1_priority_level_configuration_spec_local_var->limited = limited; v1_priority_level_configuration_spec_local_var->type = type; + v1_priority_level_configuration_spec_local_var->_library_owned = 1; return v1_priority_level_configuration_spec_local_var; } +__attribute__((deprecated)) v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_create( + v1_exempt_priority_level_configuration_t *exempt, + v1_limited_priority_level_configuration_t *limited, + char *type + ) { + return v1_priority_level_configuration_spec_create_internal ( + exempt, + limited, + type + ); +} void v1_priority_level_configuration_spec_free(v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec) { if(NULL == v1_priority_level_configuration_spec){ return ; } + if(v1_priority_level_configuration_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_level_configuration_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_level_configuration_spec->exempt) { v1_exempt_priority_level_configuration_free(v1_priority_level_configuration_spec->exempt); @@ -99,18 +115,27 @@ v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_par // v1_priority_level_configuration_spec->exempt cJSON *exempt = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_specJSON, "exempt"); + if (cJSON_IsNull(exempt)) { + exempt = NULL; + } if (exempt) { exempt_local_nonprim = v1_exempt_priority_level_configuration_parseFromJSON(exempt); //nonprimitive } // v1_priority_level_configuration_spec->limited cJSON *limited = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_specJSON, "limited"); + if (cJSON_IsNull(limited)) { + limited = NULL; + } if (limited) { limited_local_nonprim = v1_limited_priority_level_configuration_parseFromJSON(limited); //nonprimitive } // v1_priority_level_configuration_spec->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_specJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -122,7 +147,7 @@ v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_par } - v1_priority_level_configuration_spec_local_var = v1_priority_level_configuration_spec_create ( + v1_priority_level_configuration_spec_local_var = v1_priority_level_configuration_spec_create_internal ( exempt ? exempt_local_nonprim : NULL, limited ? limited_local_nonprim : NULL, strdup(type->valuestring) diff --git a/kubernetes/model/v1_priority_level_configuration_spec.h b/kubernetes/model/v1_priority_level_configuration_spec.h index 22fdaa49..dab03ab6 100644 --- a/kubernetes/model/v1_priority_level_configuration_spec.h +++ b/kubernetes/model/v1_priority_level_configuration_spec.h @@ -25,9 +25,10 @@ typedef struct v1_priority_level_configuration_spec_t { struct v1_limited_priority_level_configuration_t *limited; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_level_configuration_spec_t; -v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_create( +__attribute__((deprecated)) v1_priority_level_configuration_spec_t *v1_priority_level_configuration_spec_create( v1_exempt_priority_level_configuration_t *exempt, v1_limited_priority_level_configuration_t *limited, char *type diff --git a/kubernetes/model/v1_priority_level_configuration_status.c b/kubernetes/model/v1_priority_level_configuration_status.c index d9f506c7..f624ee04 100644 --- a/kubernetes/model/v1_priority_level_configuration_status.c +++ b/kubernetes/model/v1_priority_level_configuration_status.c @@ -5,7 +5,7 @@ -v1_priority_level_configuration_status_t *v1_priority_level_configuration_status_create( +static v1_priority_level_configuration_status_t *v1_priority_level_configuration_status_create_internal( list_t *conditions ) { v1_priority_level_configuration_status_t *v1_priority_level_configuration_status_local_var = malloc(sizeof(v1_priority_level_configuration_status_t)); @@ -14,14 +14,26 @@ v1_priority_level_configuration_status_t *v1_priority_level_configuration_status } v1_priority_level_configuration_status_local_var->conditions = conditions; + v1_priority_level_configuration_status_local_var->_library_owned = 1; return v1_priority_level_configuration_status_local_var; } +__attribute__((deprecated)) v1_priority_level_configuration_status_t *v1_priority_level_configuration_status_create( + list_t *conditions + ) { + return v1_priority_level_configuration_status_create_internal ( + conditions + ); +} void v1_priority_level_configuration_status_free(v1_priority_level_configuration_status_t *v1_priority_level_configuration_status) { if(NULL == v1_priority_level_configuration_status){ return ; } + if(v1_priority_level_configuration_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_priority_level_configuration_status_free"); + return ; + } listEntry_t *listEntry; if (v1_priority_level_configuration_status->conditions) { list_ForEach(listEntry, v1_priority_level_configuration_status->conditions) { @@ -72,6 +84,9 @@ v1_priority_level_configuration_status_t *v1_priority_level_configuration_status // v1_priority_level_configuration_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_priority_level_configuration_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -92,7 +107,7 @@ v1_priority_level_configuration_status_t *v1_priority_level_configuration_status } - v1_priority_level_configuration_status_local_var = v1_priority_level_configuration_status_create ( + v1_priority_level_configuration_status_local_var = v1_priority_level_configuration_status_create_internal ( conditions ? conditionsList : NULL ); diff --git a/kubernetes/model/v1_priority_level_configuration_status.h b/kubernetes/model/v1_priority_level_configuration_status.h index 3e07df38..c518745d 100644 --- a/kubernetes/model/v1_priority_level_configuration_status.h +++ b/kubernetes/model/v1_priority_level_configuration_status.h @@ -22,9 +22,10 @@ typedef struct v1_priority_level_configuration_status_t v1_priority_level_config typedef struct v1_priority_level_configuration_status_t { list_t *conditions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_priority_level_configuration_status_t; -v1_priority_level_configuration_status_t *v1_priority_level_configuration_status_create( +__attribute__((deprecated)) v1_priority_level_configuration_status_t *v1_priority_level_configuration_status_create( list_t *conditions ); diff --git a/kubernetes/model/v1_probe.c b/kubernetes/model/v1_probe.c index 4f8ae7df..9cd64370 100644 --- a/kubernetes/model/v1_probe.c +++ b/kubernetes/model/v1_probe.c @@ -5,7 +5,7 @@ -v1_probe_t *v1_probe_create( +static v1_probe_t *v1_probe_create_internal( v1_exec_action_t *exec, int failure_threshold, v1_grpc_action_t *grpc, @@ -32,14 +32,44 @@ v1_probe_t *v1_probe_create( v1_probe_local_var->termination_grace_period_seconds = termination_grace_period_seconds; v1_probe_local_var->timeout_seconds = timeout_seconds; + v1_probe_local_var->_library_owned = 1; return v1_probe_local_var; } +__attribute__((deprecated)) v1_probe_t *v1_probe_create( + v1_exec_action_t *exec, + int failure_threshold, + v1_grpc_action_t *grpc, + v1_http_get_action_t *http_get, + int initial_delay_seconds, + int period_seconds, + int success_threshold, + v1_tcp_socket_action_t *tcp_socket, + long termination_grace_period_seconds, + int timeout_seconds + ) { + return v1_probe_create_internal ( + exec, + failure_threshold, + grpc, + http_get, + initial_delay_seconds, + period_seconds, + success_threshold, + tcp_socket, + termination_grace_period_seconds, + timeout_seconds + ); +} void v1_probe_free(v1_probe_t *v1_probe) { if(NULL == v1_probe){ return ; } + if(v1_probe->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_probe_free"); + return ; + } listEntry_t *listEntry; if (v1_probe->exec) { v1_exec_action_free(v1_probe->exec); @@ -188,12 +218,18 @@ v1_probe_t *v1_probe_parseFromJSON(cJSON *v1_probeJSON){ // v1_probe->exec cJSON *exec = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "exec"); + if (cJSON_IsNull(exec)) { + exec = NULL; + } if (exec) { exec_local_nonprim = v1_exec_action_parseFromJSON(exec); //nonprimitive } // v1_probe->failure_threshold cJSON *failure_threshold = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "failureThreshold"); + if (cJSON_IsNull(failure_threshold)) { + failure_threshold = NULL; + } if (failure_threshold) { if(!cJSON_IsNumber(failure_threshold)) { @@ -203,18 +239,27 @@ v1_probe_t *v1_probe_parseFromJSON(cJSON *v1_probeJSON){ // v1_probe->grpc cJSON *grpc = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "grpc"); + if (cJSON_IsNull(grpc)) { + grpc = NULL; + } if (grpc) { grpc_local_nonprim = v1_grpc_action_parseFromJSON(grpc); //nonprimitive } // v1_probe->http_get cJSON *http_get = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "httpGet"); + if (cJSON_IsNull(http_get)) { + http_get = NULL; + } if (http_get) { http_get_local_nonprim = v1_http_get_action_parseFromJSON(http_get); //nonprimitive } // v1_probe->initial_delay_seconds cJSON *initial_delay_seconds = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "initialDelaySeconds"); + if (cJSON_IsNull(initial_delay_seconds)) { + initial_delay_seconds = NULL; + } if (initial_delay_seconds) { if(!cJSON_IsNumber(initial_delay_seconds)) { @@ -224,6 +269,9 @@ v1_probe_t *v1_probe_parseFromJSON(cJSON *v1_probeJSON){ // v1_probe->period_seconds cJSON *period_seconds = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "periodSeconds"); + if (cJSON_IsNull(period_seconds)) { + period_seconds = NULL; + } if (period_seconds) { if(!cJSON_IsNumber(period_seconds)) { @@ -233,6 +281,9 @@ v1_probe_t *v1_probe_parseFromJSON(cJSON *v1_probeJSON){ // v1_probe->success_threshold cJSON *success_threshold = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "successThreshold"); + if (cJSON_IsNull(success_threshold)) { + success_threshold = NULL; + } if (success_threshold) { if(!cJSON_IsNumber(success_threshold)) { @@ -242,12 +293,18 @@ v1_probe_t *v1_probe_parseFromJSON(cJSON *v1_probeJSON){ // v1_probe->tcp_socket cJSON *tcp_socket = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "tcpSocket"); + if (cJSON_IsNull(tcp_socket)) { + tcp_socket = NULL; + } if (tcp_socket) { tcp_socket_local_nonprim = v1_tcp_socket_action_parseFromJSON(tcp_socket); //nonprimitive } // v1_probe->termination_grace_period_seconds cJSON *termination_grace_period_seconds = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "terminationGracePeriodSeconds"); + if (cJSON_IsNull(termination_grace_period_seconds)) { + termination_grace_period_seconds = NULL; + } if (termination_grace_period_seconds) { if(!cJSON_IsNumber(termination_grace_period_seconds)) { @@ -257,6 +314,9 @@ v1_probe_t *v1_probe_parseFromJSON(cJSON *v1_probeJSON){ // v1_probe->timeout_seconds cJSON *timeout_seconds = cJSON_GetObjectItemCaseSensitive(v1_probeJSON, "timeoutSeconds"); + if (cJSON_IsNull(timeout_seconds)) { + timeout_seconds = NULL; + } if (timeout_seconds) { if(!cJSON_IsNumber(timeout_seconds)) { @@ -265,7 +325,7 @@ v1_probe_t *v1_probe_parseFromJSON(cJSON *v1_probeJSON){ } - v1_probe_local_var = v1_probe_create ( + v1_probe_local_var = v1_probe_create_internal ( exec ? exec_local_nonprim : NULL, failure_threshold ? failure_threshold->valuedouble : 0, grpc ? grpc_local_nonprim : NULL, diff --git a/kubernetes/model/v1_probe.h b/kubernetes/model/v1_probe.h index 693d4060..b89b07ec 100644 --- a/kubernetes/model/v1_probe.h +++ b/kubernetes/model/v1_probe.h @@ -34,9 +34,10 @@ typedef struct v1_probe_t { long termination_grace_period_seconds; //numeric int timeout_seconds; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_probe_t; -v1_probe_t *v1_probe_create( +__attribute__((deprecated)) v1_probe_t *v1_probe_create( v1_exec_action_t *exec, int failure_threshold, v1_grpc_action_t *grpc, diff --git a/kubernetes/model/v1_projected_volume_source.c b/kubernetes/model/v1_projected_volume_source.c index 5d4ab48b..e93991b3 100644 --- a/kubernetes/model/v1_projected_volume_source.c +++ b/kubernetes/model/v1_projected_volume_source.c @@ -5,7 +5,7 @@ -v1_projected_volume_source_t *v1_projected_volume_source_create( +static v1_projected_volume_source_t *v1_projected_volume_source_create_internal( int default_mode, list_t *sources ) { @@ -16,14 +16,28 @@ v1_projected_volume_source_t *v1_projected_volume_source_create( v1_projected_volume_source_local_var->default_mode = default_mode; v1_projected_volume_source_local_var->sources = sources; + v1_projected_volume_source_local_var->_library_owned = 1; return v1_projected_volume_source_local_var; } +__attribute__((deprecated)) v1_projected_volume_source_t *v1_projected_volume_source_create( + int default_mode, + list_t *sources + ) { + return v1_projected_volume_source_create_internal ( + default_mode, + sources + ); +} void v1_projected_volume_source_free(v1_projected_volume_source_t *v1_projected_volume_source) { if(NULL == v1_projected_volume_source){ return ; } + if(v1_projected_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_projected_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_projected_volume_source->sources) { list_ForEach(listEntry, v1_projected_volume_source->sources) { @@ -82,6 +96,9 @@ v1_projected_volume_source_t *v1_projected_volume_source_parseFromJSON(cJSON *v1 // v1_projected_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_projected_volume_sourceJSON, "defaultMode"); + if (cJSON_IsNull(default_mode)) { + default_mode = NULL; + } if (default_mode) { if(!cJSON_IsNumber(default_mode)) { @@ -91,6 +108,9 @@ v1_projected_volume_source_t *v1_projected_volume_source_parseFromJSON(cJSON *v1 // v1_projected_volume_source->sources cJSON *sources = cJSON_GetObjectItemCaseSensitive(v1_projected_volume_sourceJSON, "sources"); + if (cJSON_IsNull(sources)) { + sources = NULL; + } if (sources) { cJSON *sources_local_nonprimitive = NULL; if(!cJSON_IsArray(sources)){ @@ -111,7 +131,7 @@ v1_projected_volume_source_t *v1_projected_volume_source_parseFromJSON(cJSON *v1 } - v1_projected_volume_source_local_var = v1_projected_volume_source_create ( + v1_projected_volume_source_local_var = v1_projected_volume_source_create_internal ( default_mode ? default_mode->valuedouble : 0, sources ? sourcesList : NULL ); diff --git a/kubernetes/model/v1_projected_volume_source.h b/kubernetes/model/v1_projected_volume_source.h index 2fd85ca5..f93bca75 100644 --- a/kubernetes/model/v1_projected_volume_source.h +++ b/kubernetes/model/v1_projected_volume_source.h @@ -23,9 +23,10 @@ typedef struct v1_projected_volume_source_t { int default_mode; //numeric list_t *sources; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_projected_volume_source_t; -v1_projected_volume_source_t *v1_projected_volume_source_create( +__attribute__((deprecated)) v1_projected_volume_source_t *v1_projected_volume_source_create( int default_mode, list_t *sources ); diff --git a/kubernetes/model/v1_queuing_configuration.c b/kubernetes/model/v1_queuing_configuration.c index 5ec4aa51..a6234deb 100644 --- a/kubernetes/model/v1_queuing_configuration.c +++ b/kubernetes/model/v1_queuing_configuration.c @@ -5,7 +5,7 @@ -v1_queuing_configuration_t *v1_queuing_configuration_create( +static v1_queuing_configuration_t *v1_queuing_configuration_create_internal( int hand_size, int queue_length_limit, int queues @@ -18,14 +18,30 @@ v1_queuing_configuration_t *v1_queuing_configuration_create( v1_queuing_configuration_local_var->queue_length_limit = queue_length_limit; v1_queuing_configuration_local_var->queues = queues; + v1_queuing_configuration_local_var->_library_owned = 1; return v1_queuing_configuration_local_var; } +__attribute__((deprecated)) v1_queuing_configuration_t *v1_queuing_configuration_create( + int hand_size, + int queue_length_limit, + int queues + ) { + return v1_queuing_configuration_create_internal ( + hand_size, + queue_length_limit, + queues + ); +} void v1_queuing_configuration_free(v1_queuing_configuration_t *v1_queuing_configuration) { if(NULL == v1_queuing_configuration){ return ; } + if(v1_queuing_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_queuing_configuration_free"); + return ; + } listEntry_t *listEntry; free(v1_queuing_configuration); } @@ -70,6 +86,9 @@ v1_queuing_configuration_t *v1_queuing_configuration_parseFromJSON(cJSON *v1_que // v1_queuing_configuration->hand_size cJSON *hand_size = cJSON_GetObjectItemCaseSensitive(v1_queuing_configurationJSON, "handSize"); + if (cJSON_IsNull(hand_size)) { + hand_size = NULL; + } if (hand_size) { if(!cJSON_IsNumber(hand_size)) { @@ -79,6 +98,9 @@ v1_queuing_configuration_t *v1_queuing_configuration_parseFromJSON(cJSON *v1_que // v1_queuing_configuration->queue_length_limit cJSON *queue_length_limit = cJSON_GetObjectItemCaseSensitive(v1_queuing_configurationJSON, "queueLengthLimit"); + if (cJSON_IsNull(queue_length_limit)) { + queue_length_limit = NULL; + } if (queue_length_limit) { if(!cJSON_IsNumber(queue_length_limit)) { @@ -88,6 +110,9 @@ v1_queuing_configuration_t *v1_queuing_configuration_parseFromJSON(cJSON *v1_que // v1_queuing_configuration->queues cJSON *queues = cJSON_GetObjectItemCaseSensitive(v1_queuing_configurationJSON, "queues"); + if (cJSON_IsNull(queues)) { + queues = NULL; + } if (queues) { if(!cJSON_IsNumber(queues)) { @@ -96,7 +121,7 @@ v1_queuing_configuration_t *v1_queuing_configuration_parseFromJSON(cJSON *v1_que } - v1_queuing_configuration_local_var = v1_queuing_configuration_create ( + v1_queuing_configuration_local_var = v1_queuing_configuration_create_internal ( hand_size ? hand_size->valuedouble : 0, queue_length_limit ? queue_length_limit->valuedouble : 0, queues ? queues->valuedouble : 0 diff --git a/kubernetes/model/v1_queuing_configuration.h b/kubernetes/model/v1_queuing_configuration.h index f1c6ed3e..d0b612c4 100644 --- a/kubernetes/model/v1_queuing_configuration.h +++ b/kubernetes/model/v1_queuing_configuration.h @@ -23,9 +23,10 @@ typedef struct v1_queuing_configuration_t { int queue_length_limit; //numeric int queues; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_queuing_configuration_t; -v1_queuing_configuration_t *v1_queuing_configuration_create( +__attribute__((deprecated)) v1_queuing_configuration_t *v1_queuing_configuration_create( int hand_size, int queue_length_limit, int queues diff --git a/kubernetes/model/v1_quobyte_volume_source.c b/kubernetes/model/v1_quobyte_volume_source.c index 6140266d..448754fe 100644 --- a/kubernetes/model/v1_quobyte_volume_source.c +++ b/kubernetes/model/v1_quobyte_volume_source.c @@ -5,7 +5,7 @@ -v1_quobyte_volume_source_t *v1_quobyte_volume_source_create( +static v1_quobyte_volume_source_t *v1_quobyte_volume_source_create_internal( char *group, int read_only, char *registry, @@ -24,14 +24,36 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_create( v1_quobyte_volume_source_local_var->user = user; v1_quobyte_volume_source_local_var->volume = volume; + v1_quobyte_volume_source_local_var->_library_owned = 1; return v1_quobyte_volume_source_local_var; } +__attribute__((deprecated)) v1_quobyte_volume_source_t *v1_quobyte_volume_source_create( + char *group, + int read_only, + char *registry, + char *tenant, + char *user, + char *volume + ) { + return v1_quobyte_volume_source_create_internal ( + group, + read_only, + registry, + tenant, + user, + volume + ); +} void v1_quobyte_volume_source_free(v1_quobyte_volume_source_t *v1_quobyte_volume_source) { if(NULL == v1_quobyte_volume_source){ return ; } + if(v1_quobyte_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_quobyte_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_quobyte_volume_source->group) { free(v1_quobyte_volume_source->group); @@ -122,6 +144,9 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_parseFromJSON(cJSON *v1_quo // v1_quobyte_volume_source->group cJSON *group = cJSON_GetObjectItemCaseSensitive(v1_quobyte_volume_sourceJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (group) { if(!cJSON_IsString(group) && !cJSON_IsNull(group)) { @@ -131,6 +156,9 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_parseFromJSON(cJSON *v1_quo // v1_quobyte_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_quobyte_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -140,6 +168,9 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_parseFromJSON(cJSON *v1_quo // v1_quobyte_volume_source->registry cJSON *registry = cJSON_GetObjectItemCaseSensitive(v1_quobyte_volume_sourceJSON, "registry"); + if (cJSON_IsNull(registry)) { + registry = NULL; + } if (!registry) { goto end; } @@ -152,6 +183,9 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_parseFromJSON(cJSON *v1_quo // v1_quobyte_volume_source->tenant cJSON *tenant = cJSON_GetObjectItemCaseSensitive(v1_quobyte_volume_sourceJSON, "tenant"); + if (cJSON_IsNull(tenant)) { + tenant = NULL; + } if (tenant) { if(!cJSON_IsString(tenant) && !cJSON_IsNull(tenant)) { @@ -161,6 +195,9 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_parseFromJSON(cJSON *v1_quo // v1_quobyte_volume_source->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_quobyte_volume_sourceJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { if(!cJSON_IsString(user) && !cJSON_IsNull(user)) { @@ -170,6 +207,9 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_parseFromJSON(cJSON *v1_quo // v1_quobyte_volume_source->volume cJSON *volume = cJSON_GetObjectItemCaseSensitive(v1_quobyte_volume_sourceJSON, "volume"); + if (cJSON_IsNull(volume)) { + volume = NULL; + } if (!volume) { goto end; } @@ -181,7 +221,7 @@ v1_quobyte_volume_source_t *v1_quobyte_volume_source_parseFromJSON(cJSON *v1_quo } - v1_quobyte_volume_source_local_var = v1_quobyte_volume_source_create ( + v1_quobyte_volume_source_local_var = v1_quobyte_volume_source_create_internal ( group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, read_only ? read_only->valueint : 0, strdup(registry->valuestring), diff --git a/kubernetes/model/v1_quobyte_volume_source.h b/kubernetes/model/v1_quobyte_volume_source.h index 72546e34..9f793059 100644 --- a/kubernetes/model/v1_quobyte_volume_source.h +++ b/kubernetes/model/v1_quobyte_volume_source.h @@ -26,9 +26,10 @@ typedef struct v1_quobyte_volume_source_t { char *user; // string char *volume; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_quobyte_volume_source_t; -v1_quobyte_volume_source_t *v1_quobyte_volume_source_create( +__attribute__((deprecated)) v1_quobyte_volume_source_t *v1_quobyte_volume_source_create( char *group, int read_only, char *registry, diff --git a/kubernetes/model/v1_rbd_persistent_volume_source.c b/kubernetes/model/v1_rbd_persistent_volume_source.c index 28d7b492..bc8e3613 100644 --- a/kubernetes/model/v1_rbd_persistent_volume_source.c +++ b/kubernetes/model/v1_rbd_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_create( +static v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_create_internal( char *fs_type, char *image, char *keyring, @@ -28,14 +28,40 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_create( v1_rbd_persistent_volume_source_local_var->secret_ref = secret_ref; v1_rbd_persistent_volume_source_local_var->user = user; + v1_rbd_persistent_volume_source_local_var->_library_owned = 1; return v1_rbd_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_create( + char *fs_type, + char *image, + char *keyring, + list_t *monitors, + char *pool, + int read_only, + v1_secret_reference_t *secret_ref, + char *user + ) { + return v1_rbd_persistent_volume_source_create_internal ( + fs_type, + image, + keyring, + monitors, + pool, + read_only, + secret_ref, + user + ); +} void v1_rbd_persistent_volume_source_free(v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source) { if(NULL == v1_rbd_persistent_volume_source){ return ; } + if(v1_rbd_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_rbd_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_rbd_persistent_volume_source->fs_type) { free(v1_rbd_persistent_volume_source->fs_type); @@ -110,7 +136,7 @@ cJSON *v1_rbd_persistent_volume_source_convertToJSON(v1_rbd_persistent_volume_so listEntry_t *monitorsListEntry; list_ForEach(monitorsListEntry, v1_rbd_persistent_volume_source->monitors) { - if(cJSON_AddStringToObject(monitors, "", (char*)monitorsListEntry->data) == NULL) + if(cJSON_AddStringToObject(monitors, "", monitorsListEntry->data) == NULL) { goto fail; } @@ -173,6 +199,9 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON // v1_rbd_persistent_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -182,6 +211,9 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON // v1_rbd_persistent_volume_source->image cJSON *image = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "image"); + if (cJSON_IsNull(image)) { + image = NULL; + } if (!image) { goto end; } @@ -194,6 +226,9 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON // v1_rbd_persistent_volume_source->keyring cJSON *keyring = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "keyring"); + if (cJSON_IsNull(keyring)) { + keyring = NULL; + } if (keyring) { if(!cJSON_IsString(keyring) && !cJSON_IsNull(keyring)) { @@ -203,6 +238,9 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON // v1_rbd_persistent_volume_source->monitors cJSON *monitors = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "monitors"); + if (cJSON_IsNull(monitors)) { + monitors = NULL; + } if (!monitors) { goto end; } @@ -225,6 +263,9 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON // v1_rbd_persistent_volume_source->pool cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } if (pool) { if(!cJSON_IsString(pool) && !cJSON_IsNull(pool)) { @@ -234,6 +275,9 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON // v1_rbd_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -243,12 +287,18 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON // v1_rbd_persistent_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_secret_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_rbd_persistent_volume_source->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_rbd_persistent_volume_sourceJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { if(!cJSON_IsString(user) && !cJSON_IsNull(user)) { @@ -257,7 +307,7 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON } - v1_rbd_persistent_volume_source_local_var = v1_rbd_persistent_volume_source_create ( + v1_rbd_persistent_volume_source_local_var = v1_rbd_persistent_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, strdup(image->valuestring), keyring && !cJSON_IsNull(keyring) ? strdup(keyring->valuestring) : NULL, diff --git a/kubernetes/model/v1_rbd_persistent_volume_source.h b/kubernetes/model/v1_rbd_persistent_volume_source.h index d4c464b5..a33e6435 100644 --- a/kubernetes/model/v1_rbd_persistent_volume_source.h +++ b/kubernetes/model/v1_rbd_persistent_volume_source.h @@ -29,9 +29,10 @@ typedef struct v1_rbd_persistent_volume_source_t { struct v1_secret_reference_t *secret_ref; //model char *user; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_rbd_persistent_volume_source_t; -v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_create( +__attribute__((deprecated)) v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_create( char *fs_type, char *image, char *keyring, diff --git a/kubernetes/model/v1_rbd_volume_source.c b/kubernetes/model/v1_rbd_volume_source.c index 5443f147..1cfcd3d6 100644 --- a/kubernetes/model/v1_rbd_volume_source.c +++ b/kubernetes/model/v1_rbd_volume_source.c @@ -5,7 +5,7 @@ -v1_rbd_volume_source_t *v1_rbd_volume_source_create( +static v1_rbd_volume_source_t *v1_rbd_volume_source_create_internal( char *fs_type, char *image, char *keyring, @@ -28,14 +28,40 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_create( v1_rbd_volume_source_local_var->secret_ref = secret_ref; v1_rbd_volume_source_local_var->user = user; + v1_rbd_volume_source_local_var->_library_owned = 1; return v1_rbd_volume_source_local_var; } +__attribute__((deprecated)) v1_rbd_volume_source_t *v1_rbd_volume_source_create( + char *fs_type, + char *image, + char *keyring, + list_t *monitors, + char *pool, + int read_only, + v1_local_object_reference_t *secret_ref, + char *user + ) { + return v1_rbd_volume_source_create_internal ( + fs_type, + image, + keyring, + monitors, + pool, + read_only, + secret_ref, + user + ); +} void v1_rbd_volume_source_free(v1_rbd_volume_source_t *v1_rbd_volume_source) { if(NULL == v1_rbd_volume_source){ return ; } + if(v1_rbd_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_rbd_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_rbd_volume_source->fs_type) { free(v1_rbd_volume_source->fs_type); @@ -110,7 +136,7 @@ cJSON *v1_rbd_volume_source_convertToJSON(v1_rbd_volume_source_t *v1_rbd_volume_ listEntry_t *monitorsListEntry; list_ForEach(monitorsListEntry, v1_rbd_volume_source->monitors) { - if(cJSON_AddStringToObject(monitors, "", (char*)monitorsListEntry->data) == NULL) + if(cJSON_AddStringToObject(monitors, "", monitorsListEntry->data) == NULL) { goto fail; } @@ -173,6 +199,9 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ // v1_rbd_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -182,6 +211,9 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ // v1_rbd_volume_source->image cJSON *image = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "image"); + if (cJSON_IsNull(image)) { + image = NULL; + } if (!image) { goto end; } @@ -194,6 +226,9 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ // v1_rbd_volume_source->keyring cJSON *keyring = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "keyring"); + if (cJSON_IsNull(keyring)) { + keyring = NULL; + } if (keyring) { if(!cJSON_IsString(keyring) && !cJSON_IsNull(keyring)) { @@ -203,6 +238,9 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ // v1_rbd_volume_source->monitors cJSON *monitors = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "monitors"); + if (cJSON_IsNull(monitors)) { + monitors = NULL; + } if (!monitors) { goto end; } @@ -225,6 +263,9 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ // v1_rbd_volume_source->pool cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } if (pool) { if(!cJSON_IsString(pool) && !cJSON_IsNull(pool)) { @@ -234,6 +275,9 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ // v1_rbd_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -243,12 +287,18 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ // v1_rbd_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_local_object_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_rbd_volume_source->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_rbd_volume_sourceJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { if(!cJSON_IsString(user) && !cJSON_IsNull(user)) { @@ -257,7 +307,7 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ } - v1_rbd_volume_source_local_var = v1_rbd_volume_source_create ( + v1_rbd_volume_source_local_var = v1_rbd_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, strdup(image->valuestring), keyring && !cJSON_IsNull(keyring) ? strdup(keyring->valuestring) : NULL, diff --git a/kubernetes/model/v1_rbd_volume_source.h b/kubernetes/model/v1_rbd_volume_source.h index 44161279..bb1e7f3a 100644 --- a/kubernetes/model/v1_rbd_volume_source.h +++ b/kubernetes/model/v1_rbd_volume_source.h @@ -29,9 +29,10 @@ typedef struct v1_rbd_volume_source_t { struct v1_local_object_reference_t *secret_ref; //model char *user; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_rbd_volume_source_t; -v1_rbd_volume_source_t *v1_rbd_volume_source_create( +__attribute__((deprecated)) v1_rbd_volume_source_t *v1_rbd_volume_source_create( char *fs_type, char *image, char *keyring, diff --git a/kubernetes/model/v1_replica_set.c b/kubernetes/model/v1_replica_set.c index f01d4673..15b28947 100644 --- a/kubernetes/model/v1_replica_set.c +++ b/kubernetes/model/v1_replica_set.c @@ -5,7 +5,7 @@ -v1_replica_set_t *v1_replica_set_create( +static v1_replica_set_t *v1_replica_set_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_replica_set_t *v1_replica_set_create( v1_replica_set_local_var->spec = spec; v1_replica_set_local_var->status = status; + v1_replica_set_local_var->_library_owned = 1; return v1_replica_set_local_var; } +__attribute__((deprecated)) v1_replica_set_t *v1_replica_set_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_replica_set_spec_t *spec, + v1_replica_set_status_t *status + ) { + return v1_replica_set_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_replica_set_free(v1_replica_set_t *v1_replica_set) { if(NULL == v1_replica_set){ return ; } + if(v1_replica_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replica_set_free"); + return ; + } listEntry_t *listEntry; if (v1_replica_set->api_version) { free(v1_replica_set->api_version); @@ -134,6 +154,9 @@ v1_replica_set_t *v1_replica_set_parseFromJSON(cJSON *v1_replica_setJSON){ // v1_replica_set->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_replica_setJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_replica_set_t *v1_replica_set_parseFromJSON(cJSON *v1_replica_setJSON){ // v1_replica_set->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_replica_setJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_replica_set_t *v1_replica_set_parseFromJSON(cJSON *v1_replica_setJSON){ // v1_replica_set->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_replica_setJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_replica_set->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_replica_setJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_replica_set_spec_parseFromJSON(spec); //nonprimitive } // v1_replica_set->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_replica_setJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_replica_set_status_parseFromJSON(status); //nonprimitive } - v1_replica_set_local_var = v1_replica_set_create ( + v1_replica_set_local_var = v1_replica_set_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_replica_set.h b/kubernetes/model/v1_replica_set.h index 73fcf40a..2791a3fb 100644 --- a/kubernetes/model/v1_replica_set.h +++ b/kubernetes/model/v1_replica_set.h @@ -28,9 +28,10 @@ typedef struct v1_replica_set_t { struct v1_replica_set_spec_t *spec; //model struct v1_replica_set_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_replica_set_t; -v1_replica_set_t *v1_replica_set_create( +__attribute__((deprecated)) v1_replica_set_t *v1_replica_set_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_replica_set_condition.c b/kubernetes/model/v1_replica_set_condition.c index 4e7957d4..83bd52d0 100644 --- a/kubernetes/model/v1_replica_set_condition.c +++ b/kubernetes/model/v1_replica_set_condition.c @@ -5,7 +5,7 @@ -v1_replica_set_condition_t *v1_replica_set_condition_create( +static v1_replica_set_condition_t *v1_replica_set_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_replica_set_condition_t *v1_replica_set_condition_create( v1_replica_set_condition_local_var->status = status; v1_replica_set_condition_local_var->type = type; + v1_replica_set_condition_local_var->_library_owned = 1; return v1_replica_set_condition_local_var; } +__attribute__((deprecated)) v1_replica_set_condition_t *v1_replica_set_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_replica_set_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_replica_set_condition_free(v1_replica_set_condition_t *v1_replica_set_condition) { if(NULL == v1_replica_set_condition){ return ; } + if(v1_replica_set_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replica_set_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_replica_set_condition->last_transition_time) { free(v1_replica_set_condition->last_transition_time); @@ -112,6 +132,9 @@ v1_replica_set_condition_t *v1_replica_set_condition_parseFromJSON(cJSON *v1_rep // v1_replica_set_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_replica_set_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v1_replica_set_condition_t *v1_replica_set_condition_parseFromJSON(cJSON *v1_rep // v1_replica_set_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_replica_set_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1_replica_set_condition_t *v1_replica_set_condition_parseFromJSON(cJSON *v1_rep // v1_replica_set_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_replica_set_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1_replica_set_condition_t *v1_replica_set_condition_parseFromJSON(cJSON *v1_rep // v1_replica_set_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_replica_set_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1_replica_set_condition_t *v1_replica_set_condition_parseFromJSON(cJSON *v1_rep // v1_replica_set_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_replica_set_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1_replica_set_condition_t *v1_replica_set_condition_parseFromJSON(cJSON *v1_rep } - v1_replica_set_condition_local_var = v1_replica_set_condition_create ( + v1_replica_set_condition_local_var = v1_replica_set_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_replica_set_condition.h b/kubernetes/model/v1_replica_set_condition.h index e47b4db9..87efcba2 100644 --- a/kubernetes/model/v1_replica_set_condition.h +++ b/kubernetes/model/v1_replica_set_condition.h @@ -25,9 +25,10 @@ typedef struct v1_replica_set_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_replica_set_condition_t; -v1_replica_set_condition_t *v1_replica_set_condition_create( +__attribute__((deprecated)) v1_replica_set_condition_t *v1_replica_set_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_replica_set_list.c b/kubernetes/model/v1_replica_set_list.c index 80684690..313dedf8 100644 --- a/kubernetes/model/v1_replica_set_list.c +++ b/kubernetes/model/v1_replica_set_list.c @@ -5,7 +5,7 @@ -v1_replica_set_list_t *v1_replica_set_list_create( +static v1_replica_set_list_t *v1_replica_set_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_replica_set_list_t *v1_replica_set_list_create( v1_replica_set_list_local_var->kind = kind; v1_replica_set_list_local_var->metadata = metadata; + v1_replica_set_list_local_var->_library_owned = 1; return v1_replica_set_list_local_var; } +__attribute__((deprecated)) v1_replica_set_list_t *v1_replica_set_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_replica_set_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_replica_set_list_free(v1_replica_set_list_t *v1_replica_set_list) { if(NULL == v1_replica_set_list){ return ; } + if(v1_replica_set_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replica_set_list_free"); + return ; + } listEntry_t *listEntry; if (v1_replica_set_list->api_version) { free(v1_replica_set_list->api_version); @@ -123,6 +141,9 @@ v1_replica_set_list_t *v1_replica_set_list_parseFromJSON(cJSON *v1_replica_set_l // v1_replica_set_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_replica_set_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_replica_set_list_t *v1_replica_set_list_parseFromJSON(cJSON *v1_replica_set_l // v1_replica_set_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_replica_set_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_replica_set_list_t *v1_replica_set_list_parseFromJSON(cJSON *v1_replica_set_l // v1_replica_set_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_replica_set_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_replica_set_list_t *v1_replica_set_list_parseFromJSON(cJSON *v1_replica_set_l // v1_replica_set_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_replica_set_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_replica_set_list_local_var = v1_replica_set_list_create ( + v1_replica_set_list_local_var = v1_replica_set_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_replica_set_list.h b/kubernetes/model/v1_replica_set_list.h index cc3a8aea..b112f206 100644 --- a/kubernetes/model/v1_replica_set_list.h +++ b/kubernetes/model/v1_replica_set_list.h @@ -26,9 +26,10 @@ typedef struct v1_replica_set_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_replica_set_list_t; -v1_replica_set_list_t *v1_replica_set_list_create( +__attribute__((deprecated)) v1_replica_set_list_t *v1_replica_set_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_replica_set_spec.c b/kubernetes/model/v1_replica_set_spec.c index 89f1ee84..80d5097a 100644 --- a/kubernetes/model/v1_replica_set_spec.c +++ b/kubernetes/model/v1_replica_set_spec.c @@ -5,7 +5,7 @@ -v1_replica_set_spec_t *v1_replica_set_spec_create( +static v1_replica_set_spec_t *v1_replica_set_spec_create_internal( int min_ready_seconds, int replicas, v1_label_selector_t *selector, @@ -20,14 +20,32 @@ v1_replica_set_spec_t *v1_replica_set_spec_create( v1_replica_set_spec_local_var->selector = selector; v1_replica_set_spec_local_var->_template = _template; + v1_replica_set_spec_local_var->_library_owned = 1; return v1_replica_set_spec_local_var; } +__attribute__((deprecated)) v1_replica_set_spec_t *v1_replica_set_spec_create( + int min_ready_seconds, + int replicas, + v1_label_selector_t *selector, + v1_pod_template_spec_t *_template + ) { + return v1_replica_set_spec_create_internal ( + min_ready_seconds, + replicas, + selector, + _template + ); +} void v1_replica_set_spec_free(v1_replica_set_spec_t *v1_replica_set_spec) { if(NULL == v1_replica_set_spec){ return ; } + if(v1_replica_set_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replica_set_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_replica_set_spec->selector) { v1_label_selector_free(v1_replica_set_spec->selector); @@ -105,6 +123,9 @@ v1_replica_set_spec_t *v1_replica_set_spec_parseFromJSON(cJSON *v1_replica_set_s // v1_replica_set_spec->min_ready_seconds cJSON *min_ready_seconds = cJSON_GetObjectItemCaseSensitive(v1_replica_set_specJSON, "minReadySeconds"); + if (cJSON_IsNull(min_ready_seconds)) { + min_ready_seconds = NULL; + } if (min_ready_seconds) { if(!cJSON_IsNumber(min_ready_seconds)) { @@ -114,6 +135,9 @@ v1_replica_set_spec_t *v1_replica_set_spec_parseFromJSON(cJSON *v1_replica_set_s // v1_replica_set_spec->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_replica_set_specJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (replicas) { if(!cJSON_IsNumber(replicas)) { @@ -123,6 +147,9 @@ v1_replica_set_spec_t *v1_replica_set_spec_parseFromJSON(cJSON *v1_replica_set_s // v1_replica_set_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_replica_set_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (!selector) { goto end; } @@ -132,12 +159,15 @@ v1_replica_set_spec_t *v1_replica_set_spec_parseFromJSON(cJSON *v1_replica_set_s // v1_replica_set_spec->_template cJSON *_template = cJSON_GetObjectItemCaseSensitive(v1_replica_set_specJSON, "template"); + if (cJSON_IsNull(_template)) { + _template = NULL; + } if (_template) { _template_local_nonprim = v1_pod_template_spec_parseFromJSON(_template); //nonprimitive } - v1_replica_set_spec_local_var = v1_replica_set_spec_create ( + v1_replica_set_spec_local_var = v1_replica_set_spec_create_internal ( min_ready_seconds ? min_ready_seconds->valuedouble : 0, replicas ? replicas->valuedouble : 0, selector_local_nonprim, diff --git a/kubernetes/model/v1_replica_set_spec.h b/kubernetes/model/v1_replica_set_spec.h index 9a9a1440..f91e324f 100644 --- a/kubernetes/model/v1_replica_set_spec.h +++ b/kubernetes/model/v1_replica_set_spec.h @@ -26,9 +26,10 @@ typedef struct v1_replica_set_spec_t { struct v1_label_selector_t *selector; //model struct v1_pod_template_spec_t *_template; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_replica_set_spec_t; -v1_replica_set_spec_t *v1_replica_set_spec_create( +__attribute__((deprecated)) v1_replica_set_spec_t *v1_replica_set_spec_create( int min_ready_seconds, int replicas, v1_label_selector_t *selector, diff --git a/kubernetes/model/v1_replica_set_status.c b/kubernetes/model/v1_replica_set_status.c index 276627a0..503880fb 100644 --- a/kubernetes/model/v1_replica_set_status.c +++ b/kubernetes/model/v1_replica_set_status.c @@ -5,13 +5,14 @@ -v1_replica_set_status_t *v1_replica_set_status_create( +static v1_replica_set_status_t *v1_replica_set_status_create_internal( int available_replicas, list_t *conditions, int fully_labeled_replicas, long observed_generation, int ready_replicas, - int replicas + int replicas, + int terminating_replicas ) { v1_replica_set_status_t *v1_replica_set_status_local_var = malloc(sizeof(v1_replica_set_status_t)); if (!v1_replica_set_status_local_var) { @@ -23,15 +24,40 @@ v1_replica_set_status_t *v1_replica_set_status_create( v1_replica_set_status_local_var->observed_generation = observed_generation; v1_replica_set_status_local_var->ready_replicas = ready_replicas; v1_replica_set_status_local_var->replicas = replicas; + v1_replica_set_status_local_var->terminating_replicas = terminating_replicas; + v1_replica_set_status_local_var->_library_owned = 1; return v1_replica_set_status_local_var; } +__attribute__((deprecated)) v1_replica_set_status_t *v1_replica_set_status_create( + int available_replicas, + list_t *conditions, + int fully_labeled_replicas, + long observed_generation, + int ready_replicas, + int replicas, + int terminating_replicas + ) { + return v1_replica_set_status_create_internal ( + available_replicas, + conditions, + fully_labeled_replicas, + observed_generation, + ready_replicas, + replicas, + terminating_replicas + ); +} void v1_replica_set_status_free(v1_replica_set_status_t *v1_replica_set_status) { if(NULL == v1_replica_set_status){ return ; } + if(v1_replica_set_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replica_set_status_free"); + return ; + } listEntry_t *listEntry; if (v1_replica_set_status->conditions) { list_ForEach(listEntry, v1_replica_set_status->conditions) { @@ -106,6 +132,14 @@ cJSON *v1_replica_set_status_convertToJSON(v1_replica_set_status_t *v1_replica_s goto fail; //Numeric } + + // v1_replica_set_status->terminating_replicas + if(v1_replica_set_status->terminating_replicas) { + if(cJSON_AddNumberToObject(item, "terminatingReplicas", v1_replica_set_status->terminating_replicas) == NULL) { + goto fail; //Numeric + } + } + return item; fail: if (item) { @@ -123,6 +157,9 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s // v1_replica_set_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "availableReplicas"); + if (cJSON_IsNull(available_replicas)) { + available_replicas = NULL; + } if (available_replicas) { if(!cJSON_IsNumber(available_replicas)) { @@ -132,6 +169,9 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s // v1_replica_set_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -153,6 +193,9 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s // v1_replica_set_status->fully_labeled_replicas cJSON *fully_labeled_replicas = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "fullyLabeledReplicas"); + if (cJSON_IsNull(fully_labeled_replicas)) { + fully_labeled_replicas = NULL; + } if (fully_labeled_replicas) { if(!cJSON_IsNumber(fully_labeled_replicas)) { @@ -162,6 +205,9 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s // v1_replica_set_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -171,6 +217,9 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s // v1_replica_set_status->ready_replicas cJSON *ready_replicas = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "readyReplicas"); + if (cJSON_IsNull(ready_replicas)) { + ready_replicas = NULL; + } if (ready_replicas) { if(!cJSON_IsNumber(ready_replicas)) { @@ -180,6 +229,9 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s // v1_replica_set_status->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (!replicas) { goto end; } @@ -190,14 +242,27 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s goto end; //Numeric } + // v1_replica_set_status->terminating_replicas + cJSON *terminating_replicas = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "terminatingReplicas"); + if (cJSON_IsNull(terminating_replicas)) { + terminating_replicas = NULL; + } + if (terminating_replicas) { + if(!cJSON_IsNumber(terminating_replicas)) + { + goto end; //Numeric + } + } + - v1_replica_set_status_local_var = v1_replica_set_status_create ( + v1_replica_set_status_local_var = v1_replica_set_status_create_internal ( available_replicas ? available_replicas->valuedouble : 0, conditions ? conditionsList : NULL, fully_labeled_replicas ? fully_labeled_replicas->valuedouble : 0, observed_generation ? observed_generation->valuedouble : 0, ready_replicas ? ready_replicas->valuedouble : 0, - replicas->valuedouble + replicas->valuedouble, + terminating_replicas ? terminating_replicas->valuedouble : 0 ); return v1_replica_set_status_local_var; diff --git a/kubernetes/model/v1_replica_set_status.h b/kubernetes/model/v1_replica_set_status.h index 93ac559e..61bd585e 100644 --- a/kubernetes/model/v1_replica_set_status.h +++ b/kubernetes/model/v1_replica_set_status.h @@ -26,16 +26,19 @@ typedef struct v1_replica_set_status_t { long observed_generation; //numeric int ready_replicas; //numeric int replicas; //numeric + int terminating_replicas; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_replica_set_status_t; -v1_replica_set_status_t *v1_replica_set_status_create( +__attribute__((deprecated)) v1_replica_set_status_t *v1_replica_set_status_create( int available_replicas, list_t *conditions, int fully_labeled_replicas, long observed_generation, int ready_replicas, - int replicas + int replicas, + int terminating_replicas ); void v1_replica_set_status_free(v1_replica_set_status_t *v1_replica_set_status); diff --git a/kubernetes/model/v1_replication_controller.c b/kubernetes/model/v1_replication_controller.c index 0872b6b3..39c0fc27 100644 --- a/kubernetes/model/v1_replication_controller.c +++ b/kubernetes/model/v1_replication_controller.c @@ -5,7 +5,7 @@ -v1_replication_controller_t *v1_replication_controller_create( +static v1_replication_controller_t *v1_replication_controller_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_replication_controller_t *v1_replication_controller_create( v1_replication_controller_local_var->spec = spec; v1_replication_controller_local_var->status = status; + v1_replication_controller_local_var->_library_owned = 1; return v1_replication_controller_local_var; } +__attribute__((deprecated)) v1_replication_controller_t *v1_replication_controller_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_replication_controller_spec_t *spec, + v1_replication_controller_status_t *status + ) { + return v1_replication_controller_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_replication_controller_free(v1_replication_controller_t *v1_replication_controller) { if(NULL == v1_replication_controller){ return ; } + if(v1_replication_controller->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replication_controller_free"); + return ; + } listEntry_t *listEntry; if (v1_replication_controller->api_version) { free(v1_replication_controller->api_version); @@ -134,6 +154,9 @@ v1_replication_controller_t *v1_replication_controller_parseFromJSON(cJSON *v1_r // v1_replication_controller->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_replication_controllerJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_replication_controller_t *v1_replication_controller_parseFromJSON(cJSON *v1_r // v1_replication_controller->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_replication_controllerJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_replication_controller_t *v1_replication_controller_parseFromJSON(cJSON *v1_r // v1_replication_controller->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_replication_controllerJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_replication_controller->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_replication_controllerJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_replication_controller_spec_parseFromJSON(spec); //nonprimitive } // v1_replication_controller->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_replication_controllerJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_replication_controller_status_parseFromJSON(status); //nonprimitive } - v1_replication_controller_local_var = v1_replication_controller_create ( + v1_replication_controller_local_var = v1_replication_controller_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_replication_controller.h b/kubernetes/model/v1_replication_controller.h index a43dae5b..95f4d5b7 100644 --- a/kubernetes/model/v1_replication_controller.h +++ b/kubernetes/model/v1_replication_controller.h @@ -28,9 +28,10 @@ typedef struct v1_replication_controller_t { struct v1_replication_controller_spec_t *spec; //model struct v1_replication_controller_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_replication_controller_t; -v1_replication_controller_t *v1_replication_controller_create( +__attribute__((deprecated)) v1_replication_controller_t *v1_replication_controller_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_replication_controller_condition.c b/kubernetes/model/v1_replication_controller_condition.c index 830854d5..79176efd 100644 --- a/kubernetes/model/v1_replication_controller_condition.c +++ b/kubernetes/model/v1_replication_controller_condition.c @@ -5,7 +5,7 @@ -v1_replication_controller_condition_t *v1_replication_controller_condition_create( +static v1_replication_controller_condition_t *v1_replication_controller_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_replication_controller_condition_t *v1_replication_controller_condition_creat v1_replication_controller_condition_local_var->status = status; v1_replication_controller_condition_local_var->type = type; + v1_replication_controller_condition_local_var->_library_owned = 1; return v1_replication_controller_condition_local_var; } +__attribute__((deprecated)) v1_replication_controller_condition_t *v1_replication_controller_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_replication_controller_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_replication_controller_condition_free(v1_replication_controller_condition_t *v1_replication_controller_condition) { if(NULL == v1_replication_controller_condition){ return ; } + if(v1_replication_controller_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replication_controller_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_replication_controller_condition->last_transition_time) { free(v1_replication_controller_condition->last_transition_time); @@ -112,6 +132,9 @@ v1_replication_controller_condition_t *v1_replication_controller_condition_parse // v1_replication_controller_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v1_replication_controller_condition_t *v1_replication_controller_condition_parse // v1_replication_controller_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1_replication_controller_condition_t *v1_replication_controller_condition_parse // v1_replication_controller_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1_replication_controller_condition_t *v1_replication_controller_condition_parse // v1_replication_controller_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1_replication_controller_condition_t *v1_replication_controller_condition_parse // v1_replication_controller_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1_replication_controller_condition_t *v1_replication_controller_condition_parse } - v1_replication_controller_condition_local_var = v1_replication_controller_condition_create ( + v1_replication_controller_condition_local_var = v1_replication_controller_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_replication_controller_condition.h b/kubernetes/model/v1_replication_controller_condition.h index 007da413..8c0f44a0 100644 --- a/kubernetes/model/v1_replication_controller_condition.h +++ b/kubernetes/model/v1_replication_controller_condition.h @@ -25,9 +25,10 @@ typedef struct v1_replication_controller_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_replication_controller_condition_t; -v1_replication_controller_condition_t *v1_replication_controller_condition_create( +__attribute__((deprecated)) v1_replication_controller_condition_t *v1_replication_controller_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_replication_controller_list.c b/kubernetes/model/v1_replication_controller_list.c index 465027a5..aa9fd3f3 100644 --- a/kubernetes/model/v1_replication_controller_list.c +++ b/kubernetes/model/v1_replication_controller_list.c @@ -5,7 +5,7 @@ -v1_replication_controller_list_t *v1_replication_controller_list_create( +static v1_replication_controller_list_t *v1_replication_controller_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_replication_controller_list_t *v1_replication_controller_list_create( v1_replication_controller_list_local_var->kind = kind; v1_replication_controller_list_local_var->metadata = metadata; + v1_replication_controller_list_local_var->_library_owned = 1; return v1_replication_controller_list_local_var; } +__attribute__((deprecated)) v1_replication_controller_list_t *v1_replication_controller_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_replication_controller_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_replication_controller_list_free(v1_replication_controller_list_t *v1_replication_controller_list) { if(NULL == v1_replication_controller_list){ return ; } + if(v1_replication_controller_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replication_controller_list_free"); + return ; + } listEntry_t *listEntry; if (v1_replication_controller_list->api_version) { free(v1_replication_controller_list->api_version); @@ -123,6 +141,9 @@ v1_replication_controller_list_t *v1_replication_controller_list_parseFromJSON(c // v1_replication_controller_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_replication_controller_list_t *v1_replication_controller_list_parseFromJSON(c // v1_replication_controller_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_replication_controller_list_t *v1_replication_controller_list_parseFromJSON(c // v1_replication_controller_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_replication_controller_list_t *v1_replication_controller_list_parseFromJSON(c // v1_replication_controller_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_replication_controller_list_local_var = v1_replication_controller_list_create ( + v1_replication_controller_list_local_var = v1_replication_controller_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_replication_controller_list.h b/kubernetes/model/v1_replication_controller_list.h index c85385f8..11a416c3 100644 --- a/kubernetes/model/v1_replication_controller_list.h +++ b/kubernetes/model/v1_replication_controller_list.h @@ -26,9 +26,10 @@ typedef struct v1_replication_controller_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_replication_controller_list_t; -v1_replication_controller_list_t *v1_replication_controller_list_create( +__attribute__((deprecated)) v1_replication_controller_list_t *v1_replication_controller_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_replication_controller_spec.c b/kubernetes/model/v1_replication_controller_spec.c index 5f0b68af..58156b57 100644 --- a/kubernetes/model/v1_replication_controller_spec.c +++ b/kubernetes/model/v1_replication_controller_spec.c @@ -5,7 +5,7 @@ -v1_replication_controller_spec_t *v1_replication_controller_spec_create( +static v1_replication_controller_spec_t *v1_replication_controller_spec_create_internal( int min_ready_seconds, int replicas, list_t* selector, @@ -20,18 +20,36 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_create( v1_replication_controller_spec_local_var->selector = selector; v1_replication_controller_spec_local_var->_template = _template; + v1_replication_controller_spec_local_var->_library_owned = 1; return v1_replication_controller_spec_local_var; } +__attribute__((deprecated)) v1_replication_controller_spec_t *v1_replication_controller_spec_create( + int min_ready_seconds, + int replicas, + list_t* selector, + v1_pod_template_spec_t *_template + ) { + return v1_replication_controller_spec_create_internal ( + min_ready_seconds, + replicas, + selector, + _template + ); +} void v1_replication_controller_spec_free(v1_replication_controller_spec_t *v1_replication_controller_spec) { if(NULL == v1_replication_controller_spec){ return ; } + if(v1_replication_controller_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replication_controller_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_replication_controller_spec->selector) { list_ForEach(listEntry, v1_replication_controller_spec->selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -75,8 +93,8 @@ cJSON *v1_replication_controller_spec_convertToJSON(v1_replication_controller_sp listEntry_t *selectorListEntry; if (v1_replication_controller_spec->selector) { list_ForEach(selectorListEntry, v1_replication_controller_spec->selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)selectorListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = selectorListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -117,6 +135,9 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c // v1_replication_controller_spec->min_ready_seconds cJSON *min_ready_seconds = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_specJSON, "minReadySeconds"); + if (cJSON_IsNull(min_ready_seconds)) { + min_ready_seconds = NULL; + } if (min_ready_seconds) { if(!cJSON_IsNumber(min_ready_seconds)) { @@ -126,6 +147,9 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c // v1_replication_controller_spec->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_specJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (replicas) { if(!cJSON_IsNumber(replicas)) { @@ -135,6 +159,9 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c // v1_replication_controller_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { cJSON *selector_local_map = NULL; if(!cJSON_IsObject(selector) && !cJSON_IsNull(selector)) @@ -160,12 +187,15 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c // v1_replication_controller_spec->_template cJSON *_template = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_specJSON, "template"); + if (cJSON_IsNull(_template)) { + _template = NULL; + } if (_template) { _template_local_nonprim = v1_pod_template_spec_parseFromJSON(_template); //nonprimitive } - v1_replication_controller_spec_local_var = v1_replication_controller_spec_create ( + v1_replication_controller_spec_local_var = v1_replication_controller_spec_create_internal ( min_ready_seconds ? min_ready_seconds->valuedouble : 0, replicas ? replicas->valuedouble : 0, selector ? selectorList : NULL, @@ -177,7 +207,7 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c if (selectorList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, selectorList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_replication_controller_spec.h b/kubernetes/model/v1_replication_controller_spec.h index 5f7ffdfe..b4e355e5 100644 --- a/kubernetes/model/v1_replication_controller_spec.h +++ b/kubernetes/model/v1_replication_controller_spec.h @@ -25,9 +25,10 @@ typedef struct v1_replication_controller_spec_t { list_t* selector; //map struct v1_pod_template_spec_t *_template; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_replication_controller_spec_t; -v1_replication_controller_spec_t *v1_replication_controller_spec_create( +__attribute__((deprecated)) v1_replication_controller_spec_t *v1_replication_controller_spec_create( int min_ready_seconds, int replicas, list_t* selector, diff --git a/kubernetes/model/v1_replication_controller_status.c b/kubernetes/model/v1_replication_controller_status.c index d68f4ad3..96dcef78 100644 --- a/kubernetes/model/v1_replication_controller_status.c +++ b/kubernetes/model/v1_replication_controller_status.c @@ -5,7 +5,7 @@ -v1_replication_controller_status_t *v1_replication_controller_status_create( +static v1_replication_controller_status_t *v1_replication_controller_status_create_internal( int available_replicas, list_t *conditions, int fully_labeled_replicas, @@ -24,14 +24,36 @@ v1_replication_controller_status_t *v1_replication_controller_status_create( v1_replication_controller_status_local_var->ready_replicas = ready_replicas; v1_replication_controller_status_local_var->replicas = replicas; + v1_replication_controller_status_local_var->_library_owned = 1; return v1_replication_controller_status_local_var; } +__attribute__((deprecated)) v1_replication_controller_status_t *v1_replication_controller_status_create( + int available_replicas, + list_t *conditions, + int fully_labeled_replicas, + long observed_generation, + int ready_replicas, + int replicas + ) { + return v1_replication_controller_status_create_internal ( + available_replicas, + conditions, + fully_labeled_replicas, + observed_generation, + ready_replicas, + replicas + ); +} void v1_replication_controller_status_free(v1_replication_controller_status_t *v1_replication_controller_status) { if(NULL == v1_replication_controller_status){ return ; } + if(v1_replication_controller_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_replication_controller_status_free"); + return ; + } listEntry_t *listEntry; if (v1_replication_controller_status->conditions) { list_ForEach(listEntry, v1_replication_controller_status->conditions) { @@ -123,6 +145,9 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS // v1_replication_controller_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "availableReplicas"); + if (cJSON_IsNull(available_replicas)) { + available_replicas = NULL; + } if (available_replicas) { if(!cJSON_IsNumber(available_replicas)) { @@ -132,6 +157,9 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS // v1_replication_controller_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -153,6 +181,9 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS // v1_replication_controller_status->fully_labeled_replicas cJSON *fully_labeled_replicas = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "fullyLabeledReplicas"); + if (cJSON_IsNull(fully_labeled_replicas)) { + fully_labeled_replicas = NULL; + } if (fully_labeled_replicas) { if(!cJSON_IsNumber(fully_labeled_replicas)) { @@ -162,6 +193,9 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS // v1_replication_controller_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -171,6 +205,9 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS // v1_replication_controller_status->ready_replicas cJSON *ready_replicas = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "readyReplicas"); + if (cJSON_IsNull(ready_replicas)) { + ready_replicas = NULL; + } if (ready_replicas) { if(!cJSON_IsNumber(ready_replicas)) { @@ -180,6 +217,9 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS // v1_replication_controller_status->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (!replicas) { goto end; } @@ -191,7 +231,7 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS } - v1_replication_controller_status_local_var = v1_replication_controller_status_create ( + v1_replication_controller_status_local_var = v1_replication_controller_status_create_internal ( available_replicas ? available_replicas->valuedouble : 0, conditions ? conditionsList : NULL, fully_labeled_replicas ? fully_labeled_replicas->valuedouble : 0, diff --git a/kubernetes/model/v1_replication_controller_status.h b/kubernetes/model/v1_replication_controller_status.h index be26b3cb..eedb76d7 100644 --- a/kubernetes/model/v1_replication_controller_status.h +++ b/kubernetes/model/v1_replication_controller_status.h @@ -27,9 +27,10 @@ typedef struct v1_replication_controller_status_t { int ready_replicas; //numeric int replicas; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_replication_controller_status_t; -v1_replication_controller_status_t *v1_replication_controller_status_create( +__attribute__((deprecated)) v1_replication_controller_status_t *v1_replication_controller_status_create( int available_replicas, list_t *conditions, int fully_labeled_replicas, diff --git a/kubernetes/model/v1_resource_attributes.c b/kubernetes/model/v1_resource_attributes.c index ac3c1b95..9813fab6 100644 --- a/kubernetes/model/v1_resource_attributes.c +++ b/kubernetes/model/v1_resource_attributes.c @@ -5,8 +5,10 @@ -v1_resource_attributes_t *v1_resource_attributes_create( +static v1_resource_attributes_t *v1_resource_attributes_create_internal( + v1_field_selector_attributes_t *field_selector, char *group, + v1_label_selector_attributes_t *label_selector, char *name, char *_namespace, char *resource, @@ -18,7 +20,9 @@ v1_resource_attributes_t *v1_resource_attributes_create( if (!v1_resource_attributes_local_var) { return NULL; } + v1_resource_attributes_local_var->field_selector = field_selector; v1_resource_attributes_local_var->group = group; + v1_resource_attributes_local_var->label_selector = label_selector; v1_resource_attributes_local_var->name = name; v1_resource_attributes_local_var->_namespace = _namespace; v1_resource_attributes_local_var->resource = resource; @@ -26,19 +30,55 @@ v1_resource_attributes_t *v1_resource_attributes_create( v1_resource_attributes_local_var->verb = verb; v1_resource_attributes_local_var->version = version; + v1_resource_attributes_local_var->_library_owned = 1; return v1_resource_attributes_local_var; } +__attribute__((deprecated)) v1_resource_attributes_t *v1_resource_attributes_create( + v1_field_selector_attributes_t *field_selector, + char *group, + v1_label_selector_attributes_t *label_selector, + char *name, + char *_namespace, + char *resource, + char *subresource, + char *verb, + char *version + ) { + return v1_resource_attributes_create_internal ( + field_selector, + group, + label_selector, + name, + _namespace, + resource, + subresource, + verb, + version + ); +} void v1_resource_attributes_free(v1_resource_attributes_t *v1_resource_attributes) { if(NULL == v1_resource_attributes){ return ; } + if(v1_resource_attributes->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_attributes_free"); + return ; + } listEntry_t *listEntry; + if (v1_resource_attributes->field_selector) { + v1_field_selector_attributes_free(v1_resource_attributes->field_selector); + v1_resource_attributes->field_selector = NULL; + } if (v1_resource_attributes->group) { free(v1_resource_attributes->group); v1_resource_attributes->group = NULL; } + if (v1_resource_attributes->label_selector) { + v1_label_selector_attributes_free(v1_resource_attributes->label_selector); + v1_resource_attributes->label_selector = NULL; + } if (v1_resource_attributes->name) { free(v1_resource_attributes->name); v1_resource_attributes->name = NULL; @@ -69,6 +109,19 @@ void v1_resource_attributes_free(v1_resource_attributes_t *v1_resource_attribute cJSON *v1_resource_attributes_convertToJSON(v1_resource_attributes_t *v1_resource_attributes) { cJSON *item = cJSON_CreateObject(); + // v1_resource_attributes->field_selector + if(v1_resource_attributes->field_selector) { + cJSON *field_selector_local_JSON = v1_field_selector_attributes_convertToJSON(v1_resource_attributes->field_selector); + if(field_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "fieldSelector", field_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_resource_attributes->group if(v1_resource_attributes->group) { if(cJSON_AddStringToObject(item, "group", v1_resource_attributes->group) == NULL) { @@ -77,6 +130,19 @@ cJSON *v1_resource_attributes_convertToJSON(v1_resource_attributes_t *v1_resourc } + // v1_resource_attributes->label_selector + if(v1_resource_attributes->label_selector) { + cJSON *label_selector_local_JSON = v1_label_selector_attributes_convertToJSON(v1_resource_attributes->label_selector); + if(label_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "labelSelector", label_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_resource_attributes->name if(v1_resource_attributes->name) { if(cJSON_AddStringToObject(item, "name", v1_resource_attributes->name) == NULL) { @@ -136,8 +202,26 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc v1_resource_attributes_t *v1_resource_attributes_local_var = NULL; + // define the local variable for v1_resource_attributes->field_selector + v1_field_selector_attributes_t *field_selector_local_nonprim = NULL; + + // define the local variable for v1_resource_attributes->label_selector + v1_label_selector_attributes_t *label_selector_local_nonprim = NULL; + + // v1_resource_attributes->field_selector + cJSON *field_selector = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "fieldSelector"); + if (cJSON_IsNull(field_selector)) { + field_selector = NULL; + } + if (field_selector) { + field_selector_local_nonprim = v1_field_selector_attributes_parseFromJSON(field_selector); //nonprimitive + } + // v1_resource_attributes->group cJSON *group = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (group) { if(!cJSON_IsString(group) && !cJSON_IsNull(group)) { @@ -145,8 +229,20 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc } } + // v1_resource_attributes->label_selector + cJSON *label_selector = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "labelSelector"); + if (cJSON_IsNull(label_selector)) { + label_selector = NULL; + } + if (label_selector) { + label_selector_local_nonprim = v1_label_selector_attributes_parseFromJSON(label_selector); //nonprimitive + } + // v1_resource_attributes->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -156,6 +252,9 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc // v1_resource_attributes->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -165,6 +264,9 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc // v1_resource_attributes->resource cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } if (resource) { if(!cJSON_IsString(resource) && !cJSON_IsNull(resource)) { @@ -174,6 +276,9 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc // v1_resource_attributes->subresource cJSON *subresource = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "subresource"); + if (cJSON_IsNull(subresource)) { + subresource = NULL; + } if (subresource) { if(!cJSON_IsString(subresource) && !cJSON_IsNull(subresource)) { @@ -183,6 +288,9 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc // v1_resource_attributes->verb cJSON *verb = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "verb"); + if (cJSON_IsNull(verb)) { + verb = NULL; + } if (verb) { if(!cJSON_IsString(verb) && !cJSON_IsNull(verb)) { @@ -192,6 +300,9 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc // v1_resource_attributes->version cJSON *version = cJSON_GetObjectItemCaseSensitive(v1_resource_attributesJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } if (version) { if(!cJSON_IsString(version) && !cJSON_IsNull(version)) { @@ -200,8 +311,10 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc } - v1_resource_attributes_local_var = v1_resource_attributes_create ( + v1_resource_attributes_local_var = v1_resource_attributes_create_internal ( + field_selector ? field_selector_local_nonprim : NULL, group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, + label_selector ? label_selector_local_nonprim : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, resource && !cJSON_IsNull(resource) ? strdup(resource->valuestring) : NULL, @@ -212,6 +325,14 @@ v1_resource_attributes_t *v1_resource_attributes_parseFromJSON(cJSON *v1_resourc return v1_resource_attributes_local_var; end: + if (field_selector_local_nonprim) { + v1_field_selector_attributes_free(field_selector_local_nonprim); + field_selector_local_nonprim = NULL; + } + if (label_selector_local_nonprim) { + v1_label_selector_attributes_free(label_selector_local_nonprim); + label_selector_local_nonprim = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_resource_attributes.h b/kubernetes/model/v1_resource_attributes.h index 4114cb09..ff1b3fed 100644 --- a/kubernetes/model/v1_resource_attributes.h +++ b/kubernetes/model/v1_resource_attributes.h @@ -15,11 +15,15 @@ typedef struct v1_resource_attributes_t v1_resource_attributes_t; +#include "v1_field_selector_attributes.h" +#include "v1_label_selector_attributes.h" typedef struct v1_resource_attributes_t { + struct v1_field_selector_attributes_t *field_selector; //model char *group; // string + struct v1_label_selector_attributes_t *label_selector; //model char *name; // string char *_namespace; // string char *resource; // string @@ -27,10 +31,13 @@ typedef struct v1_resource_attributes_t { char *verb; // string char *version; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_attributes_t; -v1_resource_attributes_t *v1_resource_attributes_create( +__attribute__((deprecated)) v1_resource_attributes_t *v1_resource_attributes_create( + v1_field_selector_attributes_t *field_selector, char *group, + v1_label_selector_attributes_t *label_selector, char *name, char *_namespace, char *resource, diff --git a/kubernetes/model/v1_resource_claim.c b/kubernetes/model/v1_resource_claim.c deleted file mode 100644 index e37ca3ff..00000000 --- a/kubernetes/model/v1_resource_claim.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1_resource_claim.h" - - - -v1_resource_claim_t *v1_resource_claim_create( - char *name - ) { - v1_resource_claim_t *v1_resource_claim_local_var = malloc(sizeof(v1_resource_claim_t)); - if (!v1_resource_claim_local_var) { - return NULL; - } - v1_resource_claim_local_var->name = name; - - return v1_resource_claim_local_var; -} - - -void v1_resource_claim_free(v1_resource_claim_t *v1_resource_claim) { - if(NULL == v1_resource_claim){ - return ; - } - listEntry_t *listEntry; - if (v1_resource_claim->name) { - free(v1_resource_claim->name); - v1_resource_claim->name = NULL; - } - free(v1_resource_claim); -} - -cJSON *v1_resource_claim_convertToJSON(v1_resource_claim_t *v1_resource_claim) { - cJSON *item = cJSON_CreateObject(); - - // v1_resource_claim->name - if (!v1_resource_claim->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1_resource_claim->name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1_resource_claim_t *v1_resource_claim_parseFromJSON(cJSON *v1_resource_claimJSON){ - - v1_resource_claim_t *v1_resource_claim_local_var = NULL; - - // v1_resource_claim->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_resource_claimJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - - v1_resource_claim_local_var = v1_resource_claim_create ( - strdup(name->valuestring) - ); - - return v1_resource_claim_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1_resource_claim.h b/kubernetes/model/v1_resource_claim.h deleted file mode 100644 index b68f7ace..00000000 --- a/kubernetes/model/v1_resource_claim.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1_resource_claim.h - * - * ResourceClaim references one entry in PodSpec.ResourceClaims. - */ - -#ifndef _v1_resource_claim_H_ -#define _v1_resource_claim_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1_resource_claim_t v1_resource_claim_t; - - - - -typedef struct v1_resource_claim_t { - char *name; // string - -} v1_resource_claim_t; - -v1_resource_claim_t *v1_resource_claim_create( - char *name -); - -void v1_resource_claim_free(v1_resource_claim_t *v1_resource_claim); - -v1_resource_claim_t *v1_resource_claim_parseFromJSON(cJSON *v1_resource_claimJSON); - -cJSON *v1_resource_claim_convertToJSON(v1_resource_claim_t *v1_resource_claim); - -#endif /* _v1_resource_claim_H_ */ - diff --git a/kubernetes/model/v1_resource_claim_consumer_reference.c b/kubernetes/model/v1_resource_claim_consumer_reference.c new file mode 100644 index 00000000..055c5fa2 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_consumer_reference.c @@ -0,0 +1,187 @@ +#include +#include +#include +#include "v1_resource_claim_consumer_reference.h" + + + +static v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference_create_internal( + char *api_group, + char *name, + char *resource, + char *uid + ) { + v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference_local_var = malloc(sizeof(v1_resource_claim_consumer_reference_t)); + if (!v1_resource_claim_consumer_reference_local_var) { + return NULL; + } + v1_resource_claim_consumer_reference_local_var->api_group = api_group; + v1_resource_claim_consumer_reference_local_var->name = name; + v1_resource_claim_consumer_reference_local_var->resource = resource; + v1_resource_claim_consumer_reference_local_var->uid = uid; + + v1_resource_claim_consumer_reference_local_var->_library_owned = 1; + return v1_resource_claim_consumer_reference_local_var; +} + +__attribute__((deprecated)) v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference_create( + char *api_group, + char *name, + char *resource, + char *uid + ) { + return v1_resource_claim_consumer_reference_create_internal ( + api_group, + name, + resource, + uid + ); +} + +void v1_resource_claim_consumer_reference_free(v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference) { + if(NULL == v1_resource_claim_consumer_reference){ + return ; + } + if(v1_resource_claim_consumer_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_claim_consumer_reference_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_claim_consumer_reference->api_group) { + free(v1_resource_claim_consumer_reference->api_group); + v1_resource_claim_consumer_reference->api_group = NULL; + } + if (v1_resource_claim_consumer_reference->name) { + free(v1_resource_claim_consumer_reference->name); + v1_resource_claim_consumer_reference->name = NULL; + } + if (v1_resource_claim_consumer_reference->resource) { + free(v1_resource_claim_consumer_reference->resource); + v1_resource_claim_consumer_reference->resource = NULL; + } + if (v1_resource_claim_consumer_reference->uid) { + free(v1_resource_claim_consumer_reference->uid); + v1_resource_claim_consumer_reference->uid = NULL; + } + free(v1_resource_claim_consumer_reference); +} + +cJSON *v1_resource_claim_consumer_reference_convertToJSON(v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_claim_consumer_reference->api_group + if(v1_resource_claim_consumer_reference->api_group) { + if(cJSON_AddStringToObject(item, "apiGroup", v1_resource_claim_consumer_reference->api_group) == NULL) { + goto fail; //String + } + } + + + // v1_resource_claim_consumer_reference->name + if (!v1_resource_claim_consumer_reference->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_resource_claim_consumer_reference->name) == NULL) { + goto fail; //String + } + + + // v1_resource_claim_consumer_reference->resource + if (!v1_resource_claim_consumer_reference->resource) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resource", v1_resource_claim_consumer_reference->resource) == NULL) { + goto fail; //String + } + + + // v1_resource_claim_consumer_reference->uid + if (!v1_resource_claim_consumer_reference->uid) { + goto fail; + } + if(cJSON_AddStringToObject(item, "uid", v1_resource_claim_consumer_reference->uid) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference_parseFromJSON(cJSON *v1_resource_claim_consumer_referenceJSON){ + + v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference_local_var = NULL; + + // v1_resource_claim_consumer_reference->api_group + cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_consumer_referenceJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } + if (api_group) { + if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) + { + goto end; //String + } + } + + // v1_resource_claim_consumer_reference->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_consumer_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1_resource_claim_consumer_reference->resource + cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_consumer_referenceJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } + if (!resource) { + goto end; + } + + + if(!cJSON_IsString(resource)) + { + goto end; //String + } + + // v1_resource_claim_consumer_reference->uid + cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_consumer_referenceJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } + if (!uid) { + goto end; + } + + + if(!cJSON_IsString(uid)) + { + goto end; //String + } + + + v1_resource_claim_consumer_reference_local_var = v1_resource_claim_consumer_reference_create_internal ( + api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, + strdup(name->valuestring), + strdup(resource->valuestring), + strdup(uid->valuestring) + ); + + return v1_resource_claim_consumer_reference_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_resource_claim_consumer_reference.h b/kubernetes/model/v1_resource_claim_consumer_reference.h new file mode 100644 index 00000000..9bcf7c2c --- /dev/null +++ b/kubernetes/model/v1_resource_claim_consumer_reference.h @@ -0,0 +1,44 @@ +/* + * v1_resource_claim_consumer_reference.h + * + * ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim. + */ + +#ifndef _v1_resource_claim_consumer_reference_H_ +#define _v1_resource_claim_consumer_reference_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_claim_consumer_reference_t v1_resource_claim_consumer_reference_t; + + + + +typedef struct v1_resource_claim_consumer_reference_t { + char *api_group; // string + char *name; // string + char *resource; // string + char *uid; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_claim_consumer_reference_t; + +__attribute__((deprecated)) v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference_create( + char *api_group, + char *name, + char *resource, + char *uid +); + +void v1_resource_claim_consumer_reference_free(v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference); + +v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference_parseFromJSON(cJSON *v1_resource_claim_consumer_referenceJSON); + +cJSON *v1_resource_claim_consumer_reference_convertToJSON(v1_resource_claim_consumer_reference_t *v1_resource_claim_consumer_reference); + +#endif /* _v1_resource_claim_consumer_reference_H_ */ + diff --git a/kubernetes/model/v1_resource_claim_list.c b/kubernetes/model/v1_resource_claim_list.c new file mode 100644 index 00000000..dd3c8a94 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1_resource_claim_list.h" + + + +static v1_resource_claim_list_t *v1_resource_claim_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1_resource_claim_list_t *v1_resource_claim_list_local_var = malloc(sizeof(v1_resource_claim_list_t)); + if (!v1_resource_claim_list_local_var) { + return NULL; + } + v1_resource_claim_list_local_var->api_version = api_version; + v1_resource_claim_list_local_var->items = items; + v1_resource_claim_list_local_var->kind = kind; + v1_resource_claim_list_local_var->metadata = metadata; + + v1_resource_claim_list_local_var->_library_owned = 1; + return v1_resource_claim_list_local_var; +} + +__attribute__((deprecated)) v1_resource_claim_list_t *v1_resource_claim_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_resource_claim_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1_resource_claim_list_free(v1_resource_claim_list_t *v1_resource_claim_list) { + if(NULL == v1_resource_claim_list){ + return ; + } + if(v1_resource_claim_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_claim_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_claim_list->api_version) { + free(v1_resource_claim_list->api_version); + v1_resource_claim_list->api_version = NULL; + } + if (v1_resource_claim_list->items) { + list_ForEach(listEntry, v1_resource_claim_list->items) { + resource_v1_resource_claim_free(listEntry->data); + } + list_freeList(v1_resource_claim_list->items); + v1_resource_claim_list->items = NULL; + } + if (v1_resource_claim_list->kind) { + free(v1_resource_claim_list->kind); + v1_resource_claim_list->kind = NULL; + } + if (v1_resource_claim_list->metadata) { + v1_list_meta_free(v1_resource_claim_list->metadata); + v1_resource_claim_list->metadata = NULL; + } + free(v1_resource_claim_list); +} + +cJSON *v1_resource_claim_list_convertToJSON(v1_resource_claim_list_t *v1_resource_claim_list) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_claim_list->api_version + if(v1_resource_claim_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_resource_claim_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_resource_claim_list->items + if (!v1_resource_claim_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1_resource_claim_list->items) { + list_ForEach(itemsListEntry, v1_resource_claim_list->items) { + cJSON *itemLocal = resource_v1_resource_claim_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1_resource_claim_list->kind + if(v1_resource_claim_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_resource_claim_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1_resource_claim_list->metadata + if(v1_resource_claim_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1_resource_claim_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_claim_list_t *v1_resource_claim_list_parseFromJSON(cJSON *v1_resource_claim_listJSON){ + + v1_resource_claim_list_t *v1_resource_claim_list_local_var = NULL; + + // define the local list for v1_resource_claim_list->items + list_t *itemsList = NULL; + + // define the local variable for v1_resource_claim_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1_resource_claim_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_resource_claim_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + resource_v1_resource_claim_t *itemsItem = resource_v1_resource_claim_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1_resource_claim_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_resource_claim_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1_resource_claim_list_local_var = v1_resource_claim_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1_resource_claim_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + resource_v1_resource_claim_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_claim_list.h b/kubernetes/model/v1_resource_claim_list.h new file mode 100644 index 00000000..028d9afa --- /dev/null +++ b/kubernetes/model/v1_resource_claim_list.h @@ -0,0 +1,46 @@ +/* + * v1_resource_claim_list.h + * + * ResourceClaimList is a collection of claims. + */ + +#ifndef _v1_resource_claim_list_H_ +#define _v1_resource_claim_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_claim_list_t v1_resource_claim_list_t; + +#include "resource_v1_resource_claim.h" +#include "v1_list_meta.h" + + + +typedef struct v1_resource_claim_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_claim_list_t; + +__attribute__((deprecated)) v1_resource_claim_list_t *v1_resource_claim_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1_resource_claim_list_free(v1_resource_claim_list_t *v1_resource_claim_list); + +v1_resource_claim_list_t *v1_resource_claim_list_parseFromJSON(cJSON *v1_resource_claim_listJSON); + +cJSON *v1_resource_claim_list_convertToJSON(v1_resource_claim_list_t *v1_resource_claim_list); + +#endif /* _v1_resource_claim_list_H_ */ + diff --git a/kubernetes/model/v1_resource_claim_spec.c b/kubernetes/model/v1_resource_claim_spec.c new file mode 100644 index 00000000..9e3055ad --- /dev/null +++ b/kubernetes/model/v1_resource_claim_spec.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1_resource_claim_spec.h" + + + +static v1_resource_claim_spec_t *v1_resource_claim_spec_create_internal( + v1_device_claim_t *devices + ) { + v1_resource_claim_spec_t *v1_resource_claim_spec_local_var = malloc(sizeof(v1_resource_claim_spec_t)); + if (!v1_resource_claim_spec_local_var) { + return NULL; + } + v1_resource_claim_spec_local_var->devices = devices; + + v1_resource_claim_spec_local_var->_library_owned = 1; + return v1_resource_claim_spec_local_var; +} + +__attribute__((deprecated)) v1_resource_claim_spec_t *v1_resource_claim_spec_create( + v1_device_claim_t *devices + ) { + return v1_resource_claim_spec_create_internal ( + devices + ); +} + +void v1_resource_claim_spec_free(v1_resource_claim_spec_t *v1_resource_claim_spec) { + if(NULL == v1_resource_claim_spec){ + return ; + } + if(v1_resource_claim_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_claim_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_claim_spec->devices) { + v1_device_claim_free(v1_resource_claim_spec->devices); + v1_resource_claim_spec->devices = NULL; + } + free(v1_resource_claim_spec); +} + +cJSON *v1_resource_claim_spec_convertToJSON(v1_resource_claim_spec_t *v1_resource_claim_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_claim_spec->devices + if(v1_resource_claim_spec->devices) { + cJSON *devices_local_JSON = v1_device_claim_convertToJSON(v1_resource_claim_spec->devices); + if(devices_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "devices", devices_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_claim_spec_t *v1_resource_claim_spec_parseFromJSON(cJSON *v1_resource_claim_specJSON){ + + v1_resource_claim_spec_t *v1_resource_claim_spec_local_var = NULL; + + // define the local variable for v1_resource_claim_spec->devices + v1_device_claim_t *devices_local_nonprim = NULL; + + // v1_resource_claim_spec->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_specJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + devices_local_nonprim = v1_device_claim_parseFromJSON(devices); //nonprimitive + } + + + v1_resource_claim_spec_local_var = v1_resource_claim_spec_create_internal ( + devices ? devices_local_nonprim : NULL + ); + + return v1_resource_claim_spec_local_var; +end: + if (devices_local_nonprim) { + v1_device_claim_free(devices_local_nonprim); + devices_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_claim_spec.h b/kubernetes/model/v1_resource_claim_spec.h new file mode 100644 index 00000000..b54280f4 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_spec.h @@ -0,0 +1,39 @@ +/* + * v1_resource_claim_spec.h + * + * ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it. + */ + +#ifndef _v1_resource_claim_spec_H_ +#define _v1_resource_claim_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_claim_spec_t v1_resource_claim_spec_t; + +#include "v1_device_claim.h" + + + +typedef struct v1_resource_claim_spec_t { + struct v1_device_claim_t *devices; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_claim_spec_t; + +__attribute__((deprecated)) v1_resource_claim_spec_t *v1_resource_claim_spec_create( + v1_device_claim_t *devices +); + +void v1_resource_claim_spec_free(v1_resource_claim_spec_t *v1_resource_claim_spec); + +v1_resource_claim_spec_t *v1_resource_claim_spec_parseFromJSON(cJSON *v1_resource_claim_specJSON); + +cJSON *v1_resource_claim_spec_convertToJSON(v1_resource_claim_spec_t *v1_resource_claim_spec); + +#endif /* _v1_resource_claim_spec_H_ */ + diff --git a/kubernetes/model/v1_resource_claim_status.c b/kubernetes/model/v1_resource_claim_status.c new file mode 100644 index 00000000..766d1cf8 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_status.c @@ -0,0 +1,233 @@ +#include +#include +#include +#include "v1_resource_claim_status.h" + + + +static v1_resource_claim_status_t *v1_resource_claim_status_create_internal( + v1_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for + ) { + v1_resource_claim_status_t *v1_resource_claim_status_local_var = malloc(sizeof(v1_resource_claim_status_t)); + if (!v1_resource_claim_status_local_var) { + return NULL; + } + v1_resource_claim_status_local_var->allocation = allocation; + v1_resource_claim_status_local_var->devices = devices; + v1_resource_claim_status_local_var->reserved_for = reserved_for; + + v1_resource_claim_status_local_var->_library_owned = 1; + return v1_resource_claim_status_local_var; +} + +__attribute__((deprecated)) v1_resource_claim_status_t *v1_resource_claim_status_create( + v1_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for + ) { + return v1_resource_claim_status_create_internal ( + allocation, + devices, + reserved_for + ); +} + +void v1_resource_claim_status_free(v1_resource_claim_status_t *v1_resource_claim_status) { + if(NULL == v1_resource_claim_status){ + return ; + } + if(v1_resource_claim_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_claim_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_claim_status->allocation) { + v1_allocation_result_free(v1_resource_claim_status->allocation); + v1_resource_claim_status->allocation = NULL; + } + if (v1_resource_claim_status->devices) { + list_ForEach(listEntry, v1_resource_claim_status->devices) { + v1_allocated_device_status_free(listEntry->data); + } + list_freeList(v1_resource_claim_status->devices); + v1_resource_claim_status->devices = NULL; + } + if (v1_resource_claim_status->reserved_for) { + list_ForEach(listEntry, v1_resource_claim_status->reserved_for) { + v1_resource_claim_consumer_reference_free(listEntry->data); + } + list_freeList(v1_resource_claim_status->reserved_for); + v1_resource_claim_status->reserved_for = NULL; + } + free(v1_resource_claim_status); +} + +cJSON *v1_resource_claim_status_convertToJSON(v1_resource_claim_status_t *v1_resource_claim_status) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_claim_status->allocation + if(v1_resource_claim_status->allocation) { + cJSON *allocation_local_JSON = v1_allocation_result_convertToJSON(v1_resource_claim_status->allocation); + if(allocation_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "allocation", allocation_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_resource_claim_status->devices + if(v1_resource_claim_status->devices) { + cJSON *devices = cJSON_AddArrayToObject(item, "devices"); + if(devices == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *devicesListEntry; + if (v1_resource_claim_status->devices) { + list_ForEach(devicesListEntry, v1_resource_claim_status->devices) { + cJSON *itemLocal = v1_allocated_device_status_convertToJSON(devicesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(devices, itemLocal); + } + } + } + + + // v1_resource_claim_status->reserved_for + if(v1_resource_claim_status->reserved_for) { + cJSON *reserved_for = cJSON_AddArrayToObject(item, "reservedFor"); + if(reserved_for == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *reserved_forListEntry; + if (v1_resource_claim_status->reserved_for) { + list_ForEach(reserved_forListEntry, v1_resource_claim_status->reserved_for) { + cJSON *itemLocal = v1_resource_claim_consumer_reference_convertToJSON(reserved_forListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(reserved_for, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_claim_status_t *v1_resource_claim_status_parseFromJSON(cJSON *v1_resource_claim_statusJSON){ + + v1_resource_claim_status_t *v1_resource_claim_status_local_var = NULL; + + // define the local variable for v1_resource_claim_status->allocation + v1_allocation_result_t *allocation_local_nonprim = NULL; + + // define the local list for v1_resource_claim_status->devices + list_t *devicesList = NULL; + + // define the local list for v1_resource_claim_status->reserved_for + list_t *reserved_forList = NULL; + + // v1_resource_claim_status->allocation + cJSON *allocation = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_statusJSON, "allocation"); + if (cJSON_IsNull(allocation)) { + allocation = NULL; + } + if (allocation) { + allocation_local_nonprim = v1_allocation_result_parseFromJSON(allocation); //nonprimitive + } + + // v1_resource_claim_status->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_statusJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + cJSON *devices_local_nonprimitive = NULL; + if(!cJSON_IsArray(devices)){ + goto end; //nonprimitive container + } + + devicesList = list_createList(); + + cJSON_ArrayForEach(devices_local_nonprimitive,devices ) + { + if(!cJSON_IsObject(devices_local_nonprimitive)){ + goto end; + } + v1_allocated_device_status_t *devicesItem = v1_allocated_device_status_parseFromJSON(devices_local_nonprimitive); + + list_addElement(devicesList, devicesItem); + } + } + + // v1_resource_claim_status->reserved_for + cJSON *reserved_for = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_statusJSON, "reservedFor"); + if (cJSON_IsNull(reserved_for)) { + reserved_for = NULL; + } + if (reserved_for) { + cJSON *reserved_for_local_nonprimitive = NULL; + if(!cJSON_IsArray(reserved_for)){ + goto end; //nonprimitive container + } + + reserved_forList = list_createList(); + + cJSON_ArrayForEach(reserved_for_local_nonprimitive,reserved_for ) + { + if(!cJSON_IsObject(reserved_for_local_nonprimitive)){ + goto end; + } + v1_resource_claim_consumer_reference_t *reserved_forItem = v1_resource_claim_consumer_reference_parseFromJSON(reserved_for_local_nonprimitive); + + list_addElement(reserved_forList, reserved_forItem); + } + } + + + v1_resource_claim_status_local_var = v1_resource_claim_status_create_internal ( + allocation ? allocation_local_nonprim : NULL, + devices ? devicesList : NULL, + reserved_for ? reserved_forList : NULL + ); + + return v1_resource_claim_status_local_var; +end: + if (allocation_local_nonprim) { + v1_allocation_result_free(allocation_local_nonprim); + allocation_local_nonprim = NULL; + } + if (devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, devicesList) { + v1_allocated_device_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(devicesList); + devicesList = NULL; + } + if (reserved_forList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, reserved_forList) { + v1_resource_claim_consumer_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(reserved_forList); + reserved_forList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_claim_status.h b/kubernetes/model/v1_resource_claim_status.h new file mode 100644 index 00000000..31cd78ab --- /dev/null +++ b/kubernetes/model/v1_resource_claim_status.h @@ -0,0 +1,45 @@ +/* + * v1_resource_claim_status.h + * + * ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was. + */ + +#ifndef _v1_resource_claim_status_H_ +#define _v1_resource_claim_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_claim_status_t v1_resource_claim_status_t; + +#include "v1_allocated_device_status.h" +#include "v1_allocation_result.h" +#include "v1_resource_claim_consumer_reference.h" + + + +typedef struct v1_resource_claim_status_t { + struct v1_allocation_result_t *allocation; //model + list_t *devices; //nonprimitive container + list_t *reserved_for; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_claim_status_t; + +__attribute__((deprecated)) v1_resource_claim_status_t *v1_resource_claim_status_create( + v1_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for +); + +void v1_resource_claim_status_free(v1_resource_claim_status_t *v1_resource_claim_status); + +v1_resource_claim_status_t *v1_resource_claim_status_parseFromJSON(cJSON *v1_resource_claim_statusJSON); + +cJSON *v1_resource_claim_status_convertToJSON(v1_resource_claim_status_t *v1_resource_claim_status); + +#endif /* _v1_resource_claim_status_H_ */ + diff --git a/kubernetes/model/v1_resource_claim_template.c b/kubernetes/model/v1_resource_claim_template.c new file mode 100644 index 00000000..a2af4ac6 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_template.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1_resource_claim_template.h" + + + +static v1_resource_claim_template_t *v1_resource_claim_template_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_claim_template_spec_t *spec + ) { + v1_resource_claim_template_t *v1_resource_claim_template_local_var = malloc(sizeof(v1_resource_claim_template_t)); + if (!v1_resource_claim_template_local_var) { + return NULL; + } + v1_resource_claim_template_local_var->api_version = api_version; + v1_resource_claim_template_local_var->kind = kind; + v1_resource_claim_template_local_var->metadata = metadata; + v1_resource_claim_template_local_var->spec = spec; + + v1_resource_claim_template_local_var->_library_owned = 1; + return v1_resource_claim_template_local_var; +} + +__attribute__((deprecated)) v1_resource_claim_template_t *v1_resource_claim_template_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_claim_template_spec_t *spec + ) { + return v1_resource_claim_template_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1_resource_claim_template_free(v1_resource_claim_template_t *v1_resource_claim_template) { + if(NULL == v1_resource_claim_template){ + return ; + } + if(v1_resource_claim_template->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_claim_template_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_claim_template->api_version) { + free(v1_resource_claim_template->api_version); + v1_resource_claim_template->api_version = NULL; + } + if (v1_resource_claim_template->kind) { + free(v1_resource_claim_template->kind); + v1_resource_claim_template->kind = NULL; + } + if (v1_resource_claim_template->metadata) { + v1_object_meta_free(v1_resource_claim_template->metadata); + v1_resource_claim_template->metadata = NULL; + } + if (v1_resource_claim_template->spec) { + v1_resource_claim_template_spec_free(v1_resource_claim_template->spec); + v1_resource_claim_template->spec = NULL; + } + free(v1_resource_claim_template); +} + +cJSON *v1_resource_claim_template_convertToJSON(v1_resource_claim_template_t *v1_resource_claim_template) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_claim_template->api_version + if(v1_resource_claim_template->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_resource_claim_template->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_resource_claim_template->kind + if(v1_resource_claim_template->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_resource_claim_template->kind) == NULL) { + goto fail; //String + } + } + + + // v1_resource_claim_template->metadata + if(v1_resource_claim_template->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1_resource_claim_template->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_resource_claim_template->spec + if (!v1_resource_claim_template->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1_resource_claim_template_spec_convertToJSON(v1_resource_claim_template->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_claim_template_t *v1_resource_claim_template_parseFromJSON(cJSON *v1_resource_claim_templateJSON){ + + v1_resource_claim_template_t *v1_resource_claim_template_local_var = NULL; + + // define the local variable for v1_resource_claim_template->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1_resource_claim_template->spec + v1_resource_claim_template_spec_t *spec_local_nonprim = NULL; + + // v1_resource_claim_template->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_templateJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_resource_claim_template->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_templateJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_resource_claim_template->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_templateJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1_resource_claim_template->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_templateJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1_resource_claim_template_spec_parseFromJSON(spec); //nonprimitive + + + v1_resource_claim_template_local_var = v1_resource_claim_template_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1_resource_claim_template_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1_resource_claim_template_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_claim_template.h b/kubernetes/model/v1_resource_claim_template.h new file mode 100644 index 00000000..21c3e813 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_template.h @@ -0,0 +1,46 @@ +/* + * v1_resource_claim_template.h + * + * ResourceClaimTemplate is used to produce ResourceClaim objects. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1_resource_claim_template_H_ +#define _v1_resource_claim_template_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_claim_template_t v1_resource_claim_template_t; + +#include "v1_object_meta.h" +#include "v1_resource_claim_template_spec.h" + + + +typedef struct v1_resource_claim_template_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1_resource_claim_template_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_claim_template_t; + +__attribute__((deprecated)) v1_resource_claim_template_t *v1_resource_claim_template_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_claim_template_spec_t *spec +); + +void v1_resource_claim_template_free(v1_resource_claim_template_t *v1_resource_claim_template); + +v1_resource_claim_template_t *v1_resource_claim_template_parseFromJSON(cJSON *v1_resource_claim_templateJSON); + +cJSON *v1_resource_claim_template_convertToJSON(v1_resource_claim_template_t *v1_resource_claim_template); + +#endif /* _v1_resource_claim_template_H_ */ + diff --git a/kubernetes/model/v1_resource_claim_template_list.c b/kubernetes/model/v1_resource_claim_template_list.c new file mode 100644 index 00000000..81970665 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_template_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1_resource_claim_template_list.h" + + + +static v1_resource_claim_template_list_t *v1_resource_claim_template_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1_resource_claim_template_list_t *v1_resource_claim_template_list_local_var = malloc(sizeof(v1_resource_claim_template_list_t)); + if (!v1_resource_claim_template_list_local_var) { + return NULL; + } + v1_resource_claim_template_list_local_var->api_version = api_version; + v1_resource_claim_template_list_local_var->items = items; + v1_resource_claim_template_list_local_var->kind = kind; + v1_resource_claim_template_list_local_var->metadata = metadata; + + v1_resource_claim_template_list_local_var->_library_owned = 1; + return v1_resource_claim_template_list_local_var; +} + +__attribute__((deprecated)) v1_resource_claim_template_list_t *v1_resource_claim_template_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_resource_claim_template_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1_resource_claim_template_list_free(v1_resource_claim_template_list_t *v1_resource_claim_template_list) { + if(NULL == v1_resource_claim_template_list){ + return ; + } + if(v1_resource_claim_template_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_claim_template_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_claim_template_list->api_version) { + free(v1_resource_claim_template_list->api_version); + v1_resource_claim_template_list->api_version = NULL; + } + if (v1_resource_claim_template_list->items) { + list_ForEach(listEntry, v1_resource_claim_template_list->items) { + v1_resource_claim_template_free(listEntry->data); + } + list_freeList(v1_resource_claim_template_list->items); + v1_resource_claim_template_list->items = NULL; + } + if (v1_resource_claim_template_list->kind) { + free(v1_resource_claim_template_list->kind); + v1_resource_claim_template_list->kind = NULL; + } + if (v1_resource_claim_template_list->metadata) { + v1_list_meta_free(v1_resource_claim_template_list->metadata); + v1_resource_claim_template_list->metadata = NULL; + } + free(v1_resource_claim_template_list); +} + +cJSON *v1_resource_claim_template_list_convertToJSON(v1_resource_claim_template_list_t *v1_resource_claim_template_list) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_claim_template_list->api_version + if(v1_resource_claim_template_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_resource_claim_template_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_resource_claim_template_list->items + if (!v1_resource_claim_template_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1_resource_claim_template_list->items) { + list_ForEach(itemsListEntry, v1_resource_claim_template_list->items) { + cJSON *itemLocal = v1_resource_claim_template_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1_resource_claim_template_list->kind + if(v1_resource_claim_template_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_resource_claim_template_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1_resource_claim_template_list->metadata + if(v1_resource_claim_template_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1_resource_claim_template_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_claim_template_list_t *v1_resource_claim_template_list_parseFromJSON(cJSON *v1_resource_claim_template_listJSON){ + + v1_resource_claim_template_list_t *v1_resource_claim_template_list_local_var = NULL; + + // define the local list for v1_resource_claim_template_list->items + list_t *itemsList = NULL; + + // define the local variable for v1_resource_claim_template_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1_resource_claim_template_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_template_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_resource_claim_template_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_template_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1_resource_claim_template_t *itemsItem = v1_resource_claim_template_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1_resource_claim_template_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_template_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_resource_claim_template_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_template_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1_resource_claim_template_list_local_var = v1_resource_claim_template_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1_resource_claim_template_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_resource_claim_template_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_claim_template_list.h b/kubernetes/model/v1_resource_claim_template_list.h new file mode 100644 index 00000000..55ac2fea --- /dev/null +++ b/kubernetes/model/v1_resource_claim_template_list.h @@ -0,0 +1,46 @@ +/* + * v1_resource_claim_template_list.h + * + * ResourceClaimTemplateList is a collection of claim templates. + */ + +#ifndef _v1_resource_claim_template_list_H_ +#define _v1_resource_claim_template_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_claim_template_list_t v1_resource_claim_template_list_t; + +#include "v1_list_meta.h" +#include "v1_resource_claim_template.h" + + + +typedef struct v1_resource_claim_template_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_claim_template_list_t; + +__attribute__((deprecated)) v1_resource_claim_template_list_t *v1_resource_claim_template_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1_resource_claim_template_list_free(v1_resource_claim_template_list_t *v1_resource_claim_template_list); + +v1_resource_claim_template_list_t *v1_resource_claim_template_list_parseFromJSON(cJSON *v1_resource_claim_template_listJSON); + +cJSON *v1_resource_claim_template_list_convertToJSON(v1_resource_claim_template_list_t *v1_resource_claim_template_list); + +#endif /* _v1_resource_claim_template_list_H_ */ + diff --git a/kubernetes/model/v1_resource_claim_template_spec.c b/kubernetes/model/v1_resource_claim_template_spec.c new file mode 100644 index 00000000..52d54739 --- /dev/null +++ b/kubernetes/model/v1_resource_claim_template_spec.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include "v1_resource_claim_template_spec.h" + + + +static v1_resource_claim_template_spec_t *v1_resource_claim_template_spec_create_internal( + v1_object_meta_t *metadata, + v1_resource_claim_spec_t *spec + ) { + v1_resource_claim_template_spec_t *v1_resource_claim_template_spec_local_var = malloc(sizeof(v1_resource_claim_template_spec_t)); + if (!v1_resource_claim_template_spec_local_var) { + return NULL; + } + v1_resource_claim_template_spec_local_var->metadata = metadata; + v1_resource_claim_template_spec_local_var->spec = spec; + + v1_resource_claim_template_spec_local_var->_library_owned = 1; + return v1_resource_claim_template_spec_local_var; +} + +__attribute__((deprecated)) v1_resource_claim_template_spec_t *v1_resource_claim_template_spec_create( + v1_object_meta_t *metadata, + v1_resource_claim_spec_t *spec + ) { + return v1_resource_claim_template_spec_create_internal ( + metadata, + spec + ); +} + +void v1_resource_claim_template_spec_free(v1_resource_claim_template_spec_t *v1_resource_claim_template_spec) { + if(NULL == v1_resource_claim_template_spec){ + return ; + } + if(v1_resource_claim_template_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_claim_template_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_claim_template_spec->metadata) { + v1_object_meta_free(v1_resource_claim_template_spec->metadata); + v1_resource_claim_template_spec->metadata = NULL; + } + if (v1_resource_claim_template_spec->spec) { + v1_resource_claim_spec_free(v1_resource_claim_template_spec->spec); + v1_resource_claim_template_spec->spec = NULL; + } + free(v1_resource_claim_template_spec); +} + +cJSON *v1_resource_claim_template_spec_convertToJSON(v1_resource_claim_template_spec_t *v1_resource_claim_template_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_claim_template_spec->metadata + if(v1_resource_claim_template_spec->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1_resource_claim_template_spec->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_resource_claim_template_spec->spec + if (!v1_resource_claim_template_spec->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1_resource_claim_spec_convertToJSON(v1_resource_claim_template_spec->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_claim_template_spec_t *v1_resource_claim_template_spec_parseFromJSON(cJSON *v1_resource_claim_template_specJSON){ + + v1_resource_claim_template_spec_t *v1_resource_claim_template_spec_local_var = NULL; + + // define the local variable for v1_resource_claim_template_spec->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1_resource_claim_template_spec->spec + v1_resource_claim_spec_t *spec_local_nonprim = NULL; + + // v1_resource_claim_template_spec->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_template_specJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1_resource_claim_template_spec->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_resource_claim_template_specJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1_resource_claim_spec_parseFromJSON(spec); //nonprimitive + + + v1_resource_claim_template_spec_local_var = v1_resource_claim_template_spec_create_internal ( + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1_resource_claim_template_spec_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1_resource_claim_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_claim_template_spec.h b/kubernetes/model/v1_resource_claim_template_spec.h new file mode 100644 index 00000000..7c09d0ad --- /dev/null +++ b/kubernetes/model/v1_resource_claim_template_spec.h @@ -0,0 +1,42 @@ +/* + * v1_resource_claim_template_spec.h + * + * ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. + */ + +#ifndef _v1_resource_claim_template_spec_H_ +#define _v1_resource_claim_template_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_claim_template_spec_t v1_resource_claim_template_spec_t; + +#include "v1_object_meta.h" +#include "v1_resource_claim_spec.h" + + + +typedef struct v1_resource_claim_template_spec_t { + struct v1_object_meta_t *metadata; //model + struct v1_resource_claim_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_claim_template_spec_t; + +__attribute__((deprecated)) v1_resource_claim_template_spec_t *v1_resource_claim_template_spec_create( + v1_object_meta_t *metadata, + v1_resource_claim_spec_t *spec +); + +void v1_resource_claim_template_spec_free(v1_resource_claim_template_spec_t *v1_resource_claim_template_spec); + +v1_resource_claim_template_spec_t *v1_resource_claim_template_spec_parseFromJSON(cJSON *v1_resource_claim_template_specJSON); + +cJSON *v1_resource_claim_template_spec_convertToJSON(v1_resource_claim_template_spec_t *v1_resource_claim_template_spec); + +#endif /* _v1_resource_claim_template_spec_H_ */ + diff --git a/kubernetes/model/v1_resource_field_selector.c b/kubernetes/model/v1_resource_field_selector.c index f6bcd600..b09c9d73 100644 --- a/kubernetes/model/v1_resource_field_selector.c +++ b/kubernetes/model/v1_resource_field_selector.c @@ -5,7 +5,7 @@ -v1_resource_field_selector_t *v1_resource_field_selector_create( +static v1_resource_field_selector_t *v1_resource_field_selector_create_internal( char *container_name, char *divisor, char *resource @@ -18,14 +18,30 @@ v1_resource_field_selector_t *v1_resource_field_selector_create( v1_resource_field_selector_local_var->divisor = divisor; v1_resource_field_selector_local_var->resource = resource; + v1_resource_field_selector_local_var->_library_owned = 1; return v1_resource_field_selector_local_var; } +__attribute__((deprecated)) v1_resource_field_selector_t *v1_resource_field_selector_create( + char *container_name, + char *divisor, + char *resource + ) { + return v1_resource_field_selector_create_internal ( + container_name, + divisor, + resource + ); +} void v1_resource_field_selector_free(v1_resource_field_selector_t *v1_resource_field_selector) { if(NULL == v1_resource_field_selector){ return ; } + if(v1_resource_field_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_field_selector_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_field_selector->container_name) { free(v1_resource_field_selector->container_name); @@ -83,6 +99,9 @@ v1_resource_field_selector_t *v1_resource_field_selector_parseFromJSON(cJSON *v1 // v1_resource_field_selector->container_name cJSON *container_name = cJSON_GetObjectItemCaseSensitive(v1_resource_field_selectorJSON, "containerName"); + if (cJSON_IsNull(container_name)) { + container_name = NULL; + } if (container_name) { if(!cJSON_IsString(container_name) && !cJSON_IsNull(container_name)) { @@ -92,6 +111,9 @@ v1_resource_field_selector_t *v1_resource_field_selector_parseFromJSON(cJSON *v1 // v1_resource_field_selector->divisor cJSON *divisor = cJSON_GetObjectItemCaseSensitive(v1_resource_field_selectorJSON, "divisor"); + if (cJSON_IsNull(divisor)) { + divisor = NULL; + } if (divisor) { if(!cJSON_IsString(divisor) && !cJSON_IsNull(divisor)) { @@ -101,6 +123,9 @@ v1_resource_field_selector_t *v1_resource_field_selector_parseFromJSON(cJSON *v1 // v1_resource_field_selector->resource cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1_resource_field_selectorJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } if (!resource) { goto end; } @@ -112,7 +137,7 @@ v1_resource_field_selector_t *v1_resource_field_selector_parseFromJSON(cJSON *v1 } - v1_resource_field_selector_local_var = v1_resource_field_selector_create ( + v1_resource_field_selector_local_var = v1_resource_field_selector_create_internal ( container_name && !cJSON_IsNull(container_name) ? strdup(container_name->valuestring) : NULL, divisor && !cJSON_IsNull(divisor) ? strdup(divisor->valuestring) : NULL, strdup(resource->valuestring) diff --git a/kubernetes/model/v1_resource_field_selector.h b/kubernetes/model/v1_resource_field_selector.h index 0e908acf..5f27bd8a 100644 --- a/kubernetes/model/v1_resource_field_selector.h +++ b/kubernetes/model/v1_resource_field_selector.h @@ -23,9 +23,10 @@ typedef struct v1_resource_field_selector_t { char *divisor; // string char *resource; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_field_selector_t; -v1_resource_field_selector_t *v1_resource_field_selector_create( +__attribute__((deprecated)) v1_resource_field_selector_t *v1_resource_field_selector_create( char *container_name, char *divisor, char *resource diff --git a/kubernetes/model/v1_resource_health.c b/kubernetes/model/v1_resource_health.c new file mode 100644 index 00000000..3f1f314e --- /dev/null +++ b/kubernetes/model/v1_resource_health.c @@ -0,0 +1,121 @@ +#include +#include +#include +#include "v1_resource_health.h" + + + +static v1_resource_health_t *v1_resource_health_create_internal( + char *health, + char *resource_id + ) { + v1_resource_health_t *v1_resource_health_local_var = malloc(sizeof(v1_resource_health_t)); + if (!v1_resource_health_local_var) { + return NULL; + } + v1_resource_health_local_var->health = health; + v1_resource_health_local_var->resource_id = resource_id; + + v1_resource_health_local_var->_library_owned = 1; + return v1_resource_health_local_var; +} + +__attribute__((deprecated)) v1_resource_health_t *v1_resource_health_create( + char *health, + char *resource_id + ) { + return v1_resource_health_create_internal ( + health, + resource_id + ); +} + +void v1_resource_health_free(v1_resource_health_t *v1_resource_health) { + if(NULL == v1_resource_health){ + return ; + } + if(v1_resource_health->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_health_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_health->health) { + free(v1_resource_health->health); + v1_resource_health->health = NULL; + } + if (v1_resource_health->resource_id) { + free(v1_resource_health->resource_id); + v1_resource_health->resource_id = NULL; + } + free(v1_resource_health); +} + +cJSON *v1_resource_health_convertToJSON(v1_resource_health_t *v1_resource_health) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_health->health + if(v1_resource_health->health) { + if(cJSON_AddStringToObject(item, "health", v1_resource_health->health) == NULL) { + goto fail; //String + } + } + + + // v1_resource_health->resource_id + if (!v1_resource_health->resource_id) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resourceID", v1_resource_health->resource_id) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_health_t *v1_resource_health_parseFromJSON(cJSON *v1_resource_healthJSON){ + + v1_resource_health_t *v1_resource_health_local_var = NULL; + + // v1_resource_health->health + cJSON *health = cJSON_GetObjectItemCaseSensitive(v1_resource_healthJSON, "health"); + if (cJSON_IsNull(health)) { + health = NULL; + } + if (health) { + if(!cJSON_IsString(health) && !cJSON_IsNull(health)) + { + goto end; //String + } + } + + // v1_resource_health->resource_id + cJSON *resource_id = cJSON_GetObjectItemCaseSensitive(v1_resource_healthJSON, "resourceID"); + if (cJSON_IsNull(resource_id)) { + resource_id = NULL; + } + if (!resource_id) { + goto end; + } + + + if(!cJSON_IsString(resource_id)) + { + goto end; //String + } + + + v1_resource_health_local_var = v1_resource_health_create_internal ( + health && !cJSON_IsNull(health) ? strdup(health->valuestring) : NULL, + strdup(resource_id->valuestring) + ); + + return v1_resource_health_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_resource_health.h b/kubernetes/model/v1_resource_health.h new file mode 100644 index 00000000..9d832ce3 --- /dev/null +++ b/kubernetes/model/v1_resource_health.h @@ -0,0 +1,40 @@ +/* + * v1_resource_health.h + * + * ResourceHealth represents the health of a resource. It has the latest device health information. This is a part of KEP https://kep.k8s.io/4680. + */ + +#ifndef _v1_resource_health_H_ +#define _v1_resource_health_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_health_t v1_resource_health_t; + + + + +typedef struct v1_resource_health_t { + char *health; // string + char *resource_id; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_health_t; + +__attribute__((deprecated)) v1_resource_health_t *v1_resource_health_create( + char *health, + char *resource_id +); + +void v1_resource_health_free(v1_resource_health_t *v1_resource_health); + +v1_resource_health_t *v1_resource_health_parseFromJSON(cJSON *v1_resource_healthJSON); + +cJSON *v1_resource_health_convertToJSON(v1_resource_health_t *v1_resource_health); + +#endif /* _v1_resource_health_H_ */ + diff --git a/kubernetes/model/v1_resource_policy_rule.c b/kubernetes/model/v1_resource_policy_rule.c index 13f7504f..35998391 100644 --- a/kubernetes/model/v1_resource_policy_rule.c +++ b/kubernetes/model/v1_resource_policy_rule.c @@ -5,7 +5,7 @@ -v1_resource_policy_rule_t *v1_resource_policy_rule_create( +static v1_resource_policy_rule_t *v1_resource_policy_rule_create_internal( list_t *api_groups, int cluster_scope, list_t *namespaces, @@ -22,14 +22,34 @@ v1_resource_policy_rule_t *v1_resource_policy_rule_create( v1_resource_policy_rule_local_var->resources = resources; v1_resource_policy_rule_local_var->verbs = verbs; + v1_resource_policy_rule_local_var->_library_owned = 1; return v1_resource_policy_rule_local_var; } +__attribute__((deprecated)) v1_resource_policy_rule_t *v1_resource_policy_rule_create( + list_t *api_groups, + int cluster_scope, + list_t *namespaces, + list_t *resources, + list_t *verbs + ) { + return v1_resource_policy_rule_create_internal ( + api_groups, + cluster_scope, + namespaces, + resources, + verbs + ); +} void v1_resource_policy_rule_free(v1_resource_policy_rule_t *v1_resource_policy_rule) { if(NULL == v1_resource_policy_rule){ return ; } + if(v1_resource_policy_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_policy_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_policy_rule->api_groups) { list_ForEach(listEntry, v1_resource_policy_rule->api_groups) { @@ -76,7 +96,7 @@ cJSON *v1_resource_policy_rule_convertToJSON(v1_resource_policy_rule_t *v1_resou listEntry_t *api_groupsListEntry; list_ForEach(api_groupsListEntry, v1_resource_policy_rule->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_groups, "", api_groupsListEntry->data) == NULL) { goto fail; } @@ -100,7 +120,7 @@ cJSON *v1_resource_policy_rule_convertToJSON(v1_resource_policy_rule_t *v1_resou listEntry_t *namespacesListEntry; list_ForEach(namespacesListEntry, v1_resource_policy_rule->namespaces) { - if(cJSON_AddStringToObject(namespaces, "", (char*)namespacesListEntry->data) == NULL) + if(cJSON_AddStringToObject(namespaces, "", namespacesListEntry->data) == NULL) { goto fail; } @@ -119,7 +139,7 @@ cJSON *v1_resource_policy_rule_convertToJSON(v1_resource_policy_rule_t *v1_resou listEntry_t *resourcesListEntry; list_ForEach(resourcesListEntry, v1_resource_policy_rule->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resources, "", resourcesListEntry->data) == NULL) { goto fail; } @@ -137,7 +157,7 @@ cJSON *v1_resource_policy_rule_convertToJSON(v1_resource_policy_rule_t *v1_resou listEntry_t *verbsListEntry; list_ForEach(verbsListEntry, v1_resource_policy_rule->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) + if(cJSON_AddStringToObject(verbs, "", verbsListEntry->data) == NULL) { goto fail; } @@ -169,6 +189,9 @@ v1_resource_policy_rule_t *v1_resource_policy_rule_parseFromJSON(cJSON *v1_resou // v1_resource_policy_rule->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_resource_policy_ruleJSON, "apiGroups"); + if (cJSON_IsNull(api_groups)) { + api_groups = NULL; + } if (!api_groups) { goto end; } @@ -191,6 +214,9 @@ v1_resource_policy_rule_t *v1_resource_policy_rule_parseFromJSON(cJSON *v1_resou // v1_resource_policy_rule->cluster_scope cJSON *cluster_scope = cJSON_GetObjectItemCaseSensitive(v1_resource_policy_ruleJSON, "clusterScope"); + if (cJSON_IsNull(cluster_scope)) { + cluster_scope = NULL; + } if (cluster_scope) { if(!cJSON_IsBool(cluster_scope)) { @@ -200,6 +226,9 @@ v1_resource_policy_rule_t *v1_resource_policy_rule_parseFromJSON(cJSON *v1_resou // v1_resource_policy_rule->namespaces cJSON *namespaces = cJSON_GetObjectItemCaseSensitive(v1_resource_policy_ruleJSON, "namespaces"); + if (cJSON_IsNull(namespaces)) { + namespaces = NULL; + } if (namespaces) { cJSON *namespaces_local = NULL; if(!cJSON_IsArray(namespaces)) { @@ -219,6 +248,9 @@ v1_resource_policy_rule_t *v1_resource_policy_rule_parseFromJSON(cJSON *v1_resou // v1_resource_policy_rule->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_resource_policy_ruleJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (!resources) { goto end; } @@ -241,6 +273,9 @@ v1_resource_policy_rule_t *v1_resource_policy_rule_parseFromJSON(cJSON *v1_resou // v1_resource_policy_rule->verbs cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1_resource_policy_ruleJSON, "verbs"); + if (cJSON_IsNull(verbs)) { + verbs = NULL; + } if (!verbs) { goto end; } @@ -262,7 +297,7 @@ v1_resource_policy_rule_t *v1_resource_policy_rule_parseFromJSON(cJSON *v1_resou } - v1_resource_policy_rule_local_var = v1_resource_policy_rule_create ( + v1_resource_policy_rule_local_var = v1_resource_policy_rule_create_internal ( api_groupsList, cluster_scope ? cluster_scope->valueint : 0, namespaces ? namespacesList : NULL, diff --git a/kubernetes/model/v1_resource_policy_rule.h b/kubernetes/model/v1_resource_policy_rule.h index 004fcf32..4bf8b2d4 100644 --- a/kubernetes/model/v1_resource_policy_rule.h +++ b/kubernetes/model/v1_resource_policy_rule.h @@ -25,9 +25,10 @@ typedef struct v1_resource_policy_rule_t { list_t *resources; //primitive container list_t *verbs; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_policy_rule_t; -v1_resource_policy_rule_t *v1_resource_policy_rule_create( +__attribute__((deprecated)) v1_resource_policy_rule_t *v1_resource_policy_rule_create( list_t *api_groups, int cluster_scope, list_t *namespaces, diff --git a/kubernetes/model/v1_resource_pool.c b/kubernetes/model/v1_resource_pool.c new file mode 100644 index 00000000..04c1ef49 --- /dev/null +++ b/kubernetes/model/v1_resource_pool.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include "v1_resource_pool.h" + + + +static v1_resource_pool_t *v1_resource_pool_create_internal( + long generation, + char *name, + long resource_slice_count + ) { + v1_resource_pool_t *v1_resource_pool_local_var = malloc(sizeof(v1_resource_pool_t)); + if (!v1_resource_pool_local_var) { + return NULL; + } + v1_resource_pool_local_var->generation = generation; + v1_resource_pool_local_var->name = name; + v1_resource_pool_local_var->resource_slice_count = resource_slice_count; + + v1_resource_pool_local_var->_library_owned = 1; + return v1_resource_pool_local_var; +} + +__attribute__((deprecated)) v1_resource_pool_t *v1_resource_pool_create( + long generation, + char *name, + long resource_slice_count + ) { + return v1_resource_pool_create_internal ( + generation, + name, + resource_slice_count + ); +} + +void v1_resource_pool_free(v1_resource_pool_t *v1_resource_pool) { + if(NULL == v1_resource_pool){ + return ; + } + if(v1_resource_pool->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_pool_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_pool->name) { + free(v1_resource_pool->name); + v1_resource_pool->name = NULL; + } + free(v1_resource_pool); +} + +cJSON *v1_resource_pool_convertToJSON(v1_resource_pool_t *v1_resource_pool) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_pool->generation + if (!v1_resource_pool->generation) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "generation", v1_resource_pool->generation) == NULL) { + goto fail; //Numeric + } + + + // v1_resource_pool->name + if (!v1_resource_pool->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_resource_pool->name) == NULL) { + goto fail; //String + } + + + // v1_resource_pool->resource_slice_count + if (!v1_resource_pool->resource_slice_count) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "resourceSliceCount", v1_resource_pool->resource_slice_count) == NULL) { + goto fail; //Numeric + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_pool_t *v1_resource_pool_parseFromJSON(cJSON *v1_resource_poolJSON){ + + v1_resource_pool_t *v1_resource_pool_local_var = NULL; + + // v1_resource_pool->generation + cJSON *generation = cJSON_GetObjectItemCaseSensitive(v1_resource_poolJSON, "generation"); + if (cJSON_IsNull(generation)) { + generation = NULL; + } + if (!generation) { + goto end; + } + + + if(!cJSON_IsNumber(generation)) + { + goto end; //Numeric + } + + // v1_resource_pool->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_resource_poolJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1_resource_pool->resource_slice_count + cJSON *resource_slice_count = cJSON_GetObjectItemCaseSensitive(v1_resource_poolJSON, "resourceSliceCount"); + if (cJSON_IsNull(resource_slice_count)) { + resource_slice_count = NULL; + } + if (!resource_slice_count) { + goto end; + } + + + if(!cJSON_IsNumber(resource_slice_count)) + { + goto end; //Numeric + } + + + v1_resource_pool_local_var = v1_resource_pool_create_internal ( + generation->valuedouble, + strdup(name->valuestring), + resource_slice_count->valuedouble + ); + + return v1_resource_pool_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1_resource_pool.h b/kubernetes/model/v1_resource_pool.h new file mode 100644 index 00000000..4b17dcef --- /dev/null +++ b/kubernetes/model/v1_resource_pool.h @@ -0,0 +1,42 @@ +/* + * v1_resource_pool.h + * + * ResourcePool describes the pool that ResourceSlices belong to. + */ + +#ifndef _v1_resource_pool_H_ +#define _v1_resource_pool_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_pool_t v1_resource_pool_t; + + + + +typedef struct v1_resource_pool_t { + long generation; //numeric + char *name; // string + long resource_slice_count; //numeric + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_pool_t; + +__attribute__((deprecated)) v1_resource_pool_t *v1_resource_pool_create( + long generation, + char *name, + long resource_slice_count +); + +void v1_resource_pool_free(v1_resource_pool_t *v1_resource_pool); + +v1_resource_pool_t *v1_resource_pool_parseFromJSON(cJSON *v1_resource_poolJSON); + +cJSON *v1_resource_pool_convertToJSON(v1_resource_pool_t *v1_resource_pool); + +#endif /* _v1_resource_pool_H_ */ + diff --git a/kubernetes/model/v1_resource_quota.c b/kubernetes/model/v1_resource_quota.c index 864bc8f3..8e8c6f01 100644 --- a/kubernetes/model/v1_resource_quota.c +++ b/kubernetes/model/v1_resource_quota.c @@ -5,7 +5,7 @@ -v1_resource_quota_t *v1_resource_quota_create( +static v1_resource_quota_t *v1_resource_quota_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_resource_quota_t *v1_resource_quota_create( v1_resource_quota_local_var->spec = spec; v1_resource_quota_local_var->status = status; + v1_resource_quota_local_var->_library_owned = 1; return v1_resource_quota_local_var; } +__attribute__((deprecated)) v1_resource_quota_t *v1_resource_quota_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_quota_spec_t *spec, + v1_resource_quota_status_t *status + ) { + return v1_resource_quota_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_resource_quota_free(v1_resource_quota_t *v1_resource_quota) { if(NULL == v1_resource_quota){ return ; } + if(v1_resource_quota->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_quota_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_quota->api_version) { free(v1_resource_quota->api_version); @@ -134,6 +154,9 @@ v1_resource_quota_t *v1_resource_quota_parseFromJSON(cJSON *v1_resource_quotaJSO // v1_resource_quota->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_resource_quotaJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_resource_quota_t *v1_resource_quota_parseFromJSON(cJSON *v1_resource_quotaJSO // v1_resource_quota->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_resource_quotaJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_resource_quota_t *v1_resource_quota_parseFromJSON(cJSON *v1_resource_quotaJSO // v1_resource_quota->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_quotaJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_resource_quota->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_resource_quotaJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_resource_quota_spec_parseFromJSON(spec); //nonprimitive } // v1_resource_quota->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_resource_quotaJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_resource_quota_status_parseFromJSON(status); //nonprimitive } - v1_resource_quota_local_var = v1_resource_quota_create ( + v1_resource_quota_local_var = v1_resource_quota_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_resource_quota.h b/kubernetes/model/v1_resource_quota.h index b376af7e..87f9553c 100644 --- a/kubernetes/model/v1_resource_quota.h +++ b/kubernetes/model/v1_resource_quota.h @@ -28,9 +28,10 @@ typedef struct v1_resource_quota_t { struct v1_resource_quota_spec_t *spec; //model struct v1_resource_quota_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_quota_t; -v1_resource_quota_t *v1_resource_quota_create( +__attribute__((deprecated)) v1_resource_quota_t *v1_resource_quota_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_resource_quota_list.c b/kubernetes/model/v1_resource_quota_list.c index 5b8dfdee..02aa28dc 100644 --- a/kubernetes/model/v1_resource_quota_list.c +++ b/kubernetes/model/v1_resource_quota_list.c @@ -5,7 +5,7 @@ -v1_resource_quota_list_t *v1_resource_quota_list_create( +static v1_resource_quota_list_t *v1_resource_quota_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_resource_quota_list_t *v1_resource_quota_list_create( v1_resource_quota_list_local_var->kind = kind; v1_resource_quota_list_local_var->metadata = metadata; + v1_resource_quota_list_local_var->_library_owned = 1; return v1_resource_quota_list_local_var; } +__attribute__((deprecated)) v1_resource_quota_list_t *v1_resource_quota_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_resource_quota_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_resource_quota_list_free(v1_resource_quota_list_t *v1_resource_quota_list) { if(NULL == v1_resource_quota_list){ return ; } + if(v1_resource_quota_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_quota_list_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_quota_list->api_version) { free(v1_resource_quota_list->api_version); @@ -123,6 +141,9 @@ v1_resource_quota_list_t *v1_resource_quota_list_parseFromJSON(cJSON *v1_resourc // v1_resource_quota_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_resource_quota_list_t *v1_resource_quota_list_parseFromJSON(cJSON *v1_resourc // v1_resource_quota_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_resource_quota_list_t *v1_resource_quota_list_parseFromJSON(cJSON *v1_resourc // v1_resource_quota_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_resource_quota_list_t *v1_resource_quota_list_parseFromJSON(cJSON *v1_resourc // v1_resource_quota_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_resource_quota_list_local_var = v1_resource_quota_list_create ( + v1_resource_quota_list_local_var = v1_resource_quota_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_resource_quota_list.h b/kubernetes/model/v1_resource_quota_list.h index ca9ec935..f346fb0f 100644 --- a/kubernetes/model/v1_resource_quota_list.h +++ b/kubernetes/model/v1_resource_quota_list.h @@ -26,9 +26,10 @@ typedef struct v1_resource_quota_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_quota_list_t; -v1_resource_quota_list_t *v1_resource_quota_list_create( +__attribute__((deprecated)) v1_resource_quota_list_t *v1_resource_quota_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_resource_quota_spec.c b/kubernetes/model/v1_resource_quota_spec.c index 5424e053..780c4904 100644 --- a/kubernetes/model/v1_resource_quota_spec.c +++ b/kubernetes/model/v1_resource_quota_spec.c @@ -5,7 +5,7 @@ -v1_resource_quota_spec_t *v1_resource_quota_spec_create( +static v1_resource_quota_spec_t *v1_resource_quota_spec_create_internal( list_t* hard, v1_scope_selector_t *scope_selector, list_t *scopes @@ -18,18 +18,34 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_create( v1_resource_quota_spec_local_var->scope_selector = scope_selector; v1_resource_quota_spec_local_var->scopes = scopes; + v1_resource_quota_spec_local_var->_library_owned = 1; return v1_resource_quota_spec_local_var; } +__attribute__((deprecated)) v1_resource_quota_spec_t *v1_resource_quota_spec_create( + list_t* hard, + v1_scope_selector_t *scope_selector, + list_t *scopes + ) { + return v1_resource_quota_spec_create_internal ( + hard, + scope_selector, + scopes + ); +} void v1_resource_quota_spec_free(v1_resource_quota_spec_t *v1_resource_quota_spec) { if(NULL == v1_resource_quota_spec){ return ; } + if(v1_resource_quota_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_quota_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_quota_spec->hard) { list_ForEach(listEntry, v1_resource_quota_spec->hard) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -64,8 +80,8 @@ cJSON *v1_resource_quota_spec_convertToJSON(v1_resource_quota_spec_t *v1_resourc listEntry_t *hardListEntry; if (v1_resource_quota_spec->hard) { list_ForEach(hardListEntry, v1_resource_quota_spec->hard) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)hardListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = hardListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -96,7 +112,7 @@ cJSON *v1_resource_quota_spec_convertToJSON(v1_resource_quota_spec_t *v1_resourc listEntry_t *scopesListEntry; list_ForEach(scopesListEntry, v1_resource_quota_spec->scopes) { - if(cJSON_AddStringToObject(scopes, "", (char*)scopesListEntry->data) == NULL) + if(cJSON_AddStringToObject(scopes, "", scopesListEntry->data) == NULL) { goto fail; } @@ -126,6 +142,9 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc // v1_resource_quota_spec->hard cJSON *hard = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_specJSON, "hard"); + if (cJSON_IsNull(hard)) { + hard = NULL; + } if (hard) { cJSON *hard_local_map = NULL; if(!cJSON_IsObject(hard) && !cJSON_IsNull(hard)) @@ -151,12 +170,18 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc // v1_resource_quota_spec->scope_selector cJSON *scope_selector = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_specJSON, "scopeSelector"); + if (cJSON_IsNull(scope_selector)) { + scope_selector = NULL; + } if (scope_selector) { scope_selector_local_nonprim = v1_scope_selector_parseFromJSON(scope_selector); //nonprimitive } // v1_resource_quota_spec->scopes cJSON *scopes = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_specJSON, "scopes"); + if (cJSON_IsNull(scopes)) { + scopes = NULL; + } if (scopes) { cJSON *scopes_local = NULL; if(!cJSON_IsArray(scopes)) { @@ -175,7 +200,7 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc } - v1_resource_quota_spec_local_var = v1_resource_quota_spec_create ( + v1_resource_quota_spec_local_var = v1_resource_quota_spec_create_internal ( hard ? hardList : NULL, scope_selector ? scope_selector_local_nonprim : NULL, scopes ? scopesList : NULL @@ -186,7 +211,7 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc if (hardList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, hardList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_resource_quota_spec.h b/kubernetes/model/v1_resource_quota_spec.h index ee0aace7..b01ade5c 100644 --- a/kubernetes/model/v1_resource_quota_spec.h +++ b/kubernetes/model/v1_resource_quota_spec.h @@ -24,9 +24,10 @@ typedef struct v1_resource_quota_spec_t { struct v1_scope_selector_t *scope_selector; //model list_t *scopes; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_quota_spec_t; -v1_resource_quota_spec_t *v1_resource_quota_spec_create( +__attribute__((deprecated)) v1_resource_quota_spec_t *v1_resource_quota_spec_create( list_t* hard, v1_scope_selector_t *scope_selector, list_t *scopes diff --git a/kubernetes/model/v1_resource_quota_status.c b/kubernetes/model/v1_resource_quota_status.c index 66fe7e6e..dd00d711 100644 --- a/kubernetes/model/v1_resource_quota_status.c +++ b/kubernetes/model/v1_resource_quota_status.c @@ -5,7 +5,7 @@ -v1_resource_quota_status_t *v1_resource_quota_status_create( +static v1_resource_quota_status_t *v1_resource_quota_status_create_internal( list_t* hard, list_t* used ) { @@ -16,18 +16,32 @@ v1_resource_quota_status_t *v1_resource_quota_status_create( v1_resource_quota_status_local_var->hard = hard; v1_resource_quota_status_local_var->used = used; + v1_resource_quota_status_local_var->_library_owned = 1; return v1_resource_quota_status_local_var; } +__attribute__((deprecated)) v1_resource_quota_status_t *v1_resource_quota_status_create( + list_t* hard, + list_t* used + ) { + return v1_resource_quota_status_create_internal ( + hard, + used + ); +} void v1_resource_quota_status_free(v1_resource_quota_status_t *v1_resource_quota_status) { if(NULL == v1_resource_quota_status){ return ; } + if(v1_resource_quota_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_quota_status_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_quota_status->hard) { list_ForEach(listEntry, v1_resource_quota_status->hard) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -37,7 +51,7 @@ void v1_resource_quota_status_free(v1_resource_quota_status_t *v1_resource_quota } if (v1_resource_quota_status->used) { list_ForEach(listEntry, v1_resource_quota_status->used) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -61,8 +75,8 @@ cJSON *v1_resource_quota_status_convertToJSON(v1_resource_quota_status_t *v1_res listEntry_t *hardListEntry; if (v1_resource_quota_status->hard) { list_ForEach(hardListEntry, v1_resource_quota_status->hard) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)hardListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = hardListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -81,8 +95,8 @@ cJSON *v1_resource_quota_status_convertToJSON(v1_resource_quota_status_t *v1_res listEntry_t *usedListEntry; if (v1_resource_quota_status->used) { list_ForEach(usedListEntry, v1_resource_quota_status->used) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)usedListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = usedListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -110,6 +124,9 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res // v1_resource_quota_status->hard cJSON *hard = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_statusJSON, "hard"); + if (cJSON_IsNull(hard)) { + hard = NULL; + } if (hard) { cJSON *hard_local_map = NULL; if(!cJSON_IsObject(hard) && !cJSON_IsNull(hard)) @@ -135,6 +152,9 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res // v1_resource_quota_status->used cJSON *used = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_statusJSON, "used"); + if (cJSON_IsNull(used)) { + used = NULL; + } if (used) { cJSON *used_local_map = NULL; if(!cJSON_IsObject(used) && !cJSON_IsNull(used)) @@ -159,7 +179,7 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res } - v1_resource_quota_status_local_var = v1_resource_quota_status_create ( + v1_resource_quota_status_local_var = v1_resource_quota_status_create_internal ( hard ? hardList : NULL, used ? usedList : NULL ); @@ -169,7 +189,7 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res if (hardList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, hardList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -183,7 +203,7 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res if (usedList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, usedList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_resource_quota_status.h b/kubernetes/model/v1_resource_quota_status.h index c0ce5b3b..c995931b 100644 --- a/kubernetes/model/v1_resource_quota_status.h +++ b/kubernetes/model/v1_resource_quota_status.h @@ -22,9 +22,10 @@ typedef struct v1_resource_quota_status_t { list_t* hard; //map list_t* used; //map + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_quota_status_t; -v1_resource_quota_status_t *v1_resource_quota_status_create( +__attribute__((deprecated)) v1_resource_quota_status_t *v1_resource_quota_status_create( list_t* hard, list_t* used ); diff --git a/kubernetes/model/v1_resource_requirements.c b/kubernetes/model/v1_resource_requirements.c index f02893ee..4f3d328d 100644 --- a/kubernetes/model/v1_resource_requirements.c +++ b/kubernetes/model/v1_resource_requirements.c @@ -5,7 +5,7 @@ -v1_resource_requirements_t *v1_resource_requirements_create( +static v1_resource_requirements_t *v1_resource_requirements_create_internal( list_t *claims, list_t* limits, list_t* requests @@ -18,25 +18,41 @@ v1_resource_requirements_t *v1_resource_requirements_create( v1_resource_requirements_local_var->limits = limits; v1_resource_requirements_local_var->requests = requests; + v1_resource_requirements_local_var->_library_owned = 1; return v1_resource_requirements_local_var; } +__attribute__((deprecated)) v1_resource_requirements_t *v1_resource_requirements_create( + list_t *claims, + list_t* limits, + list_t* requests + ) { + return v1_resource_requirements_create_internal ( + claims, + limits, + requests + ); +} void v1_resource_requirements_free(v1_resource_requirements_t *v1_resource_requirements) { if(NULL == v1_resource_requirements){ return ; } + if(v1_resource_requirements->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_requirements_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_requirements->claims) { list_ForEach(listEntry, v1_resource_requirements->claims) { - v1_resource_claim_free(listEntry->data); + core_v1_resource_claim_free(listEntry->data); } list_freeList(v1_resource_requirements->claims); v1_resource_requirements->claims = NULL; } if (v1_resource_requirements->limits) { list_ForEach(listEntry, v1_resource_requirements->limits) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -46,7 +62,7 @@ void v1_resource_requirements_free(v1_resource_requirements_t *v1_resource_requi } if (v1_resource_requirements->requests) { list_ForEach(listEntry, v1_resource_requirements->requests) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -70,7 +86,7 @@ cJSON *v1_resource_requirements_convertToJSON(v1_resource_requirements_t *v1_res listEntry_t *claimsListEntry; if (v1_resource_requirements->claims) { list_ForEach(claimsListEntry, v1_resource_requirements->claims) { - cJSON *itemLocal = v1_resource_claim_convertToJSON(claimsListEntry->data); + cJSON *itemLocal = core_v1_resource_claim_convertToJSON(claimsListEntry->data); if(itemLocal == NULL) { goto fail; } @@ -90,8 +106,8 @@ cJSON *v1_resource_requirements_convertToJSON(v1_resource_requirements_t *v1_res listEntry_t *limitsListEntry; if (v1_resource_requirements->limits) { list_ForEach(limitsListEntry, v1_resource_requirements->limits) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)limitsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = limitsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -110,8 +126,8 @@ cJSON *v1_resource_requirements_convertToJSON(v1_resource_requirements_t *v1_res listEntry_t *requestsListEntry; if (v1_resource_requirements->requests) { list_ForEach(requestsListEntry, v1_resource_requirements->requests) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)requestsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = requestsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -142,6 +158,9 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res // v1_resource_requirements->claims cJSON *claims = cJSON_GetObjectItemCaseSensitive(v1_resource_requirementsJSON, "claims"); + if (cJSON_IsNull(claims)) { + claims = NULL; + } if (claims) { cJSON *claims_local_nonprimitive = NULL; if(!cJSON_IsArray(claims)){ @@ -155,7 +174,7 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res if(!cJSON_IsObject(claims_local_nonprimitive)){ goto end; } - v1_resource_claim_t *claimsItem = v1_resource_claim_parseFromJSON(claims_local_nonprimitive); + core_v1_resource_claim_t *claimsItem = core_v1_resource_claim_parseFromJSON(claims_local_nonprimitive); list_addElement(claimsList, claimsItem); } @@ -163,6 +182,9 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res // v1_resource_requirements->limits cJSON *limits = cJSON_GetObjectItemCaseSensitive(v1_resource_requirementsJSON, "limits"); + if (cJSON_IsNull(limits)) { + limits = NULL; + } if (limits) { cJSON *limits_local_map = NULL; if(!cJSON_IsObject(limits) && !cJSON_IsNull(limits)) @@ -188,6 +210,9 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res // v1_resource_requirements->requests cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_resource_requirementsJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } if (requests) { cJSON *requests_local_map = NULL; if(!cJSON_IsObject(requests) && !cJSON_IsNull(requests)) @@ -212,7 +237,7 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res } - v1_resource_requirements_local_var = v1_resource_requirements_create ( + v1_resource_requirements_local_var = v1_resource_requirements_create_internal ( claims ? claimsList : NULL, limits ? limitsList : NULL, requests ? requestsList : NULL @@ -223,7 +248,7 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res if (claimsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, claimsList) { - v1_resource_claim_free(listEntry->data); + core_v1_resource_claim_free(listEntry->data); listEntry->data = NULL; } list_freeList(claimsList); @@ -232,7 +257,7 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res if (limitsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, limitsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -246,7 +271,7 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res if (requestsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, requestsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_resource_requirements.h b/kubernetes/model/v1_resource_requirements.h index eeb17bf2..edfb5866 100644 --- a/kubernetes/model/v1_resource_requirements.h +++ b/kubernetes/model/v1_resource_requirements.h @@ -15,7 +15,7 @@ typedef struct v1_resource_requirements_t v1_resource_requirements_t; -#include "v1_resource_claim.h" +#include "core_v1_resource_claim.h" @@ -24,9 +24,10 @@ typedef struct v1_resource_requirements_t { list_t* limits; //map list_t* requests; //map + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_requirements_t; -v1_resource_requirements_t *v1_resource_requirements_create( +__attribute__((deprecated)) v1_resource_requirements_t *v1_resource_requirements_create( list_t *claims, list_t* limits, list_t* requests diff --git a/kubernetes/model/v1_resource_rule.c b/kubernetes/model/v1_resource_rule.c index 5b95e8b1..e12b0672 100644 --- a/kubernetes/model/v1_resource_rule.c +++ b/kubernetes/model/v1_resource_rule.c @@ -5,7 +5,7 @@ -v1_resource_rule_t *v1_resource_rule_create( +static v1_resource_rule_t *v1_resource_rule_create_internal( list_t *api_groups, list_t *resource_names, list_t *resources, @@ -20,14 +20,32 @@ v1_resource_rule_t *v1_resource_rule_create( v1_resource_rule_local_var->resources = resources; v1_resource_rule_local_var->verbs = verbs; + v1_resource_rule_local_var->_library_owned = 1; return v1_resource_rule_local_var; } +__attribute__((deprecated)) v1_resource_rule_t *v1_resource_rule_create( + list_t *api_groups, + list_t *resource_names, + list_t *resources, + list_t *verbs + ) { + return v1_resource_rule_create_internal ( + api_groups, + resource_names, + resources, + verbs + ); +} void v1_resource_rule_free(v1_resource_rule_t *v1_resource_rule) { if(NULL == v1_resource_rule){ return ; } + if(v1_resource_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_resource_rule->api_groups) { list_ForEach(listEntry, v1_resource_rule->api_groups) { @@ -72,7 +90,7 @@ cJSON *v1_resource_rule_convertToJSON(v1_resource_rule_t *v1_resource_rule) { listEntry_t *api_groupsListEntry; list_ForEach(api_groupsListEntry, v1_resource_rule->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_groups, "", api_groupsListEntry->data) == NULL) { goto fail; } @@ -89,7 +107,7 @@ cJSON *v1_resource_rule_convertToJSON(v1_resource_rule_t *v1_resource_rule) { listEntry_t *resource_namesListEntry; list_ForEach(resource_namesListEntry, v1_resource_rule->resource_names) { - if(cJSON_AddStringToObject(resource_names, "", (char*)resource_namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resource_names, "", resource_namesListEntry->data) == NULL) { goto fail; } @@ -106,7 +124,7 @@ cJSON *v1_resource_rule_convertToJSON(v1_resource_rule_t *v1_resource_rule) { listEntry_t *resourcesListEntry; list_ForEach(resourcesListEntry, v1_resource_rule->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resources, "", resourcesListEntry->data) == NULL) { goto fail; } @@ -125,7 +143,7 @@ cJSON *v1_resource_rule_convertToJSON(v1_resource_rule_t *v1_resource_rule) { listEntry_t *verbsListEntry; list_ForEach(verbsListEntry, v1_resource_rule->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) + if(cJSON_AddStringToObject(verbs, "", verbsListEntry->data) == NULL) { goto fail; } @@ -157,6 +175,9 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ // v1_resource_rule->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_resource_ruleJSON, "apiGroups"); + if (cJSON_IsNull(api_groups)) { + api_groups = NULL; + } if (api_groups) { cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { @@ -176,6 +197,9 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ // v1_resource_rule->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1_resource_ruleJSON, "resourceNames"); + if (cJSON_IsNull(resource_names)) { + resource_names = NULL; + } if (resource_names) { cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { @@ -195,6 +219,9 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ // v1_resource_rule->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_resource_ruleJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { @@ -214,6 +241,9 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ // v1_resource_rule->verbs cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1_resource_ruleJSON, "verbs"); + if (cJSON_IsNull(verbs)) { + verbs = NULL; + } if (!verbs) { goto end; } @@ -235,7 +265,7 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ } - v1_resource_rule_local_var = v1_resource_rule_create ( + v1_resource_rule_local_var = v1_resource_rule_create_internal ( api_groups ? api_groupsList : NULL, resource_names ? resource_namesList : NULL, resources ? resourcesList : NULL, diff --git a/kubernetes/model/v1_resource_rule.h b/kubernetes/model/v1_resource_rule.h index 3f3725e8..c81f6361 100644 --- a/kubernetes/model/v1_resource_rule.h +++ b/kubernetes/model/v1_resource_rule.h @@ -24,9 +24,10 @@ typedef struct v1_resource_rule_t { list_t *resources; //primitive container list_t *verbs; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_resource_rule_t; -v1_resource_rule_t *v1_resource_rule_create( +__attribute__((deprecated)) v1_resource_rule_t *v1_resource_rule_create( list_t *api_groups, list_t *resource_names, list_t *resources, diff --git a/kubernetes/model/v1_resource_slice.c b/kubernetes/model/v1_resource_slice.c new file mode 100644 index 00000000..393b8a48 --- /dev/null +++ b/kubernetes/model/v1_resource_slice.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1_resource_slice.h" + + + +static v1_resource_slice_t *v1_resource_slice_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_slice_spec_t *spec + ) { + v1_resource_slice_t *v1_resource_slice_local_var = malloc(sizeof(v1_resource_slice_t)); + if (!v1_resource_slice_local_var) { + return NULL; + } + v1_resource_slice_local_var->api_version = api_version; + v1_resource_slice_local_var->kind = kind; + v1_resource_slice_local_var->metadata = metadata; + v1_resource_slice_local_var->spec = spec; + + v1_resource_slice_local_var->_library_owned = 1; + return v1_resource_slice_local_var; +} + +__attribute__((deprecated)) v1_resource_slice_t *v1_resource_slice_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_slice_spec_t *spec + ) { + return v1_resource_slice_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1_resource_slice_free(v1_resource_slice_t *v1_resource_slice) { + if(NULL == v1_resource_slice){ + return ; + } + if(v1_resource_slice->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_slice_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_slice->api_version) { + free(v1_resource_slice->api_version); + v1_resource_slice->api_version = NULL; + } + if (v1_resource_slice->kind) { + free(v1_resource_slice->kind); + v1_resource_slice->kind = NULL; + } + if (v1_resource_slice->metadata) { + v1_object_meta_free(v1_resource_slice->metadata); + v1_resource_slice->metadata = NULL; + } + if (v1_resource_slice->spec) { + v1_resource_slice_spec_free(v1_resource_slice->spec); + v1_resource_slice->spec = NULL; + } + free(v1_resource_slice); +} + +cJSON *v1_resource_slice_convertToJSON(v1_resource_slice_t *v1_resource_slice) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_slice->api_version + if(v1_resource_slice->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_resource_slice->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_resource_slice->kind + if(v1_resource_slice->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_resource_slice->kind) == NULL) { + goto fail; //String + } + } + + + // v1_resource_slice->metadata + if(v1_resource_slice->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1_resource_slice->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_resource_slice->spec + if (!v1_resource_slice->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1_resource_slice_spec_convertToJSON(v1_resource_slice->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_slice_t *v1_resource_slice_parseFromJSON(cJSON *v1_resource_sliceJSON){ + + v1_resource_slice_t *v1_resource_slice_local_var = NULL; + + // define the local variable for v1_resource_slice->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1_resource_slice->spec + v1_resource_slice_spec_t *spec_local_nonprim = NULL; + + // v1_resource_slice->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_resource_sliceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_resource_slice->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_resource_sliceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_resource_slice->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_sliceJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1_resource_slice->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_resource_sliceJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1_resource_slice_spec_parseFromJSON(spec); //nonprimitive + + + v1_resource_slice_local_var = v1_resource_slice_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1_resource_slice_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1_resource_slice_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_slice.h b/kubernetes/model/v1_resource_slice.h new file mode 100644 index 00000000..0fe2da4d --- /dev/null +++ b/kubernetes/model/v1_resource_slice.h @@ -0,0 +1,46 @@ +/* + * v1_resource_slice.h + * + * ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver. At the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple <driver name>, <pool name>, <device name>. Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others. When allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool. For resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1_resource_slice_H_ +#define _v1_resource_slice_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_slice_t v1_resource_slice_t; + +#include "v1_object_meta.h" +#include "v1_resource_slice_spec.h" + + + +typedef struct v1_resource_slice_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1_resource_slice_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_slice_t; + +__attribute__((deprecated)) v1_resource_slice_t *v1_resource_slice_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_resource_slice_spec_t *spec +); + +void v1_resource_slice_free(v1_resource_slice_t *v1_resource_slice); + +v1_resource_slice_t *v1_resource_slice_parseFromJSON(cJSON *v1_resource_sliceJSON); + +cJSON *v1_resource_slice_convertToJSON(v1_resource_slice_t *v1_resource_slice); + +#endif /* _v1_resource_slice_H_ */ + diff --git a/kubernetes/model/v1_resource_slice_list.c b/kubernetes/model/v1_resource_slice_list.c new file mode 100644 index 00000000..e94d9aa0 --- /dev/null +++ b/kubernetes/model/v1_resource_slice_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1_resource_slice_list.h" + + + +static v1_resource_slice_list_t *v1_resource_slice_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1_resource_slice_list_t *v1_resource_slice_list_local_var = malloc(sizeof(v1_resource_slice_list_t)); + if (!v1_resource_slice_list_local_var) { + return NULL; + } + v1_resource_slice_list_local_var->api_version = api_version; + v1_resource_slice_list_local_var->items = items; + v1_resource_slice_list_local_var->kind = kind; + v1_resource_slice_list_local_var->metadata = metadata; + + v1_resource_slice_list_local_var->_library_owned = 1; + return v1_resource_slice_list_local_var; +} + +__attribute__((deprecated)) v1_resource_slice_list_t *v1_resource_slice_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_resource_slice_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1_resource_slice_list_free(v1_resource_slice_list_t *v1_resource_slice_list) { + if(NULL == v1_resource_slice_list){ + return ; + } + if(v1_resource_slice_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_slice_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_slice_list->api_version) { + free(v1_resource_slice_list->api_version); + v1_resource_slice_list->api_version = NULL; + } + if (v1_resource_slice_list->items) { + list_ForEach(listEntry, v1_resource_slice_list->items) { + v1_resource_slice_free(listEntry->data); + } + list_freeList(v1_resource_slice_list->items); + v1_resource_slice_list->items = NULL; + } + if (v1_resource_slice_list->kind) { + free(v1_resource_slice_list->kind); + v1_resource_slice_list->kind = NULL; + } + if (v1_resource_slice_list->metadata) { + v1_list_meta_free(v1_resource_slice_list->metadata); + v1_resource_slice_list->metadata = NULL; + } + free(v1_resource_slice_list); +} + +cJSON *v1_resource_slice_list_convertToJSON(v1_resource_slice_list_t *v1_resource_slice_list) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_slice_list->api_version + if(v1_resource_slice_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_resource_slice_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_resource_slice_list->items + if (!v1_resource_slice_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1_resource_slice_list->items) { + list_ForEach(itemsListEntry, v1_resource_slice_list->items) { + cJSON *itemLocal = v1_resource_slice_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1_resource_slice_list->kind + if(v1_resource_slice_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_resource_slice_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1_resource_slice_list->metadata + if(v1_resource_slice_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1_resource_slice_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_slice_list_t *v1_resource_slice_list_parseFromJSON(cJSON *v1_resource_slice_listJSON){ + + v1_resource_slice_list_t *v1_resource_slice_list_local_var = NULL; + + // define the local list for v1_resource_slice_list->items + list_t *itemsList = NULL; + + // define the local variable for v1_resource_slice_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1_resource_slice_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_resource_slice_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1_resource_slice_t *itemsItem = v1_resource_slice_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1_resource_slice_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_resource_slice_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1_resource_slice_list_local_var = v1_resource_slice_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1_resource_slice_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_resource_slice_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_slice_list.h b/kubernetes/model/v1_resource_slice_list.h new file mode 100644 index 00000000..f2d946db --- /dev/null +++ b/kubernetes/model/v1_resource_slice_list.h @@ -0,0 +1,46 @@ +/* + * v1_resource_slice_list.h + * + * ResourceSliceList is a collection of ResourceSlices. + */ + +#ifndef _v1_resource_slice_list_H_ +#define _v1_resource_slice_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_slice_list_t v1_resource_slice_list_t; + +#include "v1_list_meta.h" +#include "v1_resource_slice.h" + + + +typedef struct v1_resource_slice_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_slice_list_t; + +__attribute__((deprecated)) v1_resource_slice_list_t *v1_resource_slice_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1_resource_slice_list_free(v1_resource_slice_list_t *v1_resource_slice_list); + +v1_resource_slice_list_t *v1_resource_slice_list_parseFromJSON(cJSON *v1_resource_slice_listJSON); + +cJSON *v1_resource_slice_list_convertToJSON(v1_resource_slice_list_t *v1_resource_slice_list); + +#endif /* _v1_resource_slice_list_H_ */ + diff --git a/kubernetes/model/v1_resource_slice_spec.c b/kubernetes/model/v1_resource_slice_spec.c new file mode 100644 index 00000000..c44f1b53 --- /dev/null +++ b/kubernetes/model/v1_resource_slice_spec.c @@ -0,0 +1,387 @@ +#include +#include +#include +#include "v1_resource_slice_spec.h" + + + +static v1_resource_slice_spec_t *v1_resource_slice_spec_create_internal( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1_resource_pool_t *pool, + list_t *shared_counters + ) { + v1_resource_slice_spec_t *v1_resource_slice_spec_local_var = malloc(sizeof(v1_resource_slice_spec_t)); + if (!v1_resource_slice_spec_local_var) { + return NULL; + } + v1_resource_slice_spec_local_var->all_nodes = all_nodes; + v1_resource_slice_spec_local_var->devices = devices; + v1_resource_slice_spec_local_var->driver = driver; + v1_resource_slice_spec_local_var->node_name = node_name; + v1_resource_slice_spec_local_var->node_selector = node_selector; + v1_resource_slice_spec_local_var->per_device_node_selection = per_device_node_selection; + v1_resource_slice_spec_local_var->pool = pool; + v1_resource_slice_spec_local_var->shared_counters = shared_counters; + + v1_resource_slice_spec_local_var->_library_owned = 1; + return v1_resource_slice_spec_local_var; +} + +__attribute__((deprecated)) v1_resource_slice_spec_t *v1_resource_slice_spec_create( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1_resource_pool_t *pool, + list_t *shared_counters + ) { + return v1_resource_slice_spec_create_internal ( + all_nodes, + devices, + driver, + node_name, + node_selector, + per_device_node_selection, + pool, + shared_counters + ); +} + +void v1_resource_slice_spec_free(v1_resource_slice_spec_t *v1_resource_slice_spec) { + if(NULL == v1_resource_slice_spec){ + return ; + } + if(v1_resource_slice_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_slice_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_slice_spec->devices) { + list_ForEach(listEntry, v1_resource_slice_spec->devices) { + v1_device_free(listEntry->data); + } + list_freeList(v1_resource_slice_spec->devices); + v1_resource_slice_spec->devices = NULL; + } + if (v1_resource_slice_spec->driver) { + free(v1_resource_slice_spec->driver); + v1_resource_slice_spec->driver = NULL; + } + if (v1_resource_slice_spec->node_name) { + free(v1_resource_slice_spec->node_name); + v1_resource_slice_spec->node_name = NULL; + } + if (v1_resource_slice_spec->node_selector) { + v1_node_selector_free(v1_resource_slice_spec->node_selector); + v1_resource_slice_spec->node_selector = NULL; + } + if (v1_resource_slice_spec->pool) { + v1_resource_pool_free(v1_resource_slice_spec->pool); + v1_resource_slice_spec->pool = NULL; + } + if (v1_resource_slice_spec->shared_counters) { + list_ForEach(listEntry, v1_resource_slice_spec->shared_counters) { + v1_counter_set_free(listEntry->data); + } + list_freeList(v1_resource_slice_spec->shared_counters); + v1_resource_slice_spec->shared_counters = NULL; + } + free(v1_resource_slice_spec); +} + +cJSON *v1_resource_slice_spec_convertToJSON(v1_resource_slice_spec_t *v1_resource_slice_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_slice_spec->all_nodes + if(v1_resource_slice_spec->all_nodes) { + if(cJSON_AddBoolToObject(item, "allNodes", v1_resource_slice_spec->all_nodes) == NULL) { + goto fail; //Bool + } + } + + + // v1_resource_slice_spec->devices + if(v1_resource_slice_spec->devices) { + cJSON *devices = cJSON_AddArrayToObject(item, "devices"); + if(devices == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *devicesListEntry; + if (v1_resource_slice_spec->devices) { + list_ForEach(devicesListEntry, v1_resource_slice_spec->devices) { + cJSON *itemLocal = v1_device_convertToJSON(devicesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(devices, itemLocal); + } + } + } + + + // v1_resource_slice_spec->driver + if (!v1_resource_slice_spec->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1_resource_slice_spec->driver) == NULL) { + goto fail; //String + } + + + // v1_resource_slice_spec->node_name + if(v1_resource_slice_spec->node_name) { + if(cJSON_AddStringToObject(item, "nodeName", v1_resource_slice_spec->node_name) == NULL) { + goto fail; //String + } + } + + + // v1_resource_slice_spec->node_selector + if(v1_resource_slice_spec->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1_resource_slice_spec->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_resource_slice_spec->per_device_node_selection + if(v1_resource_slice_spec->per_device_node_selection) { + if(cJSON_AddBoolToObject(item, "perDeviceNodeSelection", v1_resource_slice_spec->per_device_node_selection) == NULL) { + goto fail; //Bool + } + } + + + // v1_resource_slice_spec->pool + if (!v1_resource_slice_spec->pool) { + goto fail; + } + cJSON *pool_local_JSON = v1_resource_pool_convertToJSON(v1_resource_slice_spec->pool); + if(pool_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "pool", pool_local_JSON); + if(item->child == NULL) { + goto fail; + } + + + // v1_resource_slice_spec->shared_counters + if(v1_resource_slice_spec->shared_counters) { + cJSON *shared_counters = cJSON_AddArrayToObject(item, "sharedCounters"); + if(shared_counters == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *shared_countersListEntry; + if (v1_resource_slice_spec->shared_counters) { + list_ForEach(shared_countersListEntry, v1_resource_slice_spec->shared_counters) { + cJSON *itemLocal = v1_counter_set_convertToJSON(shared_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(shared_counters, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_slice_spec_t *v1_resource_slice_spec_parseFromJSON(cJSON *v1_resource_slice_specJSON){ + + v1_resource_slice_spec_t *v1_resource_slice_spec_local_var = NULL; + + // define the local list for v1_resource_slice_spec->devices + list_t *devicesList = NULL; + + // define the local variable for v1_resource_slice_spec->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // define the local variable for v1_resource_slice_spec->pool + v1_resource_pool_t *pool_local_nonprim = NULL; + + // define the local list for v1_resource_slice_spec->shared_counters + list_t *shared_countersList = NULL; + + // v1_resource_slice_spec->all_nodes + cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "allNodes"); + if (cJSON_IsNull(all_nodes)) { + all_nodes = NULL; + } + if (all_nodes) { + if(!cJSON_IsBool(all_nodes)) + { + goto end; //Bool + } + } + + // v1_resource_slice_spec->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + cJSON *devices_local_nonprimitive = NULL; + if(!cJSON_IsArray(devices)){ + goto end; //nonprimitive container + } + + devicesList = list_createList(); + + cJSON_ArrayForEach(devices_local_nonprimitive,devices ) + { + if(!cJSON_IsObject(devices_local_nonprimitive)){ + goto end; + } + v1_device_t *devicesItem = v1_device_parseFromJSON(devices_local_nonprimitive); + + list_addElement(devicesList, devicesItem); + } + } + + // v1_resource_slice_spec->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1_resource_slice_spec->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } + if (node_name) { + if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) + { + goto end; //String + } + } + + // v1_resource_slice_spec->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + // v1_resource_slice_spec->per_device_node_selection + cJSON *per_device_node_selection = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "perDeviceNodeSelection"); + if (cJSON_IsNull(per_device_node_selection)) { + per_device_node_selection = NULL; + } + if (per_device_node_selection) { + if(!cJSON_IsBool(per_device_node_selection)) + { + goto end; //Bool + } + } + + // v1_resource_slice_spec->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + pool_local_nonprim = v1_resource_pool_parseFromJSON(pool); //nonprimitive + + // v1_resource_slice_spec->shared_counters + cJSON *shared_counters = cJSON_GetObjectItemCaseSensitive(v1_resource_slice_specJSON, "sharedCounters"); + if (cJSON_IsNull(shared_counters)) { + shared_counters = NULL; + } + if (shared_counters) { + cJSON *shared_counters_local_nonprimitive = NULL; + if(!cJSON_IsArray(shared_counters)){ + goto end; //nonprimitive container + } + + shared_countersList = list_createList(); + + cJSON_ArrayForEach(shared_counters_local_nonprimitive,shared_counters ) + { + if(!cJSON_IsObject(shared_counters_local_nonprimitive)){ + goto end; + } + v1_counter_set_t *shared_countersItem = v1_counter_set_parseFromJSON(shared_counters_local_nonprimitive); + + list_addElement(shared_countersList, shared_countersItem); + } + } + + + v1_resource_slice_spec_local_var = v1_resource_slice_spec_create_internal ( + all_nodes ? all_nodes->valueint : 0, + devices ? devicesList : NULL, + strdup(driver->valuestring), + node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, + node_selector ? node_selector_local_nonprim : NULL, + per_device_node_selection ? per_device_node_selection->valueint : 0, + pool_local_nonprim, + shared_counters ? shared_countersList : NULL + ); + + return v1_resource_slice_spec_local_var; +end: + if (devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, devicesList) { + v1_device_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(devicesList); + devicesList = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + if (pool_local_nonprim) { + v1_resource_pool_free(pool_local_nonprim); + pool_local_nonprim = NULL; + } + if (shared_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, shared_countersList) { + v1_counter_set_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(shared_countersList); + shared_countersList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_slice_spec.h b/kubernetes/model/v1_resource_slice_spec.h new file mode 100644 index 00000000..50c7d214 --- /dev/null +++ b/kubernetes/model/v1_resource_slice_spec.h @@ -0,0 +1,56 @@ +/* + * v1_resource_slice_spec.h + * + * ResourceSliceSpec contains the information published by the driver in one ResourceSlice. + */ + +#ifndef _v1_resource_slice_spec_H_ +#define _v1_resource_slice_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_slice_spec_t v1_resource_slice_spec_t; + +#include "v1_counter_set.h" +#include "v1_device.h" +#include "v1_node_selector.h" +#include "v1_resource_pool.h" + + + +typedef struct v1_resource_slice_spec_t { + int all_nodes; //boolean + list_t *devices; //nonprimitive container + char *driver; // string + char *node_name; // string + struct v1_node_selector_t *node_selector; //model + int per_device_node_selection; //boolean + struct v1_resource_pool_t *pool; //model + list_t *shared_counters; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_slice_spec_t; + +__attribute__((deprecated)) v1_resource_slice_spec_t *v1_resource_slice_spec_create( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1_resource_pool_t *pool, + list_t *shared_counters +); + +void v1_resource_slice_spec_free(v1_resource_slice_spec_t *v1_resource_slice_spec); + +v1_resource_slice_spec_t *v1_resource_slice_spec_parseFromJSON(cJSON *v1_resource_slice_specJSON); + +cJSON *v1_resource_slice_spec_convertToJSON(v1_resource_slice_spec_t *v1_resource_slice_spec); + +#endif /* _v1_resource_slice_spec_H_ */ + diff --git a/kubernetes/model/v1_resource_status.c b/kubernetes/model/v1_resource_status.c new file mode 100644 index 00000000..3d3e8e38 --- /dev/null +++ b/kubernetes/model/v1_resource_status.c @@ -0,0 +1,160 @@ +#include +#include +#include +#include "v1_resource_status.h" + + + +static v1_resource_status_t *v1_resource_status_create_internal( + char *name, + list_t *resources + ) { + v1_resource_status_t *v1_resource_status_local_var = malloc(sizeof(v1_resource_status_t)); + if (!v1_resource_status_local_var) { + return NULL; + } + v1_resource_status_local_var->name = name; + v1_resource_status_local_var->resources = resources; + + v1_resource_status_local_var->_library_owned = 1; + return v1_resource_status_local_var; +} + +__attribute__((deprecated)) v1_resource_status_t *v1_resource_status_create( + char *name, + list_t *resources + ) { + return v1_resource_status_create_internal ( + name, + resources + ); +} + +void v1_resource_status_free(v1_resource_status_t *v1_resource_status) { + if(NULL == v1_resource_status){ + return ; + } + if(v1_resource_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_resource_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1_resource_status->name) { + free(v1_resource_status->name); + v1_resource_status->name = NULL; + } + if (v1_resource_status->resources) { + list_ForEach(listEntry, v1_resource_status->resources) { + v1_resource_health_free(listEntry->data); + } + list_freeList(v1_resource_status->resources); + v1_resource_status->resources = NULL; + } + free(v1_resource_status); +} + +cJSON *v1_resource_status_convertToJSON(v1_resource_status_t *v1_resource_status) { + cJSON *item = cJSON_CreateObject(); + + // v1_resource_status->name + if (!v1_resource_status->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1_resource_status->name) == NULL) { + goto fail; //String + } + + + // v1_resource_status->resources + if(v1_resource_status->resources) { + cJSON *resources = cJSON_AddArrayToObject(item, "resources"); + if(resources == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *resourcesListEntry; + if (v1_resource_status->resources) { + list_ForEach(resourcesListEntry, v1_resource_status->resources) { + cJSON *itemLocal = v1_resource_health_convertToJSON(resourcesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(resources, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_resource_status_t *v1_resource_status_parseFromJSON(cJSON *v1_resource_statusJSON){ + + v1_resource_status_t *v1_resource_status_local_var = NULL; + + // define the local list for v1_resource_status->resources + list_t *resourcesList = NULL; + + // v1_resource_status->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_resource_statusJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1_resource_status->resources + cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_resource_statusJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } + if (resources) { + cJSON *resources_local_nonprimitive = NULL; + if(!cJSON_IsArray(resources)){ + goto end; //nonprimitive container + } + + resourcesList = list_createList(); + + cJSON_ArrayForEach(resources_local_nonprimitive,resources ) + { + if(!cJSON_IsObject(resources_local_nonprimitive)){ + goto end; + } + v1_resource_health_t *resourcesItem = v1_resource_health_parseFromJSON(resources_local_nonprimitive); + + list_addElement(resourcesList, resourcesItem); + } + } + + + v1_resource_status_local_var = v1_resource_status_create_internal ( + strdup(name->valuestring), + resources ? resourcesList : NULL + ); + + return v1_resource_status_local_var; +end: + if (resourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resourcesList) { + v1_resource_health_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resourcesList); + resourcesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_resource_status.h b/kubernetes/model/v1_resource_status.h new file mode 100644 index 00000000..bc8c7b75 --- /dev/null +++ b/kubernetes/model/v1_resource_status.h @@ -0,0 +1,41 @@ +/* + * v1_resource_status.h + * + * ResourceStatus represents the status of a single resource allocated to a Pod. + */ + +#ifndef _v1_resource_status_H_ +#define _v1_resource_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_resource_status_t v1_resource_status_t; + +#include "v1_resource_health.h" + + + +typedef struct v1_resource_status_t { + char *name; // string + list_t *resources; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_resource_status_t; + +__attribute__((deprecated)) v1_resource_status_t *v1_resource_status_create( + char *name, + list_t *resources +); + +void v1_resource_status_free(v1_resource_status_t *v1_resource_status); + +v1_resource_status_t *v1_resource_status_parseFromJSON(cJSON *v1_resource_statusJSON); + +cJSON *v1_resource_status_convertToJSON(v1_resource_status_t *v1_resource_status); + +#endif /* _v1_resource_status_H_ */ + diff --git a/kubernetes/model/v1_role.c b/kubernetes/model/v1_role.c index aeaa7de1..7a486b95 100644 --- a/kubernetes/model/v1_role.c +++ b/kubernetes/model/v1_role.c @@ -5,7 +5,7 @@ -v1_role_t *v1_role_create( +static v1_role_t *v1_role_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_role_t *v1_role_create( v1_role_local_var->metadata = metadata; v1_role_local_var->rules = rules; + v1_role_local_var->_library_owned = 1; return v1_role_local_var; } +__attribute__((deprecated)) v1_role_t *v1_role_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + list_t *rules + ) { + return v1_role_create_internal ( + api_version, + kind, + metadata, + rules + ); +} void v1_role_free(v1_role_t *v1_role) { if(NULL == v1_role){ return ; } + if(v1_role->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_role_free"); + return ; + } listEntry_t *listEntry; if (v1_role->api_version) { free(v1_role->api_version); @@ -122,6 +140,9 @@ v1_role_t *v1_role_parseFromJSON(cJSON *v1_roleJSON){ // v1_role->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_roleJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -131,6 +152,9 @@ v1_role_t *v1_role_parseFromJSON(cJSON *v1_roleJSON){ // v1_role->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_roleJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -140,12 +164,18 @@ v1_role_t *v1_role_parseFromJSON(cJSON *v1_roleJSON){ // v1_role->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_roleJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_role->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_roleJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (rules) { cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ @@ -166,7 +196,7 @@ v1_role_t *v1_role_parseFromJSON(cJSON *v1_roleJSON){ } - v1_role_local_var = v1_role_create ( + v1_role_local_var = v1_role_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_role.h b/kubernetes/model/v1_role.h index 5944eefd..4474e5ac 100644 --- a/kubernetes/model/v1_role.h +++ b/kubernetes/model/v1_role.h @@ -26,9 +26,10 @@ typedef struct v1_role_t { struct v1_object_meta_t *metadata; //model list_t *rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_role_t; -v1_role_t *v1_role_create( +__attribute__((deprecated)) v1_role_t *v1_role_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_role_binding.c b/kubernetes/model/v1_role_binding.c index abd533b5..a81b0678 100644 --- a/kubernetes/model/v1_role_binding.c +++ b/kubernetes/model/v1_role_binding.c @@ -5,7 +5,7 @@ -v1_role_binding_t *v1_role_binding_create( +static v1_role_binding_t *v1_role_binding_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_role_binding_t *v1_role_binding_create( v1_role_binding_local_var->role_ref = role_ref; v1_role_binding_local_var->subjects = subjects; + v1_role_binding_local_var->_library_owned = 1; return v1_role_binding_local_var; } +__attribute__((deprecated)) v1_role_binding_t *v1_role_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_role_ref_t *role_ref, + list_t *subjects + ) { + return v1_role_binding_create_internal ( + api_version, + kind, + metadata, + role_ref, + subjects + ); +} void v1_role_binding_free(v1_role_binding_t *v1_role_binding) { if(NULL == v1_role_binding){ return ; } + if(v1_role_binding->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_role_binding_free"); + return ; + } listEntry_t *listEntry; if (v1_role_binding->api_version) { free(v1_role_binding->api_version); @@ -145,6 +165,9 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ // v1_role_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_role_bindingJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -154,6 +177,9 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ // v1_role_binding->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_role_bindingJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -163,12 +189,18 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ // v1_role_binding->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_role_bindingJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_role_binding->role_ref cJSON *role_ref = cJSON_GetObjectItemCaseSensitive(v1_role_bindingJSON, "roleRef"); + if (cJSON_IsNull(role_ref)) { + role_ref = NULL; + } if (!role_ref) { goto end; } @@ -178,6 +210,9 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ // v1_role_binding->subjects cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1_role_bindingJSON, "subjects"); + if (cJSON_IsNull(subjects)) { + subjects = NULL; + } if (subjects) { cJSON *subjects_local_nonprimitive = NULL; if(!cJSON_IsArray(subjects)){ @@ -198,7 +233,7 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ } - v1_role_binding_local_var = v1_role_binding_create ( + v1_role_binding_local_var = v1_role_binding_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_role_binding.h b/kubernetes/model/v1_role_binding.h index 6070da49..5246171a 100644 --- a/kubernetes/model/v1_role_binding.h +++ b/kubernetes/model/v1_role_binding.h @@ -28,9 +28,10 @@ typedef struct v1_role_binding_t { struct v1_role_ref_t *role_ref; //model list_t *subjects; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_role_binding_t; -v1_role_binding_t *v1_role_binding_create( +__attribute__((deprecated)) v1_role_binding_t *v1_role_binding_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_role_binding_list.c b/kubernetes/model/v1_role_binding_list.c index e01aca09..95c1d0b1 100644 --- a/kubernetes/model/v1_role_binding_list.c +++ b/kubernetes/model/v1_role_binding_list.c @@ -5,7 +5,7 @@ -v1_role_binding_list_t *v1_role_binding_list_create( +static v1_role_binding_list_t *v1_role_binding_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_role_binding_list_t *v1_role_binding_list_create( v1_role_binding_list_local_var->kind = kind; v1_role_binding_list_local_var->metadata = metadata; + v1_role_binding_list_local_var->_library_owned = 1; return v1_role_binding_list_local_var; } +__attribute__((deprecated)) v1_role_binding_list_t *v1_role_binding_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_role_binding_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_role_binding_list_free(v1_role_binding_list_t *v1_role_binding_list) { if(NULL == v1_role_binding_list){ return ; } + if(v1_role_binding_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_role_binding_list_free"); + return ; + } listEntry_t *listEntry; if (v1_role_binding_list->api_version) { free(v1_role_binding_list->api_version); @@ -123,6 +141,9 @@ v1_role_binding_list_t *v1_role_binding_list_parseFromJSON(cJSON *v1_role_bindin // v1_role_binding_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_role_binding_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_role_binding_list_t *v1_role_binding_list_parseFromJSON(cJSON *v1_role_bindin // v1_role_binding_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_role_binding_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_role_binding_list_t *v1_role_binding_list_parseFromJSON(cJSON *v1_role_bindin // v1_role_binding_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_role_binding_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_role_binding_list_t *v1_role_binding_list_parseFromJSON(cJSON *v1_role_bindin // v1_role_binding_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_role_binding_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_role_binding_list_local_var = v1_role_binding_list_create ( + v1_role_binding_list_local_var = v1_role_binding_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_role_binding_list.h b/kubernetes/model/v1_role_binding_list.h index bda4f1c8..bd4cba0a 100644 --- a/kubernetes/model/v1_role_binding_list.h +++ b/kubernetes/model/v1_role_binding_list.h @@ -26,9 +26,10 @@ typedef struct v1_role_binding_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_role_binding_list_t; -v1_role_binding_list_t *v1_role_binding_list_create( +__attribute__((deprecated)) v1_role_binding_list_t *v1_role_binding_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_role_list.c b/kubernetes/model/v1_role_list.c index 9b166052..cec754f2 100644 --- a/kubernetes/model/v1_role_list.c +++ b/kubernetes/model/v1_role_list.c @@ -5,7 +5,7 @@ -v1_role_list_t *v1_role_list_create( +static v1_role_list_t *v1_role_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_role_list_t *v1_role_list_create( v1_role_list_local_var->kind = kind; v1_role_list_local_var->metadata = metadata; + v1_role_list_local_var->_library_owned = 1; return v1_role_list_local_var; } +__attribute__((deprecated)) v1_role_list_t *v1_role_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_role_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_role_list_free(v1_role_list_t *v1_role_list) { if(NULL == v1_role_list){ return ; } + if(v1_role_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_role_list_free"); + return ; + } listEntry_t *listEntry; if (v1_role_list->api_version) { free(v1_role_list->api_version); @@ -123,6 +141,9 @@ v1_role_list_t *v1_role_list_parseFromJSON(cJSON *v1_role_listJSON){ // v1_role_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_role_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_role_list_t *v1_role_list_parseFromJSON(cJSON *v1_role_listJSON){ // v1_role_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_role_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_role_list_t *v1_role_list_parseFromJSON(cJSON *v1_role_listJSON){ // v1_role_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_role_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_role_list_t *v1_role_list_parseFromJSON(cJSON *v1_role_listJSON){ // v1_role_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_role_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_role_list_local_var = v1_role_list_create ( + v1_role_list_local_var = v1_role_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_role_list.h b/kubernetes/model/v1_role_list.h index f2f692e6..00b76db7 100644 --- a/kubernetes/model/v1_role_list.h +++ b/kubernetes/model/v1_role_list.h @@ -26,9 +26,10 @@ typedef struct v1_role_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_role_list_t; -v1_role_list_t *v1_role_list_create( +__attribute__((deprecated)) v1_role_list_t *v1_role_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_role_ref.c b/kubernetes/model/v1_role_ref.c index 445f8292..01fa126d 100644 --- a/kubernetes/model/v1_role_ref.c +++ b/kubernetes/model/v1_role_ref.c @@ -5,7 +5,7 @@ -v1_role_ref_t *v1_role_ref_create( +static v1_role_ref_t *v1_role_ref_create_internal( char *api_group, char *kind, char *name @@ -18,14 +18,30 @@ v1_role_ref_t *v1_role_ref_create( v1_role_ref_local_var->kind = kind; v1_role_ref_local_var->name = name; + v1_role_ref_local_var->_library_owned = 1; return v1_role_ref_local_var; } +__attribute__((deprecated)) v1_role_ref_t *v1_role_ref_create( + char *api_group, + char *kind, + char *name + ) { + return v1_role_ref_create_internal ( + api_group, + kind, + name + ); +} void v1_role_ref_free(v1_role_ref_t *v1_role_ref) { if(NULL == v1_role_ref){ return ; } + if(v1_role_ref->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_role_ref_free"); + return ; + } listEntry_t *listEntry; if (v1_role_ref->api_group) { free(v1_role_ref->api_group); @@ -85,6 +101,9 @@ v1_role_ref_t *v1_role_ref_parseFromJSON(cJSON *v1_role_refJSON){ // v1_role_ref->api_group cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1_role_refJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } if (!api_group) { goto end; } @@ -97,6 +116,9 @@ v1_role_ref_t *v1_role_ref_parseFromJSON(cJSON *v1_role_refJSON){ // v1_role_ref->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_role_refJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -109,6 +131,9 @@ v1_role_ref_t *v1_role_ref_parseFromJSON(cJSON *v1_role_refJSON){ // v1_role_ref->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_role_refJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -120,7 +145,7 @@ v1_role_ref_t *v1_role_ref_parseFromJSON(cJSON *v1_role_refJSON){ } - v1_role_ref_local_var = v1_role_ref_create ( + v1_role_ref_local_var = v1_role_ref_create_internal ( strdup(api_group->valuestring), strdup(kind->valuestring), strdup(name->valuestring) diff --git a/kubernetes/model/v1_role_ref.h b/kubernetes/model/v1_role_ref.h index 089c4208..57e0b1cf 100644 --- a/kubernetes/model/v1_role_ref.h +++ b/kubernetes/model/v1_role_ref.h @@ -23,9 +23,10 @@ typedef struct v1_role_ref_t { char *kind; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_role_ref_t; -v1_role_ref_t *v1_role_ref_create( +__attribute__((deprecated)) v1_role_ref_t *v1_role_ref_create( char *api_group, char *kind, char *name diff --git a/kubernetes/model/v1_rolling_update_daemon_set.c b/kubernetes/model/v1_rolling_update_daemon_set.c index 606ec1ac..2e9cd6b7 100644 --- a/kubernetes/model/v1_rolling_update_daemon_set.c +++ b/kubernetes/model/v1_rolling_update_daemon_set.c @@ -5,7 +5,7 @@ -v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set_create( +static v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set_create_internal( int_or_string_t *max_surge, int_or_string_t *max_unavailable ) { @@ -16,14 +16,28 @@ v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set_create( v1_rolling_update_daemon_set_local_var->max_surge = max_surge; v1_rolling_update_daemon_set_local_var->max_unavailable = max_unavailable; + v1_rolling_update_daemon_set_local_var->_library_owned = 1; return v1_rolling_update_daemon_set_local_var; } +__attribute__((deprecated)) v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set_create( + int_or_string_t *max_surge, + int_or_string_t *max_unavailable + ) { + return v1_rolling_update_daemon_set_create_internal ( + max_surge, + max_unavailable + ); +} void v1_rolling_update_daemon_set_free(v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set) { if(NULL == v1_rolling_update_daemon_set){ return ; } + if(v1_rolling_update_daemon_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_rolling_update_daemon_set_free"); + return ; + } listEntry_t *listEntry; if (v1_rolling_update_daemon_set->max_surge) { int_or_string_free(v1_rolling_update_daemon_set->max_surge); @@ -84,18 +98,24 @@ v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set_parseFromJSON(cJSON // v1_rolling_update_daemon_set->max_surge cJSON *max_surge = cJSON_GetObjectItemCaseSensitive(v1_rolling_update_daemon_setJSON, "maxSurge"); + if (cJSON_IsNull(max_surge)) { + max_surge = NULL; + } if (max_surge) { max_surge_local_nonprim = int_or_string_parseFromJSON(max_surge); //custom } // v1_rolling_update_daemon_set->max_unavailable cJSON *max_unavailable = cJSON_GetObjectItemCaseSensitive(v1_rolling_update_daemon_setJSON, "maxUnavailable"); + if (cJSON_IsNull(max_unavailable)) { + max_unavailable = NULL; + } if (max_unavailable) { max_unavailable_local_nonprim = int_or_string_parseFromJSON(max_unavailable); //custom } - v1_rolling_update_daemon_set_local_var = v1_rolling_update_daemon_set_create ( + v1_rolling_update_daemon_set_local_var = v1_rolling_update_daemon_set_create_internal ( max_surge ? max_surge_local_nonprim : NULL, max_unavailable ? max_unavailable_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_rolling_update_daemon_set.h b/kubernetes/model/v1_rolling_update_daemon_set.h index d465f14a..8de26745 100644 --- a/kubernetes/model/v1_rolling_update_daemon_set.h +++ b/kubernetes/model/v1_rolling_update_daemon_set.h @@ -23,9 +23,10 @@ typedef struct v1_rolling_update_daemon_set_t { int_or_string_t *max_surge; // custom int_or_string_t *max_unavailable; // custom + int _library_owned; // Is the library responsible for freeing this object? } v1_rolling_update_daemon_set_t; -v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set_create( +__attribute__((deprecated)) v1_rolling_update_daemon_set_t *v1_rolling_update_daemon_set_create( int_or_string_t *max_surge, int_or_string_t *max_unavailable ); diff --git a/kubernetes/model/v1_rolling_update_deployment.c b/kubernetes/model/v1_rolling_update_deployment.c index f149ba5d..f7d26461 100644 --- a/kubernetes/model/v1_rolling_update_deployment.c +++ b/kubernetes/model/v1_rolling_update_deployment.c @@ -5,7 +5,7 @@ -v1_rolling_update_deployment_t *v1_rolling_update_deployment_create( +static v1_rolling_update_deployment_t *v1_rolling_update_deployment_create_internal( int_or_string_t *max_surge, int_or_string_t *max_unavailable ) { @@ -16,14 +16,28 @@ v1_rolling_update_deployment_t *v1_rolling_update_deployment_create( v1_rolling_update_deployment_local_var->max_surge = max_surge; v1_rolling_update_deployment_local_var->max_unavailable = max_unavailable; + v1_rolling_update_deployment_local_var->_library_owned = 1; return v1_rolling_update_deployment_local_var; } +__attribute__((deprecated)) v1_rolling_update_deployment_t *v1_rolling_update_deployment_create( + int_or_string_t *max_surge, + int_or_string_t *max_unavailable + ) { + return v1_rolling_update_deployment_create_internal ( + max_surge, + max_unavailable + ); +} void v1_rolling_update_deployment_free(v1_rolling_update_deployment_t *v1_rolling_update_deployment) { if(NULL == v1_rolling_update_deployment){ return ; } + if(v1_rolling_update_deployment->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_rolling_update_deployment_free"); + return ; + } listEntry_t *listEntry; if (v1_rolling_update_deployment->max_surge) { int_or_string_free(v1_rolling_update_deployment->max_surge); @@ -84,18 +98,24 @@ v1_rolling_update_deployment_t *v1_rolling_update_deployment_parseFromJSON(cJSON // v1_rolling_update_deployment->max_surge cJSON *max_surge = cJSON_GetObjectItemCaseSensitive(v1_rolling_update_deploymentJSON, "maxSurge"); + if (cJSON_IsNull(max_surge)) { + max_surge = NULL; + } if (max_surge) { max_surge_local_nonprim = int_or_string_parseFromJSON(max_surge); //custom } // v1_rolling_update_deployment->max_unavailable cJSON *max_unavailable = cJSON_GetObjectItemCaseSensitive(v1_rolling_update_deploymentJSON, "maxUnavailable"); + if (cJSON_IsNull(max_unavailable)) { + max_unavailable = NULL; + } if (max_unavailable) { max_unavailable_local_nonprim = int_or_string_parseFromJSON(max_unavailable); //custom } - v1_rolling_update_deployment_local_var = v1_rolling_update_deployment_create ( + v1_rolling_update_deployment_local_var = v1_rolling_update_deployment_create_internal ( max_surge ? max_surge_local_nonprim : NULL, max_unavailable ? max_unavailable_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_rolling_update_deployment.h b/kubernetes/model/v1_rolling_update_deployment.h index 550c1316..a7da6850 100644 --- a/kubernetes/model/v1_rolling_update_deployment.h +++ b/kubernetes/model/v1_rolling_update_deployment.h @@ -23,9 +23,10 @@ typedef struct v1_rolling_update_deployment_t { int_or_string_t *max_surge; // custom int_or_string_t *max_unavailable; // custom + int _library_owned; // Is the library responsible for freeing this object? } v1_rolling_update_deployment_t; -v1_rolling_update_deployment_t *v1_rolling_update_deployment_create( +__attribute__((deprecated)) v1_rolling_update_deployment_t *v1_rolling_update_deployment_create( int_or_string_t *max_surge, int_or_string_t *max_unavailable ); diff --git a/kubernetes/model/v1_rolling_update_stateful_set_strategy.c b/kubernetes/model/v1_rolling_update_stateful_set_strategy.c index 7ed1b3bb..c0510d44 100644 --- a/kubernetes/model/v1_rolling_update_stateful_set_strategy.c +++ b/kubernetes/model/v1_rolling_update_stateful_set_strategy.c @@ -5,7 +5,7 @@ -v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strategy_create( +static v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strategy_create_internal( int_or_string_t *max_unavailable, int partition ) { @@ -16,14 +16,28 @@ v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strate v1_rolling_update_stateful_set_strategy_local_var->max_unavailable = max_unavailable; v1_rolling_update_stateful_set_strategy_local_var->partition = partition; + v1_rolling_update_stateful_set_strategy_local_var->_library_owned = 1; return v1_rolling_update_stateful_set_strategy_local_var; } +__attribute__((deprecated)) v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strategy_create( + int_or_string_t *max_unavailable, + int partition + ) { + return v1_rolling_update_stateful_set_strategy_create_internal ( + max_unavailable, + partition + ); +} void v1_rolling_update_stateful_set_strategy_free(v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strategy) { if(NULL == v1_rolling_update_stateful_set_strategy){ return ; } + if(v1_rolling_update_stateful_set_strategy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_rolling_update_stateful_set_strategy_free"); + return ; + } listEntry_t *listEntry; if (v1_rolling_update_stateful_set_strategy->max_unavailable) { int_or_string_free(v1_rolling_update_stateful_set_strategy->max_unavailable); @@ -72,12 +86,18 @@ v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strate // v1_rolling_update_stateful_set_strategy->max_unavailable cJSON *max_unavailable = cJSON_GetObjectItemCaseSensitive(v1_rolling_update_stateful_set_strategyJSON, "maxUnavailable"); + if (cJSON_IsNull(max_unavailable)) { + max_unavailable = NULL; + } if (max_unavailable) { max_unavailable_local_nonprim = int_or_string_parseFromJSON(max_unavailable); //custom } // v1_rolling_update_stateful_set_strategy->partition cJSON *partition = cJSON_GetObjectItemCaseSensitive(v1_rolling_update_stateful_set_strategyJSON, "partition"); + if (cJSON_IsNull(partition)) { + partition = NULL; + } if (partition) { if(!cJSON_IsNumber(partition)) { @@ -86,7 +106,7 @@ v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strate } - v1_rolling_update_stateful_set_strategy_local_var = v1_rolling_update_stateful_set_strategy_create ( + v1_rolling_update_stateful_set_strategy_local_var = v1_rolling_update_stateful_set_strategy_create_internal ( max_unavailable ? max_unavailable_local_nonprim : NULL, partition ? partition->valuedouble : 0 ); diff --git a/kubernetes/model/v1_rolling_update_stateful_set_strategy.h b/kubernetes/model/v1_rolling_update_stateful_set_strategy.h index 52335bc3..e681ecd6 100644 --- a/kubernetes/model/v1_rolling_update_stateful_set_strategy.h +++ b/kubernetes/model/v1_rolling_update_stateful_set_strategy.h @@ -23,9 +23,10 @@ typedef struct v1_rolling_update_stateful_set_strategy_t { int_or_string_t *max_unavailable; // custom int partition; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_rolling_update_stateful_set_strategy_t; -v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strategy_create( +__attribute__((deprecated)) v1_rolling_update_stateful_set_strategy_t *v1_rolling_update_stateful_set_strategy_create( int_or_string_t *max_unavailable, int partition ); diff --git a/kubernetes/model/v1_rule_with_operations.c b/kubernetes/model/v1_rule_with_operations.c index 8e2524c3..b336ca7a 100644 --- a/kubernetes/model/v1_rule_with_operations.c +++ b/kubernetes/model/v1_rule_with_operations.c @@ -5,7 +5,7 @@ -v1_rule_with_operations_t *v1_rule_with_operations_create( +static v1_rule_with_operations_t *v1_rule_with_operations_create_internal( list_t *api_groups, list_t *api_versions, list_t *operations, @@ -22,14 +22,34 @@ v1_rule_with_operations_t *v1_rule_with_operations_create( v1_rule_with_operations_local_var->resources = resources; v1_rule_with_operations_local_var->scope = scope; + v1_rule_with_operations_local_var->_library_owned = 1; return v1_rule_with_operations_local_var; } +__attribute__((deprecated)) v1_rule_with_operations_t *v1_rule_with_operations_create( + list_t *api_groups, + list_t *api_versions, + list_t *operations, + list_t *resources, + char *scope + ) { + return v1_rule_with_operations_create_internal ( + api_groups, + api_versions, + operations, + resources, + scope + ); +} void v1_rule_with_operations_free(v1_rule_with_operations_t *v1_rule_with_operations) { if(NULL == v1_rule_with_operations){ return ; } + if(v1_rule_with_operations->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_rule_with_operations_free"); + return ; + } listEntry_t *listEntry; if (v1_rule_with_operations->api_groups) { list_ForEach(listEntry, v1_rule_with_operations->api_groups) { @@ -78,7 +98,7 @@ cJSON *v1_rule_with_operations_convertToJSON(v1_rule_with_operations_t *v1_rule_ listEntry_t *api_groupsListEntry; list_ForEach(api_groupsListEntry, v1_rule_with_operations->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_groups, "", api_groupsListEntry->data) == NULL) { goto fail; } @@ -95,7 +115,7 @@ cJSON *v1_rule_with_operations_convertToJSON(v1_rule_with_operations_t *v1_rule_ listEntry_t *api_versionsListEntry; list_ForEach(api_versionsListEntry, v1_rule_with_operations->api_versions) { - if(cJSON_AddStringToObject(api_versions, "", (char*)api_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_versions, "", api_versionsListEntry->data) == NULL) { goto fail; } @@ -112,7 +132,7 @@ cJSON *v1_rule_with_operations_convertToJSON(v1_rule_with_operations_t *v1_rule_ listEntry_t *operationsListEntry; list_ForEach(operationsListEntry, v1_rule_with_operations->operations) { - if(cJSON_AddStringToObject(operations, "", (char*)operationsListEntry->data) == NULL) + if(cJSON_AddStringToObject(operations, "", operationsListEntry->data) == NULL) { goto fail; } @@ -129,7 +149,7 @@ cJSON *v1_rule_with_operations_convertToJSON(v1_rule_with_operations_t *v1_rule_ listEntry_t *resourcesListEntry; list_ForEach(resourcesListEntry, v1_rule_with_operations->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resources, "", resourcesListEntry->data) == NULL) { goto fail; } @@ -170,6 +190,9 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "apiGroups"); + if (cJSON_IsNull(api_groups)) { + api_groups = NULL; + } if (api_groups) { cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { @@ -189,6 +212,9 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->api_versions cJSON *api_versions = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "apiVersions"); + if (cJSON_IsNull(api_versions)) { + api_versions = NULL; + } if (api_versions) { cJSON *api_versions_local = NULL; if(!cJSON_IsArray(api_versions)) { @@ -208,6 +234,9 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->operations cJSON *operations = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "operations"); + if (cJSON_IsNull(operations)) { + operations = NULL; + } if (operations) { cJSON *operations_local = NULL; if(!cJSON_IsArray(operations)) { @@ -227,6 +256,9 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { @@ -246,6 +278,9 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->scope cJSON *scope = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "scope"); + if (cJSON_IsNull(scope)) { + scope = NULL; + } if (scope) { if(!cJSON_IsString(scope) && !cJSON_IsNull(scope)) { @@ -254,7 +289,7 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ } - v1_rule_with_operations_local_var = v1_rule_with_operations_create ( + v1_rule_with_operations_local_var = v1_rule_with_operations_create_internal ( api_groups ? api_groupsList : NULL, api_versions ? api_versionsList : NULL, operations ? operationsList : NULL, diff --git a/kubernetes/model/v1_rule_with_operations.h b/kubernetes/model/v1_rule_with_operations.h index 449ac194..1e498cab 100644 --- a/kubernetes/model/v1_rule_with_operations.h +++ b/kubernetes/model/v1_rule_with_operations.h @@ -25,9 +25,10 @@ typedef struct v1_rule_with_operations_t { list_t *resources; //primitive container char *scope; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_rule_with_operations_t; -v1_rule_with_operations_t *v1_rule_with_operations_create( +__attribute__((deprecated)) v1_rule_with_operations_t *v1_rule_with_operations_create( list_t *api_groups, list_t *api_versions, list_t *operations, diff --git a/kubernetes/model/v1_runtime_class.c b/kubernetes/model/v1_runtime_class.c index 8ff44d65..e511dbe8 100644 --- a/kubernetes/model/v1_runtime_class.c +++ b/kubernetes/model/v1_runtime_class.c @@ -5,7 +5,7 @@ -v1_runtime_class_t *v1_runtime_class_create( +static v1_runtime_class_t *v1_runtime_class_create_internal( char *api_version, char *handler, char *kind, @@ -24,14 +24,36 @@ v1_runtime_class_t *v1_runtime_class_create( v1_runtime_class_local_var->overhead = overhead; v1_runtime_class_local_var->scheduling = scheduling; + v1_runtime_class_local_var->_library_owned = 1; return v1_runtime_class_local_var; } +__attribute__((deprecated)) v1_runtime_class_t *v1_runtime_class_create( + char *api_version, + char *handler, + char *kind, + v1_object_meta_t *metadata, + v1_overhead_t *overhead, + v1_scheduling_t *scheduling + ) { + return v1_runtime_class_create_internal ( + api_version, + handler, + kind, + metadata, + overhead, + scheduling + ); +} void v1_runtime_class_free(v1_runtime_class_t *v1_runtime_class) { if(NULL == v1_runtime_class){ return ; } + if(v1_runtime_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_runtime_class_free"); + return ; + } listEntry_t *listEntry; if (v1_runtime_class->api_version) { free(v1_runtime_class->api_version); @@ -149,6 +171,9 @@ v1_runtime_class_t *v1_runtime_class_parseFromJSON(cJSON *v1_runtime_classJSON){ // v1_runtime_class->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_runtime_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -158,6 +183,9 @@ v1_runtime_class_t *v1_runtime_class_parseFromJSON(cJSON *v1_runtime_classJSON){ // v1_runtime_class->handler cJSON *handler = cJSON_GetObjectItemCaseSensitive(v1_runtime_classJSON, "handler"); + if (cJSON_IsNull(handler)) { + handler = NULL; + } if (!handler) { goto end; } @@ -170,6 +198,9 @@ v1_runtime_class_t *v1_runtime_class_parseFromJSON(cJSON *v1_runtime_classJSON){ // v1_runtime_class->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_runtime_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -179,24 +210,33 @@ v1_runtime_class_t *v1_runtime_class_parseFromJSON(cJSON *v1_runtime_classJSON){ // v1_runtime_class->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_runtime_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_runtime_class->overhead cJSON *overhead = cJSON_GetObjectItemCaseSensitive(v1_runtime_classJSON, "overhead"); + if (cJSON_IsNull(overhead)) { + overhead = NULL; + } if (overhead) { overhead_local_nonprim = v1_overhead_parseFromJSON(overhead); //nonprimitive } // v1_runtime_class->scheduling cJSON *scheduling = cJSON_GetObjectItemCaseSensitive(v1_runtime_classJSON, "scheduling"); + if (cJSON_IsNull(scheduling)) { + scheduling = NULL; + } if (scheduling) { scheduling_local_nonprim = v1_scheduling_parseFromJSON(scheduling); //nonprimitive } - v1_runtime_class_local_var = v1_runtime_class_create ( + v1_runtime_class_local_var = v1_runtime_class_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, strdup(handler->valuestring), kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_runtime_class.h b/kubernetes/model/v1_runtime_class.h index 5383d51c..4247289b 100644 --- a/kubernetes/model/v1_runtime_class.h +++ b/kubernetes/model/v1_runtime_class.h @@ -29,9 +29,10 @@ typedef struct v1_runtime_class_t { struct v1_overhead_t *overhead; //model struct v1_scheduling_t *scheduling; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_runtime_class_t; -v1_runtime_class_t *v1_runtime_class_create( +__attribute__((deprecated)) v1_runtime_class_t *v1_runtime_class_create( char *api_version, char *handler, char *kind, diff --git a/kubernetes/model/v1_runtime_class_list.c b/kubernetes/model/v1_runtime_class_list.c index d4480b07..9b0769d9 100644 --- a/kubernetes/model/v1_runtime_class_list.c +++ b/kubernetes/model/v1_runtime_class_list.c @@ -5,7 +5,7 @@ -v1_runtime_class_list_t *v1_runtime_class_list_create( +static v1_runtime_class_list_t *v1_runtime_class_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_runtime_class_list_t *v1_runtime_class_list_create( v1_runtime_class_list_local_var->kind = kind; v1_runtime_class_list_local_var->metadata = metadata; + v1_runtime_class_list_local_var->_library_owned = 1; return v1_runtime_class_list_local_var; } +__attribute__((deprecated)) v1_runtime_class_list_t *v1_runtime_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_runtime_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_runtime_class_list_free(v1_runtime_class_list_t *v1_runtime_class_list) { if(NULL == v1_runtime_class_list){ return ; } + if(v1_runtime_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_runtime_class_list_free"); + return ; + } listEntry_t *listEntry; if (v1_runtime_class_list->api_version) { free(v1_runtime_class_list->api_version); @@ -123,6 +141,9 @@ v1_runtime_class_list_t *v1_runtime_class_list_parseFromJSON(cJSON *v1_runtime_c // v1_runtime_class_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_runtime_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_runtime_class_list_t *v1_runtime_class_list_parseFromJSON(cJSON *v1_runtime_c // v1_runtime_class_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_runtime_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_runtime_class_list_t *v1_runtime_class_list_parseFromJSON(cJSON *v1_runtime_c // v1_runtime_class_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_runtime_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_runtime_class_list_t *v1_runtime_class_list_parseFromJSON(cJSON *v1_runtime_c // v1_runtime_class_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_runtime_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_runtime_class_list_local_var = v1_runtime_class_list_create ( + v1_runtime_class_list_local_var = v1_runtime_class_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_runtime_class_list.h b/kubernetes/model/v1_runtime_class_list.h index f7b223be..ec475e98 100644 --- a/kubernetes/model/v1_runtime_class_list.h +++ b/kubernetes/model/v1_runtime_class_list.h @@ -26,9 +26,10 @@ typedef struct v1_runtime_class_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_runtime_class_list_t; -v1_runtime_class_list_t *v1_runtime_class_list_create( +__attribute__((deprecated)) v1_runtime_class_list_t *v1_runtime_class_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_scale.c b/kubernetes/model/v1_scale.c index 68c01d43..23afb88d 100644 --- a/kubernetes/model/v1_scale.c +++ b/kubernetes/model/v1_scale.c @@ -5,7 +5,7 @@ -v1_scale_t *v1_scale_create( +static v1_scale_t *v1_scale_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_scale_t *v1_scale_create( v1_scale_local_var->spec = spec; v1_scale_local_var->status = status; + v1_scale_local_var->_library_owned = 1; return v1_scale_local_var; } +__attribute__((deprecated)) v1_scale_t *v1_scale_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_scale_spec_t *spec, + v1_scale_status_t *status + ) { + return v1_scale_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_scale_free(v1_scale_t *v1_scale) { if(NULL == v1_scale){ return ; } + if(v1_scale->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scale_free"); + return ; + } listEntry_t *listEntry; if (v1_scale->api_version) { free(v1_scale->api_version); @@ -134,6 +154,9 @@ v1_scale_t *v1_scale_parseFromJSON(cJSON *v1_scaleJSON){ // v1_scale->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_scaleJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_scale_t *v1_scale_parseFromJSON(cJSON *v1_scaleJSON){ // v1_scale->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_scaleJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_scale_t *v1_scale_parseFromJSON(cJSON *v1_scaleJSON){ // v1_scale->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_scaleJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_scale->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_scaleJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_scale_spec_parseFromJSON(spec); //nonprimitive } // v1_scale->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_scaleJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_scale_status_parseFromJSON(status); //nonprimitive } - v1_scale_local_var = v1_scale_create ( + v1_scale_local_var = v1_scale_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_scale.h b/kubernetes/model/v1_scale.h index fce31349..54ea79e9 100644 --- a/kubernetes/model/v1_scale.h +++ b/kubernetes/model/v1_scale.h @@ -28,9 +28,10 @@ typedef struct v1_scale_t { struct v1_scale_spec_t *spec; //model struct v1_scale_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_scale_t; -v1_scale_t *v1_scale_create( +__attribute__((deprecated)) v1_scale_t *v1_scale_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_scale_io_persistent_volume_source.c b/kubernetes/model/v1_scale_io_persistent_volume_source.c index 70ab5691..dc5fda45 100644 --- a/kubernetes/model/v1_scale_io_persistent_volume_source.c +++ b/kubernetes/model/v1_scale_io_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_create( +static v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_create_internal( char *fs_type, char *gateway, char *protection_domain, @@ -32,14 +32,44 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_cre v1_scale_io_persistent_volume_source_local_var->system = system; v1_scale_io_persistent_volume_source_local_var->volume_name = volume_name; + v1_scale_io_persistent_volume_source_local_var->_library_owned = 1; return v1_scale_io_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_create( + char *fs_type, + char *gateway, + char *protection_domain, + int read_only, + v1_secret_reference_t *secret_ref, + int ssl_enabled, + char *storage_mode, + char *storage_pool, + char *system, + char *volume_name + ) { + return v1_scale_io_persistent_volume_source_create_internal ( + fs_type, + gateway, + protection_domain, + read_only, + secret_ref, + ssl_enabled, + storage_mode, + storage_pool, + system, + volume_name + ); +} void v1_scale_io_persistent_volume_source_free(v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source) { if(NULL == v1_scale_io_persistent_volume_source){ return ; } + if(v1_scale_io_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scale_io_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_scale_io_persistent_volume_source->fs_type) { free(v1_scale_io_persistent_volume_source->fs_type); @@ -183,6 +213,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -192,6 +225,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->gateway cJSON *gateway = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "gateway"); + if (cJSON_IsNull(gateway)) { + gateway = NULL; + } if (!gateway) { goto end; } @@ -204,6 +240,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->protection_domain cJSON *protection_domain = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "protectionDomain"); + if (cJSON_IsNull(protection_domain)) { + protection_domain = NULL; + } if (protection_domain) { if(!cJSON_IsString(protection_domain) && !cJSON_IsNull(protection_domain)) { @@ -213,6 +252,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -222,6 +264,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (!secret_ref) { goto end; } @@ -231,6 +276,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->ssl_enabled cJSON *ssl_enabled = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "sslEnabled"); + if (cJSON_IsNull(ssl_enabled)) { + ssl_enabled = NULL; + } if (ssl_enabled) { if(!cJSON_IsBool(ssl_enabled)) { @@ -240,6 +288,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->storage_mode cJSON *storage_mode = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "storageMode"); + if (cJSON_IsNull(storage_mode)) { + storage_mode = NULL; + } if (storage_mode) { if(!cJSON_IsString(storage_mode) && !cJSON_IsNull(storage_mode)) { @@ -249,6 +300,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->storage_pool cJSON *storage_pool = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "storagePool"); + if (cJSON_IsNull(storage_pool)) { + storage_pool = NULL; + } if (storage_pool) { if(!cJSON_IsString(storage_pool) && !cJSON_IsNull(storage_pool)) { @@ -258,6 +312,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->system cJSON *system = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "system"); + if (cJSON_IsNull(system)) { + system = NULL; + } if (!system) { goto end; } @@ -270,6 +327,9 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par // v1_scale_io_persistent_volume_source->volume_name cJSON *volume_name = cJSON_GetObjectItemCaseSensitive(v1_scale_io_persistent_volume_sourceJSON, "volumeName"); + if (cJSON_IsNull(volume_name)) { + volume_name = NULL; + } if (volume_name) { if(!cJSON_IsString(volume_name) && !cJSON_IsNull(volume_name)) { @@ -278,7 +338,7 @@ v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_par } - v1_scale_io_persistent_volume_source_local_var = v1_scale_io_persistent_volume_source_create ( + v1_scale_io_persistent_volume_source_local_var = v1_scale_io_persistent_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, strdup(gateway->valuestring), protection_domain && !cJSON_IsNull(protection_domain) ? strdup(protection_domain->valuestring) : NULL, diff --git a/kubernetes/model/v1_scale_io_persistent_volume_source.h b/kubernetes/model/v1_scale_io_persistent_volume_source.h index 23fb9277..622da25b 100644 --- a/kubernetes/model/v1_scale_io_persistent_volume_source.h +++ b/kubernetes/model/v1_scale_io_persistent_volume_source.h @@ -31,9 +31,10 @@ typedef struct v1_scale_io_persistent_volume_source_t { char *system; // string char *volume_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_scale_io_persistent_volume_source_t; -v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_create( +__attribute__((deprecated)) v1_scale_io_persistent_volume_source_t *v1_scale_io_persistent_volume_source_create( char *fs_type, char *gateway, char *protection_domain, diff --git a/kubernetes/model/v1_scale_io_volume_source.c b/kubernetes/model/v1_scale_io_volume_source.c index bd19c31e..0d41a23c 100644 --- a/kubernetes/model/v1_scale_io_volume_source.c +++ b/kubernetes/model/v1_scale_io_volume_source.c @@ -5,7 +5,7 @@ -v1_scale_io_volume_source_t *v1_scale_io_volume_source_create( +static v1_scale_io_volume_source_t *v1_scale_io_volume_source_create_internal( char *fs_type, char *gateway, char *protection_domain, @@ -32,14 +32,44 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_create( v1_scale_io_volume_source_local_var->system = system; v1_scale_io_volume_source_local_var->volume_name = volume_name; + v1_scale_io_volume_source_local_var->_library_owned = 1; return v1_scale_io_volume_source_local_var; } +__attribute__((deprecated)) v1_scale_io_volume_source_t *v1_scale_io_volume_source_create( + char *fs_type, + char *gateway, + char *protection_domain, + int read_only, + v1_local_object_reference_t *secret_ref, + int ssl_enabled, + char *storage_mode, + char *storage_pool, + char *system, + char *volume_name + ) { + return v1_scale_io_volume_source_create_internal ( + fs_type, + gateway, + protection_domain, + read_only, + secret_ref, + ssl_enabled, + storage_mode, + storage_pool, + system, + volume_name + ); +} void v1_scale_io_volume_source_free(v1_scale_io_volume_source_t *v1_scale_io_volume_source) { if(NULL == v1_scale_io_volume_source){ return ; } + if(v1_scale_io_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scale_io_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_scale_io_volume_source->fs_type) { free(v1_scale_io_volume_source->fs_type); @@ -183,6 +213,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -192,6 +225,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->gateway cJSON *gateway = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "gateway"); + if (cJSON_IsNull(gateway)) { + gateway = NULL; + } if (!gateway) { goto end; } @@ -204,6 +240,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->protection_domain cJSON *protection_domain = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "protectionDomain"); + if (cJSON_IsNull(protection_domain)) { + protection_domain = NULL; + } if (protection_domain) { if(!cJSON_IsString(protection_domain) && !cJSON_IsNull(protection_domain)) { @@ -213,6 +252,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -222,6 +264,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (!secret_ref) { goto end; } @@ -231,6 +276,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->ssl_enabled cJSON *ssl_enabled = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "sslEnabled"); + if (cJSON_IsNull(ssl_enabled)) { + ssl_enabled = NULL; + } if (ssl_enabled) { if(!cJSON_IsBool(ssl_enabled)) { @@ -240,6 +288,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->storage_mode cJSON *storage_mode = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "storageMode"); + if (cJSON_IsNull(storage_mode)) { + storage_mode = NULL; + } if (storage_mode) { if(!cJSON_IsString(storage_mode) && !cJSON_IsNull(storage_mode)) { @@ -249,6 +300,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->storage_pool cJSON *storage_pool = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "storagePool"); + if (cJSON_IsNull(storage_pool)) { + storage_pool = NULL; + } if (storage_pool) { if(!cJSON_IsString(storage_pool) && !cJSON_IsNull(storage_pool)) { @@ -258,6 +312,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->system cJSON *system = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "system"); + if (cJSON_IsNull(system)) { + system = NULL; + } if (!system) { goto end; } @@ -270,6 +327,9 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s // v1_scale_io_volume_source->volume_name cJSON *volume_name = cJSON_GetObjectItemCaseSensitive(v1_scale_io_volume_sourceJSON, "volumeName"); + if (cJSON_IsNull(volume_name)) { + volume_name = NULL; + } if (volume_name) { if(!cJSON_IsString(volume_name) && !cJSON_IsNull(volume_name)) { @@ -278,7 +338,7 @@ v1_scale_io_volume_source_t *v1_scale_io_volume_source_parseFromJSON(cJSON *v1_s } - v1_scale_io_volume_source_local_var = v1_scale_io_volume_source_create ( + v1_scale_io_volume_source_local_var = v1_scale_io_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, strdup(gateway->valuestring), protection_domain && !cJSON_IsNull(protection_domain) ? strdup(protection_domain->valuestring) : NULL, diff --git a/kubernetes/model/v1_scale_io_volume_source.h b/kubernetes/model/v1_scale_io_volume_source.h index 9290ddea..f93353a8 100644 --- a/kubernetes/model/v1_scale_io_volume_source.h +++ b/kubernetes/model/v1_scale_io_volume_source.h @@ -31,9 +31,10 @@ typedef struct v1_scale_io_volume_source_t { char *system; // string char *volume_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_scale_io_volume_source_t; -v1_scale_io_volume_source_t *v1_scale_io_volume_source_create( +__attribute__((deprecated)) v1_scale_io_volume_source_t *v1_scale_io_volume_source_create( char *fs_type, char *gateway, char *protection_domain, diff --git a/kubernetes/model/v1_scale_spec.c b/kubernetes/model/v1_scale_spec.c index 7e2a2f0f..bfead9f8 100644 --- a/kubernetes/model/v1_scale_spec.c +++ b/kubernetes/model/v1_scale_spec.c @@ -5,7 +5,7 @@ -v1_scale_spec_t *v1_scale_spec_create( +static v1_scale_spec_t *v1_scale_spec_create_internal( int replicas ) { v1_scale_spec_t *v1_scale_spec_local_var = malloc(sizeof(v1_scale_spec_t)); @@ -14,14 +14,26 @@ v1_scale_spec_t *v1_scale_spec_create( } v1_scale_spec_local_var->replicas = replicas; + v1_scale_spec_local_var->_library_owned = 1; return v1_scale_spec_local_var; } +__attribute__((deprecated)) v1_scale_spec_t *v1_scale_spec_create( + int replicas + ) { + return v1_scale_spec_create_internal ( + replicas + ); +} void v1_scale_spec_free(v1_scale_spec_t *v1_scale_spec) { if(NULL == v1_scale_spec){ return ; } + if(v1_scale_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scale_spec_free"); + return ; + } listEntry_t *listEntry; free(v1_scale_spec); } @@ -50,6 +62,9 @@ v1_scale_spec_t *v1_scale_spec_parseFromJSON(cJSON *v1_scale_specJSON){ // v1_scale_spec->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_scale_specJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (replicas) { if(!cJSON_IsNumber(replicas)) { @@ -58,7 +73,7 @@ v1_scale_spec_t *v1_scale_spec_parseFromJSON(cJSON *v1_scale_specJSON){ } - v1_scale_spec_local_var = v1_scale_spec_create ( + v1_scale_spec_local_var = v1_scale_spec_create_internal ( replicas ? replicas->valuedouble : 0 ); diff --git a/kubernetes/model/v1_scale_spec.h b/kubernetes/model/v1_scale_spec.h index 4bf40c13..9f942f4b 100644 --- a/kubernetes/model/v1_scale_spec.h +++ b/kubernetes/model/v1_scale_spec.h @@ -21,9 +21,10 @@ typedef struct v1_scale_spec_t v1_scale_spec_t; typedef struct v1_scale_spec_t { int replicas; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_scale_spec_t; -v1_scale_spec_t *v1_scale_spec_create( +__attribute__((deprecated)) v1_scale_spec_t *v1_scale_spec_create( int replicas ); diff --git a/kubernetes/model/v1_scale_status.c b/kubernetes/model/v1_scale_status.c index 8b8f985e..8aa7d792 100644 --- a/kubernetes/model/v1_scale_status.c +++ b/kubernetes/model/v1_scale_status.c @@ -5,7 +5,7 @@ -v1_scale_status_t *v1_scale_status_create( +static v1_scale_status_t *v1_scale_status_create_internal( int replicas, char *selector ) { @@ -16,14 +16,28 @@ v1_scale_status_t *v1_scale_status_create( v1_scale_status_local_var->replicas = replicas; v1_scale_status_local_var->selector = selector; + v1_scale_status_local_var->_library_owned = 1; return v1_scale_status_local_var; } +__attribute__((deprecated)) v1_scale_status_t *v1_scale_status_create( + int replicas, + char *selector + ) { + return v1_scale_status_create_internal ( + replicas, + selector + ); +} void v1_scale_status_free(v1_scale_status_t *v1_scale_status) { if(NULL == v1_scale_status){ return ; } + if(v1_scale_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scale_status_free"); + return ; + } listEntry_t *listEntry; if (v1_scale_status->selector) { free(v1_scale_status->selector); @@ -65,6 +79,9 @@ v1_scale_status_t *v1_scale_status_parseFromJSON(cJSON *v1_scale_statusJSON){ // v1_scale_status->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_scale_statusJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (!replicas) { goto end; } @@ -77,6 +94,9 @@ v1_scale_status_t *v1_scale_status_parseFromJSON(cJSON *v1_scale_statusJSON){ // v1_scale_status->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_scale_statusJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { if(!cJSON_IsString(selector) && !cJSON_IsNull(selector)) { @@ -85,7 +105,7 @@ v1_scale_status_t *v1_scale_status_parseFromJSON(cJSON *v1_scale_statusJSON){ } - v1_scale_status_local_var = v1_scale_status_create ( + v1_scale_status_local_var = v1_scale_status_create_internal ( replicas->valuedouble, selector && !cJSON_IsNull(selector) ? strdup(selector->valuestring) : NULL ); diff --git a/kubernetes/model/v1_scale_status.h b/kubernetes/model/v1_scale_status.h index 3b9cdf97..22d8c070 100644 --- a/kubernetes/model/v1_scale_status.h +++ b/kubernetes/model/v1_scale_status.h @@ -22,9 +22,10 @@ typedef struct v1_scale_status_t { int replicas; //numeric char *selector; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_scale_status_t; -v1_scale_status_t *v1_scale_status_create( +__attribute__((deprecated)) v1_scale_status_t *v1_scale_status_create( int replicas, char *selector ); diff --git a/kubernetes/model/v1_scheduling.c b/kubernetes/model/v1_scheduling.c index f9cdc7df..e49795e8 100644 --- a/kubernetes/model/v1_scheduling.c +++ b/kubernetes/model/v1_scheduling.c @@ -5,7 +5,7 @@ -v1_scheduling_t *v1_scheduling_create( +static v1_scheduling_t *v1_scheduling_create_internal( list_t* node_selector, list_t *tolerations ) { @@ -16,18 +16,32 @@ v1_scheduling_t *v1_scheduling_create( v1_scheduling_local_var->node_selector = node_selector; v1_scheduling_local_var->tolerations = tolerations; + v1_scheduling_local_var->_library_owned = 1; return v1_scheduling_local_var; } +__attribute__((deprecated)) v1_scheduling_t *v1_scheduling_create( + list_t* node_selector, + list_t *tolerations + ) { + return v1_scheduling_create_internal ( + node_selector, + tolerations + ); +} void v1_scheduling_free(v1_scheduling_t *v1_scheduling) { if(NULL == v1_scheduling){ return ; } + if(v1_scheduling->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scheduling_free"); + return ; + } listEntry_t *listEntry; if (v1_scheduling->node_selector) { list_ForEach(listEntry, v1_scheduling->node_selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -58,8 +72,8 @@ cJSON *v1_scheduling_convertToJSON(v1_scheduling_t *v1_scheduling) { listEntry_t *node_selectorListEntry; if (v1_scheduling->node_selector) { list_ForEach(node_selectorListEntry, v1_scheduling->node_selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)node_selectorListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = node_selectorListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -107,6 +121,9 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ // v1_scheduling->node_selector cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_schedulingJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } if (node_selector) { cJSON *node_selector_local_map = NULL; if(!cJSON_IsObject(node_selector) && !cJSON_IsNull(node_selector)) @@ -132,6 +149,9 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ // v1_scheduling->tolerations cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1_schedulingJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } if (tolerations) { cJSON *tolerations_local_nonprimitive = NULL; if(!cJSON_IsArray(tolerations)){ @@ -152,7 +172,7 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ } - v1_scheduling_local_var = v1_scheduling_create ( + v1_scheduling_local_var = v1_scheduling_create_internal ( node_selector ? node_selectorList : NULL, tolerations ? tolerationsList : NULL ); @@ -162,7 +182,7 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ if (node_selectorList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, node_selectorList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_scheduling.h b/kubernetes/model/v1_scheduling.h index 2a6b7b36..80835a73 100644 --- a/kubernetes/model/v1_scheduling.h +++ b/kubernetes/model/v1_scheduling.h @@ -23,9 +23,10 @@ typedef struct v1_scheduling_t { list_t* node_selector; //map list_t *tolerations; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_scheduling_t; -v1_scheduling_t *v1_scheduling_create( +__attribute__((deprecated)) v1_scheduling_t *v1_scheduling_create( list_t* node_selector, list_t *tolerations ); diff --git a/kubernetes/model/v1_scope_selector.c b/kubernetes/model/v1_scope_selector.c index 6b443e64..9ea6268c 100644 --- a/kubernetes/model/v1_scope_selector.c +++ b/kubernetes/model/v1_scope_selector.c @@ -5,7 +5,7 @@ -v1_scope_selector_t *v1_scope_selector_create( +static v1_scope_selector_t *v1_scope_selector_create_internal( list_t *match_expressions ) { v1_scope_selector_t *v1_scope_selector_local_var = malloc(sizeof(v1_scope_selector_t)); @@ -14,14 +14,26 @@ v1_scope_selector_t *v1_scope_selector_create( } v1_scope_selector_local_var->match_expressions = match_expressions; + v1_scope_selector_local_var->_library_owned = 1; return v1_scope_selector_local_var; } +__attribute__((deprecated)) v1_scope_selector_t *v1_scope_selector_create( + list_t *match_expressions + ) { + return v1_scope_selector_create_internal ( + match_expressions + ); +} void v1_scope_selector_free(v1_scope_selector_t *v1_scope_selector) { if(NULL == v1_scope_selector){ return ; } + if(v1_scope_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scope_selector_free"); + return ; + } listEntry_t *listEntry; if (v1_scope_selector->match_expressions) { list_ForEach(listEntry, v1_scope_selector->match_expressions) { @@ -72,6 +84,9 @@ v1_scope_selector_t *v1_scope_selector_parseFromJSON(cJSON *v1_scope_selectorJSO // v1_scope_selector->match_expressions cJSON *match_expressions = cJSON_GetObjectItemCaseSensitive(v1_scope_selectorJSON, "matchExpressions"); + if (cJSON_IsNull(match_expressions)) { + match_expressions = NULL; + } if (match_expressions) { cJSON *match_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_expressions)){ @@ -92,7 +107,7 @@ v1_scope_selector_t *v1_scope_selector_parseFromJSON(cJSON *v1_scope_selectorJSO } - v1_scope_selector_local_var = v1_scope_selector_create ( + v1_scope_selector_local_var = v1_scope_selector_create_internal ( match_expressions ? match_expressionsList : NULL ); diff --git a/kubernetes/model/v1_scope_selector.h b/kubernetes/model/v1_scope_selector.h index cc47ec10..f1a120d0 100644 --- a/kubernetes/model/v1_scope_selector.h +++ b/kubernetes/model/v1_scope_selector.h @@ -22,9 +22,10 @@ typedef struct v1_scope_selector_t v1_scope_selector_t; typedef struct v1_scope_selector_t { list_t *match_expressions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_scope_selector_t; -v1_scope_selector_t *v1_scope_selector_create( +__attribute__((deprecated)) v1_scope_selector_t *v1_scope_selector_create( list_t *match_expressions ); diff --git a/kubernetes/model/v1_scoped_resource_selector_requirement.c b/kubernetes/model/v1_scoped_resource_selector_requirement.c index 57148729..1192749f 100644 --- a/kubernetes/model/v1_scoped_resource_selector_requirement.c +++ b/kubernetes/model/v1_scoped_resource_selector_requirement.c @@ -5,7 +5,7 @@ -v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requirement_create( +static v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requirement_create_internal( char *_operator, char *scope_name, list_t *values @@ -18,14 +18,30 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme v1_scoped_resource_selector_requirement_local_var->scope_name = scope_name; v1_scoped_resource_selector_requirement_local_var->values = values; + v1_scoped_resource_selector_requirement_local_var->_library_owned = 1; return v1_scoped_resource_selector_requirement_local_var; } +__attribute__((deprecated)) v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requirement_create( + char *_operator, + char *scope_name, + list_t *values + ) { + return v1_scoped_resource_selector_requirement_create_internal ( + _operator, + scope_name, + values + ); +} void v1_scoped_resource_selector_requirement_free(v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requirement) { if(NULL == v1_scoped_resource_selector_requirement){ return ; } + if(v1_scoped_resource_selector_requirement->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_scoped_resource_selector_requirement_free"); + return ; + } listEntry_t *listEntry; if (v1_scoped_resource_selector_requirement->_operator) { free(v1_scoped_resource_selector_requirement->_operator); @@ -75,7 +91,7 @@ cJSON *v1_scoped_resource_selector_requirement_convertToJSON(v1_scoped_resource_ listEntry_t *valuesListEntry; list_ForEach(valuesListEntry, v1_scoped_resource_selector_requirement->values) { - if(cJSON_AddStringToObject(values, "", (char*)valuesListEntry->data) == NULL) + if(cJSON_AddStringToObject(values, "", valuesListEntry->data) == NULL) { goto fail; } @@ -99,6 +115,9 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme // v1_scoped_resource_selector_requirement->_operator cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_scoped_resource_selector_requirementJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } if (!_operator) { goto end; } @@ -111,6 +130,9 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme // v1_scoped_resource_selector_requirement->scope_name cJSON *scope_name = cJSON_GetObjectItemCaseSensitive(v1_scoped_resource_selector_requirementJSON, "scopeName"); + if (cJSON_IsNull(scope_name)) { + scope_name = NULL; + } if (!scope_name) { goto end; } @@ -123,6 +145,9 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme // v1_scoped_resource_selector_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_scoped_resource_selector_requirementJSON, "values"); + if (cJSON_IsNull(values)) { + values = NULL; + } if (values) { cJSON *values_local = NULL; if(!cJSON_IsArray(values)) { @@ -141,7 +166,7 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme } - v1_scoped_resource_selector_requirement_local_var = v1_scoped_resource_selector_requirement_create ( + v1_scoped_resource_selector_requirement_local_var = v1_scoped_resource_selector_requirement_create_internal ( strdup(_operator->valuestring), strdup(scope_name->valuestring), values ? valuesList : NULL diff --git a/kubernetes/model/v1_scoped_resource_selector_requirement.h b/kubernetes/model/v1_scoped_resource_selector_requirement.h index d586da83..0df71184 100644 --- a/kubernetes/model/v1_scoped_resource_selector_requirement.h +++ b/kubernetes/model/v1_scoped_resource_selector_requirement.h @@ -23,9 +23,10 @@ typedef struct v1_scoped_resource_selector_requirement_t { char *scope_name; // string list_t *values; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_scoped_resource_selector_requirement_t; -v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requirement_create( +__attribute__((deprecated)) v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requirement_create( char *_operator, char *scope_name, list_t *values diff --git a/kubernetes/model/v1_se_linux_options.c b/kubernetes/model/v1_se_linux_options.c index 487bfa99..d487f639 100644 --- a/kubernetes/model/v1_se_linux_options.c +++ b/kubernetes/model/v1_se_linux_options.c @@ -5,7 +5,7 @@ -v1_se_linux_options_t *v1_se_linux_options_create( +static v1_se_linux_options_t *v1_se_linux_options_create_internal( char *level, char *role, char *type, @@ -20,14 +20,32 @@ v1_se_linux_options_t *v1_se_linux_options_create( v1_se_linux_options_local_var->type = type; v1_se_linux_options_local_var->user = user; + v1_se_linux_options_local_var->_library_owned = 1; return v1_se_linux_options_local_var; } +__attribute__((deprecated)) v1_se_linux_options_t *v1_se_linux_options_create( + char *level, + char *role, + char *type, + char *user + ) { + return v1_se_linux_options_create_internal ( + level, + role, + type, + user + ); +} void v1_se_linux_options_free(v1_se_linux_options_t *v1_se_linux_options) { if(NULL == v1_se_linux_options){ return ; } + if(v1_se_linux_options->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_se_linux_options_free"); + return ; + } listEntry_t *listEntry; if (v1_se_linux_options->level) { free(v1_se_linux_options->level); @@ -96,6 +114,9 @@ v1_se_linux_options_t *v1_se_linux_options_parseFromJSON(cJSON *v1_se_linux_opti // v1_se_linux_options->level cJSON *level = cJSON_GetObjectItemCaseSensitive(v1_se_linux_optionsJSON, "level"); + if (cJSON_IsNull(level)) { + level = NULL; + } if (level) { if(!cJSON_IsString(level) && !cJSON_IsNull(level)) { @@ -105,6 +126,9 @@ v1_se_linux_options_t *v1_se_linux_options_parseFromJSON(cJSON *v1_se_linux_opti // v1_se_linux_options->role cJSON *role = cJSON_GetObjectItemCaseSensitive(v1_se_linux_optionsJSON, "role"); + if (cJSON_IsNull(role)) { + role = NULL; + } if (role) { if(!cJSON_IsString(role) && !cJSON_IsNull(role)) { @@ -114,6 +138,9 @@ v1_se_linux_options_t *v1_se_linux_options_parseFromJSON(cJSON *v1_se_linux_opti // v1_se_linux_options->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_se_linux_optionsJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -123,6 +150,9 @@ v1_se_linux_options_t *v1_se_linux_options_parseFromJSON(cJSON *v1_se_linux_opti // v1_se_linux_options->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_se_linux_optionsJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { if(!cJSON_IsString(user) && !cJSON_IsNull(user)) { @@ -131,7 +161,7 @@ v1_se_linux_options_t *v1_se_linux_options_parseFromJSON(cJSON *v1_se_linux_opti } - v1_se_linux_options_local_var = v1_se_linux_options_create ( + v1_se_linux_options_local_var = v1_se_linux_options_create_internal ( level && !cJSON_IsNull(level) ? strdup(level->valuestring) : NULL, role && !cJSON_IsNull(role) ? strdup(role->valuestring) : NULL, type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL, diff --git a/kubernetes/model/v1_se_linux_options.h b/kubernetes/model/v1_se_linux_options.h index 642e385b..619cd344 100644 --- a/kubernetes/model/v1_se_linux_options.h +++ b/kubernetes/model/v1_se_linux_options.h @@ -24,9 +24,10 @@ typedef struct v1_se_linux_options_t { char *type; // string char *user; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_se_linux_options_t; -v1_se_linux_options_t *v1_se_linux_options_create( +__attribute__((deprecated)) v1_se_linux_options_t *v1_se_linux_options_create( char *level, char *role, char *type, diff --git a/kubernetes/model/v1_seccomp_profile.c b/kubernetes/model/v1_seccomp_profile.c index aa328787..25b6882e 100644 --- a/kubernetes/model/v1_seccomp_profile.c +++ b/kubernetes/model/v1_seccomp_profile.c @@ -5,7 +5,7 @@ -v1_seccomp_profile_t *v1_seccomp_profile_create( +static v1_seccomp_profile_t *v1_seccomp_profile_create_internal( char *localhost_profile, char *type ) { @@ -16,14 +16,28 @@ v1_seccomp_profile_t *v1_seccomp_profile_create( v1_seccomp_profile_local_var->localhost_profile = localhost_profile; v1_seccomp_profile_local_var->type = type; + v1_seccomp_profile_local_var->_library_owned = 1; return v1_seccomp_profile_local_var; } +__attribute__((deprecated)) v1_seccomp_profile_t *v1_seccomp_profile_create( + char *localhost_profile, + char *type + ) { + return v1_seccomp_profile_create_internal ( + localhost_profile, + type + ); +} void v1_seccomp_profile_free(v1_seccomp_profile_t *v1_seccomp_profile) { if(NULL == v1_seccomp_profile){ return ; } + if(v1_seccomp_profile->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_seccomp_profile_free"); + return ; + } listEntry_t *listEntry; if (v1_seccomp_profile->localhost_profile) { free(v1_seccomp_profile->localhost_profile); @@ -69,6 +83,9 @@ v1_seccomp_profile_t *v1_seccomp_profile_parseFromJSON(cJSON *v1_seccomp_profile // v1_seccomp_profile->localhost_profile cJSON *localhost_profile = cJSON_GetObjectItemCaseSensitive(v1_seccomp_profileJSON, "localhostProfile"); + if (cJSON_IsNull(localhost_profile)) { + localhost_profile = NULL; + } if (localhost_profile) { if(!cJSON_IsString(localhost_profile) && !cJSON_IsNull(localhost_profile)) { @@ -78,6 +95,9 @@ v1_seccomp_profile_t *v1_seccomp_profile_parseFromJSON(cJSON *v1_seccomp_profile // v1_seccomp_profile->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_seccomp_profileJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -89,7 +109,7 @@ v1_seccomp_profile_t *v1_seccomp_profile_parseFromJSON(cJSON *v1_seccomp_profile } - v1_seccomp_profile_local_var = v1_seccomp_profile_create ( + v1_seccomp_profile_local_var = v1_seccomp_profile_create_internal ( localhost_profile && !cJSON_IsNull(localhost_profile) ? strdup(localhost_profile->valuestring) : NULL, strdup(type->valuestring) ); diff --git a/kubernetes/model/v1_seccomp_profile.h b/kubernetes/model/v1_seccomp_profile.h index b32e9675..3084df37 100644 --- a/kubernetes/model/v1_seccomp_profile.h +++ b/kubernetes/model/v1_seccomp_profile.h @@ -22,9 +22,10 @@ typedef struct v1_seccomp_profile_t { char *localhost_profile; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_seccomp_profile_t; -v1_seccomp_profile_t *v1_seccomp_profile_create( +__attribute__((deprecated)) v1_seccomp_profile_t *v1_seccomp_profile_create( char *localhost_profile, char *type ); diff --git a/kubernetes/model/v1_secret.c b/kubernetes/model/v1_secret.c index 3d0fc2b2..c1681efd 100644 --- a/kubernetes/model/v1_secret.c +++ b/kubernetes/model/v1_secret.c @@ -5,7 +5,7 @@ -v1_secret_t *v1_secret_create( +static v1_secret_t *v1_secret_create_internal( char *api_version, list_t* data, int immutable, @@ -26,14 +26,38 @@ v1_secret_t *v1_secret_create( v1_secret_local_var->string_data = string_data; v1_secret_local_var->type = type; + v1_secret_local_var->_library_owned = 1; return v1_secret_local_var; } +__attribute__((deprecated)) v1_secret_t *v1_secret_create( + char *api_version, + list_t* data, + int immutable, + char *kind, + v1_object_meta_t *metadata, + list_t* string_data, + char *type + ) { + return v1_secret_create_internal ( + api_version, + data, + immutable, + kind, + metadata, + string_data, + type + ); +} void v1_secret_free(v1_secret_t *v1_secret) { if(NULL == v1_secret){ return ; } + if(v1_secret->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_secret_free"); + return ; + } listEntry_t *listEntry; if (v1_secret->api_version) { free(v1_secret->api_version); @@ -41,7 +65,7 @@ void v1_secret_free(v1_secret_t *v1_secret) { } if (v1_secret->data) { list_ForEach(listEntry, v1_secret->data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -59,7 +83,7 @@ void v1_secret_free(v1_secret_t *v1_secret) { } if (v1_secret->string_data) { list_ForEach(listEntry, v1_secret->string_data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -95,8 +119,8 @@ cJSON *v1_secret_convertToJSON(v1_secret_t *v1_secret) { listEntry_t *dataListEntry; if (v1_secret->data) { list_ForEach(dataListEntry, v1_secret->data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)dataListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = dataListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -144,8 +168,8 @@ cJSON *v1_secret_convertToJSON(v1_secret_t *v1_secret) { listEntry_t *string_dataListEntry; if (v1_secret->string_data) { list_ForEach(string_dataListEntry, v1_secret->string_data) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)string_dataListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = string_dataListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -184,6 +208,9 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -193,6 +220,9 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->data cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "data"); + if (cJSON_IsNull(data)) { + data = NULL; + } if (data) { cJSON *data_local_map = NULL; if(!cJSON_IsObject(data) && !cJSON_IsNull(data)) @@ -218,6 +248,9 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->immutable cJSON *immutable = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "immutable"); + if (cJSON_IsNull(immutable)) { + immutable = NULL; + } if (immutable) { if(!cJSON_IsBool(immutable)) { @@ -227,6 +260,9 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -236,12 +272,18 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_secret->string_data cJSON *string_data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "stringData"); + if (cJSON_IsNull(string_data)) { + string_data = NULL; + } if (string_data) { cJSON *string_data_local_map = NULL; if(!cJSON_IsObject(string_data) && !cJSON_IsNull(string_data)) @@ -267,6 +309,9 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -275,7 +320,7 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ } - v1_secret_local_var = v1_secret_create ( + v1_secret_local_var = v1_secret_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, data ? dataList : NULL, immutable ? immutable->valueint : 0, @@ -290,7 +335,7 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ if (dataList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, dataList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -308,7 +353,7 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ if (string_dataList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, string_dataList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_secret.h b/kubernetes/model/v1_secret.h index 6b675dde..731e1873 100644 --- a/kubernetes/model/v1_secret.h +++ b/kubernetes/model/v1_secret.h @@ -28,9 +28,10 @@ typedef struct v1_secret_t { list_t* string_data; //map char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_secret_t; -v1_secret_t *v1_secret_create( +__attribute__((deprecated)) v1_secret_t *v1_secret_create( char *api_version, list_t* data, int immutable, diff --git a/kubernetes/model/v1_secret_env_source.c b/kubernetes/model/v1_secret_env_source.c index c94135e3..fa98f117 100644 --- a/kubernetes/model/v1_secret_env_source.c +++ b/kubernetes/model/v1_secret_env_source.c @@ -5,7 +5,7 @@ -v1_secret_env_source_t *v1_secret_env_source_create( +static v1_secret_env_source_t *v1_secret_env_source_create_internal( char *name, int optional ) { @@ -16,14 +16,28 @@ v1_secret_env_source_t *v1_secret_env_source_create( v1_secret_env_source_local_var->name = name; v1_secret_env_source_local_var->optional = optional; + v1_secret_env_source_local_var->_library_owned = 1; return v1_secret_env_source_local_var; } +__attribute__((deprecated)) v1_secret_env_source_t *v1_secret_env_source_create( + char *name, + int optional + ) { + return v1_secret_env_source_create_internal ( + name, + optional + ); +} void v1_secret_env_source_free(v1_secret_env_source_t *v1_secret_env_source) { if(NULL == v1_secret_env_source){ return ; } + if(v1_secret_env_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_secret_env_source_free"); + return ; + } listEntry_t *listEntry; if (v1_secret_env_source->name) { free(v1_secret_env_source->name); @@ -64,6 +78,9 @@ v1_secret_env_source_t *v1_secret_env_source_parseFromJSON(cJSON *v1_secret_env_ // v1_secret_env_source->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_secret_env_sourceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -73,6 +90,9 @@ v1_secret_env_source_t *v1_secret_env_source_parseFromJSON(cJSON *v1_secret_env_ // v1_secret_env_source->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_secret_env_sourceJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -81,7 +101,7 @@ v1_secret_env_source_t *v1_secret_env_source_parseFromJSON(cJSON *v1_secret_env_ } - v1_secret_env_source_local_var = v1_secret_env_source_create ( + v1_secret_env_source_local_var = v1_secret_env_source_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, optional ? optional->valueint : 0 ); diff --git a/kubernetes/model/v1_secret_env_source.h b/kubernetes/model/v1_secret_env_source.h index 234b2015..cd7fe67a 100644 --- a/kubernetes/model/v1_secret_env_source.h +++ b/kubernetes/model/v1_secret_env_source.h @@ -22,9 +22,10 @@ typedef struct v1_secret_env_source_t { char *name; // string int optional; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_secret_env_source_t; -v1_secret_env_source_t *v1_secret_env_source_create( +__attribute__((deprecated)) v1_secret_env_source_t *v1_secret_env_source_create( char *name, int optional ); diff --git a/kubernetes/model/v1_secret_key_selector.c b/kubernetes/model/v1_secret_key_selector.c index 302333f9..2fa246c6 100644 --- a/kubernetes/model/v1_secret_key_selector.c +++ b/kubernetes/model/v1_secret_key_selector.c @@ -5,7 +5,7 @@ -v1_secret_key_selector_t *v1_secret_key_selector_create( +static v1_secret_key_selector_t *v1_secret_key_selector_create_internal( char *key, char *name, int optional @@ -18,14 +18,30 @@ v1_secret_key_selector_t *v1_secret_key_selector_create( v1_secret_key_selector_local_var->name = name; v1_secret_key_selector_local_var->optional = optional; + v1_secret_key_selector_local_var->_library_owned = 1; return v1_secret_key_selector_local_var; } +__attribute__((deprecated)) v1_secret_key_selector_t *v1_secret_key_selector_create( + char *key, + char *name, + int optional + ) { + return v1_secret_key_selector_create_internal ( + key, + name, + optional + ); +} void v1_secret_key_selector_free(v1_secret_key_selector_t *v1_secret_key_selector) { if(NULL == v1_secret_key_selector){ return ; } + if(v1_secret_key_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_secret_key_selector_free"); + return ; + } listEntry_t *listEntry; if (v1_secret_key_selector->key) { free(v1_secret_key_selector->key); @@ -79,6 +95,9 @@ v1_secret_key_selector_t *v1_secret_key_selector_parseFromJSON(cJSON *v1_secret_ // v1_secret_key_selector->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_secret_key_selectorJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -91,6 +110,9 @@ v1_secret_key_selector_t *v1_secret_key_selector_parseFromJSON(cJSON *v1_secret_ // v1_secret_key_selector->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_secret_key_selectorJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -100,6 +122,9 @@ v1_secret_key_selector_t *v1_secret_key_selector_parseFromJSON(cJSON *v1_secret_ // v1_secret_key_selector->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_secret_key_selectorJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -108,7 +133,7 @@ v1_secret_key_selector_t *v1_secret_key_selector_parseFromJSON(cJSON *v1_secret_ } - v1_secret_key_selector_local_var = v1_secret_key_selector_create ( + v1_secret_key_selector_local_var = v1_secret_key_selector_create_internal ( strdup(key->valuestring), name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, optional ? optional->valueint : 0 diff --git a/kubernetes/model/v1_secret_key_selector.h b/kubernetes/model/v1_secret_key_selector.h index 628b3e15..ebb60031 100644 --- a/kubernetes/model/v1_secret_key_selector.h +++ b/kubernetes/model/v1_secret_key_selector.h @@ -23,9 +23,10 @@ typedef struct v1_secret_key_selector_t { char *name; // string int optional; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_secret_key_selector_t; -v1_secret_key_selector_t *v1_secret_key_selector_create( +__attribute__((deprecated)) v1_secret_key_selector_t *v1_secret_key_selector_create( char *key, char *name, int optional diff --git a/kubernetes/model/v1_secret_list.c b/kubernetes/model/v1_secret_list.c index 06f48ec8..e4a4c749 100644 --- a/kubernetes/model/v1_secret_list.c +++ b/kubernetes/model/v1_secret_list.c @@ -5,7 +5,7 @@ -v1_secret_list_t *v1_secret_list_create( +static v1_secret_list_t *v1_secret_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_secret_list_t *v1_secret_list_create( v1_secret_list_local_var->kind = kind; v1_secret_list_local_var->metadata = metadata; + v1_secret_list_local_var->_library_owned = 1; return v1_secret_list_local_var; } +__attribute__((deprecated)) v1_secret_list_t *v1_secret_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_secret_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_secret_list_free(v1_secret_list_t *v1_secret_list) { if(NULL == v1_secret_list){ return ; } + if(v1_secret_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_secret_list_free"); + return ; + } listEntry_t *listEntry; if (v1_secret_list->api_version) { free(v1_secret_list->api_version); @@ -123,6 +141,9 @@ v1_secret_list_t *v1_secret_list_parseFromJSON(cJSON *v1_secret_listJSON){ // v1_secret_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_secret_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_secret_list_t *v1_secret_list_parseFromJSON(cJSON *v1_secret_listJSON){ // v1_secret_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_secret_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_secret_list_t *v1_secret_list_parseFromJSON(cJSON *v1_secret_listJSON){ // v1_secret_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_secret_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_secret_list_t *v1_secret_list_parseFromJSON(cJSON *v1_secret_listJSON){ // v1_secret_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_secret_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_secret_list_local_var = v1_secret_list_create ( + v1_secret_list_local_var = v1_secret_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_secret_list.h b/kubernetes/model/v1_secret_list.h index 446765e5..b8ffc9fa 100644 --- a/kubernetes/model/v1_secret_list.h +++ b/kubernetes/model/v1_secret_list.h @@ -26,9 +26,10 @@ typedef struct v1_secret_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_secret_list_t; -v1_secret_list_t *v1_secret_list_create( +__attribute__((deprecated)) v1_secret_list_t *v1_secret_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_secret_projection.c b/kubernetes/model/v1_secret_projection.c index d1ed5ef0..c69c00b2 100644 --- a/kubernetes/model/v1_secret_projection.c +++ b/kubernetes/model/v1_secret_projection.c @@ -5,7 +5,7 @@ -v1_secret_projection_t *v1_secret_projection_create( +static v1_secret_projection_t *v1_secret_projection_create_internal( list_t *items, char *name, int optional @@ -18,14 +18,30 @@ v1_secret_projection_t *v1_secret_projection_create( v1_secret_projection_local_var->name = name; v1_secret_projection_local_var->optional = optional; + v1_secret_projection_local_var->_library_owned = 1; return v1_secret_projection_local_var; } +__attribute__((deprecated)) v1_secret_projection_t *v1_secret_projection_create( + list_t *items, + char *name, + int optional + ) { + return v1_secret_projection_create_internal ( + items, + name, + optional + ); +} void v1_secret_projection_free(v1_secret_projection_t *v1_secret_projection) { if(NULL == v1_secret_projection){ return ; } + if(v1_secret_projection->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_secret_projection_free"); + return ; + } listEntry_t *listEntry; if (v1_secret_projection->items) { list_ForEach(listEntry, v1_secret_projection->items) { @@ -96,6 +112,9 @@ v1_secret_projection_t *v1_secret_projection_parseFromJSON(cJSON *v1_secret_proj // v1_secret_projection->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_secret_projectionJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (items) { cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ @@ -117,6 +136,9 @@ v1_secret_projection_t *v1_secret_projection_parseFromJSON(cJSON *v1_secret_proj // v1_secret_projection->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_secret_projectionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -126,6 +148,9 @@ v1_secret_projection_t *v1_secret_projection_parseFromJSON(cJSON *v1_secret_proj // v1_secret_projection->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_secret_projectionJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -134,7 +159,7 @@ v1_secret_projection_t *v1_secret_projection_parseFromJSON(cJSON *v1_secret_proj } - v1_secret_projection_local_var = v1_secret_projection_create ( + v1_secret_projection_local_var = v1_secret_projection_create_internal ( items ? itemsList : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, optional ? optional->valueint : 0 diff --git a/kubernetes/model/v1_secret_projection.h b/kubernetes/model/v1_secret_projection.h index 951d16fe..f51c2a15 100644 --- a/kubernetes/model/v1_secret_projection.h +++ b/kubernetes/model/v1_secret_projection.h @@ -24,9 +24,10 @@ typedef struct v1_secret_projection_t { char *name; // string int optional; //boolean + int _library_owned; // Is the library responsible for freeing this object? } v1_secret_projection_t; -v1_secret_projection_t *v1_secret_projection_create( +__attribute__((deprecated)) v1_secret_projection_t *v1_secret_projection_create( list_t *items, char *name, int optional diff --git a/kubernetes/model/v1_secret_reference.c b/kubernetes/model/v1_secret_reference.c index c1d2a1dc..ab0a03ba 100644 --- a/kubernetes/model/v1_secret_reference.c +++ b/kubernetes/model/v1_secret_reference.c @@ -5,7 +5,7 @@ -v1_secret_reference_t *v1_secret_reference_create( +static v1_secret_reference_t *v1_secret_reference_create_internal( char *name, char *_namespace ) { @@ -16,14 +16,28 @@ v1_secret_reference_t *v1_secret_reference_create( v1_secret_reference_local_var->name = name; v1_secret_reference_local_var->_namespace = _namespace; + v1_secret_reference_local_var->_library_owned = 1; return v1_secret_reference_local_var; } +__attribute__((deprecated)) v1_secret_reference_t *v1_secret_reference_create( + char *name, + char *_namespace + ) { + return v1_secret_reference_create_internal ( + name, + _namespace + ); +} void v1_secret_reference_free(v1_secret_reference_t *v1_secret_reference) { if(NULL == v1_secret_reference){ return ; } + if(v1_secret_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_secret_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_secret_reference->name) { free(v1_secret_reference->name); @@ -68,6 +82,9 @@ v1_secret_reference_t *v1_secret_reference_parseFromJSON(cJSON *v1_secret_refere // v1_secret_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_secret_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -77,6 +94,9 @@ v1_secret_reference_t *v1_secret_reference_parseFromJSON(cJSON *v1_secret_refere // v1_secret_reference->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_secret_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -85,7 +105,7 @@ v1_secret_reference_t *v1_secret_reference_parseFromJSON(cJSON *v1_secret_refere } - v1_secret_reference_local_var = v1_secret_reference_create ( + v1_secret_reference_local_var = v1_secret_reference_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL ); diff --git a/kubernetes/model/v1_secret_reference.h b/kubernetes/model/v1_secret_reference.h index 54e01f29..be7da573 100644 --- a/kubernetes/model/v1_secret_reference.h +++ b/kubernetes/model/v1_secret_reference.h @@ -22,9 +22,10 @@ typedef struct v1_secret_reference_t { char *name; // string char *_namespace; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_secret_reference_t; -v1_secret_reference_t *v1_secret_reference_create( +__attribute__((deprecated)) v1_secret_reference_t *v1_secret_reference_create( char *name, char *_namespace ); diff --git a/kubernetes/model/v1_secret_volume_source.c b/kubernetes/model/v1_secret_volume_source.c index 2612e5f5..fbd55499 100644 --- a/kubernetes/model/v1_secret_volume_source.c +++ b/kubernetes/model/v1_secret_volume_source.c @@ -5,7 +5,7 @@ -v1_secret_volume_source_t *v1_secret_volume_source_create( +static v1_secret_volume_source_t *v1_secret_volume_source_create_internal( int default_mode, list_t *items, int optional, @@ -20,14 +20,32 @@ v1_secret_volume_source_t *v1_secret_volume_source_create( v1_secret_volume_source_local_var->optional = optional; v1_secret_volume_source_local_var->secret_name = secret_name; + v1_secret_volume_source_local_var->_library_owned = 1; return v1_secret_volume_source_local_var; } +__attribute__((deprecated)) v1_secret_volume_source_t *v1_secret_volume_source_create( + int default_mode, + list_t *items, + int optional, + char *secret_name + ) { + return v1_secret_volume_source_create_internal ( + default_mode, + items, + optional, + secret_name + ); +} void v1_secret_volume_source_free(v1_secret_volume_source_t *v1_secret_volume_source) { if(NULL == v1_secret_volume_source){ return ; } + if(v1_secret_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_secret_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_secret_volume_source->items) { list_ForEach(listEntry, v1_secret_volume_source->items) { @@ -106,6 +124,9 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre // v1_secret_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_secret_volume_sourceJSON, "defaultMode"); + if (cJSON_IsNull(default_mode)) { + default_mode = NULL; + } if (default_mode) { if(!cJSON_IsNumber(default_mode)) { @@ -115,6 +136,9 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre // v1_secret_volume_source->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_secret_volume_sourceJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (items) { cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ @@ -136,6 +160,9 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre // v1_secret_volume_source->optional cJSON *optional = cJSON_GetObjectItemCaseSensitive(v1_secret_volume_sourceJSON, "optional"); + if (cJSON_IsNull(optional)) { + optional = NULL; + } if (optional) { if(!cJSON_IsBool(optional)) { @@ -145,6 +172,9 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre // v1_secret_volume_source->secret_name cJSON *secret_name = cJSON_GetObjectItemCaseSensitive(v1_secret_volume_sourceJSON, "secretName"); + if (cJSON_IsNull(secret_name)) { + secret_name = NULL; + } if (secret_name) { if(!cJSON_IsString(secret_name) && !cJSON_IsNull(secret_name)) { @@ -153,7 +183,7 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre } - v1_secret_volume_source_local_var = v1_secret_volume_source_create ( + v1_secret_volume_source_local_var = v1_secret_volume_source_create_internal ( default_mode ? default_mode->valuedouble : 0, items ? itemsList : NULL, optional ? optional->valueint : 0, diff --git a/kubernetes/model/v1_secret_volume_source.h b/kubernetes/model/v1_secret_volume_source.h index 1db6e466..995af8c7 100644 --- a/kubernetes/model/v1_secret_volume_source.h +++ b/kubernetes/model/v1_secret_volume_source.h @@ -25,9 +25,10 @@ typedef struct v1_secret_volume_source_t { int optional; //boolean char *secret_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_secret_volume_source_t; -v1_secret_volume_source_t *v1_secret_volume_source_create( +__attribute__((deprecated)) v1_secret_volume_source_t *v1_secret_volume_source_create( int default_mode, list_t *items, int optional, diff --git a/kubernetes/model/v1_security_context.c b/kubernetes/model/v1_security_context.c index 435f7a23..39814c27 100644 --- a/kubernetes/model/v1_security_context.c +++ b/kubernetes/model/v1_security_context.c @@ -5,7 +5,7 @@ -v1_security_context_t *v1_security_context_create( +static v1_security_context_t *v1_security_context_create_internal( int allow_privilege_escalation, v1_app_armor_profile_t *app_armor_profile, v1_capabilities_t *capabilities, @@ -36,14 +36,48 @@ v1_security_context_t *v1_security_context_create( v1_security_context_local_var->seccomp_profile = seccomp_profile; v1_security_context_local_var->windows_options = windows_options; + v1_security_context_local_var->_library_owned = 1; return v1_security_context_local_var; } +__attribute__((deprecated)) v1_security_context_t *v1_security_context_create( + int allow_privilege_escalation, + v1_app_armor_profile_t *app_armor_profile, + v1_capabilities_t *capabilities, + int privileged, + char *proc_mount, + int read_only_root_filesystem, + long run_as_group, + int run_as_non_root, + long run_as_user, + v1_se_linux_options_t *se_linux_options, + v1_seccomp_profile_t *seccomp_profile, + v1_windows_security_context_options_t *windows_options + ) { + return v1_security_context_create_internal ( + allow_privilege_escalation, + app_armor_profile, + capabilities, + privileged, + proc_mount, + read_only_root_filesystem, + run_as_group, + run_as_non_root, + run_as_user, + se_linux_options, + seccomp_profile, + windows_options + ); +} void v1_security_context_free(v1_security_context_t *v1_security_context) { if(NULL == v1_security_context){ return ; } + if(v1_security_context->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_security_context_free"); + return ; + } listEntry_t *listEntry; if (v1_security_context->app_armor_profile) { v1_app_armor_profile_free(v1_security_context->app_armor_profile); @@ -224,6 +258,9 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->allow_privilege_escalation cJSON *allow_privilege_escalation = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "allowPrivilegeEscalation"); + if (cJSON_IsNull(allow_privilege_escalation)) { + allow_privilege_escalation = NULL; + } if (allow_privilege_escalation) { if(!cJSON_IsBool(allow_privilege_escalation)) { @@ -233,18 +270,27 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->app_armor_profile cJSON *app_armor_profile = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "appArmorProfile"); + if (cJSON_IsNull(app_armor_profile)) { + app_armor_profile = NULL; + } if (app_armor_profile) { app_armor_profile_local_nonprim = v1_app_armor_profile_parseFromJSON(app_armor_profile); //nonprimitive } // v1_security_context->capabilities cJSON *capabilities = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "capabilities"); + if (cJSON_IsNull(capabilities)) { + capabilities = NULL; + } if (capabilities) { capabilities_local_nonprim = v1_capabilities_parseFromJSON(capabilities); //nonprimitive } // v1_security_context->privileged cJSON *privileged = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "privileged"); + if (cJSON_IsNull(privileged)) { + privileged = NULL; + } if (privileged) { if(!cJSON_IsBool(privileged)) { @@ -254,6 +300,9 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->proc_mount cJSON *proc_mount = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "procMount"); + if (cJSON_IsNull(proc_mount)) { + proc_mount = NULL; + } if (proc_mount) { if(!cJSON_IsString(proc_mount) && !cJSON_IsNull(proc_mount)) { @@ -263,6 +312,9 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->read_only_root_filesystem cJSON *read_only_root_filesystem = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "readOnlyRootFilesystem"); + if (cJSON_IsNull(read_only_root_filesystem)) { + read_only_root_filesystem = NULL; + } if (read_only_root_filesystem) { if(!cJSON_IsBool(read_only_root_filesystem)) { @@ -272,6 +324,9 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->run_as_group cJSON *run_as_group = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "runAsGroup"); + if (cJSON_IsNull(run_as_group)) { + run_as_group = NULL; + } if (run_as_group) { if(!cJSON_IsNumber(run_as_group)) { @@ -281,6 +336,9 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->run_as_non_root cJSON *run_as_non_root = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "runAsNonRoot"); + if (cJSON_IsNull(run_as_non_root)) { + run_as_non_root = NULL; + } if (run_as_non_root) { if(!cJSON_IsBool(run_as_non_root)) { @@ -290,6 +348,9 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->run_as_user cJSON *run_as_user = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "runAsUser"); + if (cJSON_IsNull(run_as_user)) { + run_as_user = NULL; + } if (run_as_user) { if(!cJSON_IsNumber(run_as_user)) { @@ -299,24 +360,33 @@ v1_security_context_t *v1_security_context_parseFromJSON(cJSON *v1_security_cont // v1_security_context->se_linux_options cJSON *se_linux_options = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "seLinuxOptions"); + if (cJSON_IsNull(se_linux_options)) { + se_linux_options = NULL; + } if (se_linux_options) { se_linux_options_local_nonprim = v1_se_linux_options_parseFromJSON(se_linux_options); //nonprimitive } // v1_security_context->seccomp_profile cJSON *seccomp_profile = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "seccompProfile"); + if (cJSON_IsNull(seccomp_profile)) { + seccomp_profile = NULL; + } if (seccomp_profile) { seccomp_profile_local_nonprim = v1_seccomp_profile_parseFromJSON(seccomp_profile); //nonprimitive } // v1_security_context->windows_options cJSON *windows_options = cJSON_GetObjectItemCaseSensitive(v1_security_contextJSON, "windowsOptions"); + if (cJSON_IsNull(windows_options)) { + windows_options = NULL; + } if (windows_options) { windows_options_local_nonprim = v1_windows_security_context_options_parseFromJSON(windows_options); //nonprimitive } - v1_security_context_local_var = v1_security_context_create ( + v1_security_context_local_var = v1_security_context_create_internal ( allow_privilege_escalation ? allow_privilege_escalation->valueint : 0, app_armor_profile ? app_armor_profile_local_nonprim : NULL, capabilities ? capabilities_local_nonprim : NULL, diff --git a/kubernetes/model/v1_security_context.h b/kubernetes/model/v1_security_context.h index 76e9c5c6..f9cb21dd 100644 --- a/kubernetes/model/v1_security_context.h +++ b/kubernetes/model/v1_security_context.h @@ -37,9 +37,10 @@ typedef struct v1_security_context_t { struct v1_seccomp_profile_t *seccomp_profile; //model struct v1_windows_security_context_options_t *windows_options; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_security_context_t; -v1_security_context_t *v1_security_context_create( +__attribute__((deprecated)) v1_security_context_t *v1_security_context_create( int allow_privilege_escalation, v1_app_armor_profile_t *app_armor_profile, v1_capabilities_t *capabilities, diff --git a/kubernetes/model/v1_selectable_field.c b/kubernetes/model/v1_selectable_field.c index 3ed5ea56..6ecb6a5d 100644 --- a/kubernetes/model/v1_selectable_field.c +++ b/kubernetes/model/v1_selectable_field.c @@ -5,7 +5,7 @@ -v1_selectable_field_t *v1_selectable_field_create( +static v1_selectable_field_t *v1_selectable_field_create_internal( char *json_path ) { v1_selectable_field_t *v1_selectable_field_local_var = malloc(sizeof(v1_selectable_field_t)); @@ -14,14 +14,26 @@ v1_selectable_field_t *v1_selectable_field_create( } v1_selectable_field_local_var->json_path = json_path; + v1_selectable_field_local_var->_library_owned = 1; return v1_selectable_field_local_var; } +__attribute__((deprecated)) v1_selectable_field_t *v1_selectable_field_create( + char *json_path + ) { + return v1_selectable_field_create_internal ( + json_path + ); +} void v1_selectable_field_free(v1_selectable_field_t *v1_selectable_field) { if(NULL == v1_selectable_field){ return ; } + if(v1_selectable_field->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_selectable_field_free"); + return ; + } listEntry_t *listEntry; if (v1_selectable_field->json_path) { free(v1_selectable_field->json_path); @@ -55,6 +67,9 @@ v1_selectable_field_t *v1_selectable_field_parseFromJSON(cJSON *v1_selectable_fi // v1_selectable_field->json_path cJSON *json_path = cJSON_GetObjectItemCaseSensitive(v1_selectable_fieldJSON, "jsonPath"); + if (cJSON_IsNull(json_path)) { + json_path = NULL; + } if (!json_path) { goto end; } @@ -66,7 +81,7 @@ v1_selectable_field_t *v1_selectable_field_parseFromJSON(cJSON *v1_selectable_fi } - v1_selectable_field_local_var = v1_selectable_field_create ( + v1_selectable_field_local_var = v1_selectable_field_create_internal ( strdup(json_path->valuestring) ); diff --git a/kubernetes/model/v1_selectable_field.h b/kubernetes/model/v1_selectable_field.h index 4c0615ff..b89d770e 100644 --- a/kubernetes/model/v1_selectable_field.h +++ b/kubernetes/model/v1_selectable_field.h @@ -21,9 +21,10 @@ typedef struct v1_selectable_field_t v1_selectable_field_t; typedef struct v1_selectable_field_t { char *json_path; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_selectable_field_t; -v1_selectable_field_t *v1_selectable_field_create( +__attribute__((deprecated)) v1_selectable_field_t *v1_selectable_field_create( char *json_path ); diff --git a/kubernetes/model/v1_self_subject_access_review.c b/kubernetes/model/v1_self_subject_access_review.c index 5280e61f..fe1fac78 100644 --- a/kubernetes/model/v1_self_subject_access_review.c +++ b/kubernetes/model/v1_self_subject_access_review.c @@ -5,7 +5,7 @@ -v1_self_subject_access_review_t *v1_self_subject_access_review_create( +static v1_self_subject_access_review_t *v1_self_subject_access_review_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_self_subject_access_review_t *v1_self_subject_access_review_create( v1_self_subject_access_review_local_var->spec = spec; v1_self_subject_access_review_local_var->status = status; + v1_self_subject_access_review_local_var->_library_owned = 1; return v1_self_subject_access_review_local_var; } +__attribute__((deprecated)) v1_self_subject_access_review_t *v1_self_subject_access_review_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_self_subject_access_review_spec_t *spec, + v1_subject_access_review_status_t *status + ) { + return v1_self_subject_access_review_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_self_subject_access_review_free(v1_self_subject_access_review_t *v1_self_subject_access_review) { if(NULL == v1_self_subject_access_review){ return ; } + if(v1_self_subject_access_review->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_self_subject_access_review_free"); + return ; + } listEntry_t *listEntry; if (v1_self_subject_access_review->api_version) { free(v1_self_subject_access_review->api_version); @@ -135,6 +155,9 @@ v1_self_subject_access_review_t *v1_self_subject_access_review_parseFromJSON(cJS // v1_self_subject_access_review->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_self_subject_access_reviewJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_self_subject_access_review_t *v1_self_subject_access_review_parseFromJSON(cJS // v1_self_subject_access_review->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_self_subject_access_reviewJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_self_subject_access_review_t *v1_self_subject_access_review_parseFromJSON(cJS // v1_self_subject_access_review->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_self_subject_access_reviewJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_self_subject_access_review->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_self_subject_access_reviewJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_self_subject_access_review_t *v1_self_subject_access_review_parseFromJSON(cJS // v1_self_subject_access_review->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_self_subject_access_reviewJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_subject_access_review_status_parseFromJSON(status); //nonprimitive } - v1_self_subject_access_review_local_var = v1_self_subject_access_review_create ( + v1_self_subject_access_review_local_var = v1_self_subject_access_review_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_self_subject_access_review.h b/kubernetes/model/v1_self_subject_access_review.h index caedb184..b0ce880d 100644 --- a/kubernetes/model/v1_self_subject_access_review.h +++ b/kubernetes/model/v1_self_subject_access_review.h @@ -28,9 +28,10 @@ typedef struct v1_self_subject_access_review_t { struct v1_self_subject_access_review_spec_t *spec; //model struct v1_subject_access_review_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_self_subject_access_review_t; -v1_self_subject_access_review_t *v1_self_subject_access_review_create( +__attribute__((deprecated)) v1_self_subject_access_review_t *v1_self_subject_access_review_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_self_subject_access_review_spec.c b/kubernetes/model/v1_self_subject_access_review_spec.c index f1095795..5dff2f55 100644 --- a/kubernetes/model/v1_self_subject_access_review_spec.c +++ b/kubernetes/model/v1_self_subject_access_review_spec.c @@ -5,7 +5,7 @@ -v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec_create( +static v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec_create_internal( v1_non_resource_attributes_t *non_resource_attributes, v1_resource_attributes_t *resource_attributes ) { @@ -16,14 +16,28 @@ v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec_create( v1_self_subject_access_review_spec_local_var->non_resource_attributes = non_resource_attributes; v1_self_subject_access_review_spec_local_var->resource_attributes = resource_attributes; + v1_self_subject_access_review_spec_local_var->_library_owned = 1; return v1_self_subject_access_review_spec_local_var; } +__attribute__((deprecated)) v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec_create( + v1_non_resource_attributes_t *non_resource_attributes, + v1_resource_attributes_t *resource_attributes + ) { + return v1_self_subject_access_review_spec_create_internal ( + non_resource_attributes, + resource_attributes + ); +} void v1_self_subject_access_review_spec_free(v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec) { if(NULL == v1_self_subject_access_review_spec){ return ; } + if(v1_self_subject_access_review_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_self_subject_access_review_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_self_subject_access_review_spec->non_resource_attributes) { v1_non_resource_attributes_free(v1_self_subject_access_review_spec->non_resource_attributes); @@ -84,18 +98,24 @@ v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec_parseFr // v1_self_subject_access_review_spec->non_resource_attributes cJSON *non_resource_attributes = cJSON_GetObjectItemCaseSensitive(v1_self_subject_access_review_specJSON, "nonResourceAttributes"); + if (cJSON_IsNull(non_resource_attributes)) { + non_resource_attributes = NULL; + } if (non_resource_attributes) { non_resource_attributes_local_nonprim = v1_non_resource_attributes_parseFromJSON(non_resource_attributes); //nonprimitive } // v1_self_subject_access_review_spec->resource_attributes cJSON *resource_attributes = cJSON_GetObjectItemCaseSensitive(v1_self_subject_access_review_specJSON, "resourceAttributes"); + if (cJSON_IsNull(resource_attributes)) { + resource_attributes = NULL; + } if (resource_attributes) { resource_attributes_local_nonprim = v1_resource_attributes_parseFromJSON(resource_attributes); //nonprimitive } - v1_self_subject_access_review_spec_local_var = v1_self_subject_access_review_spec_create ( + v1_self_subject_access_review_spec_local_var = v1_self_subject_access_review_spec_create_internal ( non_resource_attributes ? non_resource_attributes_local_nonprim : NULL, resource_attributes ? resource_attributes_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_self_subject_access_review_spec.h b/kubernetes/model/v1_self_subject_access_review_spec.h index ded3ef65..1406131b 100644 --- a/kubernetes/model/v1_self_subject_access_review_spec.h +++ b/kubernetes/model/v1_self_subject_access_review_spec.h @@ -24,9 +24,10 @@ typedef struct v1_self_subject_access_review_spec_t { struct v1_non_resource_attributes_t *non_resource_attributes; //model struct v1_resource_attributes_t *resource_attributes; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_self_subject_access_review_spec_t; -v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec_create( +__attribute__((deprecated)) v1_self_subject_access_review_spec_t *v1_self_subject_access_review_spec_create( v1_non_resource_attributes_t *non_resource_attributes, v1_resource_attributes_t *resource_attributes ); diff --git a/kubernetes/model/v1_self_subject_review.c b/kubernetes/model/v1_self_subject_review.c index 20e3e3f1..18895b4e 100644 --- a/kubernetes/model/v1_self_subject_review.c +++ b/kubernetes/model/v1_self_subject_review.c @@ -5,7 +5,7 @@ -v1_self_subject_review_t *v1_self_subject_review_create( +static v1_self_subject_review_t *v1_self_subject_review_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_self_subject_review_t *v1_self_subject_review_create( v1_self_subject_review_local_var->metadata = metadata; v1_self_subject_review_local_var->status = status; + v1_self_subject_review_local_var->_library_owned = 1; return v1_self_subject_review_local_var; } +__attribute__((deprecated)) v1_self_subject_review_t *v1_self_subject_review_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_self_subject_review_status_t *status + ) { + return v1_self_subject_review_create_internal ( + api_version, + kind, + metadata, + status + ); +} void v1_self_subject_review_free(v1_self_subject_review_t *v1_self_subject_review) { if(NULL == v1_self_subject_review){ return ; } + if(v1_self_subject_review->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_self_subject_review_free"); + return ; + } listEntry_t *listEntry; if (v1_self_subject_review->api_version) { free(v1_self_subject_review->api_version); @@ -112,6 +130,9 @@ v1_self_subject_review_t *v1_self_subject_review_parseFromJSON(cJSON *v1_self_su // v1_self_subject_review->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_self_subject_reviewJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,6 +142,9 @@ v1_self_subject_review_t *v1_self_subject_review_parseFromJSON(cJSON *v1_self_su // v1_self_subject_review->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_self_subject_reviewJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -130,18 +154,24 @@ v1_self_subject_review_t *v1_self_subject_review_parseFromJSON(cJSON *v1_self_su // v1_self_subject_review->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_self_subject_reviewJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_self_subject_review->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_self_subject_reviewJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_self_subject_review_status_parseFromJSON(status); //nonprimitive } - v1_self_subject_review_local_var = v1_self_subject_review_create ( + v1_self_subject_review_local_var = v1_self_subject_review_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_self_subject_review.h b/kubernetes/model/v1_self_subject_review.h index 48004394..6db0e453 100644 --- a/kubernetes/model/v1_self_subject_review.h +++ b/kubernetes/model/v1_self_subject_review.h @@ -26,9 +26,10 @@ typedef struct v1_self_subject_review_t { struct v1_object_meta_t *metadata; //model struct v1_self_subject_review_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_self_subject_review_t; -v1_self_subject_review_t *v1_self_subject_review_create( +__attribute__((deprecated)) v1_self_subject_review_t *v1_self_subject_review_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_self_subject_review_status.c b/kubernetes/model/v1_self_subject_review_status.c index 4fc98266..010e994a 100644 --- a/kubernetes/model/v1_self_subject_review_status.c +++ b/kubernetes/model/v1_self_subject_review_status.c @@ -5,7 +5,7 @@ -v1_self_subject_review_status_t *v1_self_subject_review_status_create( +static v1_self_subject_review_status_t *v1_self_subject_review_status_create_internal( v1_user_info_t *user_info ) { v1_self_subject_review_status_t *v1_self_subject_review_status_local_var = malloc(sizeof(v1_self_subject_review_status_t)); @@ -14,14 +14,26 @@ v1_self_subject_review_status_t *v1_self_subject_review_status_create( } v1_self_subject_review_status_local_var->user_info = user_info; + v1_self_subject_review_status_local_var->_library_owned = 1; return v1_self_subject_review_status_local_var; } +__attribute__((deprecated)) v1_self_subject_review_status_t *v1_self_subject_review_status_create( + v1_user_info_t *user_info + ) { + return v1_self_subject_review_status_create_internal ( + user_info + ); +} void v1_self_subject_review_status_free(v1_self_subject_review_status_t *v1_self_subject_review_status) { if(NULL == v1_self_subject_review_status){ return ; } + if(v1_self_subject_review_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_self_subject_review_status_free"); + return ; + } listEntry_t *listEntry; if (v1_self_subject_review_status->user_info) { v1_user_info_free(v1_self_subject_review_status->user_info); @@ -62,12 +74,15 @@ v1_self_subject_review_status_t *v1_self_subject_review_status_parseFromJSON(cJS // v1_self_subject_review_status->user_info cJSON *user_info = cJSON_GetObjectItemCaseSensitive(v1_self_subject_review_statusJSON, "userInfo"); + if (cJSON_IsNull(user_info)) { + user_info = NULL; + } if (user_info) { user_info_local_nonprim = v1_user_info_parseFromJSON(user_info); //nonprimitive } - v1_self_subject_review_status_local_var = v1_self_subject_review_status_create ( + v1_self_subject_review_status_local_var = v1_self_subject_review_status_create_internal ( user_info ? user_info_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_self_subject_review_status.h b/kubernetes/model/v1_self_subject_review_status.h index d451bd5a..adea3dc0 100644 --- a/kubernetes/model/v1_self_subject_review_status.h +++ b/kubernetes/model/v1_self_subject_review_status.h @@ -22,9 +22,10 @@ typedef struct v1_self_subject_review_status_t v1_self_subject_review_status_t; typedef struct v1_self_subject_review_status_t { struct v1_user_info_t *user_info; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_self_subject_review_status_t; -v1_self_subject_review_status_t *v1_self_subject_review_status_create( +__attribute__((deprecated)) v1_self_subject_review_status_t *v1_self_subject_review_status_create( v1_user_info_t *user_info ); diff --git a/kubernetes/model/v1_self_subject_rules_review.c b/kubernetes/model/v1_self_subject_rules_review.c index d31307ba..b5aa2466 100644 --- a/kubernetes/model/v1_self_subject_rules_review.c +++ b/kubernetes/model/v1_self_subject_rules_review.c @@ -5,7 +5,7 @@ -v1_self_subject_rules_review_t *v1_self_subject_rules_review_create( +static v1_self_subject_rules_review_t *v1_self_subject_rules_review_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_self_subject_rules_review_t *v1_self_subject_rules_review_create( v1_self_subject_rules_review_local_var->spec = spec; v1_self_subject_rules_review_local_var->status = status; + v1_self_subject_rules_review_local_var->_library_owned = 1; return v1_self_subject_rules_review_local_var; } +__attribute__((deprecated)) v1_self_subject_rules_review_t *v1_self_subject_rules_review_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_self_subject_rules_review_spec_t *spec, + v1_subject_rules_review_status_t *status + ) { + return v1_self_subject_rules_review_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_self_subject_rules_review_free(v1_self_subject_rules_review_t *v1_self_subject_rules_review) { if(NULL == v1_self_subject_rules_review){ return ; } + if(v1_self_subject_rules_review->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_self_subject_rules_review_free"); + return ; + } listEntry_t *listEntry; if (v1_self_subject_rules_review->api_version) { free(v1_self_subject_rules_review->api_version); @@ -135,6 +155,9 @@ v1_self_subject_rules_review_t *v1_self_subject_rules_review_parseFromJSON(cJSON // v1_self_subject_rules_review->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_self_subject_rules_reviewJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_self_subject_rules_review_t *v1_self_subject_rules_review_parseFromJSON(cJSON // v1_self_subject_rules_review->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_self_subject_rules_reviewJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_self_subject_rules_review_t *v1_self_subject_rules_review_parseFromJSON(cJSON // v1_self_subject_rules_review->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_self_subject_rules_reviewJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_self_subject_rules_review->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_self_subject_rules_reviewJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_self_subject_rules_review_t *v1_self_subject_rules_review_parseFromJSON(cJSON // v1_self_subject_rules_review->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_self_subject_rules_reviewJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_subject_rules_review_status_parseFromJSON(status); //nonprimitive } - v1_self_subject_rules_review_local_var = v1_self_subject_rules_review_create ( + v1_self_subject_rules_review_local_var = v1_self_subject_rules_review_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_self_subject_rules_review.h b/kubernetes/model/v1_self_subject_rules_review.h index a0ca6925..daf48daf 100644 --- a/kubernetes/model/v1_self_subject_rules_review.h +++ b/kubernetes/model/v1_self_subject_rules_review.h @@ -28,9 +28,10 @@ typedef struct v1_self_subject_rules_review_t { struct v1_self_subject_rules_review_spec_t *spec; //model struct v1_subject_rules_review_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_self_subject_rules_review_t; -v1_self_subject_rules_review_t *v1_self_subject_rules_review_create( +__attribute__((deprecated)) v1_self_subject_rules_review_t *v1_self_subject_rules_review_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_self_subject_rules_review_spec.c b/kubernetes/model/v1_self_subject_rules_review_spec.c index f707b7e7..52a80a06 100644 --- a/kubernetes/model/v1_self_subject_rules_review_spec.c +++ b/kubernetes/model/v1_self_subject_rules_review_spec.c @@ -5,7 +5,7 @@ -v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_create( +static v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_create_internal( char *_namespace ) { v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_local_var = malloc(sizeof(v1_self_subject_rules_review_spec_t)); @@ -14,14 +14,26 @@ v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_create( } v1_self_subject_rules_review_spec_local_var->_namespace = _namespace; + v1_self_subject_rules_review_spec_local_var->_library_owned = 1; return v1_self_subject_rules_review_spec_local_var; } +__attribute__((deprecated)) v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_create( + char *_namespace + ) { + return v1_self_subject_rules_review_spec_create_internal ( + _namespace + ); +} void v1_self_subject_rules_review_spec_free(v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec) { if(NULL == v1_self_subject_rules_review_spec){ return ; } + if(v1_self_subject_rules_review_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_self_subject_rules_review_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_self_subject_rules_review_spec->_namespace) { free(v1_self_subject_rules_review_spec->_namespace); @@ -54,6 +66,9 @@ v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_parseFrom // v1_self_subject_rules_review_spec->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_self_subject_rules_review_specJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -62,7 +77,7 @@ v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_parseFrom } - v1_self_subject_rules_review_spec_local_var = v1_self_subject_rules_review_spec_create ( + v1_self_subject_rules_review_spec_local_var = v1_self_subject_rules_review_spec_create_internal ( _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL ); diff --git a/kubernetes/model/v1_self_subject_rules_review_spec.h b/kubernetes/model/v1_self_subject_rules_review_spec.h index 84d2c852..377b2ee9 100644 --- a/kubernetes/model/v1_self_subject_rules_review_spec.h +++ b/kubernetes/model/v1_self_subject_rules_review_spec.h @@ -21,9 +21,10 @@ typedef struct v1_self_subject_rules_review_spec_t v1_self_subject_rules_review_ typedef struct v1_self_subject_rules_review_spec_t { char *_namespace; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_self_subject_rules_review_spec_t; -v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_create( +__attribute__((deprecated)) v1_self_subject_rules_review_spec_t *v1_self_subject_rules_review_spec_create( char *_namespace ); diff --git a/kubernetes/model/v1_server_address_by_client_cidr.c b/kubernetes/model/v1_server_address_by_client_cidr.c index 7dd21c99..8044425e 100644 --- a/kubernetes/model/v1_server_address_by_client_cidr.c +++ b/kubernetes/model/v1_server_address_by_client_cidr.c @@ -5,7 +5,7 @@ -v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_create( +static v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_create_internal( char *client_cidr, char *server_address ) { @@ -16,14 +16,28 @@ v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_create( v1_server_address_by_client_cidr_local_var->client_cidr = client_cidr; v1_server_address_by_client_cidr_local_var->server_address = server_address; + v1_server_address_by_client_cidr_local_var->_library_owned = 1; return v1_server_address_by_client_cidr_local_var; } +__attribute__((deprecated)) v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_create( + char *client_cidr, + char *server_address + ) { + return v1_server_address_by_client_cidr_create_internal ( + client_cidr, + server_address + ); +} void v1_server_address_by_client_cidr_free(v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr) { if(NULL == v1_server_address_by_client_cidr){ return ; } + if(v1_server_address_by_client_cidr->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_server_address_by_client_cidr_free"); + return ; + } listEntry_t *listEntry; if (v1_server_address_by_client_cidr->client_cidr) { free(v1_server_address_by_client_cidr->client_cidr); @@ -70,6 +84,9 @@ v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_parseFromJS // v1_server_address_by_client_cidr->client_cidr cJSON *client_cidr = cJSON_GetObjectItemCaseSensitive(v1_server_address_by_client_cidrJSON, "clientCIDR"); + if (cJSON_IsNull(client_cidr)) { + client_cidr = NULL; + } if (!client_cidr) { goto end; } @@ -82,6 +99,9 @@ v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_parseFromJS // v1_server_address_by_client_cidr->server_address cJSON *server_address = cJSON_GetObjectItemCaseSensitive(v1_server_address_by_client_cidrJSON, "serverAddress"); + if (cJSON_IsNull(server_address)) { + server_address = NULL; + } if (!server_address) { goto end; } @@ -93,7 +113,7 @@ v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_parseFromJS } - v1_server_address_by_client_cidr_local_var = v1_server_address_by_client_cidr_create ( + v1_server_address_by_client_cidr_local_var = v1_server_address_by_client_cidr_create_internal ( strdup(client_cidr->valuestring), strdup(server_address->valuestring) ); diff --git a/kubernetes/model/v1_server_address_by_client_cidr.h b/kubernetes/model/v1_server_address_by_client_cidr.h index e96bb1af..1cc4e5ea 100644 --- a/kubernetes/model/v1_server_address_by_client_cidr.h +++ b/kubernetes/model/v1_server_address_by_client_cidr.h @@ -22,9 +22,10 @@ typedef struct v1_server_address_by_client_cidr_t { char *client_cidr; // string char *server_address; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_server_address_by_client_cidr_t; -v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_create( +__attribute__((deprecated)) v1_server_address_by_client_cidr_t *v1_server_address_by_client_cidr_create( char *client_cidr, char *server_address ); diff --git a/kubernetes/model/v1_service.c b/kubernetes/model/v1_service.c index d65ea2ca..9cf252b8 100644 --- a/kubernetes/model/v1_service.c +++ b/kubernetes/model/v1_service.c @@ -5,7 +5,7 @@ -v1_service_t *v1_service_create( +static v1_service_t *v1_service_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_service_t *v1_service_create( v1_service_local_var->spec = spec; v1_service_local_var->status = status; + v1_service_local_var->_library_owned = 1; return v1_service_local_var; } +__attribute__((deprecated)) v1_service_t *v1_service_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_service_spec_t *spec, + v1_service_status_t *status + ) { + return v1_service_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_service_free(v1_service_t *v1_service) { if(NULL == v1_service){ return ; } + if(v1_service->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_free"); + return ; + } listEntry_t *listEntry; if (v1_service->api_version) { free(v1_service->api_version); @@ -134,6 +154,9 @@ v1_service_t *v1_service_parseFromJSON(cJSON *v1_serviceJSON){ // v1_service->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_serviceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_service_t *v1_service_parseFromJSON(cJSON *v1_serviceJSON){ // v1_service->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_serviceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_service_t *v1_service_parseFromJSON(cJSON *v1_serviceJSON){ // v1_service->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_serviceJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_service->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_serviceJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_service_spec_parseFromJSON(spec); //nonprimitive } // v1_service->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_serviceJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_service_status_parseFromJSON(status); //nonprimitive } - v1_service_local_var = v1_service_create ( + v1_service_local_var = v1_service_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_service.h b/kubernetes/model/v1_service.h index 6b989cfa..10c8089d 100644 --- a/kubernetes/model/v1_service.h +++ b/kubernetes/model/v1_service.h @@ -28,9 +28,10 @@ typedef struct v1_service_t { struct v1_service_spec_t *spec; //model struct v1_service_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_service_t; -v1_service_t *v1_service_create( +__attribute__((deprecated)) v1_service_t *v1_service_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_service_account.c b/kubernetes/model/v1_service_account.c index 9e1b72f0..2ad57c11 100644 --- a/kubernetes/model/v1_service_account.c +++ b/kubernetes/model/v1_service_account.c @@ -5,7 +5,7 @@ -v1_service_account_t *v1_service_account_create( +static v1_service_account_t *v1_service_account_create_internal( char *api_version, int automount_service_account_token, list_t *image_pull_secrets, @@ -24,14 +24,36 @@ v1_service_account_t *v1_service_account_create( v1_service_account_local_var->metadata = metadata; v1_service_account_local_var->secrets = secrets; + v1_service_account_local_var->_library_owned = 1; return v1_service_account_local_var; } +__attribute__((deprecated)) v1_service_account_t *v1_service_account_create( + char *api_version, + int automount_service_account_token, + list_t *image_pull_secrets, + char *kind, + v1_object_meta_t *metadata, + list_t *secrets + ) { + return v1_service_account_create_internal ( + api_version, + automount_service_account_token, + image_pull_secrets, + kind, + metadata, + secrets + ); +} void v1_service_account_free(v1_service_account_t *v1_service_account) { if(NULL == v1_service_account){ return ; } + if(v1_service_account->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_account_free"); + return ; + } listEntry_t *listEntry; if (v1_service_account->api_version) { free(v1_service_account->api_version); @@ -164,6 +186,9 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account // v1_service_account->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -173,6 +198,9 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account // v1_service_account->automount_service_account_token cJSON *automount_service_account_token = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "automountServiceAccountToken"); + if (cJSON_IsNull(automount_service_account_token)) { + automount_service_account_token = NULL; + } if (automount_service_account_token) { if(!cJSON_IsBool(automount_service_account_token)) { @@ -182,6 +210,9 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account // v1_service_account->image_pull_secrets cJSON *image_pull_secrets = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "imagePullSecrets"); + if (cJSON_IsNull(image_pull_secrets)) { + image_pull_secrets = NULL; + } if (image_pull_secrets) { cJSON *image_pull_secrets_local_nonprimitive = NULL; if(!cJSON_IsArray(image_pull_secrets)){ @@ -203,6 +234,9 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account // v1_service_account->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -212,12 +246,18 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account // v1_service_account->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_service_account->secrets cJSON *secrets = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "secrets"); + if (cJSON_IsNull(secrets)) { + secrets = NULL; + } if (secrets) { cJSON *secrets_local_nonprimitive = NULL; if(!cJSON_IsArray(secrets)){ @@ -238,7 +278,7 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account } - v1_service_account_local_var = v1_service_account_create ( + v1_service_account_local_var = v1_service_account_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, automount_service_account_token ? automount_service_account_token->valueint : 0, image_pull_secrets ? image_pull_secretsList : NULL, diff --git a/kubernetes/model/v1_service_account.h b/kubernetes/model/v1_service_account.h index 59752da3..19caa29c 100644 --- a/kubernetes/model/v1_service_account.h +++ b/kubernetes/model/v1_service_account.h @@ -29,9 +29,10 @@ typedef struct v1_service_account_t { struct v1_object_meta_t *metadata; //model list_t *secrets; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_service_account_t; -v1_service_account_t *v1_service_account_create( +__attribute__((deprecated)) v1_service_account_t *v1_service_account_create( char *api_version, int automount_service_account_token, list_t *image_pull_secrets, diff --git a/kubernetes/model/v1_service_account_list.c b/kubernetes/model/v1_service_account_list.c index a445aca9..0b66ec88 100644 --- a/kubernetes/model/v1_service_account_list.c +++ b/kubernetes/model/v1_service_account_list.c @@ -5,7 +5,7 @@ -v1_service_account_list_t *v1_service_account_list_create( +static v1_service_account_list_t *v1_service_account_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_service_account_list_t *v1_service_account_list_create( v1_service_account_list_local_var->kind = kind; v1_service_account_list_local_var->metadata = metadata; + v1_service_account_list_local_var->_library_owned = 1; return v1_service_account_list_local_var; } +__attribute__((deprecated)) v1_service_account_list_t *v1_service_account_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_service_account_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_service_account_list_free(v1_service_account_list_t *v1_service_account_list) { if(NULL == v1_service_account_list){ return ; } + if(v1_service_account_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_account_list_free"); + return ; + } listEntry_t *listEntry; if (v1_service_account_list->api_version) { free(v1_service_account_list->api_version); @@ -123,6 +141,9 @@ v1_service_account_list_t *v1_service_account_list_parseFromJSON(cJSON *v1_servi // v1_service_account_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_service_account_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_service_account_list_t *v1_service_account_list_parseFromJSON(cJSON *v1_servi // v1_service_account_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_service_account_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_service_account_list_t *v1_service_account_list_parseFromJSON(cJSON *v1_servi // v1_service_account_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_service_account_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_service_account_list_t *v1_service_account_list_parseFromJSON(cJSON *v1_servi // v1_service_account_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_service_account_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_service_account_list_local_var = v1_service_account_list_create ( + v1_service_account_list_local_var = v1_service_account_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_service_account_list.h b/kubernetes/model/v1_service_account_list.h index 1649f47d..986f45e9 100644 --- a/kubernetes/model/v1_service_account_list.h +++ b/kubernetes/model/v1_service_account_list.h @@ -26,9 +26,10 @@ typedef struct v1_service_account_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_service_account_list_t; -v1_service_account_list_t *v1_service_account_list_create( +__attribute__((deprecated)) v1_service_account_list_t *v1_service_account_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_service_account_subject.c b/kubernetes/model/v1_service_account_subject.c index 43e0c2e9..60340b01 100644 --- a/kubernetes/model/v1_service_account_subject.c +++ b/kubernetes/model/v1_service_account_subject.c @@ -5,7 +5,7 @@ -v1_service_account_subject_t *v1_service_account_subject_create( +static v1_service_account_subject_t *v1_service_account_subject_create_internal( char *name, char *_namespace ) { @@ -16,14 +16,28 @@ v1_service_account_subject_t *v1_service_account_subject_create( v1_service_account_subject_local_var->name = name; v1_service_account_subject_local_var->_namespace = _namespace; + v1_service_account_subject_local_var->_library_owned = 1; return v1_service_account_subject_local_var; } +__attribute__((deprecated)) v1_service_account_subject_t *v1_service_account_subject_create( + char *name, + char *_namespace + ) { + return v1_service_account_subject_create_internal ( + name, + _namespace + ); +} void v1_service_account_subject_free(v1_service_account_subject_t *v1_service_account_subject) { if(NULL == v1_service_account_subject){ return ; } + if(v1_service_account_subject->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_account_subject_free"); + return ; + } listEntry_t *listEntry; if (v1_service_account_subject->name) { free(v1_service_account_subject->name); @@ -70,6 +84,9 @@ v1_service_account_subject_t *v1_service_account_subject_parseFromJSON(cJSON *v1 // v1_service_account_subject->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_service_account_subjectJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -82,6 +99,9 @@ v1_service_account_subject_t *v1_service_account_subject_parseFromJSON(cJSON *v1 // v1_service_account_subject->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_service_account_subjectJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (!_namespace) { goto end; } @@ -93,7 +113,7 @@ v1_service_account_subject_t *v1_service_account_subject_parseFromJSON(cJSON *v1 } - v1_service_account_subject_local_var = v1_service_account_subject_create ( + v1_service_account_subject_local_var = v1_service_account_subject_create_internal ( strdup(name->valuestring), strdup(_namespace->valuestring) ); diff --git a/kubernetes/model/v1_service_account_subject.h b/kubernetes/model/v1_service_account_subject.h index 0ba21e36..a320c55d 100644 --- a/kubernetes/model/v1_service_account_subject.h +++ b/kubernetes/model/v1_service_account_subject.h @@ -22,9 +22,10 @@ typedef struct v1_service_account_subject_t { char *name; // string char *_namespace; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_service_account_subject_t; -v1_service_account_subject_t *v1_service_account_subject_create( +__attribute__((deprecated)) v1_service_account_subject_t *v1_service_account_subject_create( char *name, char *_namespace ); diff --git a/kubernetes/model/v1_service_account_token_projection.c b/kubernetes/model/v1_service_account_token_projection.c index 9eedfe98..d1489256 100644 --- a/kubernetes/model/v1_service_account_token_projection.c +++ b/kubernetes/model/v1_service_account_token_projection.c @@ -5,7 +5,7 @@ -v1_service_account_token_projection_t *v1_service_account_token_projection_create( +static v1_service_account_token_projection_t *v1_service_account_token_projection_create_internal( char *audience, long expiration_seconds, char *path @@ -18,14 +18,30 @@ v1_service_account_token_projection_t *v1_service_account_token_projection_creat v1_service_account_token_projection_local_var->expiration_seconds = expiration_seconds; v1_service_account_token_projection_local_var->path = path; + v1_service_account_token_projection_local_var->_library_owned = 1; return v1_service_account_token_projection_local_var; } +__attribute__((deprecated)) v1_service_account_token_projection_t *v1_service_account_token_projection_create( + char *audience, + long expiration_seconds, + char *path + ) { + return v1_service_account_token_projection_create_internal ( + audience, + expiration_seconds, + path + ); +} void v1_service_account_token_projection_free(v1_service_account_token_projection_t *v1_service_account_token_projection) { if(NULL == v1_service_account_token_projection){ return ; } + if(v1_service_account_token_projection->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_account_token_projection_free"); + return ; + } listEntry_t *listEntry; if (v1_service_account_token_projection->audience) { free(v1_service_account_token_projection->audience); @@ -79,6 +95,9 @@ v1_service_account_token_projection_t *v1_service_account_token_projection_parse // v1_service_account_token_projection->audience cJSON *audience = cJSON_GetObjectItemCaseSensitive(v1_service_account_token_projectionJSON, "audience"); + if (cJSON_IsNull(audience)) { + audience = NULL; + } if (audience) { if(!cJSON_IsString(audience) && !cJSON_IsNull(audience)) { @@ -88,6 +107,9 @@ v1_service_account_token_projection_t *v1_service_account_token_projection_parse // v1_service_account_token_projection->expiration_seconds cJSON *expiration_seconds = cJSON_GetObjectItemCaseSensitive(v1_service_account_token_projectionJSON, "expirationSeconds"); + if (cJSON_IsNull(expiration_seconds)) { + expiration_seconds = NULL; + } if (expiration_seconds) { if(!cJSON_IsNumber(expiration_seconds)) { @@ -97,6 +119,9 @@ v1_service_account_token_projection_t *v1_service_account_token_projection_parse // v1_service_account_token_projection->path cJSON *path = cJSON_GetObjectItemCaseSensitive(v1_service_account_token_projectionJSON, "path"); + if (cJSON_IsNull(path)) { + path = NULL; + } if (!path) { goto end; } @@ -108,7 +133,7 @@ v1_service_account_token_projection_t *v1_service_account_token_projection_parse } - v1_service_account_token_projection_local_var = v1_service_account_token_projection_create ( + v1_service_account_token_projection_local_var = v1_service_account_token_projection_create_internal ( audience && !cJSON_IsNull(audience) ? strdup(audience->valuestring) : NULL, expiration_seconds ? expiration_seconds->valuedouble : 0, strdup(path->valuestring) diff --git a/kubernetes/model/v1_service_account_token_projection.h b/kubernetes/model/v1_service_account_token_projection.h index 1ef238f1..f6d6c93c 100644 --- a/kubernetes/model/v1_service_account_token_projection.h +++ b/kubernetes/model/v1_service_account_token_projection.h @@ -23,9 +23,10 @@ typedef struct v1_service_account_token_projection_t { long expiration_seconds; //numeric char *path; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_service_account_token_projection_t; -v1_service_account_token_projection_t *v1_service_account_token_projection_create( +__attribute__((deprecated)) v1_service_account_token_projection_t *v1_service_account_token_projection_create( char *audience, long expiration_seconds, char *path diff --git a/kubernetes/model/v1_service_backend_port.c b/kubernetes/model/v1_service_backend_port.c index 098c6459..dc7b6a56 100644 --- a/kubernetes/model/v1_service_backend_port.c +++ b/kubernetes/model/v1_service_backend_port.c @@ -5,7 +5,7 @@ -v1_service_backend_port_t *v1_service_backend_port_create( +static v1_service_backend_port_t *v1_service_backend_port_create_internal( char *name, int number ) { @@ -16,14 +16,28 @@ v1_service_backend_port_t *v1_service_backend_port_create( v1_service_backend_port_local_var->name = name; v1_service_backend_port_local_var->number = number; + v1_service_backend_port_local_var->_library_owned = 1; return v1_service_backend_port_local_var; } +__attribute__((deprecated)) v1_service_backend_port_t *v1_service_backend_port_create( + char *name, + int number + ) { + return v1_service_backend_port_create_internal ( + name, + number + ); +} void v1_service_backend_port_free(v1_service_backend_port_t *v1_service_backend_port) { if(NULL == v1_service_backend_port){ return ; } + if(v1_service_backend_port->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_backend_port_free"); + return ; + } listEntry_t *listEntry; if (v1_service_backend_port->name) { free(v1_service_backend_port->name); @@ -64,6 +78,9 @@ v1_service_backend_port_t *v1_service_backend_port_parseFromJSON(cJSON *v1_servi // v1_service_backend_port->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_service_backend_portJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -73,6 +90,9 @@ v1_service_backend_port_t *v1_service_backend_port_parseFromJSON(cJSON *v1_servi // v1_service_backend_port->number cJSON *number = cJSON_GetObjectItemCaseSensitive(v1_service_backend_portJSON, "number"); + if (cJSON_IsNull(number)) { + number = NULL; + } if (number) { if(!cJSON_IsNumber(number)) { @@ -81,7 +101,7 @@ v1_service_backend_port_t *v1_service_backend_port_parseFromJSON(cJSON *v1_servi } - v1_service_backend_port_local_var = v1_service_backend_port_create ( + v1_service_backend_port_local_var = v1_service_backend_port_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, number ? number->valuedouble : 0 ); diff --git a/kubernetes/model/v1_service_backend_port.h b/kubernetes/model/v1_service_backend_port.h index c847fea7..0221a864 100644 --- a/kubernetes/model/v1_service_backend_port.h +++ b/kubernetes/model/v1_service_backend_port.h @@ -22,9 +22,10 @@ typedef struct v1_service_backend_port_t { char *name; // string int number; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_service_backend_port_t; -v1_service_backend_port_t *v1_service_backend_port_create( +__attribute__((deprecated)) v1_service_backend_port_t *v1_service_backend_port_create( char *name, int number ); diff --git a/kubernetes/model/v1_service_cidr.c b/kubernetes/model/v1_service_cidr.c new file mode 100644 index 00000000..bd4b2d4f --- /dev/null +++ b/kubernetes/model/v1_service_cidr.c @@ -0,0 +1,231 @@ +#include +#include +#include +#include "v1_service_cidr.h" + + + +static v1_service_cidr_t *v1_service_cidr_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_service_cidr_spec_t *spec, + v1_service_cidr_status_t *status + ) { + v1_service_cidr_t *v1_service_cidr_local_var = malloc(sizeof(v1_service_cidr_t)); + if (!v1_service_cidr_local_var) { + return NULL; + } + v1_service_cidr_local_var->api_version = api_version; + v1_service_cidr_local_var->kind = kind; + v1_service_cidr_local_var->metadata = metadata; + v1_service_cidr_local_var->spec = spec; + v1_service_cidr_local_var->status = status; + + v1_service_cidr_local_var->_library_owned = 1; + return v1_service_cidr_local_var; +} + +__attribute__((deprecated)) v1_service_cidr_t *v1_service_cidr_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_service_cidr_spec_t *spec, + v1_service_cidr_status_t *status + ) { + return v1_service_cidr_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} + +void v1_service_cidr_free(v1_service_cidr_t *v1_service_cidr) { + if(NULL == v1_service_cidr){ + return ; + } + if(v1_service_cidr->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_cidr_free"); + return ; + } + listEntry_t *listEntry; + if (v1_service_cidr->api_version) { + free(v1_service_cidr->api_version); + v1_service_cidr->api_version = NULL; + } + if (v1_service_cidr->kind) { + free(v1_service_cidr->kind); + v1_service_cidr->kind = NULL; + } + if (v1_service_cidr->metadata) { + v1_object_meta_free(v1_service_cidr->metadata); + v1_service_cidr->metadata = NULL; + } + if (v1_service_cidr->spec) { + v1_service_cidr_spec_free(v1_service_cidr->spec); + v1_service_cidr->spec = NULL; + } + if (v1_service_cidr->status) { + v1_service_cidr_status_free(v1_service_cidr->status); + v1_service_cidr->status = NULL; + } + free(v1_service_cidr); +} + +cJSON *v1_service_cidr_convertToJSON(v1_service_cidr_t *v1_service_cidr) { + cJSON *item = cJSON_CreateObject(); + + // v1_service_cidr->api_version + if(v1_service_cidr->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_service_cidr->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_service_cidr->kind + if(v1_service_cidr->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_service_cidr->kind) == NULL) { + goto fail; //String + } + } + + + // v1_service_cidr->metadata + if(v1_service_cidr->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1_service_cidr->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_service_cidr->spec + if(v1_service_cidr->spec) { + cJSON *spec_local_JSON = v1_service_cidr_spec_convertToJSON(v1_service_cidr->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_service_cidr->status + if(v1_service_cidr->status) { + cJSON *status_local_JSON = v1_service_cidr_status_convertToJSON(v1_service_cidr->status); + if(status_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "status", status_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_service_cidr_t *v1_service_cidr_parseFromJSON(cJSON *v1_service_cidrJSON){ + + v1_service_cidr_t *v1_service_cidr_local_var = NULL; + + // define the local variable for v1_service_cidr->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1_service_cidr->spec + v1_service_cidr_spec_t *spec_local_nonprim = NULL; + + // define the local variable for v1_service_cidr->status + v1_service_cidr_status_t *status_local_nonprim = NULL; + + // v1_service_cidr->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_service_cidrJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_service_cidr->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_service_cidrJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_service_cidr->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_service_cidrJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1_service_cidr->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_service_cidrJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1_service_cidr_spec_parseFromJSON(spec); //nonprimitive + } + + // v1_service_cidr->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_service_cidrJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } + if (status) { + status_local_nonprim = v1_service_cidr_status_parseFromJSON(status); //nonprimitive + } + + + v1_service_cidr_local_var = v1_service_cidr_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL, + status ? status_local_nonprim : NULL + ); + + return v1_service_cidr_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1_service_cidr_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + if (status_local_nonprim) { + v1_service_cidr_status_free(status_local_nonprim); + status_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_service_cidr.h b/kubernetes/model/v1_service_cidr.h new file mode 100644 index 00000000..52eb1746 --- /dev/null +++ b/kubernetes/model/v1_service_cidr.h @@ -0,0 +1,49 @@ +/* + * v1_service_cidr.h + * + * ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects. + */ + +#ifndef _v1_service_cidr_H_ +#define _v1_service_cidr_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_service_cidr_t v1_service_cidr_t; + +#include "v1_object_meta.h" +#include "v1_service_cidr_spec.h" +#include "v1_service_cidr_status.h" + + + +typedef struct v1_service_cidr_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1_service_cidr_spec_t *spec; //model + struct v1_service_cidr_status_t *status; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_service_cidr_t; + +__attribute__((deprecated)) v1_service_cidr_t *v1_service_cidr_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_service_cidr_spec_t *spec, + v1_service_cidr_status_t *status +); + +void v1_service_cidr_free(v1_service_cidr_t *v1_service_cidr); + +v1_service_cidr_t *v1_service_cidr_parseFromJSON(cJSON *v1_service_cidrJSON); + +cJSON *v1_service_cidr_convertToJSON(v1_service_cidr_t *v1_service_cidr); + +#endif /* _v1_service_cidr_H_ */ + diff --git a/kubernetes/model/v1_service_cidr_list.c b/kubernetes/model/v1_service_cidr_list.c new file mode 100644 index 00000000..a12a36a4 --- /dev/null +++ b/kubernetes/model/v1_service_cidr_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1_service_cidr_list.h" + + + +static v1_service_cidr_list_t *v1_service_cidr_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1_service_cidr_list_t *v1_service_cidr_list_local_var = malloc(sizeof(v1_service_cidr_list_t)); + if (!v1_service_cidr_list_local_var) { + return NULL; + } + v1_service_cidr_list_local_var->api_version = api_version; + v1_service_cidr_list_local_var->items = items; + v1_service_cidr_list_local_var->kind = kind; + v1_service_cidr_list_local_var->metadata = metadata; + + v1_service_cidr_list_local_var->_library_owned = 1; + return v1_service_cidr_list_local_var; +} + +__attribute__((deprecated)) v1_service_cidr_list_t *v1_service_cidr_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_service_cidr_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1_service_cidr_list_free(v1_service_cidr_list_t *v1_service_cidr_list) { + if(NULL == v1_service_cidr_list){ + return ; + } + if(v1_service_cidr_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_cidr_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1_service_cidr_list->api_version) { + free(v1_service_cidr_list->api_version); + v1_service_cidr_list->api_version = NULL; + } + if (v1_service_cidr_list->items) { + list_ForEach(listEntry, v1_service_cidr_list->items) { + v1_service_cidr_free(listEntry->data); + } + list_freeList(v1_service_cidr_list->items); + v1_service_cidr_list->items = NULL; + } + if (v1_service_cidr_list->kind) { + free(v1_service_cidr_list->kind); + v1_service_cidr_list->kind = NULL; + } + if (v1_service_cidr_list->metadata) { + v1_list_meta_free(v1_service_cidr_list->metadata); + v1_service_cidr_list->metadata = NULL; + } + free(v1_service_cidr_list); +} + +cJSON *v1_service_cidr_list_convertToJSON(v1_service_cidr_list_t *v1_service_cidr_list) { + cJSON *item = cJSON_CreateObject(); + + // v1_service_cidr_list->api_version + if(v1_service_cidr_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_service_cidr_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_service_cidr_list->items + if (!v1_service_cidr_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1_service_cidr_list->items) { + list_ForEach(itemsListEntry, v1_service_cidr_list->items) { + cJSON *itemLocal = v1_service_cidr_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1_service_cidr_list->kind + if(v1_service_cidr_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_service_cidr_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1_service_cidr_list->metadata + if(v1_service_cidr_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1_service_cidr_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_service_cidr_list_t *v1_service_cidr_list_parseFromJSON(cJSON *v1_service_cidr_listJSON){ + + v1_service_cidr_list_t *v1_service_cidr_list_local_var = NULL; + + // define the local list for v1_service_cidr_list->items + list_t *itemsList = NULL; + + // define the local variable for v1_service_cidr_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1_service_cidr_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_service_cidr_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_service_cidr_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_service_cidr_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1_service_cidr_t *itemsItem = v1_service_cidr_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1_service_cidr_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_service_cidr_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_service_cidr_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_service_cidr_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1_service_cidr_list_local_var = v1_service_cidr_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1_service_cidr_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_service_cidr_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_service_cidr_list.h b/kubernetes/model/v1_service_cidr_list.h new file mode 100644 index 00000000..e4be6e91 --- /dev/null +++ b/kubernetes/model/v1_service_cidr_list.h @@ -0,0 +1,46 @@ +/* + * v1_service_cidr_list.h + * + * ServiceCIDRList contains a list of ServiceCIDR objects. + */ + +#ifndef _v1_service_cidr_list_H_ +#define _v1_service_cidr_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_service_cidr_list_t v1_service_cidr_list_t; + +#include "v1_list_meta.h" +#include "v1_service_cidr.h" + + + +typedef struct v1_service_cidr_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_service_cidr_list_t; + +__attribute__((deprecated)) v1_service_cidr_list_t *v1_service_cidr_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1_service_cidr_list_free(v1_service_cidr_list_t *v1_service_cidr_list); + +v1_service_cidr_list_t *v1_service_cidr_list_parseFromJSON(cJSON *v1_service_cidr_listJSON); + +cJSON *v1_service_cidr_list_convertToJSON(v1_service_cidr_list_t *v1_service_cidr_list); + +#endif /* _v1_service_cidr_list_H_ */ + diff --git a/kubernetes/model/v1_service_cidr_spec.c b/kubernetes/model/v1_service_cidr_spec.c new file mode 100644 index 00000000..292ba86c --- /dev/null +++ b/kubernetes/model/v1_service_cidr_spec.c @@ -0,0 +1,122 @@ +#include +#include +#include +#include "v1_service_cidr_spec.h" + + + +static v1_service_cidr_spec_t *v1_service_cidr_spec_create_internal( + list_t *cidrs + ) { + v1_service_cidr_spec_t *v1_service_cidr_spec_local_var = malloc(sizeof(v1_service_cidr_spec_t)); + if (!v1_service_cidr_spec_local_var) { + return NULL; + } + v1_service_cidr_spec_local_var->cidrs = cidrs; + + v1_service_cidr_spec_local_var->_library_owned = 1; + return v1_service_cidr_spec_local_var; +} + +__attribute__((deprecated)) v1_service_cidr_spec_t *v1_service_cidr_spec_create( + list_t *cidrs + ) { + return v1_service_cidr_spec_create_internal ( + cidrs + ); +} + +void v1_service_cidr_spec_free(v1_service_cidr_spec_t *v1_service_cidr_spec) { + if(NULL == v1_service_cidr_spec){ + return ; + } + if(v1_service_cidr_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_cidr_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1_service_cidr_spec->cidrs) { + list_ForEach(listEntry, v1_service_cidr_spec->cidrs) { + free(listEntry->data); + } + list_freeList(v1_service_cidr_spec->cidrs); + v1_service_cidr_spec->cidrs = NULL; + } + free(v1_service_cidr_spec); +} + +cJSON *v1_service_cidr_spec_convertToJSON(v1_service_cidr_spec_t *v1_service_cidr_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1_service_cidr_spec->cidrs + if(v1_service_cidr_spec->cidrs) { + cJSON *cidrs = cJSON_AddArrayToObject(item, "cidrs"); + if(cidrs == NULL) { + goto fail; //primitive container + } + + listEntry_t *cidrsListEntry; + list_ForEach(cidrsListEntry, v1_service_cidr_spec->cidrs) { + if(cJSON_AddStringToObject(cidrs, "", cidrsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_service_cidr_spec_t *v1_service_cidr_spec_parseFromJSON(cJSON *v1_service_cidr_specJSON){ + + v1_service_cidr_spec_t *v1_service_cidr_spec_local_var = NULL; + + // define the local list for v1_service_cidr_spec->cidrs + list_t *cidrsList = NULL; + + // v1_service_cidr_spec->cidrs + cJSON *cidrs = cJSON_GetObjectItemCaseSensitive(v1_service_cidr_specJSON, "cidrs"); + if (cJSON_IsNull(cidrs)) { + cidrs = NULL; + } + if (cidrs) { + cJSON *cidrs_local = NULL; + if(!cJSON_IsArray(cidrs)) { + goto end;//primitive container + } + cidrsList = list_createList(); + + cJSON_ArrayForEach(cidrs_local, cidrs) + { + if(!cJSON_IsString(cidrs_local)) + { + goto end; + } + list_addElement(cidrsList , strdup(cidrs_local->valuestring)); + } + } + + + v1_service_cidr_spec_local_var = v1_service_cidr_spec_create_internal ( + cidrs ? cidrsList : NULL + ); + + return v1_service_cidr_spec_local_var; +end: + if (cidrsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, cidrsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(cidrsList); + cidrsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_service_cidr_spec.h b/kubernetes/model/v1_service_cidr_spec.h new file mode 100644 index 00000000..af2a1487 --- /dev/null +++ b/kubernetes/model/v1_service_cidr_spec.h @@ -0,0 +1,38 @@ +/* + * v1_service_cidr_spec.h + * + * ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. + */ + +#ifndef _v1_service_cidr_spec_H_ +#define _v1_service_cidr_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_service_cidr_spec_t v1_service_cidr_spec_t; + + + + +typedef struct v1_service_cidr_spec_t { + list_t *cidrs; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_service_cidr_spec_t; + +__attribute__((deprecated)) v1_service_cidr_spec_t *v1_service_cidr_spec_create( + list_t *cidrs +); + +void v1_service_cidr_spec_free(v1_service_cidr_spec_t *v1_service_cidr_spec); + +v1_service_cidr_spec_t *v1_service_cidr_spec_parseFromJSON(cJSON *v1_service_cidr_specJSON); + +cJSON *v1_service_cidr_spec_convertToJSON(v1_service_cidr_spec_t *v1_service_cidr_spec); + +#endif /* _v1_service_cidr_spec_H_ */ + diff --git a/kubernetes/model/v1_service_cidr_status.c b/kubernetes/model/v1_service_cidr_status.c new file mode 100644 index 00000000..267c8fe9 --- /dev/null +++ b/kubernetes/model/v1_service_cidr_status.c @@ -0,0 +1,127 @@ +#include +#include +#include +#include "v1_service_cidr_status.h" + + + +static v1_service_cidr_status_t *v1_service_cidr_status_create_internal( + list_t *conditions + ) { + v1_service_cidr_status_t *v1_service_cidr_status_local_var = malloc(sizeof(v1_service_cidr_status_t)); + if (!v1_service_cidr_status_local_var) { + return NULL; + } + v1_service_cidr_status_local_var->conditions = conditions; + + v1_service_cidr_status_local_var->_library_owned = 1; + return v1_service_cidr_status_local_var; +} + +__attribute__((deprecated)) v1_service_cidr_status_t *v1_service_cidr_status_create( + list_t *conditions + ) { + return v1_service_cidr_status_create_internal ( + conditions + ); +} + +void v1_service_cidr_status_free(v1_service_cidr_status_t *v1_service_cidr_status) { + if(NULL == v1_service_cidr_status){ + return ; + } + if(v1_service_cidr_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_cidr_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1_service_cidr_status->conditions) { + list_ForEach(listEntry, v1_service_cidr_status->conditions) { + v1_condition_free(listEntry->data); + } + list_freeList(v1_service_cidr_status->conditions); + v1_service_cidr_status->conditions = NULL; + } + free(v1_service_cidr_status); +} + +cJSON *v1_service_cidr_status_convertToJSON(v1_service_cidr_status_t *v1_service_cidr_status) { + cJSON *item = cJSON_CreateObject(); + + // v1_service_cidr_status->conditions + if(v1_service_cidr_status->conditions) { + cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); + if(conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *conditionsListEntry; + if (v1_service_cidr_status->conditions) { + list_ForEach(conditionsListEntry, v1_service_cidr_status->conditions) { + cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(conditions, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_service_cidr_status_t *v1_service_cidr_status_parseFromJSON(cJSON *v1_service_cidr_statusJSON){ + + v1_service_cidr_status_t *v1_service_cidr_status_local_var = NULL; + + // define the local list for v1_service_cidr_status->conditions + list_t *conditionsList = NULL; + + // v1_service_cidr_status->conditions + cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_service_cidr_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } + if (conditions) { + cJSON *conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(conditions)){ + goto end; //nonprimitive container + } + + conditionsList = list_createList(); + + cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) + { + if(!cJSON_IsObject(conditions_local_nonprimitive)){ + goto end; + } + v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); + + list_addElement(conditionsList, conditionsItem); + } + } + + + v1_service_cidr_status_local_var = v1_service_cidr_status_create_internal ( + conditions ? conditionsList : NULL + ); + + return v1_service_cidr_status_local_var; +end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_service_cidr_status.h b/kubernetes/model/v1_service_cidr_status.h new file mode 100644 index 00000000..a9725a51 --- /dev/null +++ b/kubernetes/model/v1_service_cidr_status.h @@ -0,0 +1,39 @@ +/* + * v1_service_cidr_status.h + * + * ServiceCIDRStatus describes the current state of the ServiceCIDR. + */ + +#ifndef _v1_service_cidr_status_H_ +#define _v1_service_cidr_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_service_cidr_status_t v1_service_cidr_status_t; + +#include "v1_condition.h" + + + +typedef struct v1_service_cidr_status_t { + list_t *conditions; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1_service_cidr_status_t; + +__attribute__((deprecated)) v1_service_cidr_status_t *v1_service_cidr_status_create( + list_t *conditions +); + +void v1_service_cidr_status_free(v1_service_cidr_status_t *v1_service_cidr_status); + +v1_service_cidr_status_t *v1_service_cidr_status_parseFromJSON(cJSON *v1_service_cidr_statusJSON); + +cJSON *v1_service_cidr_status_convertToJSON(v1_service_cidr_status_t *v1_service_cidr_status); + +#endif /* _v1_service_cidr_status_H_ */ + diff --git a/kubernetes/model/v1_service_list.c b/kubernetes/model/v1_service_list.c index b6af5b5c..69eab526 100644 --- a/kubernetes/model/v1_service_list.c +++ b/kubernetes/model/v1_service_list.c @@ -5,7 +5,7 @@ -v1_service_list_t *v1_service_list_create( +static v1_service_list_t *v1_service_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_service_list_t *v1_service_list_create( v1_service_list_local_var->kind = kind; v1_service_list_local_var->metadata = metadata; + v1_service_list_local_var->_library_owned = 1; return v1_service_list_local_var; } +__attribute__((deprecated)) v1_service_list_t *v1_service_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_service_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_service_list_free(v1_service_list_t *v1_service_list) { if(NULL == v1_service_list){ return ; } + if(v1_service_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_list_free"); + return ; + } listEntry_t *listEntry; if (v1_service_list->api_version) { free(v1_service_list->api_version); @@ -123,6 +141,9 @@ v1_service_list_t *v1_service_list_parseFromJSON(cJSON *v1_service_listJSON){ // v1_service_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_service_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_service_list_t *v1_service_list_parseFromJSON(cJSON *v1_service_listJSON){ // v1_service_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_service_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_service_list_t *v1_service_list_parseFromJSON(cJSON *v1_service_listJSON){ // v1_service_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_service_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_service_list_t *v1_service_list_parseFromJSON(cJSON *v1_service_listJSON){ // v1_service_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_service_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_service_list_local_var = v1_service_list_create ( + v1_service_list_local_var = v1_service_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_service_list.h b/kubernetes/model/v1_service_list.h index a188a9cb..31d65697 100644 --- a/kubernetes/model/v1_service_list.h +++ b/kubernetes/model/v1_service_list.h @@ -26,9 +26,10 @@ typedef struct v1_service_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_service_list_t; -v1_service_list_t *v1_service_list_create( +__attribute__((deprecated)) v1_service_list_t *v1_service_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_service_port.c b/kubernetes/model/v1_service_port.c index 5673f167..b732b62e 100644 --- a/kubernetes/model/v1_service_port.c +++ b/kubernetes/model/v1_service_port.c @@ -5,7 +5,7 @@ -v1_service_port_t *v1_service_port_create( +static v1_service_port_t *v1_service_port_create_internal( char *app_protocol, char *name, int node_port, @@ -24,14 +24,36 @@ v1_service_port_t *v1_service_port_create( v1_service_port_local_var->protocol = protocol; v1_service_port_local_var->target_port = target_port; + v1_service_port_local_var->_library_owned = 1; return v1_service_port_local_var; } +__attribute__((deprecated)) v1_service_port_t *v1_service_port_create( + char *app_protocol, + char *name, + int node_port, + int port, + char *protocol, + int_or_string_t *target_port + ) { + return v1_service_port_create_internal ( + app_protocol, + name, + node_port, + port, + protocol, + target_port + ); +} void v1_service_port_free(v1_service_port_t *v1_service_port) { if(NULL == v1_service_port){ return ; } + if(v1_service_port->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_port_free"); + return ; + } listEntry_t *listEntry; if (v1_service_port->app_protocol) { free(v1_service_port->app_protocol); @@ -125,6 +147,9 @@ v1_service_port_t *v1_service_port_parseFromJSON(cJSON *v1_service_portJSON){ // v1_service_port->app_protocol cJSON *app_protocol = cJSON_GetObjectItemCaseSensitive(v1_service_portJSON, "appProtocol"); + if (cJSON_IsNull(app_protocol)) { + app_protocol = NULL; + } if (app_protocol) { if(!cJSON_IsString(app_protocol) && !cJSON_IsNull(app_protocol)) { @@ -134,6 +159,9 @@ v1_service_port_t *v1_service_port_parseFromJSON(cJSON *v1_service_portJSON){ // v1_service_port->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_service_portJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -143,6 +171,9 @@ v1_service_port_t *v1_service_port_parseFromJSON(cJSON *v1_service_portJSON){ // v1_service_port->node_port cJSON *node_port = cJSON_GetObjectItemCaseSensitive(v1_service_portJSON, "nodePort"); + if (cJSON_IsNull(node_port)) { + node_port = NULL; + } if (node_port) { if(!cJSON_IsNumber(node_port)) { @@ -152,6 +183,9 @@ v1_service_port_t *v1_service_port_parseFromJSON(cJSON *v1_service_portJSON){ // v1_service_port->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_service_portJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -164,6 +198,9 @@ v1_service_port_t *v1_service_port_parseFromJSON(cJSON *v1_service_portJSON){ // v1_service_port->protocol cJSON *protocol = cJSON_GetObjectItemCaseSensitive(v1_service_portJSON, "protocol"); + if (cJSON_IsNull(protocol)) { + protocol = NULL; + } if (protocol) { if(!cJSON_IsString(protocol) && !cJSON_IsNull(protocol)) { @@ -173,12 +210,15 @@ v1_service_port_t *v1_service_port_parseFromJSON(cJSON *v1_service_portJSON){ // v1_service_port->target_port cJSON *target_port = cJSON_GetObjectItemCaseSensitive(v1_service_portJSON, "targetPort"); + if (cJSON_IsNull(target_port)) { + target_port = NULL; + } if (target_port) { target_port_local_nonprim = int_or_string_parseFromJSON(target_port); //custom } - v1_service_port_local_var = v1_service_port_create ( + v1_service_port_local_var = v1_service_port_create_internal ( app_protocol && !cJSON_IsNull(app_protocol) ? strdup(app_protocol->valuestring) : NULL, name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, node_port ? node_port->valuedouble : 0, diff --git a/kubernetes/model/v1_service_port.h b/kubernetes/model/v1_service_port.h index dae45429..0e9ad3ec 100644 --- a/kubernetes/model/v1_service_port.h +++ b/kubernetes/model/v1_service_port.h @@ -27,9 +27,10 @@ typedef struct v1_service_port_t { char *protocol; // string int_or_string_t *target_port; // custom + int _library_owned; // Is the library responsible for freeing this object? } v1_service_port_t; -v1_service_port_t *v1_service_port_create( +__attribute__((deprecated)) v1_service_port_t *v1_service_port_create( char *app_protocol, char *name, int node_port, diff --git a/kubernetes/model/v1_service_spec.c b/kubernetes/model/v1_service_spec.c index 7d0ebbfa..bdc509f3 100644 --- a/kubernetes/model/v1_service_spec.c +++ b/kubernetes/model/v1_service_spec.c @@ -5,7 +5,7 @@ -v1_service_spec_t *v1_service_spec_create( +static v1_service_spec_t *v1_service_spec_create_internal( int allocate_load_balancer_node_ports, char *cluster_ip, list_t *cluster_ips, @@ -52,14 +52,64 @@ v1_service_spec_t *v1_service_spec_create( v1_service_spec_local_var->traffic_distribution = traffic_distribution; v1_service_spec_local_var->type = type; + v1_service_spec_local_var->_library_owned = 1; return v1_service_spec_local_var; } +__attribute__((deprecated)) v1_service_spec_t *v1_service_spec_create( + int allocate_load_balancer_node_ports, + char *cluster_ip, + list_t *cluster_ips, + list_t *external_ips, + char *external_name, + char *external_traffic_policy, + int health_check_node_port, + char *internal_traffic_policy, + list_t *ip_families, + char *ip_family_policy, + char *load_balancer_class, + char *load_balancer_ip, + list_t *load_balancer_source_ranges, + list_t *ports, + int publish_not_ready_addresses, + list_t* selector, + char *session_affinity, + v1_session_affinity_config_t *session_affinity_config, + char *traffic_distribution, + char *type + ) { + return v1_service_spec_create_internal ( + allocate_load_balancer_node_ports, + cluster_ip, + cluster_ips, + external_ips, + external_name, + external_traffic_policy, + health_check_node_port, + internal_traffic_policy, + ip_families, + ip_family_policy, + load_balancer_class, + load_balancer_ip, + load_balancer_source_ranges, + ports, + publish_not_ready_addresses, + selector, + session_affinity, + session_affinity_config, + traffic_distribution, + type + ); +} void v1_service_spec_free(v1_service_spec_t *v1_service_spec) { if(NULL == v1_service_spec){ return ; } + if(v1_service_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_service_spec->cluster_ip) { free(v1_service_spec->cluster_ip); @@ -126,7 +176,7 @@ void v1_service_spec_free(v1_service_spec_t *v1_service_spec) { } if (v1_service_spec->selector) { list_ForEach(listEntry, v1_service_spec->selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -181,7 +231,7 @@ cJSON *v1_service_spec_convertToJSON(v1_service_spec_t *v1_service_spec) { listEntry_t *cluster_ipsListEntry; list_ForEach(cluster_ipsListEntry, v1_service_spec->cluster_ips) { - if(cJSON_AddStringToObject(cluster_ips, "", (char*)cluster_ipsListEntry->data) == NULL) + if(cJSON_AddStringToObject(cluster_ips, "", cluster_ipsListEntry->data) == NULL) { goto fail; } @@ -198,7 +248,7 @@ cJSON *v1_service_spec_convertToJSON(v1_service_spec_t *v1_service_spec) { listEntry_t *external_ipsListEntry; list_ForEach(external_ipsListEntry, v1_service_spec->external_ips) { - if(cJSON_AddStringToObject(external_ips, "", (char*)external_ipsListEntry->data) == NULL) + if(cJSON_AddStringToObject(external_ips, "", external_ipsListEntry->data) == NULL) { goto fail; } @@ -247,7 +297,7 @@ cJSON *v1_service_spec_convertToJSON(v1_service_spec_t *v1_service_spec) { listEntry_t *ip_familiesListEntry; list_ForEach(ip_familiesListEntry, v1_service_spec->ip_families) { - if(cJSON_AddStringToObject(ip_families, "", (char*)ip_familiesListEntry->data) == NULL) + if(cJSON_AddStringToObject(ip_families, "", ip_familiesListEntry->data) == NULL) { goto fail; } @@ -288,7 +338,7 @@ cJSON *v1_service_spec_convertToJSON(v1_service_spec_t *v1_service_spec) { listEntry_t *load_balancer_source_rangesListEntry; list_ForEach(load_balancer_source_rangesListEntry, v1_service_spec->load_balancer_source_ranges) { - if(cJSON_AddStringToObject(load_balancer_source_ranges, "", (char*)load_balancer_source_rangesListEntry->data) == NULL) + if(cJSON_AddStringToObject(load_balancer_source_ranges, "", load_balancer_source_rangesListEntry->data) == NULL) { goto fail; } @@ -334,8 +384,8 @@ cJSON *v1_service_spec_convertToJSON(v1_service_spec_t *v1_service_spec) { listEntry_t *selectorListEntry; if (v1_service_spec->selector) { list_ForEach(selectorListEntry, v1_service_spec->selector) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)selectorListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = selectorListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -415,6 +465,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->allocate_load_balancer_node_ports cJSON *allocate_load_balancer_node_ports = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "allocateLoadBalancerNodePorts"); + if (cJSON_IsNull(allocate_load_balancer_node_ports)) { + allocate_load_balancer_node_ports = NULL; + } if (allocate_load_balancer_node_ports) { if(!cJSON_IsBool(allocate_load_balancer_node_ports)) { @@ -424,6 +477,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->cluster_ip cJSON *cluster_ip = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "clusterIP"); + if (cJSON_IsNull(cluster_ip)) { + cluster_ip = NULL; + } if (cluster_ip) { if(!cJSON_IsString(cluster_ip) && !cJSON_IsNull(cluster_ip)) { @@ -433,6 +489,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->cluster_ips cJSON *cluster_ips = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "clusterIPs"); + if (cJSON_IsNull(cluster_ips)) { + cluster_ips = NULL; + } if (cluster_ips) { cJSON *cluster_ips_local = NULL; if(!cJSON_IsArray(cluster_ips)) { @@ -452,6 +511,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->external_ips cJSON *external_ips = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "externalIPs"); + if (cJSON_IsNull(external_ips)) { + external_ips = NULL; + } if (external_ips) { cJSON *external_ips_local = NULL; if(!cJSON_IsArray(external_ips)) { @@ -471,6 +533,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->external_name cJSON *external_name = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "externalName"); + if (cJSON_IsNull(external_name)) { + external_name = NULL; + } if (external_name) { if(!cJSON_IsString(external_name) && !cJSON_IsNull(external_name)) { @@ -480,6 +545,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->external_traffic_policy cJSON *external_traffic_policy = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "externalTrafficPolicy"); + if (cJSON_IsNull(external_traffic_policy)) { + external_traffic_policy = NULL; + } if (external_traffic_policy) { if(!cJSON_IsString(external_traffic_policy) && !cJSON_IsNull(external_traffic_policy)) { @@ -489,6 +557,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->health_check_node_port cJSON *health_check_node_port = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "healthCheckNodePort"); + if (cJSON_IsNull(health_check_node_port)) { + health_check_node_port = NULL; + } if (health_check_node_port) { if(!cJSON_IsNumber(health_check_node_port)) { @@ -498,6 +569,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->internal_traffic_policy cJSON *internal_traffic_policy = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "internalTrafficPolicy"); + if (cJSON_IsNull(internal_traffic_policy)) { + internal_traffic_policy = NULL; + } if (internal_traffic_policy) { if(!cJSON_IsString(internal_traffic_policy) && !cJSON_IsNull(internal_traffic_policy)) { @@ -507,6 +581,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->ip_families cJSON *ip_families = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "ipFamilies"); + if (cJSON_IsNull(ip_families)) { + ip_families = NULL; + } if (ip_families) { cJSON *ip_families_local = NULL; if(!cJSON_IsArray(ip_families)) { @@ -526,6 +603,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->ip_family_policy cJSON *ip_family_policy = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "ipFamilyPolicy"); + if (cJSON_IsNull(ip_family_policy)) { + ip_family_policy = NULL; + } if (ip_family_policy) { if(!cJSON_IsString(ip_family_policy) && !cJSON_IsNull(ip_family_policy)) { @@ -535,6 +615,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->load_balancer_class cJSON *load_balancer_class = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "loadBalancerClass"); + if (cJSON_IsNull(load_balancer_class)) { + load_balancer_class = NULL; + } if (load_balancer_class) { if(!cJSON_IsString(load_balancer_class) && !cJSON_IsNull(load_balancer_class)) { @@ -544,6 +627,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->load_balancer_ip cJSON *load_balancer_ip = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "loadBalancerIP"); + if (cJSON_IsNull(load_balancer_ip)) { + load_balancer_ip = NULL; + } if (load_balancer_ip) { if(!cJSON_IsString(load_balancer_ip) && !cJSON_IsNull(load_balancer_ip)) { @@ -553,6 +639,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->load_balancer_source_ranges cJSON *load_balancer_source_ranges = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "loadBalancerSourceRanges"); + if (cJSON_IsNull(load_balancer_source_ranges)) { + load_balancer_source_ranges = NULL; + } if (load_balancer_source_ranges) { cJSON *load_balancer_source_ranges_local = NULL; if(!cJSON_IsArray(load_balancer_source_ranges)) { @@ -572,6 +661,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "ports"); + if (cJSON_IsNull(ports)) { + ports = NULL; + } if (ports) { cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ @@ -593,6 +685,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->publish_not_ready_addresses cJSON *publish_not_ready_addresses = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "publishNotReadyAddresses"); + if (cJSON_IsNull(publish_not_ready_addresses)) { + publish_not_ready_addresses = NULL; + } if (publish_not_ready_addresses) { if(!cJSON_IsBool(publish_not_ready_addresses)) { @@ -602,6 +697,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { cJSON *selector_local_map = NULL; if(!cJSON_IsObject(selector) && !cJSON_IsNull(selector)) @@ -627,6 +725,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->session_affinity cJSON *session_affinity = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "sessionAffinity"); + if (cJSON_IsNull(session_affinity)) { + session_affinity = NULL; + } if (session_affinity) { if(!cJSON_IsString(session_affinity) && !cJSON_IsNull(session_affinity)) { @@ -636,12 +737,18 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->session_affinity_config cJSON *session_affinity_config = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "sessionAffinityConfig"); + if (cJSON_IsNull(session_affinity_config)) { + session_affinity_config = NULL; + } if (session_affinity_config) { session_affinity_config_local_nonprim = v1_session_affinity_config_parseFromJSON(session_affinity_config); //nonprimitive } // v1_service_spec->traffic_distribution cJSON *traffic_distribution = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "trafficDistribution"); + if (cJSON_IsNull(traffic_distribution)) { + traffic_distribution = NULL; + } if (traffic_distribution) { if(!cJSON_IsString(traffic_distribution) && !cJSON_IsNull(traffic_distribution)) { @@ -651,6 +758,9 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -659,7 +769,7 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ } - v1_service_spec_local_var = v1_service_spec_create ( + v1_service_spec_local_var = v1_service_spec_create_internal ( allocate_load_balancer_node_ports ? allocate_load_balancer_node_ports->valueint : 0, cluster_ip && !cJSON_IsNull(cluster_ip) ? strdup(cluster_ip->valuestring) : NULL, cluster_ips ? cluster_ipsList : NULL, @@ -732,7 +842,7 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ if (selectorList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, selectorList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_service_spec.h b/kubernetes/model/v1_service_spec.h index 1e8631ad..fef95531 100644 --- a/kubernetes/model/v1_service_spec.h +++ b/kubernetes/model/v1_service_spec.h @@ -42,9 +42,10 @@ typedef struct v1_service_spec_t { char *traffic_distribution; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_service_spec_t; -v1_service_spec_t *v1_service_spec_create( +__attribute__((deprecated)) v1_service_spec_t *v1_service_spec_create( int allocate_load_balancer_node_ports, char *cluster_ip, list_t *cluster_ips, diff --git a/kubernetes/model/v1_service_status.c b/kubernetes/model/v1_service_status.c index cfab9369..5a8790c7 100644 --- a/kubernetes/model/v1_service_status.c +++ b/kubernetes/model/v1_service_status.c @@ -5,7 +5,7 @@ -v1_service_status_t *v1_service_status_create( +static v1_service_status_t *v1_service_status_create_internal( list_t *conditions, v1_load_balancer_status_t *load_balancer ) { @@ -16,14 +16,28 @@ v1_service_status_t *v1_service_status_create( v1_service_status_local_var->conditions = conditions; v1_service_status_local_var->load_balancer = load_balancer; + v1_service_status_local_var->_library_owned = 1; return v1_service_status_local_var; } +__attribute__((deprecated)) v1_service_status_t *v1_service_status_create( + list_t *conditions, + v1_load_balancer_status_t *load_balancer + ) { + return v1_service_status_create_internal ( + conditions, + load_balancer + ); +} void v1_service_status_free(v1_service_status_t *v1_service_status) { if(NULL == v1_service_status){ return ; } + if(v1_service_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_service_status_free"); + return ; + } listEntry_t *listEntry; if (v1_service_status->conditions) { list_ForEach(listEntry, v1_service_status->conditions) { @@ -94,6 +108,9 @@ v1_service_status_t *v1_service_status_parseFromJSON(cJSON *v1_service_statusJSO // v1_service_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_service_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -115,12 +132,15 @@ v1_service_status_t *v1_service_status_parseFromJSON(cJSON *v1_service_statusJSO // v1_service_status->load_balancer cJSON *load_balancer = cJSON_GetObjectItemCaseSensitive(v1_service_statusJSON, "loadBalancer"); + if (cJSON_IsNull(load_balancer)) { + load_balancer = NULL; + } if (load_balancer) { load_balancer_local_nonprim = v1_load_balancer_status_parseFromJSON(load_balancer); //nonprimitive } - v1_service_status_local_var = v1_service_status_create ( + v1_service_status_local_var = v1_service_status_create_internal ( conditions ? conditionsList : NULL, load_balancer ? load_balancer_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_service_status.h b/kubernetes/model/v1_service_status.h index c7337364..d6ca1e56 100644 --- a/kubernetes/model/v1_service_status.h +++ b/kubernetes/model/v1_service_status.h @@ -24,9 +24,10 @@ typedef struct v1_service_status_t { list_t *conditions; //nonprimitive container struct v1_load_balancer_status_t *load_balancer; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_service_status_t; -v1_service_status_t *v1_service_status_create( +__attribute__((deprecated)) v1_service_status_t *v1_service_status_create( list_t *conditions, v1_load_balancer_status_t *load_balancer ); diff --git a/kubernetes/model/v1_session_affinity_config.c b/kubernetes/model/v1_session_affinity_config.c index 9272072f..77634005 100644 --- a/kubernetes/model/v1_session_affinity_config.c +++ b/kubernetes/model/v1_session_affinity_config.c @@ -5,7 +5,7 @@ -v1_session_affinity_config_t *v1_session_affinity_config_create( +static v1_session_affinity_config_t *v1_session_affinity_config_create_internal( v1_client_ip_config_t *client_ip ) { v1_session_affinity_config_t *v1_session_affinity_config_local_var = malloc(sizeof(v1_session_affinity_config_t)); @@ -14,14 +14,26 @@ v1_session_affinity_config_t *v1_session_affinity_config_create( } v1_session_affinity_config_local_var->client_ip = client_ip; + v1_session_affinity_config_local_var->_library_owned = 1; return v1_session_affinity_config_local_var; } +__attribute__((deprecated)) v1_session_affinity_config_t *v1_session_affinity_config_create( + v1_client_ip_config_t *client_ip + ) { + return v1_session_affinity_config_create_internal ( + client_ip + ); +} void v1_session_affinity_config_free(v1_session_affinity_config_t *v1_session_affinity_config) { if(NULL == v1_session_affinity_config){ return ; } + if(v1_session_affinity_config->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_session_affinity_config_free"); + return ; + } listEntry_t *listEntry; if (v1_session_affinity_config->client_ip) { v1_client_ip_config_free(v1_session_affinity_config->client_ip); @@ -62,12 +74,15 @@ v1_session_affinity_config_t *v1_session_affinity_config_parseFromJSON(cJSON *v1 // v1_session_affinity_config->client_ip cJSON *client_ip = cJSON_GetObjectItemCaseSensitive(v1_session_affinity_configJSON, "clientIP"); + if (cJSON_IsNull(client_ip)) { + client_ip = NULL; + } if (client_ip) { client_ip_local_nonprim = v1_client_ip_config_parseFromJSON(client_ip); //nonprimitive } - v1_session_affinity_config_local_var = v1_session_affinity_config_create ( + v1_session_affinity_config_local_var = v1_session_affinity_config_create_internal ( client_ip ? client_ip_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_session_affinity_config.h b/kubernetes/model/v1_session_affinity_config.h index bf165958..385ab9fc 100644 --- a/kubernetes/model/v1_session_affinity_config.h +++ b/kubernetes/model/v1_session_affinity_config.h @@ -22,9 +22,10 @@ typedef struct v1_session_affinity_config_t v1_session_affinity_config_t; typedef struct v1_session_affinity_config_t { struct v1_client_ip_config_t *client_ip; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_session_affinity_config_t; -v1_session_affinity_config_t *v1_session_affinity_config_create( +__attribute__((deprecated)) v1_session_affinity_config_t *v1_session_affinity_config_create( v1_client_ip_config_t *client_ip ); diff --git a/kubernetes/model/v1_sleep_action.c b/kubernetes/model/v1_sleep_action.c index 6fd1a24d..42e6848e 100644 --- a/kubernetes/model/v1_sleep_action.c +++ b/kubernetes/model/v1_sleep_action.c @@ -5,7 +5,7 @@ -v1_sleep_action_t *v1_sleep_action_create( +static v1_sleep_action_t *v1_sleep_action_create_internal( long seconds ) { v1_sleep_action_t *v1_sleep_action_local_var = malloc(sizeof(v1_sleep_action_t)); @@ -14,14 +14,26 @@ v1_sleep_action_t *v1_sleep_action_create( } v1_sleep_action_local_var->seconds = seconds; + v1_sleep_action_local_var->_library_owned = 1; return v1_sleep_action_local_var; } +__attribute__((deprecated)) v1_sleep_action_t *v1_sleep_action_create( + long seconds + ) { + return v1_sleep_action_create_internal ( + seconds + ); +} void v1_sleep_action_free(v1_sleep_action_t *v1_sleep_action) { if(NULL == v1_sleep_action){ return ; } + if(v1_sleep_action->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_sleep_action_free"); + return ; + } listEntry_t *listEntry; free(v1_sleep_action); } @@ -51,6 +63,9 @@ v1_sleep_action_t *v1_sleep_action_parseFromJSON(cJSON *v1_sleep_actionJSON){ // v1_sleep_action->seconds cJSON *seconds = cJSON_GetObjectItemCaseSensitive(v1_sleep_actionJSON, "seconds"); + if (cJSON_IsNull(seconds)) { + seconds = NULL; + } if (!seconds) { goto end; } @@ -62,7 +77,7 @@ v1_sleep_action_t *v1_sleep_action_parseFromJSON(cJSON *v1_sleep_actionJSON){ } - v1_sleep_action_local_var = v1_sleep_action_create ( + v1_sleep_action_local_var = v1_sleep_action_create_internal ( seconds->valuedouble ); diff --git a/kubernetes/model/v1_sleep_action.h b/kubernetes/model/v1_sleep_action.h index 2fc969a7..00249213 100644 --- a/kubernetes/model/v1_sleep_action.h +++ b/kubernetes/model/v1_sleep_action.h @@ -21,9 +21,10 @@ typedef struct v1_sleep_action_t v1_sleep_action_t; typedef struct v1_sleep_action_t { long seconds; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_sleep_action_t; -v1_sleep_action_t *v1_sleep_action_create( +__attribute__((deprecated)) v1_sleep_action_t *v1_sleep_action_create( long seconds ); diff --git a/kubernetes/model/v1_stateful_set.c b/kubernetes/model/v1_stateful_set.c index ffc85aad..2cc043f1 100644 --- a/kubernetes/model/v1_stateful_set.c +++ b/kubernetes/model/v1_stateful_set.c @@ -5,7 +5,7 @@ -v1_stateful_set_t *v1_stateful_set_create( +static v1_stateful_set_t *v1_stateful_set_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_stateful_set_t *v1_stateful_set_create( v1_stateful_set_local_var->spec = spec; v1_stateful_set_local_var->status = status; + v1_stateful_set_local_var->_library_owned = 1; return v1_stateful_set_local_var; } +__attribute__((deprecated)) v1_stateful_set_t *v1_stateful_set_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_stateful_set_spec_t *spec, + v1_stateful_set_status_t *status + ) { + return v1_stateful_set_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_stateful_set_free(v1_stateful_set_t *v1_stateful_set) { if(NULL == v1_stateful_set){ return ; } + if(v1_stateful_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_free"); + return ; + } listEntry_t *listEntry; if (v1_stateful_set->api_version) { free(v1_stateful_set->api_version); @@ -134,6 +154,9 @@ v1_stateful_set_t *v1_stateful_set_parseFromJSON(cJSON *v1_stateful_setJSON){ // v1_stateful_set->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_stateful_setJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_stateful_set_t *v1_stateful_set_parseFromJSON(cJSON *v1_stateful_setJSON){ // v1_stateful_set->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_stateful_setJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_stateful_set_t *v1_stateful_set_parseFromJSON(cJSON *v1_stateful_setJSON){ // v1_stateful_set->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_stateful_setJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_stateful_set->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_stateful_setJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_stateful_set_spec_parseFromJSON(spec); //nonprimitive } // v1_stateful_set->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_stateful_setJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_stateful_set_status_parseFromJSON(status); //nonprimitive } - v1_stateful_set_local_var = v1_stateful_set_create ( + v1_stateful_set_local_var = v1_stateful_set_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_stateful_set.h b/kubernetes/model/v1_stateful_set.h index 0d6dd442..ce793f9e 100644 --- a/kubernetes/model/v1_stateful_set.h +++ b/kubernetes/model/v1_stateful_set.h @@ -28,9 +28,10 @@ typedef struct v1_stateful_set_t { struct v1_stateful_set_spec_t *spec; //model struct v1_stateful_set_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_t; -v1_stateful_set_t *v1_stateful_set_create( +__attribute__((deprecated)) v1_stateful_set_t *v1_stateful_set_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_stateful_set_condition.c b/kubernetes/model/v1_stateful_set_condition.c index 1b5432bd..106dbea2 100644 --- a/kubernetes/model/v1_stateful_set_condition.c +++ b/kubernetes/model/v1_stateful_set_condition.c @@ -5,7 +5,7 @@ -v1_stateful_set_condition_t *v1_stateful_set_condition_create( +static v1_stateful_set_condition_t *v1_stateful_set_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1_stateful_set_condition_t *v1_stateful_set_condition_create( v1_stateful_set_condition_local_var->status = status; v1_stateful_set_condition_local_var->type = type; + v1_stateful_set_condition_local_var->_library_owned = 1; return v1_stateful_set_condition_local_var; } +__attribute__((deprecated)) v1_stateful_set_condition_t *v1_stateful_set_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1_stateful_set_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v1_stateful_set_condition_free(v1_stateful_set_condition_t *v1_stateful_set_condition) { if(NULL == v1_stateful_set_condition){ return ; } + if(v1_stateful_set_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_condition_free"); + return ; + } listEntry_t *listEntry; if (v1_stateful_set_condition->last_transition_time) { free(v1_stateful_set_condition->last_transition_time); @@ -112,6 +132,9 @@ v1_stateful_set_condition_t *v1_stateful_set_condition_parseFromJSON(cJSON *v1_s // v1_stateful_set_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v1_stateful_set_condition_t *v1_stateful_set_condition_parseFromJSON(cJSON *v1_s // v1_stateful_set_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1_stateful_set_condition_t *v1_stateful_set_condition_parseFromJSON(cJSON *v1_s // v1_stateful_set_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1_stateful_set_condition_t *v1_stateful_set_condition_parseFromJSON(cJSON *v1_s // v1_stateful_set_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1_stateful_set_condition_t *v1_stateful_set_condition_parseFromJSON(cJSON *v1_s // v1_stateful_set_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1_stateful_set_condition_t *v1_stateful_set_condition_parseFromJSON(cJSON *v1_s } - v1_stateful_set_condition_local_var = v1_stateful_set_condition_create ( + v1_stateful_set_condition_local_var = v1_stateful_set_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1_stateful_set_condition.h b/kubernetes/model/v1_stateful_set_condition.h index 1d97ee8b..751c9cbf 100644 --- a/kubernetes/model/v1_stateful_set_condition.h +++ b/kubernetes/model/v1_stateful_set_condition.h @@ -25,9 +25,10 @@ typedef struct v1_stateful_set_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_condition_t; -v1_stateful_set_condition_t *v1_stateful_set_condition_create( +__attribute__((deprecated)) v1_stateful_set_condition_t *v1_stateful_set_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v1_stateful_set_list.c b/kubernetes/model/v1_stateful_set_list.c index 3cf4516c..9c1ff6ba 100644 --- a/kubernetes/model/v1_stateful_set_list.c +++ b/kubernetes/model/v1_stateful_set_list.c @@ -5,7 +5,7 @@ -v1_stateful_set_list_t *v1_stateful_set_list_create( +static v1_stateful_set_list_t *v1_stateful_set_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_stateful_set_list_t *v1_stateful_set_list_create( v1_stateful_set_list_local_var->kind = kind; v1_stateful_set_list_local_var->metadata = metadata; + v1_stateful_set_list_local_var->_library_owned = 1; return v1_stateful_set_list_local_var; } +__attribute__((deprecated)) v1_stateful_set_list_t *v1_stateful_set_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_stateful_set_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_stateful_set_list_free(v1_stateful_set_list_t *v1_stateful_set_list) { if(NULL == v1_stateful_set_list){ return ; } + if(v1_stateful_set_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_list_free"); + return ; + } listEntry_t *listEntry; if (v1_stateful_set_list->api_version) { free(v1_stateful_set_list->api_version); @@ -123,6 +141,9 @@ v1_stateful_set_list_t *v1_stateful_set_list_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_stateful_set_list_t *v1_stateful_set_list_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_stateful_set_list_t *v1_stateful_set_list_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_stateful_set_list_t *v1_stateful_set_list_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_stateful_set_list_local_var = v1_stateful_set_list_create ( + v1_stateful_set_list_local_var = v1_stateful_set_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_stateful_set_list.h b/kubernetes/model/v1_stateful_set_list.h index 507f684f..ac685d7c 100644 --- a/kubernetes/model/v1_stateful_set_list.h +++ b/kubernetes/model/v1_stateful_set_list.h @@ -26,9 +26,10 @@ typedef struct v1_stateful_set_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_list_t; -v1_stateful_set_list_t *v1_stateful_set_list_create( +__attribute__((deprecated)) v1_stateful_set_list_t *v1_stateful_set_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_stateful_set_ordinals.c b/kubernetes/model/v1_stateful_set_ordinals.c index aecece67..423e5692 100644 --- a/kubernetes/model/v1_stateful_set_ordinals.c +++ b/kubernetes/model/v1_stateful_set_ordinals.c @@ -5,7 +5,7 @@ -v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_create( +static v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_create_internal( int start ) { v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_local_var = malloc(sizeof(v1_stateful_set_ordinals_t)); @@ -14,14 +14,26 @@ v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_create( } v1_stateful_set_ordinals_local_var->start = start; + v1_stateful_set_ordinals_local_var->_library_owned = 1; return v1_stateful_set_ordinals_local_var; } +__attribute__((deprecated)) v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_create( + int start + ) { + return v1_stateful_set_ordinals_create_internal ( + start + ); +} void v1_stateful_set_ordinals_free(v1_stateful_set_ordinals_t *v1_stateful_set_ordinals) { if(NULL == v1_stateful_set_ordinals){ return ; } + if(v1_stateful_set_ordinals->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_ordinals_free"); + return ; + } listEntry_t *listEntry; free(v1_stateful_set_ordinals); } @@ -50,6 +62,9 @@ v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_parseFromJSON(cJSON *v1_sta // v1_stateful_set_ordinals->start cJSON *start = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_ordinalsJSON, "start"); + if (cJSON_IsNull(start)) { + start = NULL; + } if (start) { if(!cJSON_IsNumber(start)) { @@ -58,7 +73,7 @@ v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_parseFromJSON(cJSON *v1_sta } - v1_stateful_set_ordinals_local_var = v1_stateful_set_ordinals_create ( + v1_stateful_set_ordinals_local_var = v1_stateful_set_ordinals_create_internal ( start ? start->valuedouble : 0 ); diff --git a/kubernetes/model/v1_stateful_set_ordinals.h b/kubernetes/model/v1_stateful_set_ordinals.h index 65ef569a..7a84c58f 100644 --- a/kubernetes/model/v1_stateful_set_ordinals.h +++ b/kubernetes/model/v1_stateful_set_ordinals.h @@ -21,9 +21,10 @@ typedef struct v1_stateful_set_ordinals_t v1_stateful_set_ordinals_t; typedef struct v1_stateful_set_ordinals_t { int start; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_ordinals_t; -v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_create( +__attribute__((deprecated)) v1_stateful_set_ordinals_t *v1_stateful_set_ordinals_create( int start ); diff --git a/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.c b/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.c index be4cb152..ac70ed0f 100644 --- a/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.c +++ b/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.c @@ -5,7 +5,7 @@ -v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_persistent_volume_claim_retention_policy_create( +static v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_persistent_volume_claim_retention_policy_create_internal( char *when_deleted, char *when_scaled ) { @@ -16,14 +16,28 @@ v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_pers v1_stateful_set_persistent_volume_claim_retention_policy_local_var->when_deleted = when_deleted; v1_stateful_set_persistent_volume_claim_retention_policy_local_var->when_scaled = when_scaled; + v1_stateful_set_persistent_volume_claim_retention_policy_local_var->_library_owned = 1; return v1_stateful_set_persistent_volume_claim_retention_policy_local_var; } +__attribute__((deprecated)) v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_persistent_volume_claim_retention_policy_create( + char *when_deleted, + char *when_scaled + ) { + return v1_stateful_set_persistent_volume_claim_retention_policy_create_internal ( + when_deleted, + when_scaled + ); +} void v1_stateful_set_persistent_volume_claim_retention_policy_free(v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_persistent_volume_claim_retention_policy) { if(NULL == v1_stateful_set_persistent_volume_claim_retention_policy){ return ; } + if(v1_stateful_set_persistent_volume_claim_retention_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_persistent_volume_claim_retention_policy_free"); + return ; + } listEntry_t *listEntry; if (v1_stateful_set_persistent_volume_claim_retention_policy->when_deleted) { free(v1_stateful_set_persistent_volume_claim_retention_policy->when_deleted); @@ -68,6 +82,9 @@ v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_pers // v1_stateful_set_persistent_volume_claim_retention_policy->when_deleted cJSON *when_deleted = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_persistent_volume_claim_retention_policyJSON, "whenDeleted"); + if (cJSON_IsNull(when_deleted)) { + when_deleted = NULL; + } if (when_deleted) { if(!cJSON_IsString(when_deleted) && !cJSON_IsNull(when_deleted)) { @@ -77,6 +94,9 @@ v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_pers // v1_stateful_set_persistent_volume_claim_retention_policy->when_scaled cJSON *when_scaled = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_persistent_volume_claim_retention_policyJSON, "whenScaled"); + if (cJSON_IsNull(when_scaled)) { + when_scaled = NULL; + } if (when_scaled) { if(!cJSON_IsString(when_scaled) && !cJSON_IsNull(when_scaled)) { @@ -85,7 +105,7 @@ v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_pers } - v1_stateful_set_persistent_volume_claim_retention_policy_local_var = v1_stateful_set_persistent_volume_claim_retention_policy_create ( + v1_stateful_set_persistent_volume_claim_retention_policy_local_var = v1_stateful_set_persistent_volume_claim_retention_policy_create_internal ( when_deleted && !cJSON_IsNull(when_deleted) ? strdup(when_deleted->valuestring) : NULL, when_scaled && !cJSON_IsNull(when_scaled) ? strdup(when_scaled->valuestring) : NULL ); diff --git a/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.h b/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.h index 402fa11b..bc6085f7 100644 --- a/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.h +++ b/kubernetes/model/v1_stateful_set_persistent_volume_claim_retention_policy.h @@ -22,9 +22,10 @@ typedef struct v1_stateful_set_persistent_volume_claim_retention_policy_t { char *when_deleted; // string char *when_scaled; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_persistent_volume_claim_retention_policy_t; -v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_persistent_volume_claim_retention_policy_create( +__attribute__((deprecated)) v1_stateful_set_persistent_volume_claim_retention_policy_t *v1_stateful_set_persistent_volume_claim_retention_policy_create( char *when_deleted, char *when_scaled ); diff --git a/kubernetes/model/v1_stateful_set_spec.c b/kubernetes/model/v1_stateful_set_spec.c index ea9b65fa..c3152f6c 100644 --- a/kubernetes/model/v1_stateful_set_spec.c +++ b/kubernetes/model/v1_stateful_set_spec.c @@ -5,7 +5,7 @@ -v1_stateful_set_spec_t *v1_stateful_set_spec_create( +static v1_stateful_set_spec_t *v1_stateful_set_spec_create_internal( int min_ready_seconds, v1_stateful_set_ordinals_t *ordinals, v1_stateful_set_persistent_volume_claim_retention_policy_t *persistent_volume_claim_retention_policy, @@ -34,14 +34,46 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_create( v1_stateful_set_spec_local_var->update_strategy = update_strategy; v1_stateful_set_spec_local_var->volume_claim_templates = volume_claim_templates; + v1_stateful_set_spec_local_var->_library_owned = 1; return v1_stateful_set_spec_local_var; } +__attribute__((deprecated)) v1_stateful_set_spec_t *v1_stateful_set_spec_create( + int min_ready_seconds, + v1_stateful_set_ordinals_t *ordinals, + v1_stateful_set_persistent_volume_claim_retention_policy_t *persistent_volume_claim_retention_policy, + char *pod_management_policy, + int replicas, + int revision_history_limit, + v1_label_selector_t *selector, + char *service_name, + v1_pod_template_spec_t *_template, + v1_stateful_set_update_strategy_t *update_strategy, + list_t *volume_claim_templates + ) { + return v1_stateful_set_spec_create_internal ( + min_ready_seconds, + ordinals, + persistent_volume_claim_retention_policy, + pod_management_policy, + replicas, + revision_history_limit, + selector, + service_name, + _template, + update_strategy, + volume_claim_templates + ); +} void v1_stateful_set_spec_free(v1_stateful_set_spec_t *v1_stateful_set_spec) { if(NULL == v1_stateful_set_spec){ return ; } + if(v1_stateful_set_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_stateful_set_spec->ordinals) { v1_stateful_set_ordinals_free(v1_stateful_set_spec->ordinals); @@ -157,12 +189,11 @@ cJSON *v1_stateful_set_spec_convertToJSON(v1_stateful_set_spec_t *v1_stateful_se // v1_stateful_set_spec->service_name - if (!v1_stateful_set_spec->service_name) { - goto fail; - } + if(v1_stateful_set_spec->service_name) { if(cJSON_AddStringToObject(item, "serviceName", v1_stateful_set_spec->service_name) == NULL) { goto fail; //String } + } // v1_stateful_set_spec->_template @@ -243,6 +274,9 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->min_ready_seconds cJSON *min_ready_seconds = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "minReadySeconds"); + if (cJSON_IsNull(min_ready_seconds)) { + min_ready_seconds = NULL; + } if (min_ready_seconds) { if(!cJSON_IsNumber(min_ready_seconds)) { @@ -252,18 +286,27 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->ordinals cJSON *ordinals = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "ordinals"); + if (cJSON_IsNull(ordinals)) { + ordinals = NULL; + } if (ordinals) { ordinals_local_nonprim = v1_stateful_set_ordinals_parseFromJSON(ordinals); //nonprimitive } // v1_stateful_set_spec->persistent_volume_claim_retention_policy cJSON *persistent_volume_claim_retention_policy = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "persistentVolumeClaimRetentionPolicy"); + if (cJSON_IsNull(persistent_volume_claim_retention_policy)) { + persistent_volume_claim_retention_policy = NULL; + } if (persistent_volume_claim_retention_policy) { persistent_volume_claim_retention_policy_local_nonprim = v1_stateful_set_persistent_volume_claim_retention_policy_parseFromJSON(persistent_volume_claim_retention_policy); //nonprimitive } // v1_stateful_set_spec->pod_management_policy cJSON *pod_management_policy = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "podManagementPolicy"); + if (cJSON_IsNull(pod_management_policy)) { + pod_management_policy = NULL; + } if (pod_management_policy) { if(!cJSON_IsString(pod_management_policy) && !cJSON_IsNull(pod_management_policy)) { @@ -273,6 +316,9 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (replicas) { if(!cJSON_IsNumber(replicas)) { @@ -282,6 +328,9 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->revision_history_limit cJSON *revision_history_limit = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "revisionHistoryLimit"); + if (cJSON_IsNull(revision_history_limit)) { + revision_history_limit = NULL; + } if (revision_history_limit) { if(!cJSON_IsNumber(revision_history_limit)) { @@ -291,6 +340,9 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (!selector) { goto end; } @@ -300,18 +352,21 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->service_name cJSON *service_name = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "serviceName"); - if (!service_name) { - goto end; + if (cJSON_IsNull(service_name)) { + service_name = NULL; } - - - if(!cJSON_IsString(service_name)) + if (service_name) { + if(!cJSON_IsString(service_name) && !cJSON_IsNull(service_name)) { goto end; //String } + } // v1_stateful_set_spec->_template cJSON *_template = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "template"); + if (cJSON_IsNull(_template)) { + _template = NULL; + } if (!_template) { goto end; } @@ -321,12 +376,18 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->update_strategy cJSON *update_strategy = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "updateStrategy"); + if (cJSON_IsNull(update_strategy)) { + update_strategy = NULL; + } if (update_strategy) { update_strategy_local_nonprim = v1_stateful_set_update_strategy_parseFromJSON(update_strategy); //nonprimitive } // v1_stateful_set_spec->volume_claim_templates cJSON *volume_claim_templates = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "volumeClaimTemplates"); + if (cJSON_IsNull(volume_claim_templates)) { + volume_claim_templates = NULL; + } if (volume_claim_templates) { cJSON *volume_claim_templates_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_claim_templates)){ @@ -347,7 +408,7 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se } - v1_stateful_set_spec_local_var = v1_stateful_set_spec_create ( + v1_stateful_set_spec_local_var = v1_stateful_set_spec_create_internal ( min_ready_seconds ? min_ready_seconds->valuedouble : 0, ordinals ? ordinals_local_nonprim : NULL, persistent_volume_claim_retention_policy ? persistent_volume_claim_retention_policy_local_nonprim : NULL, @@ -355,7 +416,7 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se replicas ? replicas->valuedouble : 0, revision_history_limit ? revision_history_limit->valuedouble : 0, selector_local_nonprim, - strdup(service_name->valuestring), + service_name && !cJSON_IsNull(service_name) ? strdup(service_name->valuestring) : NULL, _template_local_nonprim, update_strategy ? update_strategy_local_nonprim : NULL, volume_claim_templates ? volume_claim_templatesList : NULL diff --git a/kubernetes/model/v1_stateful_set_spec.h b/kubernetes/model/v1_stateful_set_spec.h index 2019bec3..8b93140e 100644 --- a/kubernetes/model/v1_stateful_set_spec.h +++ b/kubernetes/model/v1_stateful_set_spec.h @@ -37,9 +37,10 @@ typedef struct v1_stateful_set_spec_t { struct v1_stateful_set_update_strategy_t *update_strategy; //model list_t *volume_claim_templates; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_spec_t; -v1_stateful_set_spec_t *v1_stateful_set_spec_create( +__attribute__((deprecated)) v1_stateful_set_spec_t *v1_stateful_set_spec_create( int min_ready_seconds, v1_stateful_set_ordinals_t *ordinals, v1_stateful_set_persistent_volume_claim_retention_policy_t *persistent_volume_claim_retention_policy, diff --git a/kubernetes/model/v1_stateful_set_status.c b/kubernetes/model/v1_stateful_set_status.c index 7189423b..761ae621 100644 --- a/kubernetes/model/v1_stateful_set_status.c +++ b/kubernetes/model/v1_stateful_set_status.c @@ -5,7 +5,7 @@ -v1_stateful_set_status_t *v1_stateful_set_status_create( +static v1_stateful_set_status_t *v1_stateful_set_status_create_internal( int available_replicas, int collision_count, list_t *conditions, @@ -32,14 +32,44 @@ v1_stateful_set_status_t *v1_stateful_set_status_create( v1_stateful_set_status_local_var->update_revision = update_revision; v1_stateful_set_status_local_var->updated_replicas = updated_replicas; + v1_stateful_set_status_local_var->_library_owned = 1; return v1_stateful_set_status_local_var; } +__attribute__((deprecated)) v1_stateful_set_status_t *v1_stateful_set_status_create( + int available_replicas, + int collision_count, + list_t *conditions, + int current_replicas, + char *current_revision, + long observed_generation, + int ready_replicas, + int replicas, + char *update_revision, + int updated_replicas + ) { + return v1_stateful_set_status_create_internal ( + available_replicas, + collision_count, + conditions, + current_replicas, + current_revision, + observed_generation, + ready_replicas, + replicas, + update_revision, + updated_replicas + ); +} void v1_stateful_set_status_free(v1_stateful_set_status_t *v1_stateful_set_status) { if(NULL == v1_stateful_set_status){ return ; } + if(v1_stateful_set_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_status_free"); + return ; + } listEntry_t *listEntry; if (v1_stateful_set_status->conditions) { list_ForEach(listEntry, v1_stateful_set_status->conditions) { @@ -171,6 +201,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "availableReplicas"); + if (cJSON_IsNull(available_replicas)) { + available_replicas = NULL; + } if (available_replicas) { if(!cJSON_IsNumber(available_replicas)) { @@ -180,6 +213,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->collision_count cJSON *collision_count = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "collisionCount"); + if (cJSON_IsNull(collision_count)) { + collision_count = NULL; + } if (collision_count) { if(!cJSON_IsNumber(collision_count)) { @@ -189,6 +225,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -210,6 +249,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->current_replicas cJSON *current_replicas = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "currentReplicas"); + if (cJSON_IsNull(current_replicas)) { + current_replicas = NULL; + } if (current_replicas) { if(!cJSON_IsNumber(current_replicas)) { @@ -219,6 +261,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->current_revision cJSON *current_revision = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "currentRevision"); + if (cJSON_IsNull(current_revision)) { + current_revision = NULL; + } if (current_revision) { if(!cJSON_IsString(current_revision) && !cJSON_IsNull(current_revision)) { @@ -228,6 +273,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -237,6 +285,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->ready_replicas cJSON *ready_replicas = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "readyReplicas"); + if (cJSON_IsNull(ready_replicas)) { + ready_replicas = NULL; + } if (ready_replicas) { if(!cJSON_IsNumber(ready_replicas)) { @@ -246,6 +297,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->replicas cJSON *replicas = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "replicas"); + if (cJSON_IsNull(replicas)) { + replicas = NULL; + } if (!replicas) { goto end; } @@ -258,6 +312,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->update_revision cJSON *update_revision = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "updateRevision"); + if (cJSON_IsNull(update_revision)) { + update_revision = NULL; + } if (update_revision) { if(!cJSON_IsString(update_revision) && !cJSON_IsNull(update_revision)) { @@ -267,6 +324,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->updated_replicas cJSON *updated_replicas = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "updatedReplicas"); + if (cJSON_IsNull(updated_replicas)) { + updated_replicas = NULL; + } if (updated_replicas) { if(!cJSON_IsNumber(updated_replicas)) { @@ -275,7 +335,7 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu } - v1_stateful_set_status_local_var = v1_stateful_set_status_create ( + v1_stateful_set_status_local_var = v1_stateful_set_status_create_internal ( available_replicas ? available_replicas->valuedouble : 0, collision_count ? collision_count->valuedouble : 0, conditions ? conditionsList : NULL, diff --git a/kubernetes/model/v1_stateful_set_status.h b/kubernetes/model/v1_stateful_set_status.h index 4aa7ffbc..5be6aaab 100644 --- a/kubernetes/model/v1_stateful_set_status.h +++ b/kubernetes/model/v1_stateful_set_status.h @@ -31,9 +31,10 @@ typedef struct v1_stateful_set_status_t { char *update_revision; // string int updated_replicas; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_status_t; -v1_stateful_set_status_t *v1_stateful_set_status_create( +__attribute__((deprecated)) v1_stateful_set_status_t *v1_stateful_set_status_create( int available_replicas, int collision_count, list_t *conditions, diff --git a/kubernetes/model/v1_stateful_set_update_strategy.c b/kubernetes/model/v1_stateful_set_update_strategy.c index f053576d..21b9bf3d 100644 --- a/kubernetes/model/v1_stateful_set_update_strategy.c +++ b/kubernetes/model/v1_stateful_set_update_strategy.c @@ -5,7 +5,7 @@ -v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_create( +static v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_create_internal( v1_rolling_update_stateful_set_strategy_t *rolling_update, char *type ) { @@ -16,14 +16,28 @@ v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_create( v1_stateful_set_update_strategy_local_var->rolling_update = rolling_update; v1_stateful_set_update_strategy_local_var->type = type; + v1_stateful_set_update_strategy_local_var->_library_owned = 1; return v1_stateful_set_update_strategy_local_var; } +__attribute__((deprecated)) v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_create( + v1_rolling_update_stateful_set_strategy_t *rolling_update, + char *type + ) { + return v1_stateful_set_update_strategy_create_internal ( + rolling_update, + type + ); +} void v1_stateful_set_update_strategy_free(v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy) { if(NULL == v1_stateful_set_update_strategy){ return ; } + if(v1_stateful_set_update_strategy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_stateful_set_update_strategy_free"); + return ; + } listEntry_t *listEntry; if (v1_stateful_set_update_strategy->rolling_update) { v1_rolling_update_stateful_set_strategy_free(v1_stateful_set_update_strategy->rolling_update); @@ -76,12 +90,18 @@ v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_parseFromJSON // v1_stateful_set_update_strategy->rolling_update cJSON *rolling_update = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_update_strategyJSON, "rollingUpdate"); + if (cJSON_IsNull(rolling_update)) { + rolling_update = NULL; + } if (rolling_update) { rolling_update_local_nonprim = v1_rolling_update_stateful_set_strategy_parseFromJSON(rolling_update); //nonprimitive } // v1_stateful_set_update_strategy->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_update_strategyJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -90,7 +110,7 @@ v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_parseFromJSON } - v1_stateful_set_update_strategy_local_var = v1_stateful_set_update_strategy_create ( + v1_stateful_set_update_strategy_local_var = v1_stateful_set_update_strategy_create_internal ( rolling_update ? rolling_update_local_nonprim : NULL, type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL ); diff --git a/kubernetes/model/v1_stateful_set_update_strategy.h b/kubernetes/model/v1_stateful_set_update_strategy.h index d37b7f3c..97aacec8 100644 --- a/kubernetes/model/v1_stateful_set_update_strategy.h +++ b/kubernetes/model/v1_stateful_set_update_strategy.h @@ -23,9 +23,10 @@ typedef struct v1_stateful_set_update_strategy_t { struct v1_rolling_update_stateful_set_strategy_t *rolling_update; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_stateful_set_update_strategy_t; -v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_create( +__attribute__((deprecated)) v1_stateful_set_update_strategy_t *v1_stateful_set_update_strategy_create( v1_rolling_update_stateful_set_strategy_t *rolling_update, char *type ); diff --git a/kubernetes/model/v1_status.c b/kubernetes/model/v1_status.c index c8b47634..cec965ff 100644 --- a/kubernetes/model/v1_status.c +++ b/kubernetes/model/v1_status.c @@ -5,7 +5,7 @@ -v1_status_t *v1_status_create( +static v1_status_t *v1_status_create_internal( char *api_version, int code, v1_status_details_t *details, @@ -28,14 +28,40 @@ v1_status_t *v1_status_create( v1_status_local_var->reason = reason; v1_status_local_var->status = status; + v1_status_local_var->_library_owned = 1; return v1_status_local_var; } +__attribute__((deprecated)) v1_status_t *v1_status_create( + char *api_version, + int code, + v1_status_details_t *details, + char *kind, + char *message, + v1_list_meta_t *metadata, + char *reason, + char *status + ) { + return v1_status_create_internal ( + api_version, + code, + details, + kind, + message, + metadata, + reason, + status + ); +} void v1_status_free(v1_status_t *v1_status) { if(NULL == v1_status){ return ; } + if(v1_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_status_free"); + return ; + } listEntry_t *listEntry; if (v1_status->api_version) { free(v1_status->api_version); @@ -164,6 +190,9 @@ v1_status_t *v1_status_parseFromJSON(cJSON *v1_statusJSON){ // v1_status->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -173,6 +202,9 @@ v1_status_t *v1_status_parseFromJSON(cJSON *v1_statusJSON){ // v1_status->code cJSON *code = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "code"); + if (cJSON_IsNull(code)) { + code = NULL; + } if (code) { if(!cJSON_IsNumber(code)) { @@ -182,12 +214,18 @@ v1_status_t *v1_status_parseFromJSON(cJSON *v1_statusJSON){ // v1_status->details cJSON *details = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "details"); + if (cJSON_IsNull(details)) { + details = NULL; + } if (details) { details_local_nonprim = v1_status_details_parseFromJSON(details); //nonprimitive } // v1_status->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -197,6 +235,9 @@ v1_status_t *v1_status_parseFromJSON(cJSON *v1_statusJSON){ // v1_status->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -206,12 +247,18 @@ v1_status_t *v1_status_parseFromJSON(cJSON *v1_statusJSON){ // v1_status->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } // v1_status->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -221,6 +268,9 @@ v1_status_t *v1_status_parseFromJSON(cJSON *v1_statusJSON){ // v1_status->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_statusJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { if(!cJSON_IsString(status) && !cJSON_IsNull(status)) { @@ -229,7 +279,7 @@ v1_status_t *v1_status_parseFromJSON(cJSON *v1_statusJSON){ } - v1_status_local_var = v1_status_create ( + v1_status_local_var = v1_status_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, code ? code->valuedouble : 0, details ? details_local_nonprim : NULL, diff --git a/kubernetes/model/v1_status.h b/kubernetes/model/v1_status.h index 78f46ec1..a7836819 100644 --- a/kubernetes/model/v1_status.h +++ b/kubernetes/model/v1_status.h @@ -30,9 +30,10 @@ typedef struct v1_status_t { char *reason; // string char *status; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_status_t; -v1_status_t *v1_status_create( +__attribute__((deprecated)) v1_status_t *v1_status_create( char *api_version, int code, v1_status_details_t *details, diff --git a/kubernetes/model/v1_status_cause.c b/kubernetes/model/v1_status_cause.c index 69b1bb27..8086dcae 100644 --- a/kubernetes/model/v1_status_cause.c +++ b/kubernetes/model/v1_status_cause.c @@ -5,7 +5,7 @@ -v1_status_cause_t *v1_status_cause_create( +static v1_status_cause_t *v1_status_cause_create_internal( char *field, char *message, char *reason @@ -18,14 +18,30 @@ v1_status_cause_t *v1_status_cause_create( v1_status_cause_local_var->message = message; v1_status_cause_local_var->reason = reason; + v1_status_cause_local_var->_library_owned = 1; return v1_status_cause_local_var; } +__attribute__((deprecated)) v1_status_cause_t *v1_status_cause_create( + char *field, + char *message, + char *reason + ) { + return v1_status_cause_create_internal ( + field, + message, + reason + ); +} void v1_status_cause_free(v1_status_cause_t *v1_status_cause) { if(NULL == v1_status_cause){ return ; } + if(v1_status_cause->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_status_cause_free"); + return ; + } listEntry_t *listEntry; if (v1_status_cause->field) { free(v1_status_cause->field); @@ -82,6 +98,9 @@ v1_status_cause_t *v1_status_cause_parseFromJSON(cJSON *v1_status_causeJSON){ // v1_status_cause->field cJSON *field = cJSON_GetObjectItemCaseSensitive(v1_status_causeJSON, "field"); + if (cJSON_IsNull(field)) { + field = NULL; + } if (field) { if(!cJSON_IsString(field) && !cJSON_IsNull(field)) { @@ -91,6 +110,9 @@ v1_status_cause_t *v1_status_cause_parseFromJSON(cJSON *v1_status_causeJSON){ // v1_status_cause->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_status_causeJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -100,6 +122,9 @@ v1_status_cause_t *v1_status_cause_parseFromJSON(cJSON *v1_status_causeJSON){ // v1_status_cause->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_status_causeJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -108,7 +133,7 @@ v1_status_cause_t *v1_status_cause_parseFromJSON(cJSON *v1_status_causeJSON){ } - v1_status_cause_local_var = v1_status_cause_create ( + v1_status_cause_local_var = v1_status_cause_create_internal ( field && !cJSON_IsNull(field) ? strdup(field->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL diff --git a/kubernetes/model/v1_status_cause.h b/kubernetes/model/v1_status_cause.h index a55a6f9d..6e44f682 100644 --- a/kubernetes/model/v1_status_cause.h +++ b/kubernetes/model/v1_status_cause.h @@ -23,9 +23,10 @@ typedef struct v1_status_cause_t { char *message; // string char *reason; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_status_cause_t; -v1_status_cause_t *v1_status_cause_create( +__attribute__((deprecated)) v1_status_cause_t *v1_status_cause_create( char *field, char *message, char *reason diff --git a/kubernetes/model/v1_status_details.c b/kubernetes/model/v1_status_details.c index f020b933..0d897a56 100644 --- a/kubernetes/model/v1_status_details.c +++ b/kubernetes/model/v1_status_details.c @@ -5,7 +5,7 @@ -v1_status_details_t *v1_status_details_create( +static v1_status_details_t *v1_status_details_create_internal( list_t *causes, char *group, char *kind, @@ -24,14 +24,36 @@ v1_status_details_t *v1_status_details_create( v1_status_details_local_var->retry_after_seconds = retry_after_seconds; v1_status_details_local_var->uid = uid; + v1_status_details_local_var->_library_owned = 1; return v1_status_details_local_var; } +__attribute__((deprecated)) v1_status_details_t *v1_status_details_create( + list_t *causes, + char *group, + char *kind, + char *name, + int retry_after_seconds, + char *uid + ) { + return v1_status_details_create_internal ( + causes, + group, + kind, + name, + retry_after_seconds, + uid + ); +} void v1_status_details_free(v1_status_details_t *v1_status_details) { if(NULL == v1_status_details){ return ; } + if(v1_status_details->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_status_details_free"); + return ; + } listEntry_t *listEntry; if (v1_status_details->causes) { list_ForEach(listEntry, v1_status_details->causes) { @@ -138,6 +160,9 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO // v1_status_details->causes cJSON *causes = cJSON_GetObjectItemCaseSensitive(v1_status_detailsJSON, "causes"); + if (cJSON_IsNull(causes)) { + causes = NULL; + } if (causes) { cJSON *causes_local_nonprimitive = NULL; if(!cJSON_IsArray(causes)){ @@ -159,6 +184,9 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO // v1_status_details->group cJSON *group = cJSON_GetObjectItemCaseSensitive(v1_status_detailsJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (group) { if(!cJSON_IsString(group) && !cJSON_IsNull(group)) { @@ -168,6 +196,9 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO // v1_status_details->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_status_detailsJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -177,6 +208,9 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO // v1_status_details->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_status_detailsJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -186,6 +220,9 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO // v1_status_details->retry_after_seconds cJSON *retry_after_seconds = cJSON_GetObjectItemCaseSensitive(v1_status_detailsJSON, "retryAfterSeconds"); + if (cJSON_IsNull(retry_after_seconds)) { + retry_after_seconds = NULL; + } if (retry_after_seconds) { if(!cJSON_IsNumber(retry_after_seconds)) { @@ -195,6 +232,9 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO // v1_status_details->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_status_detailsJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -203,7 +243,7 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO } - v1_status_details_local_var = v1_status_details_create ( + v1_status_details_local_var = v1_status_details_create_internal ( causes ? causesList : NULL, group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_status_details.h b/kubernetes/model/v1_status_details.h index b798e241..a6e5889a 100644 --- a/kubernetes/model/v1_status_details.h +++ b/kubernetes/model/v1_status_details.h @@ -27,9 +27,10 @@ typedef struct v1_status_details_t { int retry_after_seconds; //numeric char *uid; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_status_details_t; -v1_status_details_t *v1_status_details_create( +__attribute__((deprecated)) v1_status_details_t *v1_status_details_create( list_t *causes, char *group, char *kind, diff --git a/kubernetes/model/v1_storage_class.c b/kubernetes/model/v1_storage_class.c index 671fed13..195d998e 100644 --- a/kubernetes/model/v1_storage_class.c +++ b/kubernetes/model/v1_storage_class.c @@ -5,7 +5,7 @@ -v1_storage_class_t *v1_storage_class_create( +static v1_storage_class_t *v1_storage_class_create_internal( int allow_volume_expansion, list_t *allowed_topologies, char *api_version, @@ -32,14 +32,44 @@ v1_storage_class_t *v1_storage_class_create( v1_storage_class_local_var->reclaim_policy = reclaim_policy; v1_storage_class_local_var->volume_binding_mode = volume_binding_mode; + v1_storage_class_local_var->_library_owned = 1; return v1_storage_class_local_var; } +__attribute__((deprecated)) v1_storage_class_t *v1_storage_class_create( + int allow_volume_expansion, + list_t *allowed_topologies, + char *api_version, + char *kind, + v1_object_meta_t *metadata, + list_t *mount_options, + list_t* parameters, + char *provisioner, + char *reclaim_policy, + char *volume_binding_mode + ) { + return v1_storage_class_create_internal ( + allow_volume_expansion, + allowed_topologies, + api_version, + kind, + metadata, + mount_options, + parameters, + provisioner, + reclaim_policy, + volume_binding_mode + ); +} void v1_storage_class_free(v1_storage_class_t *v1_storage_class) { if(NULL == v1_storage_class){ return ; } + if(v1_storage_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_storage_class_free"); + return ; + } listEntry_t *listEntry; if (v1_storage_class->allowed_topologies) { list_ForEach(listEntry, v1_storage_class->allowed_topologies) { @@ -69,7 +99,7 @@ void v1_storage_class_free(v1_storage_class_t *v1_storage_class) { } if (v1_storage_class->parameters) { list_ForEach(listEntry, v1_storage_class->parameters) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -161,7 +191,7 @@ cJSON *v1_storage_class_convertToJSON(v1_storage_class_t *v1_storage_class) { listEntry_t *mount_optionsListEntry; list_ForEach(mount_optionsListEntry, v1_storage_class->mount_options) { - if(cJSON_AddStringToObject(mount_options, "", (char*)mount_optionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(mount_options, "", mount_optionsListEntry->data) == NULL) { goto fail; } @@ -179,8 +209,8 @@ cJSON *v1_storage_class_convertToJSON(v1_storage_class_t *v1_storage_class) { listEntry_t *parametersListEntry; if (v1_storage_class->parameters) { list_ForEach(parametersListEntry, v1_storage_class->parameters) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)parametersListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = parametersListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -239,6 +269,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->allow_volume_expansion cJSON *allow_volume_expansion = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "allowVolumeExpansion"); + if (cJSON_IsNull(allow_volume_expansion)) { + allow_volume_expansion = NULL; + } if (allow_volume_expansion) { if(!cJSON_IsBool(allow_volume_expansion)) { @@ -248,6 +281,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->allowed_topologies cJSON *allowed_topologies = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "allowedTopologies"); + if (cJSON_IsNull(allowed_topologies)) { + allowed_topologies = NULL; + } if (allowed_topologies) { cJSON *allowed_topologies_local_nonprimitive = NULL; if(!cJSON_IsArray(allowed_topologies)){ @@ -269,6 +305,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -278,6 +317,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -287,12 +329,18 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_storage_class->mount_options cJSON *mount_options = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "mountOptions"); + if (cJSON_IsNull(mount_options)) { + mount_options = NULL; + } if (mount_options) { cJSON *mount_options_local = NULL; if(!cJSON_IsArray(mount_options)) { @@ -312,6 +360,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->parameters cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } if (parameters) { cJSON *parameters_local_map = NULL; if(!cJSON_IsObject(parameters) && !cJSON_IsNull(parameters)) @@ -337,6 +388,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->provisioner cJSON *provisioner = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "provisioner"); + if (cJSON_IsNull(provisioner)) { + provisioner = NULL; + } if (!provisioner) { goto end; } @@ -349,6 +403,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->reclaim_policy cJSON *reclaim_policy = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "reclaimPolicy"); + if (cJSON_IsNull(reclaim_policy)) { + reclaim_policy = NULL; + } if (reclaim_policy) { if(!cJSON_IsString(reclaim_policy) && !cJSON_IsNull(reclaim_policy)) { @@ -358,6 +415,9 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->volume_binding_mode cJSON *volume_binding_mode = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "volumeBindingMode"); + if (cJSON_IsNull(volume_binding_mode)) { + volume_binding_mode = NULL; + } if (volume_binding_mode) { if(!cJSON_IsString(volume_binding_mode) && !cJSON_IsNull(volume_binding_mode)) { @@ -366,7 +426,7 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ } - v1_storage_class_local_var = v1_storage_class_create ( + v1_storage_class_local_var = v1_storage_class_create_internal ( allow_volume_expansion ? allow_volume_expansion->valueint : 0, allowed_topologies ? allowed_topologiesList : NULL, api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, @@ -406,7 +466,7 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ if (parametersList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, parametersList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_storage_class.h b/kubernetes/model/v1_storage_class.h index 3c0f6263..d4fb4abf 100644 --- a/kubernetes/model/v1_storage_class.h +++ b/kubernetes/model/v1_storage_class.h @@ -32,9 +32,10 @@ typedef struct v1_storage_class_t { char *reclaim_policy; // string char *volume_binding_mode; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_storage_class_t; -v1_storage_class_t *v1_storage_class_create( +__attribute__((deprecated)) v1_storage_class_t *v1_storage_class_create( int allow_volume_expansion, list_t *allowed_topologies, char *api_version, diff --git a/kubernetes/model/v1_storage_class_list.c b/kubernetes/model/v1_storage_class_list.c index 6287d219..738f5949 100644 --- a/kubernetes/model/v1_storage_class_list.c +++ b/kubernetes/model/v1_storage_class_list.c @@ -5,7 +5,7 @@ -v1_storage_class_list_t *v1_storage_class_list_create( +static v1_storage_class_list_t *v1_storage_class_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_storage_class_list_t *v1_storage_class_list_create( v1_storage_class_list_local_var->kind = kind; v1_storage_class_list_local_var->metadata = metadata; + v1_storage_class_list_local_var->_library_owned = 1; return v1_storage_class_list_local_var; } +__attribute__((deprecated)) v1_storage_class_list_t *v1_storage_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_storage_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_storage_class_list_free(v1_storage_class_list_t *v1_storage_class_list) { if(NULL == v1_storage_class_list){ return ; } + if(v1_storage_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_storage_class_list_free"); + return ; + } listEntry_t *listEntry; if (v1_storage_class_list->api_version) { free(v1_storage_class_list->api_version); @@ -123,6 +141,9 @@ v1_storage_class_list_t *v1_storage_class_list_parseFromJSON(cJSON *v1_storage_c // v1_storage_class_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_storage_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_storage_class_list_t *v1_storage_class_list_parseFromJSON(cJSON *v1_storage_c // v1_storage_class_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_storage_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_storage_class_list_t *v1_storage_class_list_parseFromJSON(cJSON *v1_storage_c // v1_storage_class_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_storage_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_storage_class_list_t *v1_storage_class_list_parseFromJSON(cJSON *v1_storage_c // v1_storage_class_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_storage_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_storage_class_list_local_var = v1_storage_class_list_create ( + v1_storage_class_list_local_var = v1_storage_class_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_storage_class_list.h b/kubernetes/model/v1_storage_class_list.h index 67c6a618..45553344 100644 --- a/kubernetes/model/v1_storage_class_list.h +++ b/kubernetes/model/v1_storage_class_list.h @@ -26,9 +26,10 @@ typedef struct v1_storage_class_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_storage_class_list_t; -v1_storage_class_list_t *v1_storage_class_list_create( +__attribute__((deprecated)) v1_storage_class_list_t *v1_storage_class_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_storage_os_persistent_volume_source.c b/kubernetes/model/v1_storage_os_persistent_volume_source.c index 3383bd0f..0ee4e1fe 100644 --- a/kubernetes/model/v1_storage_os_persistent_volume_source.c +++ b/kubernetes/model/v1_storage_os_persistent_volume_source.c @@ -5,7 +5,7 @@ -v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source_create( +static v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source_create_internal( char *fs_type, int read_only, v1_object_reference_t *secret_ref, @@ -22,14 +22,34 @@ v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source v1_storage_os_persistent_volume_source_local_var->volume_name = volume_name; v1_storage_os_persistent_volume_source_local_var->volume_namespace = volume_namespace; + v1_storage_os_persistent_volume_source_local_var->_library_owned = 1; return v1_storage_os_persistent_volume_source_local_var; } +__attribute__((deprecated)) v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source_create( + char *fs_type, + int read_only, + v1_object_reference_t *secret_ref, + char *volume_name, + char *volume_namespace + ) { + return v1_storage_os_persistent_volume_source_create_internal ( + fs_type, + read_only, + secret_ref, + volume_name, + volume_namespace + ); +} void v1_storage_os_persistent_volume_source_free(v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source) { if(NULL == v1_storage_os_persistent_volume_source){ return ; } + if(v1_storage_os_persistent_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_storage_os_persistent_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_storage_os_persistent_volume_source->fs_type) { free(v1_storage_os_persistent_volume_source->fs_type); @@ -114,6 +134,9 @@ v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source // v1_storage_os_persistent_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_storage_os_persistent_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -123,6 +146,9 @@ v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source // v1_storage_os_persistent_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_storage_os_persistent_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -132,12 +158,18 @@ v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source // v1_storage_os_persistent_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_storage_os_persistent_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_object_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_storage_os_persistent_volume_source->volume_name cJSON *volume_name = cJSON_GetObjectItemCaseSensitive(v1_storage_os_persistent_volume_sourceJSON, "volumeName"); + if (cJSON_IsNull(volume_name)) { + volume_name = NULL; + } if (volume_name) { if(!cJSON_IsString(volume_name) && !cJSON_IsNull(volume_name)) { @@ -147,6 +179,9 @@ v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source // v1_storage_os_persistent_volume_source->volume_namespace cJSON *volume_namespace = cJSON_GetObjectItemCaseSensitive(v1_storage_os_persistent_volume_sourceJSON, "volumeNamespace"); + if (cJSON_IsNull(volume_namespace)) { + volume_namespace = NULL; + } if (volume_namespace) { if(!cJSON_IsString(volume_namespace) && !cJSON_IsNull(volume_namespace)) { @@ -155,7 +190,7 @@ v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source } - v1_storage_os_persistent_volume_source_local_var = v1_storage_os_persistent_volume_source_create ( + v1_storage_os_persistent_volume_source_local_var = v1_storage_os_persistent_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, read_only ? read_only->valueint : 0, secret_ref ? secret_ref_local_nonprim : NULL, diff --git a/kubernetes/model/v1_storage_os_persistent_volume_source.h b/kubernetes/model/v1_storage_os_persistent_volume_source.h index 92b140f7..315205a7 100644 --- a/kubernetes/model/v1_storage_os_persistent_volume_source.h +++ b/kubernetes/model/v1_storage_os_persistent_volume_source.h @@ -26,9 +26,10 @@ typedef struct v1_storage_os_persistent_volume_source_t { char *volume_name; // string char *volume_namespace; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_storage_os_persistent_volume_source_t; -v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source_create( +__attribute__((deprecated)) v1_storage_os_persistent_volume_source_t *v1_storage_os_persistent_volume_source_create( char *fs_type, int read_only, v1_object_reference_t *secret_ref, diff --git a/kubernetes/model/v1_storage_os_volume_source.c b/kubernetes/model/v1_storage_os_volume_source.c index fd1f97d5..8048ba5a 100644 --- a/kubernetes/model/v1_storage_os_volume_source.c +++ b/kubernetes/model/v1_storage_os_volume_source.c @@ -5,7 +5,7 @@ -v1_storage_os_volume_source_t *v1_storage_os_volume_source_create( +static v1_storage_os_volume_source_t *v1_storage_os_volume_source_create_internal( char *fs_type, int read_only, v1_local_object_reference_t *secret_ref, @@ -22,14 +22,34 @@ v1_storage_os_volume_source_t *v1_storage_os_volume_source_create( v1_storage_os_volume_source_local_var->volume_name = volume_name; v1_storage_os_volume_source_local_var->volume_namespace = volume_namespace; + v1_storage_os_volume_source_local_var->_library_owned = 1; return v1_storage_os_volume_source_local_var; } +__attribute__((deprecated)) v1_storage_os_volume_source_t *v1_storage_os_volume_source_create( + char *fs_type, + int read_only, + v1_local_object_reference_t *secret_ref, + char *volume_name, + char *volume_namespace + ) { + return v1_storage_os_volume_source_create_internal ( + fs_type, + read_only, + secret_ref, + volume_name, + volume_namespace + ); +} void v1_storage_os_volume_source_free(v1_storage_os_volume_source_t *v1_storage_os_volume_source) { if(NULL == v1_storage_os_volume_source){ return ; } + if(v1_storage_os_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_storage_os_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_storage_os_volume_source->fs_type) { free(v1_storage_os_volume_source->fs_type); @@ -114,6 +134,9 @@ v1_storage_os_volume_source_t *v1_storage_os_volume_source_parseFromJSON(cJSON * // v1_storage_os_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_storage_os_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -123,6 +146,9 @@ v1_storage_os_volume_source_t *v1_storage_os_volume_source_parseFromJSON(cJSON * // v1_storage_os_volume_source->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_storage_os_volume_sourceJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -132,12 +158,18 @@ v1_storage_os_volume_source_t *v1_storage_os_volume_source_parseFromJSON(cJSON * // v1_storage_os_volume_source->secret_ref cJSON *secret_ref = cJSON_GetObjectItemCaseSensitive(v1_storage_os_volume_sourceJSON, "secretRef"); + if (cJSON_IsNull(secret_ref)) { + secret_ref = NULL; + } if (secret_ref) { secret_ref_local_nonprim = v1_local_object_reference_parseFromJSON(secret_ref); //nonprimitive } // v1_storage_os_volume_source->volume_name cJSON *volume_name = cJSON_GetObjectItemCaseSensitive(v1_storage_os_volume_sourceJSON, "volumeName"); + if (cJSON_IsNull(volume_name)) { + volume_name = NULL; + } if (volume_name) { if(!cJSON_IsString(volume_name) && !cJSON_IsNull(volume_name)) { @@ -147,6 +179,9 @@ v1_storage_os_volume_source_t *v1_storage_os_volume_source_parseFromJSON(cJSON * // v1_storage_os_volume_source->volume_namespace cJSON *volume_namespace = cJSON_GetObjectItemCaseSensitive(v1_storage_os_volume_sourceJSON, "volumeNamespace"); + if (cJSON_IsNull(volume_namespace)) { + volume_namespace = NULL; + } if (volume_namespace) { if(!cJSON_IsString(volume_namespace) && !cJSON_IsNull(volume_namespace)) { @@ -155,7 +190,7 @@ v1_storage_os_volume_source_t *v1_storage_os_volume_source_parseFromJSON(cJSON * } - v1_storage_os_volume_source_local_var = v1_storage_os_volume_source_create ( + v1_storage_os_volume_source_local_var = v1_storage_os_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, read_only ? read_only->valueint : 0, secret_ref ? secret_ref_local_nonprim : NULL, diff --git a/kubernetes/model/v1_storage_os_volume_source.h b/kubernetes/model/v1_storage_os_volume_source.h index 1e02ec76..180b296e 100644 --- a/kubernetes/model/v1_storage_os_volume_source.h +++ b/kubernetes/model/v1_storage_os_volume_source.h @@ -26,9 +26,10 @@ typedef struct v1_storage_os_volume_source_t { char *volume_name; // string char *volume_namespace; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_storage_os_volume_source_t; -v1_storage_os_volume_source_t *v1_storage_os_volume_source_create( +__attribute__((deprecated)) v1_storage_os_volume_source_t *v1_storage_os_volume_source_create( char *fs_type, int read_only, v1_local_object_reference_t *secret_ref, diff --git a/kubernetes/model/v1_subject_access_review.c b/kubernetes/model/v1_subject_access_review.c index b051d548..8021c762 100644 --- a/kubernetes/model/v1_subject_access_review.c +++ b/kubernetes/model/v1_subject_access_review.c @@ -5,7 +5,7 @@ -v1_subject_access_review_t *v1_subject_access_review_create( +static v1_subject_access_review_t *v1_subject_access_review_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_subject_access_review_t *v1_subject_access_review_create( v1_subject_access_review_local_var->spec = spec; v1_subject_access_review_local_var->status = status; + v1_subject_access_review_local_var->_library_owned = 1; return v1_subject_access_review_local_var; } +__attribute__((deprecated)) v1_subject_access_review_t *v1_subject_access_review_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_subject_access_review_spec_t *spec, + v1_subject_access_review_status_t *status + ) { + return v1_subject_access_review_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_subject_access_review_free(v1_subject_access_review_t *v1_subject_access_review) { if(NULL == v1_subject_access_review){ return ; } + if(v1_subject_access_review->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_subject_access_review_free"); + return ; + } listEntry_t *listEntry; if (v1_subject_access_review->api_version) { free(v1_subject_access_review->api_version); @@ -135,6 +155,9 @@ v1_subject_access_review_t *v1_subject_access_review_parseFromJSON(cJSON *v1_sub // v1_subject_access_review->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_subject_access_reviewJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_subject_access_review_t *v1_subject_access_review_parseFromJSON(cJSON *v1_sub // v1_subject_access_review->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_subject_access_reviewJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_subject_access_review_t *v1_subject_access_review_parseFromJSON(cJSON *v1_sub // v1_subject_access_review->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_subject_access_reviewJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_subject_access_review->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_subject_access_reviewJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_subject_access_review_t *v1_subject_access_review_parseFromJSON(cJSON *v1_sub // v1_subject_access_review->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_subject_access_reviewJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_subject_access_review_status_parseFromJSON(status); //nonprimitive } - v1_subject_access_review_local_var = v1_subject_access_review_create ( + v1_subject_access_review_local_var = v1_subject_access_review_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_subject_access_review.h b/kubernetes/model/v1_subject_access_review.h index 1328343e..715fc717 100644 --- a/kubernetes/model/v1_subject_access_review.h +++ b/kubernetes/model/v1_subject_access_review.h @@ -28,9 +28,10 @@ typedef struct v1_subject_access_review_t { struct v1_subject_access_review_spec_t *spec; //model struct v1_subject_access_review_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_subject_access_review_t; -v1_subject_access_review_t *v1_subject_access_review_create( +__attribute__((deprecated)) v1_subject_access_review_t *v1_subject_access_review_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_subject_access_review_spec.c b/kubernetes/model/v1_subject_access_review_spec.c index a413ab13..349b9889 100644 --- a/kubernetes/model/v1_subject_access_review_spec.c +++ b/kubernetes/model/v1_subject_access_review_spec.c @@ -5,7 +5,7 @@ -v1_subject_access_review_spec_t *v1_subject_access_review_spec_create( +static v1_subject_access_review_spec_t *v1_subject_access_review_spec_create_internal( list_t* extra, list_t *groups, v1_non_resource_attributes_t *non_resource_attributes, @@ -24,18 +24,40 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_create( v1_subject_access_review_spec_local_var->uid = uid; v1_subject_access_review_spec_local_var->user = user; + v1_subject_access_review_spec_local_var->_library_owned = 1; return v1_subject_access_review_spec_local_var; } +__attribute__((deprecated)) v1_subject_access_review_spec_t *v1_subject_access_review_spec_create( + list_t* extra, + list_t *groups, + v1_non_resource_attributes_t *non_resource_attributes, + v1_resource_attributes_t *resource_attributes, + char *uid, + char *user + ) { + return v1_subject_access_review_spec_create_internal ( + extra, + groups, + non_resource_attributes, + resource_attributes, + uid, + user + ); +} void v1_subject_access_review_spec_free(v1_subject_access_review_spec_t *v1_subject_access_review_spec) { if(NULL == v1_subject_access_review_spec){ return ; } + if(v1_subject_access_review_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_subject_access_review_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_subject_access_review_spec->extra) { list_ForEach(listEntry, v1_subject_access_review_spec->extra) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -82,7 +104,7 @@ cJSON *v1_subject_access_review_spec_convertToJSON(v1_subject_access_review_spec listEntry_t *extraListEntry; if (v1_subject_access_review_spec->extra) { list_ForEach(extraListEntry, v1_subject_access_review_spec->extra) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)extraListEntry->data; + keyValuePair_t *localKeyValue = extraListEntry->data; } } } @@ -97,7 +119,7 @@ cJSON *v1_subject_access_review_spec_convertToJSON(v1_subject_access_review_spec listEntry_t *groupsListEntry; list_ForEach(groupsListEntry, v1_subject_access_review_spec->groups) { - if(cJSON_AddStringToObject(groups, "", (char*)groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(groups, "", groupsListEntry->data) == NULL) { goto fail; } @@ -172,6 +194,9 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS // v1_subject_access_review_spec->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "extra"); + if (cJSON_IsNull(extra)) { + extra = NULL; + } if (extra) { cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) @@ -192,6 +217,9 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS // v1_subject_access_review_spec->groups cJSON *groups = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "groups"); + if (cJSON_IsNull(groups)) { + groups = NULL; + } if (groups) { cJSON *groups_local = NULL; if(!cJSON_IsArray(groups)) { @@ -211,18 +239,27 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS // v1_subject_access_review_spec->non_resource_attributes cJSON *non_resource_attributes = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "nonResourceAttributes"); + if (cJSON_IsNull(non_resource_attributes)) { + non_resource_attributes = NULL; + } if (non_resource_attributes) { non_resource_attributes_local_nonprim = v1_non_resource_attributes_parseFromJSON(non_resource_attributes); //nonprimitive } // v1_subject_access_review_spec->resource_attributes cJSON *resource_attributes = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "resourceAttributes"); + if (cJSON_IsNull(resource_attributes)) { + resource_attributes = NULL; + } if (resource_attributes) { resource_attributes_local_nonprim = v1_resource_attributes_parseFromJSON(resource_attributes); //nonprimitive } // v1_subject_access_review_spec->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -232,6 +269,9 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS // v1_subject_access_review_spec->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { if(!cJSON_IsString(user) && !cJSON_IsNull(user)) { @@ -240,7 +280,7 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS } - v1_subject_access_review_spec_local_var = v1_subject_access_review_spec_create ( + v1_subject_access_review_spec_local_var = v1_subject_access_review_spec_create_internal ( extra ? extraList : NULL, groups ? groupsList : NULL, non_resource_attributes ? non_resource_attributes_local_nonprim : NULL, @@ -254,7 +294,7 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS if (extraList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, extraList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; keyValuePair_free(localKeyValue); diff --git a/kubernetes/model/v1_subject_access_review_spec.h b/kubernetes/model/v1_subject_access_review_spec.h index 12d7e721..dd3a9a58 100644 --- a/kubernetes/model/v1_subject_access_review_spec.h +++ b/kubernetes/model/v1_subject_access_review_spec.h @@ -28,9 +28,10 @@ typedef struct v1_subject_access_review_spec_t { char *uid; // string char *user; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_subject_access_review_spec_t; -v1_subject_access_review_spec_t *v1_subject_access_review_spec_create( +__attribute__((deprecated)) v1_subject_access_review_spec_t *v1_subject_access_review_spec_create( list_t* extra, list_t *groups, v1_non_resource_attributes_t *non_resource_attributes, diff --git a/kubernetes/model/v1_subject_access_review_status.c b/kubernetes/model/v1_subject_access_review_status.c index dcdc70ae..7b75e719 100644 --- a/kubernetes/model/v1_subject_access_review_status.c +++ b/kubernetes/model/v1_subject_access_review_status.c @@ -5,7 +5,7 @@ -v1_subject_access_review_status_t *v1_subject_access_review_status_create( +static v1_subject_access_review_status_t *v1_subject_access_review_status_create_internal( int allowed, int denied, char *evaluation_error, @@ -20,14 +20,32 @@ v1_subject_access_review_status_t *v1_subject_access_review_status_create( v1_subject_access_review_status_local_var->evaluation_error = evaluation_error; v1_subject_access_review_status_local_var->reason = reason; + v1_subject_access_review_status_local_var->_library_owned = 1; return v1_subject_access_review_status_local_var; } +__attribute__((deprecated)) v1_subject_access_review_status_t *v1_subject_access_review_status_create( + int allowed, + int denied, + char *evaluation_error, + char *reason + ) { + return v1_subject_access_review_status_create_internal ( + allowed, + denied, + evaluation_error, + reason + ); +} void v1_subject_access_review_status_free(v1_subject_access_review_status_t *v1_subject_access_review_status) { if(NULL == v1_subject_access_review_status){ return ; } + if(v1_subject_access_review_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_subject_access_review_status_free"); + return ; + } listEntry_t *listEntry; if (v1_subject_access_review_status->evaluation_error) { free(v1_subject_access_review_status->evaluation_error); @@ -89,6 +107,9 @@ v1_subject_access_review_status_t *v1_subject_access_review_status_parseFromJSON // v1_subject_access_review_status->allowed cJSON *allowed = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_statusJSON, "allowed"); + if (cJSON_IsNull(allowed)) { + allowed = NULL; + } if (!allowed) { goto end; } @@ -101,6 +122,9 @@ v1_subject_access_review_status_t *v1_subject_access_review_status_parseFromJSON // v1_subject_access_review_status->denied cJSON *denied = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_statusJSON, "denied"); + if (cJSON_IsNull(denied)) { + denied = NULL; + } if (denied) { if(!cJSON_IsBool(denied)) { @@ -110,6 +134,9 @@ v1_subject_access_review_status_t *v1_subject_access_review_status_parseFromJSON // v1_subject_access_review_status->evaluation_error cJSON *evaluation_error = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_statusJSON, "evaluationError"); + if (cJSON_IsNull(evaluation_error)) { + evaluation_error = NULL; + } if (evaluation_error) { if(!cJSON_IsString(evaluation_error) && !cJSON_IsNull(evaluation_error)) { @@ -119,6 +146,9 @@ v1_subject_access_review_status_t *v1_subject_access_review_status_parseFromJSON // v1_subject_access_review_status->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_statusJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -127,7 +157,7 @@ v1_subject_access_review_status_t *v1_subject_access_review_status_parseFromJSON } - v1_subject_access_review_status_local_var = v1_subject_access_review_status_create ( + v1_subject_access_review_status_local_var = v1_subject_access_review_status_create_internal ( allowed->valueint, denied ? denied->valueint : 0, evaluation_error && !cJSON_IsNull(evaluation_error) ? strdup(evaluation_error->valuestring) : NULL, diff --git a/kubernetes/model/v1_subject_access_review_status.h b/kubernetes/model/v1_subject_access_review_status.h index 80f4da2b..2a3089e1 100644 --- a/kubernetes/model/v1_subject_access_review_status.h +++ b/kubernetes/model/v1_subject_access_review_status.h @@ -24,9 +24,10 @@ typedef struct v1_subject_access_review_status_t { char *evaluation_error; // string char *reason; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_subject_access_review_status_t; -v1_subject_access_review_status_t *v1_subject_access_review_status_create( +__attribute__((deprecated)) v1_subject_access_review_status_t *v1_subject_access_review_status_create( int allowed, int denied, char *evaluation_error, diff --git a/kubernetes/model/v1_subject_rules_review_status.c b/kubernetes/model/v1_subject_rules_review_status.c index 367b4a52..8c3febce 100644 --- a/kubernetes/model/v1_subject_rules_review_status.c +++ b/kubernetes/model/v1_subject_rules_review_status.c @@ -5,7 +5,7 @@ -v1_subject_rules_review_status_t *v1_subject_rules_review_status_create( +static v1_subject_rules_review_status_t *v1_subject_rules_review_status_create_internal( char *evaluation_error, int incomplete, list_t *non_resource_rules, @@ -20,14 +20,32 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_create( v1_subject_rules_review_status_local_var->non_resource_rules = non_resource_rules; v1_subject_rules_review_status_local_var->resource_rules = resource_rules; + v1_subject_rules_review_status_local_var->_library_owned = 1; return v1_subject_rules_review_status_local_var; } +__attribute__((deprecated)) v1_subject_rules_review_status_t *v1_subject_rules_review_status_create( + char *evaluation_error, + int incomplete, + list_t *non_resource_rules, + list_t *resource_rules + ) { + return v1_subject_rules_review_status_create_internal ( + evaluation_error, + incomplete, + non_resource_rules, + resource_rules + ); +} void v1_subject_rules_review_status_free(v1_subject_rules_review_status_t *v1_subject_rules_review_status) { if(NULL == v1_subject_rules_review_status){ return ; } + if(v1_subject_rules_review_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_subject_rules_review_status_free"); + return ; + } listEntry_t *listEntry; if (v1_subject_rules_review_status->evaluation_error) { free(v1_subject_rules_review_status->evaluation_error); @@ -131,6 +149,9 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c // v1_subject_rules_review_status->evaluation_error cJSON *evaluation_error = cJSON_GetObjectItemCaseSensitive(v1_subject_rules_review_statusJSON, "evaluationError"); + if (cJSON_IsNull(evaluation_error)) { + evaluation_error = NULL; + } if (evaluation_error) { if(!cJSON_IsString(evaluation_error) && !cJSON_IsNull(evaluation_error)) { @@ -140,6 +161,9 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c // v1_subject_rules_review_status->incomplete cJSON *incomplete = cJSON_GetObjectItemCaseSensitive(v1_subject_rules_review_statusJSON, "incomplete"); + if (cJSON_IsNull(incomplete)) { + incomplete = NULL; + } if (!incomplete) { goto end; } @@ -152,6 +176,9 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c // v1_subject_rules_review_status->non_resource_rules cJSON *non_resource_rules = cJSON_GetObjectItemCaseSensitive(v1_subject_rules_review_statusJSON, "nonResourceRules"); + if (cJSON_IsNull(non_resource_rules)) { + non_resource_rules = NULL; + } if (!non_resource_rules) { goto end; } @@ -176,6 +203,9 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c // v1_subject_rules_review_status->resource_rules cJSON *resource_rules = cJSON_GetObjectItemCaseSensitive(v1_subject_rules_review_statusJSON, "resourceRules"); + if (cJSON_IsNull(resource_rules)) { + resource_rules = NULL; + } if (!resource_rules) { goto end; } @@ -199,7 +229,7 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c } - v1_subject_rules_review_status_local_var = v1_subject_rules_review_status_create ( + v1_subject_rules_review_status_local_var = v1_subject_rules_review_status_create_internal ( evaluation_error && !cJSON_IsNull(evaluation_error) ? strdup(evaluation_error->valuestring) : NULL, incomplete->valueint, non_resource_rulesList, diff --git a/kubernetes/model/v1_subject_rules_review_status.h b/kubernetes/model/v1_subject_rules_review_status.h index 15ef27f0..0098e467 100644 --- a/kubernetes/model/v1_subject_rules_review_status.h +++ b/kubernetes/model/v1_subject_rules_review_status.h @@ -26,9 +26,10 @@ typedef struct v1_subject_rules_review_status_t { list_t *non_resource_rules; //nonprimitive container list_t *resource_rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_subject_rules_review_status_t; -v1_subject_rules_review_status_t *v1_subject_rules_review_status_create( +__attribute__((deprecated)) v1_subject_rules_review_status_t *v1_subject_rules_review_status_create( char *evaluation_error, int incomplete, list_t *non_resource_rules, diff --git a/kubernetes/model/v1_success_policy.c b/kubernetes/model/v1_success_policy.c index 5da253b0..bd93c0a0 100644 --- a/kubernetes/model/v1_success_policy.c +++ b/kubernetes/model/v1_success_policy.c @@ -5,7 +5,7 @@ -v1_success_policy_t *v1_success_policy_create( +static v1_success_policy_t *v1_success_policy_create_internal( list_t *rules ) { v1_success_policy_t *v1_success_policy_local_var = malloc(sizeof(v1_success_policy_t)); @@ -14,14 +14,26 @@ v1_success_policy_t *v1_success_policy_create( } v1_success_policy_local_var->rules = rules; + v1_success_policy_local_var->_library_owned = 1; return v1_success_policy_local_var; } +__attribute__((deprecated)) v1_success_policy_t *v1_success_policy_create( + list_t *rules + ) { + return v1_success_policy_create_internal ( + rules + ); +} void v1_success_policy_free(v1_success_policy_t *v1_success_policy) { if(NULL == v1_success_policy){ return ; } + if(v1_success_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_success_policy_free"); + return ; + } listEntry_t *listEntry; if (v1_success_policy->rules) { list_ForEach(listEntry, v1_success_policy->rules) { @@ -73,6 +85,9 @@ v1_success_policy_t *v1_success_policy_parseFromJSON(cJSON *v1_success_policyJSO // v1_success_policy->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_success_policyJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (!rules) { goto end; } @@ -96,7 +111,7 @@ v1_success_policy_t *v1_success_policy_parseFromJSON(cJSON *v1_success_policyJSO } - v1_success_policy_local_var = v1_success_policy_create ( + v1_success_policy_local_var = v1_success_policy_create_internal ( rulesList ); diff --git a/kubernetes/model/v1_success_policy.h b/kubernetes/model/v1_success_policy.h index f729f545..7f213e2b 100644 --- a/kubernetes/model/v1_success_policy.h +++ b/kubernetes/model/v1_success_policy.h @@ -22,9 +22,10 @@ typedef struct v1_success_policy_t v1_success_policy_t; typedef struct v1_success_policy_t { list_t *rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_success_policy_t; -v1_success_policy_t *v1_success_policy_create( +__attribute__((deprecated)) v1_success_policy_t *v1_success_policy_create( list_t *rules ); diff --git a/kubernetes/model/v1_success_policy_rule.c b/kubernetes/model/v1_success_policy_rule.c index f8f8c800..1c0b51b1 100644 --- a/kubernetes/model/v1_success_policy_rule.c +++ b/kubernetes/model/v1_success_policy_rule.c @@ -5,7 +5,7 @@ -v1_success_policy_rule_t *v1_success_policy_rule_create( +static v1_success_policy_rule_t *v1_success_policy_rule_create_internal( int succeeded_count, char *succeeded_indexes ) { @@ -16,14 +16,28 @@ v1_success_policy_rule_t *v1_success_policy_rule_create( v1_success_policy_rule_local_var->succeeded_count = succeeded_count; v1_success_policy_rule_local_var->succeeded_indexes = succeeded_indexes; + v1_success_policy_rule_local_var->_library_owned = 1; return v1_success_policy_rule_local_var; } +__attribute__((deprecated)) v1_success_policy_rule_t *v1_success_policy_rule_create( + int succeeded_count, + char *succeeded_indexes + ) { + return v1_success_policy_rule_create_internal ( + succeeded_count, + succeeded_indexes + ); +} void v1_success_policy_rule_free(v1_success_policy_rule_t *v1_success_policy_rule) { if(NULL == v1_success_policy_rule){ return ; } + if(v1_success_policy_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_success_policy_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_success_policy_rule->succeeded_indexes) { free(v1_success_policy_rule->succeeded_indexes); @@ -64,6 +78,9 @@ v1_success_policy_rule_t *v1_success_policy_rule_parseFromJSON(cJSON *v1_success // v1_success_policy_rule->succeeded_count cJSON *succeeded_count = cJSON_GetObjectItemCaseSensitive(v1_success_policy_ruleJSON, "succeededCount"); + if (cJSON_IsNull(succeeded_count)) { + succeeded_count = NULL; + } if (succeeded_count) { if(!cJSON_IsNumber(succeeded_count)) { @@ -73,6 +90,9 @@ v1_success_policy_rule_t *v1_success_policy_rule_parseFromJSON(cJSON *v1_success // v1_success_policy_rule->succeeded_indexes cJSON *succeeded_indexes = cJSON_GetObjectItemCaseSensitive(v1_success_policy_ruleJSON, "succeededIndexes"); + if (cJSON_IsNull(succeeded_indexes)) { + succeeded_indexes = NULL; + } if (succeeded_indexes) { if(!cJSON_IsString(succeeded_indexes) && !cJSON_IsNull(succeeded_indexes)) { @@ -81,7 +101,7 @@ v1_success_policy_rule_t *v1_success_policy_rule_parseFromJSON(cJSON *v1_success } - v1_success_policy_rule_local_var = v1_success_policy_rule_create ( + v1_success_policy_rule_local_var = v1_success_policy_rule_create_internal ( succeeded_count ? succeeded_count->valuedouble : 0, succeeded_indexes && !cJSON_IsNull(succeeded_indexes) ? strdup(succeeded_indexes->valuestring) : NULL ); diff --git a/kubernetes/model/v1_success_policy_rule.h b/kubernetes/model/v1_success_policy_rule.h index 4595262a..47d8994f 100644 --- a/kubernetes/model/v1_success_policy_rule.h +++ b/kubernetes/model/v1_success_policy_rule.h @@ -22,9 +22,10 @@ typedef struct v1_success_policy_rule_t { int succeeded_count; //numeric char *succeeded_indexes; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_success_policy_rule_t; -v1_success_policy_rule_t *v1_success_policy_rule_create( +__attribute__((deprecated)) v1_success_policy_rule_t *v1_success_policy_rule_create( int succeeded_count, char *succeeded_indexes ); diff --git a/kubernetes/model/v1_sysctl.c b/kubernetes/model/v1_sysctl.c index 43d7f12c..19fecec5 100644 --- a/kubernetes/model/v1_sysctl.c +++ b/kubernetes/model/v1_sysctl.c @@ -5,7 +5,7 @@ -v1_sysctl_t *v1_sysctl_create( +static v1_sysctl_t *v1_sysctl_create_internal( char *name, char *value ) { @@ -16,14 +16,28 @@ v1_sysctl_t *v1_sysctl_create( v1_sysctl_local_var->name = name; v1_sysctl_local_var->value = value; + v1_sysctl_local_var->_library_owned = 1; return v1_sysctl_local_var; } +__attribute__((deprecated)) v1_sysctl_t *v1_sysctl_create( + char *name, + char *value + ) { + return v1_sysctl_create_internal ( + name, + value + ); +} void v1_sysctl_free(v1_sysctl_t *v1_sysctl) { if(NULL == v1_sysctl){ return ; } + if(v1_sysctl->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_sysctl_free"); + return ; + } listEntry_t *listEntry; if (v1_sysctl->name) { free(v1_sysctl->name); @@ -70,6 +84,9 @@ v1_sysctl_t *v1_sysctl_parseFromJSON(cJSON *v1_sysctlJSON){ // v1_sysctl->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_sysctlJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -82,6 +99,9 @@ v1_sysctl_t *v1_sysctl_parseFromJSON(cJSON *v1_sysctlJSON){ // v1_sysctl->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_sysctlJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (!value) { goto end; } @@ -93,7 +113,7 @@ v1_sysctl_t *v1_sysctl_parseFromJSON(cJSON *v1_sysctlJSON){ } - v1_sysctl_local_var = v1_sysctl_create ( + v1_sysctl_local_var = v1_sysctl_create_internal ( strdup(name->valuestring), strdup(value->valuestring) ); diff --git a/kubernetes/model/v1_sysctl.h b/kubernetes/model/v1_sysctl.h index 7013cb68..ee33d9b2 100644 --- a/kubernetes/model/v1_sysctl.h +++ b/kubernetes/model/v1_sysctl.h @@ -22,9 +22,10 @@ typedef struct v1_sysctl_t { char *name; // string char *value; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_sysctl_t; -v1_sysctl_t *v1_sysctl_create( +__attribute__((deprecated)) v1_sysctl_t *v1_sysctl_create( char *name, char *value ); diff --git a/kubernetes/model/v1_taint.c b/kubernetes/model/v1_taint.c index a16cb699..58c88b6f 100644 --- a/kubernetes/model/v1_taint.c +++ b/kubernetes/model/v1_taint.c @@ -5,7 +5,7 @@ -v1_taint_t *v1_taint_create( +static v1_taint_t *v1_taint_create_internal( char *effect, char *key, char *time_added, @@ -20,14 +20,32 @@ v1_taint_t *v1_taint_create( v1_taint_local_var->time_added = time_added; v1_taint_local_var->value = value; + v1_taint_local_var->_library_owned = 1; return v1_taint_local_var; } +__attribute__((deprecated)) v1_taint_t *v1_taint_create( + char *effect, + char *key, + char *time_added, + char *value + ) { + return v1_taint_create_internal ( + effect, + key, + time_added, + value + ); +} void v1_taint_free(v1_taint_t *v1_taint) { if(NULL == v1_taint){ return ; } + if(v1_taint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_taint_free"); + return ; + } listEntry_t *listEntry; if (v1_taint->effect) { free(v1_taint->effect); @@ -98,6 +116,9 @@ v1_taint_t *v1_taint_parseFromJSON(cJSON *v1_taintJSON){ // v1_taint->effect cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1_taintJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } if (!effect) { goto end; } @@ -110,6 +131,9 @@ v1_taint_t *v1_taint_parseFromJSON(cJSON *v1_taintJSON){ // v1_taint->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_taintJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -122,6 +146,9 @@ v1_taint_t *v1_taint_parseFromJSON(cJSON *v1_taintJSON){ // v1_taint->time_added cJSON *time_added = cJSON_GetObjectItemCaseSensitive(v1_taintJSON, "timeAdded"); + if (cJSON_IsNull(time_added)) { + time_added = NULL; + } if (time_added) { if(!cJSON_IsString(time_added) && !cJSON_IsNull(time_added)) { @@ -131,6 +158,9 @@ v1_taint_t *v1_taint_parseFromJSON(cJSON *v1_taintJSON){ // v1_taint->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_taintJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (value) { if(!cJSON_IsString(value) && !cJSON_IsNull(value)) { @@ -139,7 +169,7 @@ v1_taint_t *v1_taint_parseFromJSON(cJSON *v1_taintJSON){ } - v1_taint_local_var = v1_taint_create ( + v1_taint_local_var = v1_taint_create_internal ( strdup(effect->valuestring), strdup(key->valuestring), time_added && !cJSON_IsNull(time_added) ? strdup(time_added->valuestring) : NULL, diff --git a/kubernetes/model/v1_taint.h b/kubernetes/model/v1_taint.h index 2aa53be9..34db590e 100644 --- a/kubernetes/model/v1_taint.h +++ b/kubernetes/model/v1_taint.h @@ -24,9 +24,10 @@ typedef struct v1_taint_t { char *time_added; //date time char *value; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_taint_t; -v1_taint_t *v1_taint_create( +__attribute__((deprecated)) v1_taint_t *v1_taint_create( char *effect, char *key, char *time_added, diff --git a/kubernetes/model/v1_tcp_socket_action.c b/kubernetes/model/v1_tcp_socket_action.c index ce2d63f0..a9cbe590 100644 --- a/kubernetes/model/v1_tcp_socket_action.c +++ b/kubernetes/model/v1_tcp_socket_action.c @@ -5,7 +5,7 @@ -v1_tcp_socket_action_t *v1_tcp_socket_action_create( +static v1_tcp_socket_action_t *v1_tcp_socket_action_create_internal( char *host, int_or_string_t *port ) { @@ -16,14 +16,28 @@ v1_tcp_socket_action_t *v1_tcp_socket_action_create( v1_tcp_socket_action_local_var->host = host; v1_tcp_socket_action_local_var->port = port; + v1_tcp_socket_action_local_var->_library_owned = 1; return v1_tcp_socket_action_local_var; } +__attribute__((deprecated)) v1_tcp_socket_action_t *v1_tcp_socket_action_create( + char *host, + int_or_string_t *port + ) { + return v1_tcp_socket_action_create_internal ( + host, + port + ); +} void v1_tcp_socket_action_free(v1_tcp_socket_action_t *v1_tcp_socket_action) { if(NULL == v1_tcp_socket_action){ return ; } + if(v1_tcp_socket_action->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_tcp_socket_action_free"); + return ; + } listEntry_t *listEntry; if (v1_tcp_socket_action->host) { free(v1_tcp_socket_action->host); @@ -77,6 +91,9 @@ v1_tcp_socket_action_t *v1_tcp_socket_action_parseFromJSON(cJSON *v1_tcp_socket_ // v1_tcp_socket_action->host cJSON *host = cJSON_GetObjectItemCaseSensitive(v1_tcp_socket_actionJSON, "host"); + if (cJSON_IsNull(host)) { + host = NULL; + } if (host) { if(!cJSON_IsString(host) && !cJSON_IsNull(host)) { @@ -86,6 +103,9 @@ v1_tcp_socket_action_t *v1_tcp_socket_action_parseFromJSON(cJSON *v1_tcp_socket_ // v1_tcp_socket_action->port cJSON *port = cJSON_GetObjectItemCaseSensitive(v1_tcp_socket_actionJSON, "port"); + if (cJSON_IsNull(port)) { + port = NULL; + } if (!port) { goto end; } @@ -94,7 +114,7 @@ v1_tcp_socket_action_t *v1_tcp_socket_action_parseFromJSON(cJSON *v1_tcp_socket_ port_local_nonprim = int_or_string_parseFromJSON(port); //custom - v1_tcp_socket_action_local_var = v1_tcp_socket_action_create ( + v1_tcp_socket_action_local_var = v1_tcp_socket_action_create_internal ( host && !cJSON_IsNull(host) ? strdup(host->valuestring) : NULL, port_local_nonprim ); diff --git a/kubernetes/model/v1_tcp_socket_action.h b/kubernetes/model/v1_tcp_socket_action.h index ac0c59b0..40fb8d93 100644 --- a/kubernetes/model/v1_tcp_socket_action.h +++ b/kubernetes/model/v1_tcp_socket_action.h @@ -23,9 +23,10 @@ typedef struct v1_tcp_socket_action_t { char *host; // string int_or_string_t *port; // custom + int _library_owned; // Is the library responsible for freeing this object? } v1_tcp_socket_action_t; -v1_tcp_socket_action_t *v1_tcp_socket_action_create( +__attribute__((deprecated)) v1_tcp_socket_action_t *v1_tcp_socket_action_create( char *host, int_or_string_t *port ); diff --git a/kubernetes/model/v1_token_request_spec.c b/kubernetes/model/v1_token_request_spec.c index 4ef487bd..7206bc3b 100644 --- a/kubernetes/model/v1_token_request_spec.c +++ b/kubernetes/model/v1_token_request_spec.c @@ -5,7 +5,7 @@ -v1_token_request_spec_t *v1_token_request_spec_create( +static v1_token_request_spec_t *v1_token_request_spec_create_internal( list_t *audiences, v1_bound_object_reference_t *bound_object_ref, long expiration_seconds @@ -18,14 +18,30 @@ v1_token_request_spec_t *v1_token_request_spec_create( v1_token_request_spec_local_var->bound_object_ref = bound_object_ref; v1_token_request_spec_local_var->expiration_seconds = expiration_seconds; + v1_token_request_spec_local_var->_library_owned = 1; return v1_token_request_spec_local_var; } +__attribute__((deprecated)) v1_token_request_spec_t *v1_token_request_spec_create( + list_t *audiences, + v1_bound_object_reference_t *bound_object_ref, + long expiration_seconds + ) { + return v1_token_request_spec_create_internal ( + audiences, + bound_object_ref, + expiration_seconds + ); +} void v1_token_request_spec_free(v1_token_request_spec_t *v1_token_request_spec) { if(NULL == v1_token_request_spec){ return ; } + if(v1_token_request_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_token_request_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_token_request_spec->audiences) { list_ForEach(listEntry, v1_token_request_spec->audiences) { @@ -55,7 +71,7 @@ cJSON *v1_token_request_spec_convertToJSON(v1_token_request_spec_t *v1_token_req listEntry_t *audiencesListEntry; list_ForEach(audiencesListEntry, v1_token_request_spec->audiences) { - if(cJSON_AddStringToObject(audiences, "", (char*)audiencesListEntry->data) == NULL) + if(cJSON_AddStringToObject(audiences, "", audiencesListEntry->data) == NULL) { goto fail; } @@ -102,6 +118,9 @@ v1_token_request_spec_t *v1_token_request_spec_parseFromJSON(cJSON *v1_token_req // v1_token_request_spec->audiences cJSON *audiences = cJSON_GetObjectItemCaseSensitive(v1_token_request_specJSON, "audiences"); + if (cJSON_IsNull(audiences)) { + audiences = NULL; + } if (!audiences) { goto end; } @@ -124,12 +143,18 @@ v1_token_request_spec_t *v1_token_request_spec_parseFromJSON(cJSON *v1_token_req // v1_token_request_spec->bound_object_ref cJSON *bound_object_ref = cJSON_GetObjectItemCaseSensitive(v1_token_request_specJSON, "boundObjectRef"); + if (cJSON_IsNull(bound_object_ref)) { + bound_object_ref = NULL; + } if (bound_object_ref) { bound_object_ref_local_nonprim = v1_bound_object_reference_parseFromJSON(bound_object_ref); //nonprimitive } // v1_token_request_spec->expiration_seconds cJSON *expiration_seconds = cJSON_GetObjectItemCaseSensitive(v1_token_request_specJSON, "expirationSeconds"); + if (cJSON_IsNull(expiration_seconds)) { + expiration_seconds = NULL; + } if (expiration_seconds) { if(!cJSON_IsNumber(expiration_seconds)) { @@ -138,7 +163,7 @@ v1_token_request_spec_t *v1_token_request_spec_parseFromJSON(cJSON *v1_token_req } - v1_token_request_spec_local_var = v1_token_request_spec_create ( + v1_token_request_spec_local_var = v1_token_request_spec_create_internal ( audiencesList, bound_object_ref ? bound_object_ref_local_nonprim : NULL, expiration_seconds ? expiration_seconds->valuedouble : 0 diff --git a/kubernetes/model/v1_token_request_spec.h b/kubernetes/model/v1_token_request_spec.h index d7f9ac08..3c396812 100644 --- a/kubernetes/model/v1_token_request_spec.h +++ b/kubernetes/model/v1_token_request_spec.h @@ -24,9 +24,10 @@ typedef struct v1_token_request_spec_t { struct v1_bound_object_reference_t *bound_object_ref; //model long expiration_seconds; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_token_request_spec_t; -v1_token_request_spec_t *v1_token_request_spec_create( +__attribute__((deprecated)) v1_token_request_spec_t *v1_token_request_spec_create( list_t *audiences, v1_bound_object_reference_t *bound_object_ref, long expiration_seconds diff --git a/kubernetes/model/v1_token_request_status.c b/kubernetes/model/v1_token_request_status.c index 7a2f45c0..01d7e101 100644 --- a/kubernetes/model/v1_token_request_status.c +++ b/kubernetes/model/v1_token_request_status.c @@ -5,7 +5,7 @@ -v1_token_request_status_t *v1_token_request_status_create( +static v1_token_request_status_t *v1_token_request_status_create_internal( char *expiration_timestamp, char *token ) { @@ -16,14 +16,28 @@ v1_token_request_status_t *v1_token_request_status_create( v1_token_request_status_local_var->expiration_timestamp = expiration_timestamp; v1_token_request_status_local_var->token = token; + v1_token_request_status_local_var->_library_owned = 1; return v1_token_request_status_local_var; } +__attribute__((deprecated)) v1_token_request_status_t *v1_token_request_status_create( + char *expiration_timestamp, + char *token + ) { + return v1_token_request_status_create_internal ( + expiration_timestamp, + token + ); +} void v1_token_request_status_free(v1_token_request_status_t *v1_token_request_status) { if(NULL == v1_token_request_status){ return ; } + if(v1_token_request_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_token_request_status_free"); + return ; + } listEntry_t *listEntry; if (v1_token_request_status->expiration_timestamp) { free(v1_token_request_status->expiration_timestamp); @@ -70,6 +84,9 @@ v1_token_request_status_t *v1_token_request_status_parseFromJSON(cJSON *v1_token // v1_token_request_status->expiration_timestamp cJSON *expiration_timestamp = cJSON_GetObjectItemCaseSensitive(v1_token_request_statusJSON, "expirationTimestamp"); + if (cJSON_IsNull(expiration_timestamp)) { + expiration_timestamp = NULL; + } if (!expiration_timestamp) { goto end; } @@ -82,6 +99,9 @@ v1_token_request_status_t *v1_token_request_status_parseFromJSON(cJSON *v1_token // v1_token_request_status->token cJSON *token = cJSON_GetObjectItemCaseSensitive(v1_token_request_statusJSON, "token"); + if (cJSON_IsNull(token)) { + token = NULL; + } if (!token) { goto end; } @@ -93,7 +113,7 @@ v1_token_request_status_t *v1_token_request_status_parseFromJSON(cJSON *v1_token } - v1_token_request_status_local_var = v1_token_request_status_create ( + v1_token_request_status_local_var = v1_token_request_status_create_internal ( strdup(expiration_timestamp->valuestring), strdup(token->valuestring) ); diff --git a/kubernetes/model/v1_token_request_status.h b/kubernetes/model/v1_token_request_status.h index 97b1e26b..3bf95fc5 100644 --- a/kubernetes/model/v1_token_request_status.h +++ b/kubernetes/model/v1_token_request_status.h @@ -22,9 +22,10 @@ typedef struct v1_token_request_status_t { char *expiration_timestamp; //date time char *token; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_token_request_status_t; -v1_token_request_status_t *v1_token_request_status_create( +__attribute__((deprecated)) v1_token_request_status_t *v1_token_request_status_create( char *expiration_timestamp, char *token ); diff --git a/kubernetes/model/v1_token_review.c b/kubernetes/model/v1_token_review.c index 9b15c67c..a752aee6 100644 --- a/kubernetes/model/v1_token_review.c +++ b/kubernetes/model/v1_token_review.c @@ -5,7 +5,7 @@ -v1_token_review_t *v1_token_review_create( +static v1_token_review_t *v1_token_review_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_token_review_t *v1_token_review_create( v1_token_review_local_var->spec = spec; v1_token_review_local_var->status = status; + v1_token_review_local_var->_library_owned = 1; return v1_token_review_local_var; } +__attribute__((deprecated)) v1_token_review_t *v1_token_review_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_token_review_spec_t *spec, + v1_token_review_status_t *status + ) { + return v1_token_review_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_token_review_free(v1_token_review_t *v1_token_review) { if(NULL == v1_token_review){ return ; } + if(v1_token_review->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_token_review_free"); + return ; + } listEntry_t *listEntry; if (v1_token_review->api_version) { free(v1_token_review->api_version); @@ -135,6 +155,9 @@ v1_token_review_t *v1_token_review_parseFromJSON(cJSON *v1_token_reviewJSON){ // v1_token_review->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_token_reviewJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_token_review_t *v1_token_review_parseFromJSON(cJSON *v1_token_reviewJSON){ // v1_token_review->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_token_reviewJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_token_review_t *v1_token_review_parseFromJSON(cJSON *v1_token_reviewJSON){ // v1_token_review->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_token_reviewJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_token_review->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_token_reviewJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_token_review_t *v1_token_review_parseFromJSON(cJSON *v1_token_reviewJSON){ // v1_token_review->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_token_reviewJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_token_review_status_parseFromJSON(status); //nonprimitive } - v1_token_review_local_var = v1_token_review_create ( + v1_token_review_local_var = v1_token_review_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_token_review.h b/kubernetes/model/v1_token_review.h index def8361b..6d837455 100644 --- a/kubernetes/model/v1_token_review.h +++ b/kubernetes/model/v1_token_review.h @@ -28,9 +28,10 @@ typedef struct v1_token_review_t { struct v1_token_review_spec_t *spec; //model struct v1_token_review_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_token_review_t; -v1_token_review_t *v1_token_review_create( +__attribute__((deprecated)) v1_token_review_t *v1_token_review_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_token_review_spec.c b/kubernetes/model/v1_token_review_spec.c index f295bc1b..fd6509ba 100644 --- a/kubernetes/model/v1_token_review_spec.c +++ b/kubernetes/model/v1_token_review_spec.c @@ -5,7 +5,7 @@ -v1_token_review_spec_t *v1_token_review_spec_create( +static v1_token_review_spec_t *v1_token_review_spec_create_internal( list_t *audiences, char *token ) { @@ -16,14 +16,28 @@ v1_token_review_spec_t *v1_token_review_spec_create( v1_token_review_spec_local_var->audiences = audiences; v1_token_review_spec_local_var->token = token; + v1_token_review_spec_local_var->_library_owned = 1; return v1_token_review_spec_local_var; } +__attribute__((deprecated)) v1_token_review_spec_t *v1_token_review_spec_create( + list_t *audiences, + char *token + ) { + return v1_token_review_spec_create_internal ( + audiences, + token + ); +} void v1_token_review_spec_free(v1_token_review_spec_t *v1_token_review_spec) { if(NULL == v1_token_review_spec){ return ; } + if(v1_token_review_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_token_review_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_token_review_spec->audiences) { list_ForEach(listEntry, v1_token_review_spec->audiences) { @@ -51,7 +65,7 @@ cJSON *v1_token_review_spec_convertToJSON(v1_token_review_spec_t *v1_token_revie listEntry_t *audiencesListEntry; list_ForEach(audiencesListEntry, v1_token_review_spec->audiences) { - if(cJSON_AddStringToObject(audiences, "", (char*)audiencesListEntry->data) == NULL) + if(cJSON_AddStringToObject(audiences, "", audiencesListEntry->data) == NULL) { goto fail; } @@ -83,6 +97,9 @@ v1_token_review_spec_t *v1_token_review_spec_parseFromJSON(cJSON *v1_token_revie // v1_token_review_spec->audiences cJSON *audiences = cJSON_GetObjectItemCaseSensitive(v1_token_review_specJSON, "audiences"); + if (cJSON_IsNull(audiences)) { + audiences = NULL; + } if (audiences) { cJSON *audiences_local = NULL; if(!cJSON_IsArray(audiences)) { @@ -102,6 +119,9 @@ v1_token_review_spec_t *v1_token_review_spec_parseFromJSON(cJSON *v1_token_revie // v1_token_review_spec->token cJSON *token = cJSON_GetObjectItemCaseSensitive(v1_token_review_specJSON, "token"); + if (cJSON_IsNull(token)) { + token = NULL; + } if (token) { if(!cJSON_IsString(token) && !cJSON_IsNull(token)) { @@ -110,7 +130,7 @@ v1_token_review_spec_t *v1_token_review_spec_parseFromJSON(cJSON *v1_token_revie } - v1_token_review_spec_local_var = v1_token_review_spec_create ( + v1_token_review_spec_local_var = v1_token_review_spec_create_internal ( audiences ? audiencesList : NULL, token && !cJSON_IsNull(token) ? strdup(token->valuestring) : NULL ); diff --git a/kubernetes/model/v1_token_review_spec.h b/kubernetes/model/v1_token_review_spec.h index e598932e..5ea239f1 100644 --- a/kubernetes/model/v1_token_review_spec.h +++ b/kubernetes/model/v1_token_review_spec.h @@ -22,9 +22,10 @@ typedef struct v1_token_review_spec_t { list_t *audiences; //primitive container char *token; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_token_review_spec_t; -v1_token_review_spec_t *v1_token_review_spec_create( +__attribute__((deprecated)) v1_token_review_spec_t *v1_token_review_spec_create( list_t *audiences, char *token ); diff --git a/kubernetes/model/v1_token_review_status.c b/kubernetes/model/v1_token_review_status.c index b454171b..7627f971 100644 --- a/kubernetes/model/v1_token_review_status.c +++ b/kubernetes/model/v1_token_review_status.c @@ -5,7 +5,7 @@ -v1_token_review_status_t *v1_token_review_status_create( +static v1_token_review_status_t *v1_token_review_status_create_internal( list_t *audiences, int authenticated, char *error, @@ -20,14 +20,32 @@ v1_token_review_status_t *v1_token_review_status_create( v1_token_review_status_local_var->error = error; v1_token_review_status_local_var->user = user; + v1_token_review_status_local_var->_library_owned = 1; return v1_token_review_status_local_var; } +__attribute__((deprecated)) v1_token_review_status_t *v1_token_review_status_create( + list_t *audiences, + int authenticated, + char *error, + v1_user_info_t *user + ) { + return v1_token_review_status_create_internal ( + audiences, + authenticated, + error, + user + ); +} void v1_token_review_status_free(v1_token_review_status_t *v1_token_review_status) { if(NULL == v1_token_review_status){ return ; } + if(v1_token_review_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_token_review_status_free"); + return ; + } listEntry_t *listEntry; if (v1_token_review_status->audiences) { list_ForEach(listEntry, v1_token_review_status->audiences) { @@ -59,7 +77,7 @@ cJSON *v1_token_review_status_convertToJSON(v1_token_review_status_t *v1_token_r listEntry_t *audiencesListEntry; list_ForEach(audiencesListEntry, v1_token_review_status->audiences) { - if(cJSON_AddStringToObject(audiences, "", (char*)audiencesListEntry->data) == NULL) + if(cJSON_AddStringToObject(audiences, "", audiencesListEntry->data) == NULL) { goto fail; } @@ -115,6 +133,9 @@ v1_token_review_status_t *v1_token_review_status_parseFromJSON(cJSON *v1_token_r // v1_token_review_status->audiences cJSON *audiences = cJSON_GetObjectItemCaseSensitive(v1_token_review_statusJSON, "audiences"); + if (cJSON_IsNull(audiences)) { + audiences = NULL; + } if (audiences) { cJSON *audiences_local = NULL; if(!cJSON_IsArray(audiences)) { @@ -134,6 +155,9 @@ v1_token_review_status_t *v1_token_review_status_parseFromJSON(cJSON *v1_token_r // v1_token_review_status->authenticated cJSON *authenticated = cJSON_GetObjectItemCaseSensitive(v1_token_review_statusJSON, "authenticated"); + if (cJSON_IsNull(authenticated)) { + authenticated = NULL; + } if (authenticated) { if(!cJSON_IsBool(authenticated)) { @@ -143,6 +167,9 @@ v1_token_review_status_t *v1_token_review_status_parseFromJSON(cJSON *v1_token_r // v1_token_review_status->error cJSON *error = cJSON_GetObjectItemCaseSensitive(v1_token_review_statusJSON, "error"); + if (cJSON_IsNull(error)) { + error = NULL; + } if (error) { if(!cJSON_IsString(error) && !cJSON_IsNull(error)) { @@ -152,12 +179,15 @@ v1_token_review_status_t *v1_token_review_status_parseFromJSON(cJSON *v1_token_r // v1_token_review_status->user cJSON *user = cJSON_GetObjectItemCaseSensitive(v1_token_review_statusJSON, "user"); + if (cJSON_IsNull(user)) { + user = NULL; + } if (user) { user_local_nonprim = v1_user_info_parseFromJSON(user); //nonprimitive } - v1_token_review_status_local_var = v1_token_review_status_create ( + v1_token_review_status_local_var = v1_token_review_status_create_internal ( audiences ? audiencesList : NULL, authenticated ? authenticated->valueint : 0, error && !cJSON_IsNull(error) ? strdup(error->valuestring) : NULL, diff --git a/kubernetes/model/v1_token_review_status.h b/kubernetes/model/v1_token_review_status.h index fb64b2f3..7ec26eb7 100644 --- a/kubernetes/model/v1_token_review_status.h +++ b/kubernetes/model/v1_token_review_status.h @@ -25,9 +25,10 @@ typedef struct v1_token_review_status_t { char *error; // string struct v1_user_info_t *user; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_token_review_status_t; -v1_token_review_status_t *v1_token_review_status_create( +__attribute__((deprecated)) v1_token_review_status_t *v1_token_review_status_create( list_t *audiences, int authenticated, char *error, diff --git a/kubernetes/model/v1_toleration.c b/kubernetes/model/v1_toleration.c index a5c89c3d..93819ec8 100644 --- a/kubernetes/model/v1_toleration.c +++ b/kubernetes/model/v1_toleration.c @@ -5,7 +5,7 @@ -v1_toleration_t *v1_toleration_create( +static v1_toleration_t *v1_toleration_create_internal( char *effect, char *key, char *_operator, @@ -22,14 +22,34 @@ v1_toleration_t *v1_toleration_create( v1_toleration_local_var->toleration_seconds = toleration_seconds; v1_toleration_local_var->value = value; + v1_toleration_local_var->_library_owned = 1; return v1_toleration_local_var; } +__attribute__((deprecated)) v1_toleration_t *v1_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + return v1_toleration_create_internal ( + effect, + key, + _operator, + toleration_seconds, + value + ); +} void v1_toleration_free(v1_toleration_t *v1_toleration) { if(NULL == v1_toleration){ return ; } + if(v1_toleration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_toleration_free"); + return ; + } listEntry_t *listEntry; if (v1_toleration->effect) { free(v1_toleration->effect); @@ -106,6 +126,9 @@ v1_toleration_t *v1_toleration_parseFromJSON(cJSON *v1_tolerationJSON){ // v1_toleration->effect cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1_tolerationJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } if (effect) { if(!cJSON_IsString(effect) && !cJSON_IsNull(effect)) { @@ -115,6 +138,9 @@ v1_toleration_t *v1_toleration_parseFromJSON(cJSON *v1_tolerationJSON){ // v1_toleration->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_tolerationJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (key) { if(!cJSON_IsString(key) && !cJSON_IsNull(key)) { @@ -124,6 +150,9 @@ v1_toleration_t *v1_toleration_parseFromJSON(cJSON *v1_tolerationJSON){ // v1_toleration->_operator cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_tolerationJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } if (_operator) { if(!cJSON_IsString(_operator) && !cJSON_IsNull(_operator)) { @@ -133,6 +162,9 @@ v1_toleration_t *v1_toleration_parseFromJSON(cJSON *v1_tolerationJSON){ // v1_toleration->toleration_seconds cJSON *toleration_seconds = cJSON_GetObjectItemCaseSensitive(v1_tolerationJSON, "tolerationSeconds"); + if (cJSON_IsNull(toleration_seconds)) { + toleration_seconds = NULL; + } if (toleration_seconds) { if(!cJSON_IsNumber(toleration_seconds)) { @@ -142,6 +174,9 @@ v1_toleration_t *v1_toleration_parseFromJSON(cJSON *v1_tolerationJSON){ // v1_toleration->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v1_tolerationJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (value) { if(!cJSON_IsString(value) && !cJSON_IsNull(value)) { @@ -150,7 +185,7 @@ v1_toleration_t *v1_toleration_parseFromJSON(cJSON *v1_tolerationJSON){ } - v1_toleration_local_var = v1_toleration_create ( + v1_toleration_local_var = v1_toleration_create_internal ( effect && !cJSON_IsNull(effect) ? strdup(effect->valuestring) : NULL, key && !cJSON_IsNull(key) ? strdup(key->valuestring) : NULL, _operator && !cJSON_IsNull(_operator) ? strdup(_operator->valuestring) : NULL, diff --git a/kubernetes/model/v1_toleration.h b/kubernetes/model/v1_toleration.h index 63ad8a04..06bd4403 100644 --- a/kubernetes/model/v1_toleration.h +++ b/kubernetes/model/v1_toleration.h @@ -25,9 +25,10 @@ typedef struct v1_toleration_t { long toleration_seconds; //numeric char *value; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_toleration_t; -v1_toleration_t *v1_toleration_create( +__attribute__((deprecated)) v1_toleration_t *v1_toleration_create( char *effect, char *key, char *_operator, diff --git a/kubernetes/model/v1_topology_selector_label_requirement.c b/kubernetes/model/v1_topology_selector_label_requirement.c index cbe88106..842054b9 100644 --- a/kubernetes/model/v1_topology_selector_label_requirement.c +++ b/kubernetes/model/v1_topology_selector_label_requirement.c @@ -5,7 +5,7 @@ -v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement_create( +static v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement_create_internal( char *key, list_t *values ) { @@ -16,14 +16,28 @@ v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement v1_topology_selector_label_requirement_local_var->key = key; v1_topology_selector_label_requirement_local_var->values = values; + v1_topology_selector_label_requirement_local_var->_library_owned = 1; return v1_topology_selector_label_requirement_local_var; } +__attribute__((deprecated)) v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement_create( + char *key, + list_t *values + ) { + return v1_topology_selector_label_requirement_create_internal ( + key, + values + ); +} void v1_topology_selector_label_requirement_free(v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement) { if(NULL == v1_topology_selector_label_requirement){ return ; } + if(v1_topology_selector_label_requirement->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_topology_selector_label_requirement_free"); + return ; + } listEntry_t *listEntry; if (v1_topology_selector_label_requirement->key) { free(v1_topology_selector_label_requirement->key); @@ -62,7 +76,7 @@ cJSON *v1_topology_selector_label_requirement_convertToJSON(v1_topology_selector listEntry_t *valuesListEntry; list_ForEach(valuesListEntry, v1_topology_selector_label_requirement->values) { - if(cJSON_AddStringToObject(values, "", (char*)valuesListEntry->data) == NULL) + if(cJSON_AddStringToObject(values, "", valuesListEntry->data) == NULL) { goto fail; } @@ -85,6 +99,9 @@ v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement // v1_topology_selector_label_requirement->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_topology_selector_label_requirementJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } if (!key) { goto end; } @@ -97,6 +114,9 @@ v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement // v1_topology_selector_label_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_topology_selector_label_requirementJSON, "values"); + if (cJSON_IsNull(values)) { + values = NULL; + } if (!values) { goto end; } @@ -118,7 +138,7 @@ v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement } - v1_topology_selector_label_requirement_local_var = v1_topology_selector_label_requirement_create ( + v1_topology_selector_label_requirement_local_var = v1_topology_selector_label_requirement_create_internal ( strdup(key->valuestring), valuesList ); diff --git a/kubernetes/model/v1_topology_selector_label_requirement.h b/kubernetes/model/v1_topology_selector_label_requirement.h index 39c1944e..1a8f964d 100644 --- a/kubernetes/model/v1_topology_selector_label_requirement.h +++ b/kubernetes/model/v1_topology_selector_label_requirement.h @@ -22,9 +22,10 @@ typedef struct v1_topology_selector_label_requirement_t { char *key; // string list_t *values; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_topology_selector_label_requirement_t; -v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement_create( +__attribute__((deprecated)) v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement_create( char *key, list_t *values ); diff --git a/kubernetes/model/v1_topology_selector_term.c b/kubernetes/model/v1_topology_selector_term.c index f2243e3b..b648be89 100644 --- a/kubernetes/model/v1_topology_selector_term.c +++ b/kubernetes/model/v1_topology_selector_term.c @@ -5,7 +5,7 @@ -v1_topology_selector_term_t *v1_topology_selector_term_create( +static v1_topology_selector_term_t *v1_topology_selector_term_create_internal( list_t *match_label_expressions ) { v1_topology_selector_term_t *v1_topology_selector_term_local_var = malloc(sizeof(v1_topology_selector_term_t)); @@ -14,14 +14,26 @@ v1_topology_selector_term_t *v1_topology_selector_term_create( } v1_topology_selector_term_local_var->match_label_expressions = match_label_expressions; + v1_topology_selector_term_local_var->_library_owned = 1; return v1_topology_selector_term_local_var; } +__attribute__((deprecated)) v1_topology_selector_term_t *v1_topology_selector_term_create( + list_t *match_label_expressions + ) { + return v1_topology_selector_term_create_internal ( + match_label_expressions + ); +} void v1_topology_selector_term_free(v1_topology_selector_term_t *v1_topology_selector_term) { if(NULL == v1_topology_selector_term){ return ; } + if(v1_topology_selector_term->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_topology_selector_term_free"); + return ; + } listEntry_t *listEntry; if (v1_topology_selector_term->match_label_expressions) { list_ForEach(listEntry, v1_topology_selector_term->match_label_expressions) { @@ -72,6 +84,9 @@ v1_topology_selector_term_t *v1_topology_selector_term_parseFromJSON(cJSON *v1_t // v1_topology_selector_term->match_label_expressions cJSON *match_label_expressions = cJSON_GetObjectItemCaseSensitive(v1_topology_selector_termJSON, "matchLabelExpressions"); + if (cJSON_IsNull(match_label_expressions)) { + match_label_expressions = NULL; + } if (match_label_expressions) { cJSON *match_label_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_label_expressions)){ @@ -92,7 +107,7 @@ v1_topology_selector_term_t *v1_topology_selector_term_parseFromJSON(cJSON *v1_t } - v1_topology_selector_term_local_var = v1_topology_selector_term_create ( + v1_topology_selector_term_local_var = v1_topology_selector_term_create_internal ( match_label_expressions ? match_label_expressionsList : NULL ); diff --git a/kubernetes/model/v1_topology_selector_term.h b/kubernetes/model/v1_topology_selector_term.h index 3a778d45..b607286a 100644 --- a/kubernetes/model/v1_topology_selector_term.h +++ b/kubernetes/model/v1_topology_selector_term.h @@ -22,9 +22,10 @@ typedef struct v1_topology_selector_term_t v1_topology_selector_term_t; typedef struct v1_topology_selector_term_t { list_t *match_label_expressions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_topology_selector_term_t; -v1_topology_selector_term_t *v1_topology_selector_term_create( +__attribute__((deprecated)) v1_topology_selector_term_t *v1_topology_selector_term_create( list_t *match_label_expressions ); diff --git a/kubernetes/model/v1_topology_spread_constraint.c b/kubernetes/model/v1_topology_spread_constraint.c index 7721b335..36a3886d 100644 --- a/kubernetes/model/v1_topology_spread_constraint.c +++ b/kubernetes/model/v1_topology_spread_constraint.c @@ -5,7 +5,7 @@ -v1_topology_spread_constraint_t *v1_topology_spread_constraint_create( +static v1_topology_spread_constraint_t *v1_topology_spread_constraint_create_internal( v1_label_selector_t *label_selector, list_t *match_label_keys, int max_skew, @@ -28,14 +28,40 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_create( v1_topology_spread_constraint_local_var->topology_key = topology_key; v1_topology_spread_constraint_local_var->when_unsatisfiable = when_unsatisfiable; + v1_topology_spread_constraint_local_var->_library_owned = 1; return v1_topology_spread_constraint_local_var; } +__attribute__((deprecated)) v1_topology_spread_constraint_t *v1_topology_spread_constraint_create( + v1_label_selector_t *label_selector, + list_t *match_label_keys, + int max_skew, + int min_domains, + char *node_affinity_policy, + char *node_taints_policy, + char *topology_key, + char *when_unsatisfiable + ) { + return v1_topology_spread_constraint_create_internal ( + label_selector, + match_label_keys, + max_skew, + min_domains, + node_affinity_policy, + node_taints_policy, + topology_key, + when_unsatisfiable + ); +} void v1_topology_spread_constraint_free(v1_topology_spread_constraint_t *v1_topology_spread_constraint) { if(NULL == v1_topology_spread_constraint){ return ; } + if(v1_topology_spread_constraint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_topology_spread_constraint_free"); + return ; + } listEntry_t *listEntry; if (v1_topology_spread_constraint->label_selector) { v1_label_selector_free(v1_topology_spread_constraint->label_selector); @@ -92,7 +118,7 @@ cJSON *v1_topology_spread_constraint_convertToJSON(v1_topology_spread_constraint listEntry_t *match_label_keysListEntry; list_ForEach(match_label_keysListEntry, v1_topology_spread_constraint->match_label_keys) { - if(cJSON_AddStringToObject(match_label_keys, "", (char*)match_label_keysListEntry->data) == NULL) + if(cJSON_AddStringToObject(match_label_keys, "", match_label_keysListEntry->data) == NULL) { goto fail; } @@ -170,12 +196,18 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS // v1_topology_spread_constraint->label_selector cJSON *label_selector = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "labelSelector"); + if (cJSON_IsNull(label_selector)) { + label_selector = NULL; + } if (label_selector) { label_selector_local_nonprim = v1_label_selector_parseFromJSON(label_selector); //nonprimitive } // v1_topology_spread_constraint->match_label_keys cJSON *match_label_keys = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "matchLabelKeys"); + if (cJSON_IsNull(match_label_keys)) { + match_label_keys = NULL; + } if (match_label_keys) { cJSON *match_label_keys_local = NULL; if(!cJSON_IsArray(match_label_keys)) { @@ -195,6 +227,9 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS // v1_topology_spread_constraint->max_skew cJSON *max_skew = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "maxSkew"); + if (cJSON_IsNull(max_skew)) { + max_skew = NULL; + } if (!max_skew) { goto end; } @@ -207,6 +242,9 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS // v1_topology_spread_constraint->min_domains cJSON *min_domains = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "minDomains"); + if (cJSON_IsNull(min_domains)) { + min_domains = NULL; + } if (min_domains) { if(!cJSON_IsNumber(min_domains)) { @@ -216,6 +254,9 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS // v1_topology_spread_constraint->node_affinity_policy cJSON *node_affinity_policy = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "nodeAffinityPolicy"); + if (cJSON_IsNull(node_affinity_policy)) { + node_affinity_policy = NULL; + } if (node_affinity_policy) { if(!cJSON_IsString(node_affinity_policy) && !cJSON_IsNull(node_affinity_policy)) { @@ -225,6 +266,9 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS // v1_topology_spread_constraint->node_taints_policy cJSON *node_taints_policy = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "nodeTaintsPolicy"); + if (cJSON_IsNull(node_taints_policy)) { + node_taints_policy = NULL; + } if (node_taints_policy) { if(!cJSON_IsString(node_taints_policy) && !cJSON_IsNull(node_taints_policy)) { @@ -234,6 +278,9 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS // v1_topology_spread_constraint->topology_key cJSON *topology_key = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "topologyKey"); + if (cJSON_IsNull(topology_key)) { + topology_key = NULL; + } if (!topology_key) { goto end; } @@ -246,6 +293,9 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS // v1_topology_spread_constraint->when_unsatisfiable cJSON *when_unsatisfiable = cJSON_GetObjectItemCaseSensitive(v1_topology_spread_constraintJSON, "whenUnsatisfiable"); + if (cJSON_IsNull(when_unsatisfiable)) { + when_unsatisfiable = NULL; + } if (!when_unsatisfiable) { goto end; } @@ -257,7 +307,7 @@ v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJS } - v1_topology_spread_constraint_local_var = v1_topology_spread_constraint_create ( + v1_topology_spread_constraint_local_var = v1_topology_spread_constraint_create_internal ( label_selector ? label_selector_local_nonprim : NULL, match_label_keys ? match_label_keysList : NULL, max_skew->valuedouble, diff --git a/kubernetes/model/v1_topology_spread_constraint.h b/kubernetes/model/v1_topology_spread_constraint.h index 14c51884..dcddaf21 100644 --- a/kubernetes/model/v1_topology_spread_constraint.h +++ b/kubernetes/model/v1_topology_spread_constraint.h @@ -29,9 +29,10 @@ typedef struct v1_topology_spread_constraint_t { char *topology_key; // string char *when_unsatisfiable; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_topology_spread_constraint_t; -v1_topology_spread_constraint_t *v1_topology_spread_constraint_create( +__attribute__((deprecated)) v1_topology_spread_constraint_t *v1_topology_spread_constraint_create( v1_label_selector_t *label_selector, list_t *match_label_keys, int max_skew, diff --git a/kubernetes/model/v1_type_checking.c b/kubernetes/model/v1_type_checking.c index 204665f4..8e4fced6 100644 --- a/kubernetes/model/v1_type_checking.c +++ b/kubernetes/model/v1_type_checking.c @@ -5,7 +5,7 @@ -v1_type_checking_t *v1_type_checking_create( +static v1_type_checking_t *v1_type_checking_create_internal( list_t *expression_warnings ) { v1_type_checking_t *v1_type_checking_local_var = malloc(sizeof(v1_type_checking_t)); @@ -14,14 +14,26 @@ v1_type_checking_t *v1_type_checking_create( } v1_type_checking_local_var->expression_warnings = expression_warnings; + v1_type_checking_local_var->_library_owned = 1; return v1_type_checking_local_var; } +__attribute__((deprecated)) v1_type_checking_t *v1_type_checking_create( + list_t *expression_warnings + ) { + return v1_type_checking_create_internal ( + expression_warnings + ); +} void v1_type_checking_free(v1_type_checking_t *v1_type_checking) { if(NULL == v1_type_checking){ return ; } + if(v1_type_checking->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_type_checking_free"); + return ; + } listEntry_t *listEntry; if (v1_type_checking->expression_warnings) { list_ForEach(listEntry, v1_type_checking->expression_warnings) { @@ -72,6 +84,9 @@ v1_type_checking_t *v1_type_checking_parseFromJSON(cJSON *v1_type_checkingJSON){ // v1_type_checking->expression_warnings cJSON *expression_warnings = cJSON_GetObjectItemCaseSensitive(v1_type_checkingJSON, "expressionWarnings"); + if (cJSON_IsNull(expression_warnings)) { + expression_warnings = NULL; + } if (expression_warnings) { cJSON *expression_warnings_local_nonprimitive = NULL; if(!cJSON_IsArray(expression_warnings)){ @@ -92,7 +107,7 @@ v1_type_checking_t *v1_type_checking_parseFromJSON(cJSON *v1_type_checkingJSON){ } - v1_type_checking_local_var = v1_type_checking_create ( + v1_type_checking_local_var = v1_type_checking_create_internal ( expression_warnings ? expression_warningsList : NULL ); diff --git a/kubernetes/model/v1_type_checking.h b/kubernetes/model/v1_type_checking.h index 13a5974e..c92b0c20 100644 --- a/kubernetes/model/v1_type_checking.h +++ b/kubernetes/model/v1_type_checking.h @@ -22,9 +22,10 @@ typedef struct v1_type_checking_t v1_type_checking_t; typedef struct v1_type_checking_t { list_t *expression_warnings; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_type_checking_t; -v1_type_checking_t *v1_type_checking_create( +__attribute__((deprecated)) v1_type_checking_t *v1_type_checking_create( list_t *expression_warnings ); diff --git a/kubernetes/model/v1_typed_local_object_reference.c b/kubernetes/model/v1_typed_local_object_reference.c index 02e899e6..91dd7572 100644 --- a/kubernetes/model/v1_typed_local_object_reference.c +++ b/kubernetes/model/v1_typed_local_object_reference.c @@ -5,7 +5,7 @@ -v1_typed_local_object_reference_t *v1_typed_local_object_reference_create( +static v1_typed_local_object_reference_t *v1_typed_local_object_reference_create_internal( char *api_group, char *kind, char *name @@ -18,14 +18,30 @@ v1_typed_local_object_reference_t *v1_typed_local_object_reference_create( v1_typed_local_object_reference_local_var->kind = kind; v1_typed_local_object_reference_local_var->name = name; + v1_typed_local_object_reference_local_var->_library_owned = 1; return v1_typed_local_object_reference_local_var; } +__attribute__((deprecated)) v1_typed_local_object_reference_t *v1_typed_local_object_reference_create( + char *api_group, + char *kind, + char *name + ) { + return v1_typed_local_object_reference_create_internal ( + api_group, + kind, + name + ); +} void v1_typed_local_object_reference_free(v1_typed_local_object_reference_t *v1_typed_local_object_reference) { if(NULL == v1_typed_local_object_reference){ return ; } + if(v1_typed_local_object_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_typed_local_object_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_typed_local_object_reference->api_group) { free(v1_typed_local_object_reference->api_group); @@ -84,6 +100,9 @@ v1_typed_local_object_reference_t *v1_typed_local_object_reference_parseFromJSON // v1_typed_local_object_reference->api_group cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1_typed_local_object_referenceJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } if (api_group) { if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) { @@ -93,6 +112,9 @@ v1_typed_local_object_reference_t *v1_typed_local_object_reference_parseFromJSON // v1_typed_local_object_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_typed_local_object_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -105,6 +127,9 @@ v1_typed_local_object_reference_t *v1_typed_local_object_reference_parseFromJSON // v1_typed_local_object_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_typed_local_object_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -116,7 +141,7 @@ v1_typed_local_object_reference_t *v1_typed_local_object_reference_parseFromJSON } - v1_typed_local_object_reference_local_var = v1_typed_local_object_reference_create ( + v1_typed_local_object_reference_local_var = v1_typed_local_object_reference_create_internal ( api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, strdup(kind->valuestring), strdup(name->valuestring) diff --git a/kubernetes/model/v1_typed_local_object_reference.h b/kubernetes/model/v1_typed_local_object_reference.h index 711a794a..fd904a8c 100644 --- a/kubernetes/model/v1_typed_local_object_reference.h +++ b/kubernetes/model/v1_typed_local_object_reference.h @@ -23,9 +23,10 @@ typedef struct v1_typed_local_object_reference_t { char *kind; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_typed_local_object_reference_t; -v1_typed_local_object_reference_t *v1_typed_local_object_reference_create( +__attribute__((deprecated)) v1_typed_local_object_reference_t *v1_typed_local_object_reference_create( char *api_group, char *kind, char *name diff --git a/kubernetes/model/v1_typed_object_reference.c b/kubernetes/model/v1_typed_object_reference.c index ec98bdb1..ec07caf5 100644 --- a/kubernetes/model/v1_typed_object_reference.c +++ b/kubernetes/model/v1_typed_object_reference.c @@ -5,7 +5,7 @@ -v1_typed_object_reference_t *v1_typed_object_reference_create( +static v1_typed_object_reference_t *v1_typed_object_reference_create_internal( char *api_group, char *kind, char *name, @@ -20,14 +20,32 @@ v1_typed_object_reference_t *v1_typed_object_reference_create( v1_typed_object_reference_local_var->name = name; v1_typed_object_reference_local_var->_namespace = _namespace; + v1_typed_object_reference_local_var->_library_owned = 1; return v1_typed_object_reference_local_var; } +__attribute__((deprecated)) v1_typed_object_reference_t *v1_typed_object_reference_create( + char *api_group, + char *kind, + char *name, + char *_namespace + ) { + return v1_typed_object_reference_create_internal ( + api_group, + kind, + name, + _namespace + ); +} void v1_typed_object_reference_free(v1_typed_object_reference_t *v1_typed_object_reference) { if(NULL == v1_typed_object_reference){ return ; } + if(v1_typed_object_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_typed_object_reference_free"); + return ; + } listEntry_t *listEntry; if (v1_typed_object_reference->api_group) { free(v1_typed_object_reference->api_group); @@ -98,6 +116,9 @@ v1_typed_object_reference_t *v1_typed_object_reference_parseFromJSON(cJSON *v1_t // v1_typed_object_reference->api_group cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1_typed_object_referenceJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } if (api_group) { if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) { @@ -107,6 +128,9 @@ v1_typed_object_reference_t *v1_typed_object_reference_parseFromJSON(cJSON *v1_t // v1_typed_object_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_typed_object_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -119,6 +143,9 @@ v1_typed_object_reference_t *v1_typed_object_reference_parseFromJSON(cJSON *v1_t // v1_typed_object_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_typed_object_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -131,6 +158,9 @@ v1_typed_object_reference_t *v1_typed_object_reference_parseFromJSON(cJSON *v1_t // v1_typed_object_reference->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1_typed_object_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -139,7 +169,7 @@ v1_typed_object_reference_t *v1_typed_object_reference_parseFromJSON(cJSON *v1_t } - v1_typed_object_reference_local_var = v1_typed_object_reference_create ( + v1_typed_object_reference_local_var = v1_typed_object_reference_create_internal ( api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, strdup(kind->valuestring), strdup(name->valuestring), diff --git a/kubernetes/model/v1_typed_object_reference.h b/kubernetes/model/v1_typed_object_reference.h index 0536d07b..b8c5a145 100644 --- a/kubernetes/model/v1_typed_object_reference.h +++ b/kubernetes/model/v1_typed_object_reference.h @@ -1,7 +1,7 @@ /* * v1_typed_object_reference.h * - * + * TypedObjectReference contains enough information to let you locate the typed referenced object */ #ifndef _v1_typed_object_reference_H_ @@ -24,9 +24,10 @@ typedef struct v1_typed_object_reference_t { char *name; // string char *_namespace; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_typed_object_reference_t; -v1_typed_object_reference_t *v1_typed_object_reference_create( +__attribute__((deprecated)) v1_typed_object_reference_t *v1_typed_object_reference_create( char *api_group, char *kind, char *name, diff --git a/kubernetes/model/v1_uncounted_terminated_pods.c b/kubernetes/model/v1_uncounted_terminated_pods.c index fbe0dc5a..fed16810 100644 --- a/kubernetes/model/v1_uncounted_terminated_pods.c +++ b/kubernetes/model/v1_uncounted_terminated_pods.c @@ -5,7 +5,7 @@ -v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_create( +static v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_create_internal( list_t *failed, list_t *succeeded ) { @@ -16,14 +16,28 @@ v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_create( v1_uncounted_terminated_pods_local_var->failed = failed; v1_uncounted_terminated_pods_local_var->succeeded = succeeded; + v1_uncounted_terminated_pods_local_var->_library_owned = 1; return v1_uncounted_terminated_pods_local_var; } +__attribute__((deprecated)) v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_create( + list_t *failed, + list_t *succeeded + ) { + return v1_uncounted_terminated_pods_create_internal ( + failed, + succeeded + ); +} void v1_uncounted_terminated_pods_free(v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods) { if(NULL == v1_uncounted_terminated_pods){ return ; } + if(v1_uncounted_terminated_pods->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_uncounted_terminated_pods_free"); + return ; + } listEntry_t *listEntry; if (v1_uncounted_terminated_pods->failed) { list_ForEach(listEntry, v1_uncounted_terminated_pods->failed) { @@ -54,7 +68,7 @@ cJSON *v1_uncounted_terminated_pods_convertToJSON(v1_uncounted_terminated_pods_t listEntry_t *failedListEntry; list_ForEach(failedListEntry, v1_uncounted_terminated_pods->failed) { - if(cJSON_AddStringToObject(failed, "", (char*)failedListEntry->data) == NULL) + if(cJSON_AddStringToObject(failed, "", failedListEntry->data) == NULL) { goto fail; } @@ -71,7 +85,7 @@ cJSON *v1_uncounted_terminated_pods_convertToJSON(v1_uncounted_terminated_pods_t listEntry_t *succeededListEntry; list_ForEach(succeededListEntry, v1_uncounted_terminated_pods->succeeded) { - if(cJSON_AddStringToObject(succeeded, "", (char*)succeededListEntry->data) == NULL) + if(cJSON_AddStringToObject(succeeded, "", succeededListEntry->data) == NULL) { goto fail; } @@ -98,6 +112,9 @@ v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_parseFromJSON(cJSON // v1_uncounted_terminated_pods->failed cJSON *failed = cJSON_GetObjectItemCaseSensitive(v1_uncounted_terminated_podsJSON, "failed"); + if (cJSON_IsNull(failed)) { + failed = NULL; + } if (failed) { cJSON *failed_local = NULL; if(!cJSON_IsArray(failed)) { @@ -117,6 +134,9 @@ v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_parseFromJSON(cJSON // v1_uncounted_terminated_pods->succeeded cJSON *succeeded = cJSON_GetObjectItemCaseSensitive(v1_uncounted_terminated_podsJSON, "succeeded"); + if (cJSON_IsNull(succeeded)) { + succeeded = NULL; + } if (succeeded) { cJSON *succeeded_local = NULL; if(!cJSON_IsArray(succeeded)) { @@ -135,7 +155,7 @@ v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_parseFromJSON(cJSON } - v1_uncounted_terminated_pods_local_var = v1_uncounted_terminated_pods_create ( + v1_uncounted_terminated_pods_local_var = v1_uncounted_terminated_pods_create_internal ( failed ? failedList : NULL, succeeded ? succeededList : NULL ); diff --git a/kubernetes/model/v1_uncounted_terminated_pods.h b/kubernetes/model/v1_uncounted_terminated_pods.h index 6f6ffb88..5c153046 100644 --- a/kubernetes/model/v1_uncounted_terminated_pods.h +++ b/kubernetes/model/v1_uncounted_terminated_pods.h @@ -22,9 +22,10 @@ typedef struct v1_uncounted_terminated_pods_t { list_t *failed; //primitive container list_t *succeeded; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_uncounted_terminated_pods_t; -v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_create( +__attribute__((deprecated)) v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_create( list_t *failed, list_t *succeeded ); diff --git a/kubernetes/model/v1_user_info.c b/kubernetes/model/v1_user_info.c index 180adf10..6f131ce4 100644 --- a/kubernetes/model/v1_user_info.c +++ b/kubernetes/model/v1_user_info.c @@ -5,7 +5,7 @@ -v1_user_info_t *v1_user_info_create( +static v1_user_info_t *v1_user_info_create_internal( list_t* extra, list_t *groups, char *uid, @@ -20,18 +20,36 @@ v1_user_info_t *v1_user_info_create( v1_user_info_local_var->uid = uid; v1_user_info_local_var->username = username; + v1_user_info_local_var->_library_owned = 1; return v1_user_info_local_var; } +__attribute__((deprecated)) v1_user_info_t *v1_user_info_create( + list_t* extra, + list_t *groups, + char *uid, + char *username + ) { + return v1_user_info_create_internal ( + extra, + groups, + uid, + username + ); +} void v1_user_info_free(v1_user_info_t *v1_user_info) { if(NULL == v1_user_info){ return ; } + if(v1_user_info->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_user_info_free"); + return ; + } listEntry_t *listEntry; if (v1_user_info->extra) { list_ForEach(listEntry, v1_user_info->extra) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -70,7 +88,7 @@ cJSON *v1_user_info_convertToJSON(v1_user_info_t *v1_user_info) { listEntry_t *extraListEntry; if (v1_user_info->extra) { list_ForEach(extraListEntry, v1_user_info->extra) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)extraListEntry->data; + keyValuePair_t *localKeyValue = extraListEntry->data; } } } @@ -85,7 +103,7 @@ cJSON *v1_user_info_convertToJSON(v1_user_info_t *v1_user_info) { listEntry_t *groupsListEntry; list_ForEach(groupsListEntry, v1_user_info->groups) { - if(cJSON_AddStringToObject(groups, "", (char*)groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(groups, "", groupsListEntry->data) == NULL) { goto fail; } @@ -128,6 +146,9 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ // v1_user_info->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_user_infoJSON, "extra"); + if (cJSON_IsNull(extra)) { + extra = NULL; + } if (extra) { cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) @@ -148,6 +169,9 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ // v1_user_info->groups cJSON *groups = cJSON_GetObjectItemCaseSensitive(v1_user_infoJSON, "groups"); + if (cJSON_IsNull(groups)) { + groups = NULL; + } if (groups) { cJSON *groups_local = NULL; if(!cJSON_IsArray(groups)) { @@ -167,6 +191,9 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ // v1_user_info->uid cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1_user_infoJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } if (uid) { if(!cJSON_IsString(uid) && !cJSON_IsNull(uid)) { @@ -176,6 +203,9 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ // v1_user_info->username cJSON *username = cJSON_GetObjectItemCaseSensitive(v1_user_infoJSON, "username"); + if (cJSON_IsNull(username)) { + username = NULL; + } if (username) { if(!cJSON_IsString(username) && !cJSON_IsNull(username)) { @@ -184,7 +214,7 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ } - v1_user_info_local_var = v1_user_info_create ( + v1_user_info_local_var = v1_user_info_create_internal ( extra ? extraList : NULL, groups ? groupsList : NULL, uid && !cJSON_IsNull(uid) ? strdup(uid->valuestring) : NULL, @@ -196,7 +226,7 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ if (extraList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, extraList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; keyValuePair_free(localKeyValue); diff --git a/kubernetes/model/v1_user_info.h b/kubernetes/model/v1_user_info.h index 80af0152..4479afa7 100644 --- a/kubernetes/model/v1_user_info.h +++ b/kubernetes/model/v1_user_info.h @@ -24,9 +24,10 @@ typedef struct v1_user_info_t { char *uid; // string char *username; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_user_info_t; -v1_user_info_t *v1_user_info_create( +__attribute__((deprecated)) v1_user_info_t *v1_user_info_create( list_t* extra, list_t *groups, char *uid, diff --git a/kubernetes/model/v1_user_subject.c b/kubernetes/model/v1_user_subject.c index ccb793a8..7b75f7c3 100644 --- a/kubernetes/model/v1_user_subject.c +++ b/kubernetes/model/v1_user_subject.c @@ -5,7 +5,7 @@ -v1_user_subject_t *v1_user_subject_create( +static v1_user_subject_t *v1_user_subject_create_internal( char *name ) { v1_user_subject_t *v1_user_subject_local_var = malloc(sizeof(v1_user_subject_t)); @@ -14,14 +14,26 @@ v1_user_subject_t *v1_user_subject_create( } v1_user_subject_local_var->name = name; + v1_user_subject_local_var->_library_owned = 1; return v1_user_subject_local_var; } +__attribute__((deprecated)) v1_user_subject_t *v1_user_subject_create( + char *name + ) { + return v1_user_subject_create_internal ( + name + ); +} void v1_user_subject_free(v1_user_subject_t *v1_user_subject) { if(NULL == v1_user_subject){ return ; } + if(v1_user_subject->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_user_subject_free"); + return ; + } listEntry_t *listEntry; if (v1_user_subject->name) { free(v1_user_subject->name); @@ -55,6 +67,9 @@ v1_user_subject_t *v1_user_subject_parseFromJSON(cJSON *v1_user_subjectJSON){ // v1_user_subject->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_user_subjectJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -66,7 +81,7 @@ v1_user_subject_t *v1_user_subject_parseFromJSON(cJSON *v1_user_subjectJSON){ } - v1_user_subject_local_var = v1_user_subject_create ( + v1_user_subject_local_var = v1_user_subject_create_internal ( strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_user_subject.h b/kubernetes/model/v1_user_subject.h index 918df977..563c9a7a 100644 --- a/kubernetes/model/v1_user_subject.h +++ b/kubernetes/model/v1_user_subject.h @@ -21,9 +21,10 @@ typedef struct v1_user_subject_t v1_user_subject_t; typedef struct v1_user_subject_t { char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_user_subject_t; -v1_user_subject_t *v1_user_subject_create( +__attribute__((deprecated)) v1_user_subject_t *v1_user_subject_create( char *name ); diff --git a/kubernetes/model/v1_validating_admission_policy.c b/kubernetes/model/v1_validating_admission_policy.c index d5d051e3..1daad1d4 100644 --- a/kubernetes/model/v1_validating_admission_policy.c +++ b/kubernetes/model/v1_validating_admission_policy.c @@ -5,7 +5,7 @@ -v1_validating_admission_policy_t *v1_validating_admission_policy_create( +static v1_validating_admission_policy_t *v1_validating_admission_policy_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_validating_admission_policy_t *v1_validating_admission_policy_create( v1_validating_admission_policy_local_var->spec = spec; v1_validating_admission_policy_local_var->status = status; + v1_validating_admission_policy_local_var->_library_owned = 1; return v1_validating_admission_policy_local_var; } +__attribute__((deprecated)) v1_validating_admission_policy_t *v1_validating_admission_policy_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_validating_admission_policy_spec_t *spec, + v1_validating_admission_policy_status_t *status + ) { + return v1_validating_admission_policy_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_validating_admission_policy_free(v1_validating_admission_policy_t *v1_validating_admission_policy) { if(NULL == v1_validating_admission_policy){ return ; } + if(v1_validating_admission_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_admission_policy_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_admission_policy->api_version) { free(v1_validating_admission_policy->api_version); @@ -134,6 +154,9 @@ v1_validating_admission_policy_t *v1_validating_admission_policy_parseFromJSON(c // v1_validating_admission_policy->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policyJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1_validating_admission_policy_t *v1_validating_admission_policy_parseFromJSON(c // v1_validating_admission_policy->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policyJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1_validating_admission_policy_t *v1_validating_admission_policy_parseFromJSON(c // v1_validating_admission_policy->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policyJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_validating_admission_policy->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policyJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_validating_admission_policy_spec_parseFromJSON(spec); //nonprimitive } // v1_validating_admission_policy->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policyJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_validating_admission_policy_status_parseFromJSON(status); //nonprimitive } - v1_validating_admission_policy_local_var = v1_validating_admission_policy_create ( + v1_validating_admission_policy_local_var = v1_validating_admission_policy_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_validating_admission_policy.h b/kubernetes/model/v1_validating_admission_policy.h index e9109b62..f15bb74d 100644 --- a/kubernetes/model/v1_validating_admission_policy.h +++ b/kubernetes/model/v1_validating_admission_policy.h @@ -28,9 +28,10 @@ typedef struct v1_validating_admission_policy_t { struct v1_validating_admission_policy_spec_t *spec; //model struct v1_validating_admission_policy_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_admission_policy_t; -v1_validating_admission_policy_t *v1_validating_admission_policy_create( +__attribute__((deprecated)) v1_validating_admission_policy_t *v1_validating_admission_policy_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_validating_admission_policy_binding.c b/kubernetes/model/v1_validating_admission_policy_binding.c index e73abff0..595c2e8e 100644 --- a/kubernetes/model/v1_validating_admission_policy_binding.c +++ b/kubernetes/model/v1_validating_admission_policy_binding.c @@ -5,7 +5,7 @@ -v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding_create( +static v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding v1_validating_admission_policy_binding_local_var->metadata = metadata; v1_validating_admission_policy_binding_local_var->spec = spec; + v1_validating_admission_policy_binding_local_var->_library_owned = 1; return v1_validating_admission_policy_binding_local_var; } +__attribute__((deprecated)) v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_validating_admission_policy_binding_spec_t *spec + ) { + return v1_validating_admission_policy_binding_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1_validating_admission_policy_binding_free(v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding) { if(NULL == v1_validating_admission_policy_binding){ return ; } + if(v1_validating_admission_policy_binding->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_admission_policy_binding_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_admission_policy_binding->api_version) { free(v1_validating_admission_policy_binding->api_version); @@ -112,6 +130,9 @@ v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding // v1_validating_admission_policy_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_bindingJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -121,6 +142,9 @@ v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding // v1_validating_admission_policy_binding->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_bindingJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -130,18 +154,24 @@ v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding // v1_validating_admission_policy_binding->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_bindingJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_validating_admission_policy_binding->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_bindingJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1_validating_admission_policy_binding_spec_parseFromJSON(spec); //nonprimitive } - v1_validating_admission_policy_binding_local_var = v1_validating_admission_policy_binding_create ( + v1_validating_admission_policy_binding_local_var = v1_validating_admission_policy_binding_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_validating_admission_policy_binding.h b/kubernetes/model/v1_validating_admission_policy_binding.h index 33e4f735..d7f56dec 100644 --- a/kubernetes/model/v1_validating_admission_policy_binding.h +++ b/kubernetes/model/v1_validating_admission_policy_binding.h @@ -26,9 +26,10 @@ typedef struct v1_validating_admission_policy_binding_t { struct v1_object_meta_t *metadata; //model struct v1_validating_admission_policy_binding_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_admission_policy_binding_t; -v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding_create( +__attribute__((deprecated)) v1_validating_admission_policy_binding_t *v1_validating_admission_policy_binding_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_validating_admission_policy_binding_list.c b/kubernetes/model/v1_validating_admission_policy_binding_list.c index aad285a0..07a6293b 100644 --- a/kubernetes/model/v1_validating_admission_policy_binding_list.c +++ b/kubernetes/model/v1_validating_admission_policy_binding_list.c @@ -5,7 +5,7 @@ -v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_binding_list_create( +static v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_binding_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_bi v1_validating_admission_policy_binding_list_local_var->kind = kind; v1_validating_admission_policy_binding_list_local_var->metadata = metadata; + v1_validating_admission_policy_binding_list_local_var->_library_owned = 1; return v1_validating_admission_policy_binding_list_local_var; } +__attribute__((deprecated)) v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_binding_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_validating_admission_policy_binding_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_validating_admission_policy_binding_list_free(v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_binding_list) { if(NULL == v1_validating_admission_policy_binding_list){ return ; } + if(v1_validating_admission_policy_binding_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_admission_policy_binding_list_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_admission_policy_binding_list->api_version) { free(v1_validating_admission_policy_binding_list->api_version); @@ -63,7 +81,9 @@ cJSON *v1_validating_admission_policy_binding_list_convertToJSON(v1_validating_a // v1_validating_admission_policy_binding_list->items - if(v1_validating_admission_policy_binding_list->items) { + if (!v1_validating_admission_policy_binding_list->items) { + goto fail; + } cJSON *items = cJSON_AddArrayToObject(item, "items"); if(items == NULL) { goto fail; //nonprimitive container @@ -79,7 +99,6 @@ cJSON *v1_validating_admission_policy_binding_list_convertToJSON(v1_validating_a cJSON_AddItemToArray(items, itemLocal); } } - } // v1_validating_admission_policy_binding_list->kind @@ -122,6 +141,9 @@ v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_bi // v1_validating_admission_policy_binding_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -131,7 +153,14 @@ v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_bi // v1_validating_admission_policy_binding_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_listJSON, "items"); - if (items) { + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container @@ -148,10 +177,12 @@ v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_bi list_addElement(itemsList, itemsItem); } - } // v1_validating_admission_policy_binding_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -161,14 +192,17 @@ v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_bi // v1_validating_admission_policy_binding_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_validating_admission_policy_binding_list_local_var = v1_validating_admission_policy_binding_list_create ( + v1_validating_admission_policy_binding_list_local_var = v1_validating_admission_policy_binding_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - items ? itemsList : NULL, + itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_validating_admission_policy_binding_list.h b/kubernetes/model/v1_validating_admission_policy_binding_list.h index 88bc9e55..bce6649f 100644 --- a/kubernetes/model/v1_validating_admission_policy_binding_list.h +++ b/kubernetes/model/v1_validating_admission_policy_binding_list.h @@ -26,9 +26,10 @@ typedef struct v1_validating_admission_policy_binding_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_admission_policy_binding_list_t; -v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_binding_list_create( +__attribute__((deprecated)) v1_validating_admission_policy_binding_list_t *v1_validating_admission_policy_binding_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_validating_admission_policy_binding_spec.c b/kubernetes/model/v1_validating_admission_policy_binding_spec.c index 8026a8b6..6ad183df 100644 --- a/kubernetes/model/v1_validating_admission_policy_binding_spec.c +++ b/kubernetes/model/v1_validating_admission_policy_binding_spec.c @@ -5,7 +5,7 @@ -v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_binding_spec_create( +static v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_binding_spec_create_internal( v1_match_resources_t *match_resources, v1_param_ref_t *param_ref, char *policy_name, @@ -20,14 +20,32 @@ v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_bi v1_validating_admission_policy_binding_spec_local_var->policy_name = policy_name; v1_validating_admission_policy_binding_spec_local_var->validation_actions = validation_actions; + v1_validating_admission_policy_binding_spec_local_var->_library_owned = 1; return v1_validating_admission_policy_binding_spec_local_var; } +__attribute__((deprecated)) v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_binding_spec_create( + v1_match_resources_t *match_resources, + v1_param_ref_t *param_ref, + char *policy_name, + list_t *validation_actions + ) { + return v1_validating_admission_policy_binding_spec_create_internal ( + match_resources, + param_ref, + policy_name, + validation_actions + ); +} void v1_validating_admission_policy_binding_spec_free(v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_binding_spec) { if(NULL == v1_validating_admission_policy_binding_spec){ return ; } + if(v1_validating_admission_policy_binding_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_admission_policy_binding_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_admission_policy_binding_spec->match_resources) { v1_match_resources_free(v1_validating_admission_policy_binding_spec->match_resources); @@ -97,7 +115,7 @@ cJSON *v1_validating_admission_policy_binding_spec_convertToJSON(v1_validating_a listEntry_t *validation_actionsListEntry; list_ForEach(validation_actionsListEntry, v1_validating_admission_policy_binding_spec->validation_actions) { - if(cJSON_AddStringToObject(validation_actions, "", (char*)validation_actionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(validation_actions, "", validation_actionsListEntry->data) == NULL) { goto fail; } @@ -127,18 +145,27 @@ v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_bi // v1_validating_admission_policy_binding_spec->match_resources cJSON *match_resources = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_specJSON, "matchResources"); + if (cJSON_IsNull(match_resources)) { + match_resources = NULL; + } if (match_resources) { match_resources_local_nonprim = v1_match_resources_parseFromJSON(match_resources); //nonprimitive } // v1_validating_admission_policy_binding_spec->param_ref cJSON *param_ref = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_specJSON, "paramRef"); + if (cJSON_IsNull(param_ref)) { + param_ref = NULL; + } if (param_ref) { param_ref_local_nonprim = v1_param_ref_parseFromJSON(param_ref); //nonprimitive } // v1_validating_admission_policy_binding_spec->policy_name cJSON *policy_name = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_specJSON, "policyName"); + if (cJSON_IsNull(policy_name)) { + policy_name = NULL; + } if (policy_name) { if(!cJSON_IsString(policy_name) && !cJSON_IsNull(policy_name)) { @@ -148,6 +175,9 @@ v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_bi // v1_validating_admission_policy_binding_spec->validation_actions cJSON *validation_actions = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_binding_specJSON, "validationActions"); + if (cJSON_IsNull(validation_actions)) { + validation_actions = NULL; + } if (validation_actions) { cJSON *validation_actions_local = NULL; if(!cJSON_IsArray(validation_actions)) { @@ -166,7 +196,7 @@ v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_bi } - v1_validating_admission_policy_binding_spec_local_var = v1_validating_admission_policy_binding_spec_create ( + v1_validating_admission_policy_binding_spec_local_var = v1_validating_admission_policy_binding_spec_create_internal ( match_resources ? match_resources_local_nonprim : NULL, param_ref ? param_ref_local_nonprim : NULL, policy_name && !cJSON_IsNull(policy_name) ? strdup(policy_name->valuestring) : NULL, diff --git a/kubernetes/model/v1_validating_admission_policy_binding_spec.h b/kubernetes/model/v1_validating_admission_policy_binding_spec.h index d55167b2..f08f519b 100644 --- a/kubernetes/model/v1_validating_admission_policy_binding_spec.h +++ b/kubernetes/model/v1_validating_admission_policy_binding_spec.h @@ -26,9 +26,10 @@ typedef struct v1_validating_admission_policy_binding_spec_t { char *policy_name; // string list_t *validation_actions; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_admission_policy_binding_spec_t; -v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_binding_spec_create( +__attribute__((deprecated)) v1_validating_admission_policy_binding_spec_t *v1_validating_admission_policy_binding_spec_create( v1_match_resources_t *match_resources, v1_param_ref_t *param_ref, char *policy_name, diff --git a/kubernetes/model/v1_validating_admission_policy_list.c b/kubernetes/model/v1_validating_admission_policy_list.c index 15aff929..78918673 100644 --- a/kubernetes/model/v1_validating_admission_policy_list.c +++ b/kubernetes/model/v1_validating_admission_policy_list.c @@ -5,7 +5,7 @@ -v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_create( +static v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_creat v1_validating_admission_policy_list_local_var->kind = kind; v1_validating_admission_policy_list_local_var->metadata = metadata; + v1_validating_admission_policy_list_local_var->_library_owned = 1; return v1_validating_admission_policy_list_local_var; } +__attribute__((deprecated)) v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_validating_admission_policy_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_validating_admission_policy_list_free(v1_validating_admission_policy_list_t *v1_validating_admission_policy_list) { if(NULL == v1_validating_admission_policy_list){ return ; } + if(v1_validating_admission_policy_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_admission_policy_list_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_admission_policy_list->api_version) { free(v1_validating_admission_policy_list->api_version); @@ -63,7 +81,9 @@ cJSON *v1_validating_admission_policy_list_convertToJSON(v1_validating_admission // v1_validating_admission_policy_list->items - if(v1_validating_admission_policy_list->items) { + if (!v1_validating_admission_policy_list->items) { + goto fail; + } cJSON *items = cJSON_AddArrayToObject(item, "items"); if(items == NULL) { goto fail; //nonprimitive container @@ -79,7 +99,6 @@ cJSON *v1_validating_admission_policy_list_convertToJSON(v1_validating_admission cJSON_AddItemToArray(items, itemLocal); } } - } // v1_validating_admission_policy_list->kind @@ -122,6 +141,9 @@ v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_parse // v1_validating_admission_policy_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -131,7 +153,14 @@ v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_parse // v1_validating_admission_policy_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_listJSON, "items"); - if (items) { + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container @@ -148,10 +177,12 @@ v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_parse list_addElement(itemsList, itemsItem); } - } // v1_validating_admission_policy_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -161,14 +192,17 @@ v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_parse // v1_validating_admission_policy_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_validating_admission_policy_list_local_var = v1_validating_admission_policy_list_create ( + v1_validating_admission_policy_list_local_var = v1_validating_admission_policy_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - items ? itemsList : NULL, + itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_validating_admission_policy_list.h b/kubernetes/model/v1_validating_admission_policy_list.h index 0a96aa49..68c37e9c 100644 --- a/kubernetes/model/v1_validating_admission_policy_list.h +++ b/kubernetes/model/v1_validating_admission_policy_list.h @@ -26,9 +26,10 @@ typedef struct v1_validating_admission_policy_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_admission_policy_list_t; -v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_create( +__attribute__((deprecated)) v1_validating_admission_policy_list_t *v1_validating_admission_policy_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_validating_admission_policy_spec.c b/kubernetes/model/v1_validating_admission_policy_spec.c index 21459bbb..d8c7043d 100644 --- a/kubernetes/model/v1_validating_admission_policy_spec.c +++ b/kubernetes/model/v1_validating_admission_policy_spec.c @@ -5,7 +5,7 @@ -v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_create( +static v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_create_internal( list_t *audit_annotations, char *failure_policy, list_t *match_conditions, @@ -26,14 +26,38 @@ v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_creat v1_validating_admission_policy_spec_local_var->validations = validations; v1_validating_admission_policy_spec_local_var->variables = variables; + v1_validating_admission_policy_spec_local_var->_library_owned = 1; return v1_validating_admission_policy_spec_local_var; } +__attribute__((deprecated)) v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_create( + list_t *audit_annotations, + char *failure_policy, + list_t *match_conditions, + v1_match_resources_t *match_constraints, + v1_param_kind_t *param_kind, + list_t *validations, + list_t *variables + ) { + return v1_validating_admission_policy_spec_create_internal ( + audit_annotations, + failure_policy, + match_conditions, + match_constraints, + param_kind, + validations, + variables + ); +} void v1_validating_admission_policy_spec_free(v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec) { if(NULL == v1_validating_admission_policy_spec){ return ; } + if(v1_validating_admission_policy_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_admission_policy_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_admission_policy_spec->audit_annotations) { list_ForEach(listEntry, v1_validating_admission_policy_spec->audit_annotations) { @@ -226,6 +250,9 @@ v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_parse // v1_validating_admission_policy_spec->audit_annotations cJSON *audit_annotations = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_specJSON, "auditAnnotations"); + if (cJSON_IsNull(audit_annotations)) { + audit_annotations = NULL; + } if (audit_annotations) { cJSON *audit_annotations_local_nonprimitive = NULL; if(!cJSON_IsArray(audit_annotations)){ @@ -247,6 +274,9 @@ v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_parse // v1_validating_admission_policy_spec->failure_policy cJSON *failure_policy = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_specJSON, "failurePolicy"); + if (cJSON_IsNull(failure_policy)) { + failure_policy = NULL; + } if (failure_policy) { if(!cJSON_IsString(failure_policy) && !cJSON_IsNull(failure_policy)) { @@ -256,6 +286,9 @@ v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_parse // v1_validating_admission_policy_spec->match_conditions cJSON *match_conditions = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_specJSON, "matchConditions"); + if (cJSON_IsNull(match_conditions)) { + match_conditions = NULL; + } if (match_conditions) { cJSON *match_conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_conditions)){ @@ -277,18 +310,27 @@ v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_parse // v1_validating_admission_policy_spec->match_constraints cJSON *match_constraints = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_specJSON, "matchConstraints"); + if (cJSON_IsNull(match_constraints)) { + match_constraints = NULL; + } if (match_constraints) { match_constraints_local_nonprim = v1_match_resources_parseFromJSON(match_constraints); //nonprimitive } // v1_validating_admission_policy_spec->param_kind cJSON *param_kind = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_specJSON, "paramKind"); + if (cJSON_IsNull(param_kind)) { + param_kind = NULL; + } if (param_kind) { param_kind_local_nonprim = v1_param_kind_parseFromJSON(param_kind); //nonprimitive } // v1_validating_admission_policy_spec->validations cJSON *validations = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_specJSON, "validations"); + if (cJSON_IsNull(validations)) { + validations = NULL; + } if (validations) { cJSON *validations_local_nonprimitive = NULL; if(!cJSON_IsArray(validations)){ @@ -310,6 +352,9 @@ v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_parse // v1_validating_admission_policy_spec->variables cJSON *variables = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_specJSON, "variables"); + if (cJSON_IsNull(variables)) { + variables = NULL; + } if (variables) { cJSON *variables_local_nonprimitive = NULL; if(!cJSON_IsArray(variables)){ @@ -330,7 +375,7 @@ v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_parse } - v1_validating_admission_policy_spec_local_var = v1_validating_admission_policy_spec_create ( + v1_validating_admission_policy_spec_local_var = v1_validating_admission_policy_spec_create_internal ( audit_annotations ? audit_annotationsList : NULL, failure_policy && !cJSON_IsNull(failure_policy) ? strdup(failure_policy->valuestring) : NULL, match_conditions ? match_conditionsList : NULL, diff --git a/kubernetes/model/v1_validating_admission_policy_spec.h b/kubernetes/model/v1_validating_admission_policy_spec.h index d101ac6e..b0d915d7 100644 --- a/kubernetes/model/v1_validating_admission_policy_spec.h +++ b/kubernetes/model/v1_validating_admission_policy_spec.h @@ -33,9 +33,10 @@ typedef struct v1_validating_admission_policy_spec_t { list_t *validations; //nonprimitive container list_t *variables; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_admission_policy_spec_t; -v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_create( +__attribute__((deprecated)) v1_validating_admission_policy_spec_t *v1_validating_admission_policy_spec_create( list_t *audit_annotations, char *failure_policy, list_t *match_conditions, diff --git a/kubernetes/model/v1_validating_admission_policy_status.c b/kubernetes/model/v1_validating_admission_policy_status.c index 865935af..6a6ec09d 100644 --- a/kubernetes/model/v1_validating_admission_policy_status.c +++ b/kubernetes/model/v1_validating_admission_policy_status.c @@ -5,7 +5,7 @@ -v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_create( +static v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_create_internal( list_t *conditions, long observed_generation, v1_type_checking_t *type_checking @@ -18,14 +18,30 @@ v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_c v1_validating_admission_policy_status_local_var->observed_generation = observed_generation; v1_validating_admission_policy_status_local_var->type_checking = type_checking; + v1_validating_admission_policy_status_local_var->_library_owned = 1; return v1_validating_admission_policy_status_local_var; } +__attribute__((deprecated)) v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_create( + list_t *conditions, + long observed_generation, + v1_type_checking_t *type_checking + ) { + return v1_validating_admission_policy_status_create_internal ( + conditions, + observed_generation, + type_checking + ); +} void v1_validating_admission_policy_status_free(v1_validating_admission_policy_status_t *v1_validating_admission_policy_status) { if(NULL == v1_validating_admission_policy_status){ return ; } + if(v1_validating_admission_policy_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_admission_policy_status_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_admission_policy_status->conditions) { list_ForEach(listEntry, v1_validating_admission_policy_status->conditions) { @@ -104,6 +120,9 @@ v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_p // v1_validating_admission_policy_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -125,6 +144,9 @@ v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_p // v1_validating_admission_policy_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -134,12 +156,15 @@ v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_p // v1_validating_admission_policy_status->type_checking cJSON *type_checking = cJSON_GetObjectItemCaseSensitive(v1_validating_admission_policy_statusJSON, "typeChecking"); + if (cJSON_IsNull(type_checking)) { + type_checking = NULL; + } if (type_checking) { type_checking_local_nonprim = v1_type_checking_parseFromJSON(type_checking); //nonprimitive } - v1_validating_admission_policy_status_local_var = v1_validating_admission_policy_status_create ( + v1_validating_admission_policy_status_local_var = v1_validating_admission_policy_status_create_internal ( conditions ? conditionsList : NULL, observed_generation ? observed_generation->valuedouble : 0, type_checking ? type_checking_local_nonprim : NULL diff --git a/kubernetes/model/v1_validating_admission_policy_status.h b/kubernetes/model/v1_validating_admission_policy_status.h index 558ecea3..ba458120 100644 --- a/kubernetes/model/v1_validating_admission_policy_status.h +++ b/kubernetes/model/v1_validating_admission_policy_status.h @@ -25,9 +25,10 @@ typedef struct v1_validating_admission_policy_status_t { long observed_generation; //numeric struct v1_type_checking_t *type_checking; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_admission_policy_status_t; -v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_create( +__attribute__((deprecated)) v1_validating_admission_policy_status_t *v1_validating_admission_policy_status_create( list_t *conditions, long observed_generation, v1_type_checking_t *type_checking diff --git a/kubernetes/model/v1_validating_webhook.c b/kubernetes/model/v1_validating_webhook.c index 0826b3d9..c86e0538 100644 --- a/kubernetes/model/v1_validating_webhook.c +++ b/kubernetes/model/v1_validating_webhook.c @@ -5,7 +5,7 @@ -v1_validating_webhook_t *v1_validating_webhook_create( +static v1_validating_webhook_t *v1_validating_webhook_create_internal( list_t *admission_review_versions, admissionregistration_v1_webhook_client_config_t *client_config, char *failure_policy, @@ -34,14 +34,46 @@ v1_validating_webhook_t *v1_validating_webhook_create( v1_validating_webhook_local_var->side_effects = side_effects; v1_validating_webhook_local_var->timeout_seconds = timeout_seconds; + v1_validating_webhook_local_var->_library_owned = 1; return v1_validating_webhook_local_var; } +__attribute__((deprecated)) v1_validating_webhook_t *v1_validating_webhook_create( + list_t *admission_review_versions, + admissionregistration_v1_webhook_client_config_t *client_config, + char *failure_policy, + list_t *match_conditions, + char *match_policy, + char *name, + v1_label_selector_t *namespace_selector, + v1_label_selector_t *object_selector, + list_t *rules, + char *side_effects, + int timeout_seconds + ) { + return v1_validating_webhook_create_internal ( + admission_review_versions, + client_config, + failure_policy, + match_conditions, + match_policy, + name, + namespace_selector, + object_selector, + rules, + side_effects, + timeout_seconds + ); +} void v1_validating_webhook_free(v1_validating_webhook_t *v1_validating_webhook) { if(NULL == v1_validating_webhook){ return ; } + if(v1_validating_webhook->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_webhook_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_webhook->admission_review_versions) { list_ForEach(listEntry, v1_validating_webhook->admission_review_versions) { @@ -109,7 +141,7 @@ cJSON *v1_validating_webhook_convertToJSON(v1_validating_webhook_t *v1_validatin listEntry_t *admission_review_versionsListEntry; list_ForEach(admission_review_versionsListEntry, v1_validating_webhook->admission_review_versions) { - if(cJSON_AddStringToObject(admission_review_versions, "", (char*)admission_review_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(admission_review_versions, "", admission_review_versionsListEntry->data) == NULL) { goto fail; } @@ -269,6 +301,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->admission_review_versions cJSON *admission_review_versions = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "admissionReviewVersions"); + if (cJSON_IsNull(admission_review_versions)) { + admission_review_versions = NULL; + } if (!admission_review_versions) { goto end; } @@ -291,6 +326,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->client_config cJSON *client_config = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "clientConfig"); + if (cJSON_IsNull(client_config)) { + client_config = NULL; + } if (!client_config) { goto end; } @@ -300,6 +338,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->failure_policy cJSON *failure_policy = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "failurePolicy"); + if (cJSON_IsNull(failure_policy)) { + failure_policy = NULL; + } if (failure_policy) { if(!cJSON_IsString(failure_policy) && !cJSON_IsNull(failure_policy)) { @@ -309,6 +350,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->match_conditions cJSON *match_conditions = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "matchConditions"); + if (cJSON_IsNull(match_conditions)) { + match_conditions = NULL; + } if (match_conditions) { cJSON *match_conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_conditions)){ @@ -330,6 +374,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->match_policy cJSON *match_policy = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "matchPolicy"); + if (cJSON_IsNull(match_policy)) { + match_policy = NULL; + } if (match_policy) { if(!cJSON_IsString(match_policy) && !cJSON_IsNull(match_policy)) { @@ -339,6 +386,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -351,18 +401,27 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->namespace_selector cJSON *namespace_selector = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "namespaceSelector"); + if (cJSON_IsNull(namespace_selector)) { + namespace_selector = NULL; + } if (namespace_selector) { namespace_selector_local_nonprim = v1_label_selector_parseFromJSON(namespace_selector); //nonprimitive } // v1_validating_webhook->object_selector cJSON *object_selector = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "objectSelector"); + if (cJSON_IsNull(object_selector)) { + object_selector = NULL; + } if (object_selector) { object_selector_local_nonprim = v1_label_selector_parseFromJSON(object_selector); //nonprimitive } // v1_validating_webhook->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "rules"); + if (cJSON_IsNull(rules)) { + rules = NULL; + } if (rules) { cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ @@ -384,6 +443,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->side_effects cJSON *side_effects = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "sideEffects"); + if (cJSON_IsNull(side_effects)) { + side_effects = NULL; + } if (!side_effects) { goto end; } @@ -396,6 +458,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->timeout_seconds cJSON *timeout_seconds = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "timeoutSeconds"); + if (cJSON_IsNull(timeout_seconds)) { + timeout_seconds = NULL; + } if (timeout_seconds) { if(!cJSON_IsNumber(timeout_seconds)) { @@ -404,7 +469,7 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin } - v1_validating_webhook_local_var = v1_validating_webhook_create ( + v1_validating_webhook_local_var = v1_validating_webhook_create_internal ( admission_review_versionsList, client_config_local_nonprim, failure_policy && !cJSON_IsNull(failure_policy) ? strdup(failure_policy->valuestring) : NULL, diff --git a/kubernetes/model/v1_validating_webhook.h b/kubernetes/model/v1_validating_webhook.h index e6f0d73c..87a5b605 100644 --- a/kubernetes/model/v1_validating_webhook.h +++ b/kubernetes/model/v1_validating_webhook.h @@ -35,9 +35,10 @@ typedef struct v1_validating_webhook_t { char *side_effects; // string int timeout_seconds; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_webhook_t; -v1_validating_webhook_t *v1_validating_webhook_create( +__attribute__((deprecated)) v1_validating_webhook_t *v1_validating_webhook_create( list_t *admission_review_versions, admissionregistration_v1_webhook_client_config_t *client_config, char *failure_policy, diff --git a/kubernetes/model/v1_validating_webhook_configuration.c b/kubernetes/model/v1_validating_webhook_configuration.c index be644943..73db5675 100644 --- a/kubernetes/model/v1_validating_webhook_configuration.c +++ b/kubernetes/model/v1_validating_webhook_configuration.c @@ -5,7 +5,7 @@ -v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_create( +static v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_creat v1_validating_webhook_configuration_local_var->metadata = metadata; v1_validating_webhook_configuration_local_var->webhooks = webhooks; + v1_validating_webhook_configuration_local_var->_library_owned = 1; return v1_validating_webhook_configuration_local_var; } +__attribute__((deprecated)) v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + list_t *webhooks + ) { + return v1_validating_webhook_configuration_create_internal ( + api_version, + kind, + metadata, + webhooks + ); +} void v1_validating_webhook_configuration_free(v1_validating_webhook_configuration_t *v1_validating_webhook_configuration) { if(NULL == v1_validating_webhook_configuration){ return ; } + if(v1_validating_webhook_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_webhook_configuration_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_webhook_configuration->api_version) { free(v1_validating_webhook_configuration->api_version); @@ -122,6 +140,9 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_parse // v1_validating_webhook_configuration->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configurationJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -131,6 +152,9 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_parse // v1_validating_webhook_configuration->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configurationJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -140,12 +164,18 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_parse // v1_validating_webhook_configuration->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configurationJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_validating_webhook_configuration->webhooks cJSON *webhooks = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configurationJSON, "webhooks"); + if (cJSON_IsNull(webhooks)) { + webhooks = NULL; + } if (webhooks) { cJSON *webhooks_local_nonprimitive = NULL; if(!cJSON_IsArray(webhooks)){ @@ -166,7 +196,7 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_parse } - v1_validating_webhook_configuration_local_var = v1_validating_webhook_configuration_create ( + v1_validating_webhook_configuration_local_var = v1_validating_webhook_configuration_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_validating_webhook_configuration.h b/kubernetes/model/v1_validating_webhook_configuration.h index 67249226..1297c970 100644 --- a/kubernetes/model/v1_validating_webhook_configuration.h +++ b/kubernetes/model/v1_validating_webhook_configuration.h @@ -26,9 +26,10 @@ typedef struct v1_validating_webhook_configuration_t { struct v1_object_meta_t *metadata; //model list_t *webhooks; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_webhook_configuration_t; -v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_create( +__attribute__((deprecated)) v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_validating_webhook_configuration_list.c b/kubernetes/model/v1_validating_webhook_configuration_list.c index 699cdbb3..238184df 100644 --- a/kubernetes/model/v1_validating_webhook_configuration_list.c +++ b/kubernetes/model/v1_validating_webhook_configuration_list.c @@ -5,7 +5,7 @@ -v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_list_create( +static v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ v1_validating_webhook_configuration_list_local_var->kind = kind; v1_validating_webhook_configuration_list_local_var->metadata = metadata; + v1_validating_webhook_configuration_list_local_var->_library_owned = 1; return v1_validating_webhook_configuration_list_local_var; } +__attribute__((deprecated)) v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_validating_webhook_configuration_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_validating_webhook_configuration_list_free(v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_list) { if(NULL == v1_validating_webhook_configuration_list){ return ; } + if(v1_validating_webhook_configuration_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validating_webhook_configuration_list_free"); + return ; + } listEntry_t *listEntry; if (v1_validating_webhook_configuration_list->api_version) { free(v1_validating_webhook_configuration_list->api_version); @@ -123,6 +141,9 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ // v1_validating_webhook_configuration_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configuration_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ // v1_validating_webhook_configuration_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configuration_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ // v1_validating_webhook_configuration_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configuration_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ // v1_validating_webhook_configuration_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configuration_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_validating_webhook_configuration_list_local_var = v1_validating_webhook_configuration_list_create ( + v1_validating_webhook_configuration_list_local_var = v1_validating_webhook_configuration_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_validating_webhook_configuration_list.h b/kubernetes/model/v1_validating_webhook_configuration_list.h index b493c120..a4f9e886 100644 --- a/kubernetes/model/v1_validating_webhook_configuration_list.h +++ b/kubernetes/model/v1_validating_webhook_configuration_list.h @@ -26,9 +26,10 @@ typedef struct v1_validating_webhook_configuration_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_validating_webhook_configuration_list_t; -v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_list_create( +__attribute__((deprecated)) v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_validation.c b/kubernetes/model/v1_validation.c index e01aa33b..5bed4c70 100644 --- a/kubernetes/model/v1_validation.c +++ b/kubernetes/model/v1_validation.c @@ -5,7 +5,7 @@ -v1_validation_t *v1_validation_create( +static v1_validation_t *v1_validation_create_internal( char *expression, char *message, char *message_expression, @@ -20,14 +20,32 @@ v1_validation_t *v1_validation_create( v1_validation_local_var->message_expression = message_expression; v1_validation_local_var->reason = reason; + v1_validation_local_var->_library_owned = 1; return v1_validation_local_var; } +__attribute__((deprecated)) v1_validation_t *v1_validation_create( + char *expression, + char *message, + char *message_expression, + char *reason + ) { + return v1_validation_create_internal ( + expression, + message, + message_expression, + reason + ); +} void v1_validation_free(v1_validation_t *v1_validation) { if(NULL == v1_validation){ return ; } + if(v1_validation->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validation_free"); + return ; + } listEntry_t *listEntry; if (v1_validation->expression) { free(v1_validation->expression); @@ -97,6 +115,9 @@ v1_validation_t *v1_validation_parseFromJSON(cJSON *v1_validationJSON){ // v1_validation->expression cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1_validationJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } if (!expression) { goto end; } @@ -109,6 +130,9 @@ v1_validation_t *v1_validation_parseFromJSON(cJSON *v1_validationJSON){ // v1_validation->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_validationJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -118,6 +142,9 @@ v1_validation_t *v1_validation_parseFromJSON(cJSON *v1_validationJSON){ // v1_validation->message_expression cJSON *message_expression = cJSON_GetObjectItemCaseSensitive(v1_validationJSON, "messageExpression"); + if (cJSON_IsNull(message_expression)) { + message_expression = NULL; + } if (message_expression) { if(!cJSON_IsString(message_expression) && !cJSON_IsNull(message_expression)) { @@ -127,6 +154,9 @@ v1_validation_t *v1_validation_parseFromJSON(cJSON *v1_validationJSON){ // v1_validation->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_validationJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -135,7 +165,7 @@ v1_validation_t *v1_validation_parseFromJSON(cJSON *v1_validationJSON){ } - v1_validation_local_var = v1_validation_create ( + v1_validation_local_var = v1_validation_create_internal ( strdup(expression->valuestring), message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, message_expression && !cJSON_IsNull(message_expression) ? strdup(message_expression->valuestring) : NULL, diff --git a/kubernetes/model/v1_validation.h b/kubernetes/model/v1_validation.h index a39ff5c6..e3ed141a 100644 --- a/kubernetes/model/v1_validation.h +++ b/kubernetes/model/v1_validation.h @@ -24,9 +24,10 @@ typedef struct v1_validation_t { char *message_expression; // string char *reason; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_validation_t; -v1_validation_t *v1_validation_create( +__attribute__((deprecated)) v1_validation_t *v1_validation_create( char *expression, char *message, char *message_expression, diff --git a/kubernetes/model/v1_validation_rule.c b/kubernetes/model/v1_validation_rule.c index 6958ae64..db9b2c1f 100644 --- a/kubernetes/model/v1_validation_rule.c +++ b/kubernetes/model/v1_validation_rule.c @@ -5,7 +5,7 @@ -v1_validation_rule_t *v1_validation_rule_create( +static v1_validation_rule_t *v1_validation_rule_create_internal( char *field_path, char *message, char *message_expression, @@ -24,14 +24,36 @@ v1_validation_rule_t *v1_validation_rule_create( v1_validation_rule_local_var->reason = reason; v1_validation_rule_local_var->rule = rule; + v1_validation_rule_local_var->_library_owned = 1; return v1_validation_rule_local_var; } +__attribute__((deprecated)) v1_validation_rule_t *v1_validation_rule_create( + char *field_path, + char *message, + char *message_expression, + int optional_old_self, + char *reason, + char *rule + ) { + return v1_validation_rule_create_internal ( + field_path, + message, + message_expression, + optional_old_self, + reason, + rule + ); +} void v1_validation_rule_free(v1_validation_rule_t *v1_validation_rule) { if(NULL == v1_validation_rule){ return ; } + if(v1_validation_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_validation_rule_free"); + return ; + } listEntry_t *listEntry; if (v1_validation_rule->field_path) { free(v1_validation_rule->field_path); @@ -121,6 +143,9 @@ v1_validation_rule_t *v1_validation_rule_parseFromJSON(cJSON *v1_validation_rule // v1_validation_rule->field_path cJSON *field_path = cJSON_GetObjectItemCaseSensitive(v1_validation_ruleJSON, "fieldPath"); + if (cJSON_IsNull(field_path)) { + field_path = NULL; + } if (field_path) { if(!cJSON_IsString(field_path) && !cJSON_IsNull(field_path)) { @@ -130,6 +155,9 @@ v1_validation_rule_t *v1_validation_rule_parseFromJSON(cJSON *v1_validation_rule // v1_validation_rule->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_validation_ruleJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -139,6 +167,9 @@ v1_validation_rule_t *v1_validation_rule_parseFromJSON(cJSON *v1_validation_rule // v1_validation_rule->message_expression cJSON *message_expression = cJSON_GetObjectItemCaseSensitive(v1_validation_ruleJSON, "messageExpression"); + if (cJSON_IsNull(message_expression)) { + message_expression = NULL; + } if (message_expression) { if(!cJSON_IsString(message_expression) && !cJSON_IsNull(message_expression)) { @@ -148,6 +179,9 @@ v1_validation_rule_t *v1_validation_rule_parseFromJSON(cJSON *v1_validation_rule // v1_validation_rule->optional_old_self cJSON *optional_old_self = cJSON_GetObjectItemCaseSensitive(v1_validation_ruleJSON, "optionalOldSelf"); + if (cJSON_IsNull(optional_old_self)) { + optional_old_self = NULL; + } if (optional_old_self) { if(!cJSON_IsBool(optional_old_self)) { @@ -157,6 +191,9 @@ v1_validation_rule_t *v1_validation_rule_parseFromJSON(cJSON *v1_validation_rule // v1_validation_rule->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1_validation_ruleJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -166,6 +203,9 @@ v1_validation_rule_t *v1_validation_rule_parseFromJSON(cJSON *v1_validation_rule // v1_validation_rule->rule cJSON *rule = cJSON_GetObjectItemCaseSensitive(v1_validation_ruleJSON, "rule"); + if (cJSON_IsNull(rule)) { + rule = NULL; + } if (!rule) { goto end; } @@ -177,7 +217,7 @@ v1_validation_rule_t *v1_validation_rule_parseFromJSON(cJSON *v1_validation_rule } - v1_validation_rule_local_var = v1_validation_rule_create ( + v1_validation_rule_local_var = v1_validation_rule_create_internal ( field_path && !cJSON_IsNull(field_path) ? strdup(field_path->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, message_expression && !cJSON_IsNull(message_expression) ? strdup(message_expression->valuestring) : NULL, diff --git a/kubernetes/model/v1_validation_rule.h b/kubernetes/model/v1_validation_rule.h index e2c44d67..f6d21797 100644 --- a/kubernetes/model/v1_validation_rule.h +++ b/kubernetes/model/v1_validation_rule.h @@ -26,9 +26,10 @@ typedef struct v1_validation_rule_t { char *reason; // string char *rule; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_validation_rule_t; -v1_validation_rule_t *v1_validation_rule_create( +__attribute__((deprecated)) v1_validation_rule_t *v1_validation_rule_create( char *field_path, char *message, char *message_expression, diff --git a/kubernetes/model/v1_variable.c b/kubernetes/model/v1_variable.c index adb244ef..3707c2fb 100644 --- a/kubernetes/model/v1_variable.c +++ b/kubernetes/model/v1_variable.c @@ -5,7 +5,7 @@ -v1_variable_t *v1_variable_create( +static v1_variable_t *v1_variable_create_internal( char *expression, char *name ) { @@ -16,14 +16,28 @@ v1_variable_t *v1_variable_create( v1_variable_local_var->expression = expression; v1_variable_local_var->name = name; + v1_variable_local_var->_library_owned = 1; return v1_variable_local_var; } +__attribute__((deprecated)) v1_variable_t *v1_variable_create( + char *expression, + char *name + ) { + return v1_variable_create_internal ( + expression, + name + ); +} void v1_variable_free(v1_variable_t *v1_variable) { if(NULL == v1_variable){ return ; } + if(v1_variable->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_variable_free"); + return ; + } listEntry_t *listEntry; if (v1_variable->expression) { free(v1_variable->expression); @@ -70,6 +84,9 @@ v1_variable_t *v1_variable_parseFromJSON(cJSON *v1_variableJSON){ // v1_variable->expression cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1_variableJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } if (!expression) { goto end; } @@ -82,6 +99,9 @@ v1_variable_t *v1_variable_parseFromJSON(cJSON *v1_variableJSON){ // v1_variable->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_variableJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1_variable_t *v1_variable_parseFromJSON(cJSON *v1_variableJSON){ } - v1_variable_local_var = v1_variable_create ( + v1_variable_local_var = v1_variable_create_internal ( strdup(expression->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_variable.h b/kubernetes/model/v1_variable.h index 3c2246d1..3dc9a665 100644 --- a/kubernetes/model/v1_variable.h +++ b/kubernetes/model/v1_variable.h @@ -22,9 +22,10 @@ typedef struct v1_variable_t { char *expression; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_variable_t; -v1_variable_t *v1_variable_create( +__attribute__((deprecated)) v1_variable_t *v1_variable_create( char *expression, char *name ); diff --git a/kubernetes/model/v1_volume.c b/kubernetes/model/v1_volume.c index 74ee2958..1ac3c296 100644 --- a/kubernetes/model/v1_volume.c +++ b/kubernetes/model/v1_volume.c @@ -5,7 +5,7 @@ -v1_volume_t *v1_volume_create( +static v1_volume_t *v1_volume_create_internal( v1_aws_elastic_block_store_volume_source_t *aws_elastic_block_store, v1_azure_disk_volume_source_t *azure_disk, v1_azure_file_volume_source_t *azure_file, @@ -23,6 +23,7 @@ v1_volume_t *v1_volume_create( v1_git_repo_volume_source_t *git_repo, v1_glusterfs_volume_source_t *glusterfs, v1_host_path_volume_source_t *host_path, + v1_image_volume_source_t *image, v1_iscsi_volume_source_t *iscsi, char *name, v1_nfs_volume_source_t *nfs, @@ -58,6 +59,7 @@ v1_volume_t *v1_volume_create( v1_volume_local_var->git_repo = git_repo; v1_volume_local_var->glusterfs = glusterfs; v1_volume_local_var->host_path = host_path; + v1_volume_local_var->image = image; v1_volume_local_var->iscsi = iscsi; v1_volume_local_var->name = name; v1_volume_local_var->nfs = nfs; @@ -72,14 +74,86 @@ v1_volume_t *v1_volume_create( v1_volume_local_var->storageos = storageos; v1_volume_local_var->vsphere_volume = vsphere_volume; + v1_volume_local_var->_library_owned = 1; return v1_volume_local_var; } +__attribute__((deprecated)) v1_volume_t *v1_volume_create( + v1_aws_elastic_block_store_volume_source_t *aws_elastic_block_store, + v1_azure_disk_volume_source_t *azure_disk, + v1_azure_file_volume_source_t *azure_file, + v1_ceph_fs_volume_source_t *cephfs, + v1_cinder_volume_source_t *cinder, + v1_config_map_volume_source_t *config_map, + v1_csi_volume_source_t *csi, + v1_downward_api_volume_source_t *downward_api, + v1_empty_dir_volume_source_t *empty_dir, + v1_ephemeral_volume_source_t *ephemeral, + v1_fc_volume_source_t *fc, + v1_flex_volume_source_t *flex_volume, + v1_flocker_volume_source_t *flocker, + v1_gce_persistent_disk_volume_source_t *gce_persistent_disk, + v1_git_repo_volume_source_t *git_repo, + v1_glusterfs_volume_source_t *glusterfs, + v1_host_path_volume_source_t *host_path, + v1_image_volume_source_t *image, + v1_iscsi_volume_source_t *iscsi, + char *name, + v1_nfs_volume_source_t *nfs, + v1_persistent_volume_claim_volume_source_t *persistent_volume_claim, + v1_photon_persistent_disk_volume_source_t *photon_persistent_disk, + v1_portworx_volume_source_t *portworx_volume, + v1_projected_volume_source_t *projected, + v1_quobyte_volume_source_t *quobyte, + v1_rbd_volume_source_t *rbd, + v1_scale_io_volume_source_t *scale_io, + v1_secret_volume_source_t *secret, + v1_storage_os_volume_source_t *storageos, + v1_vsphere_virtual_disk_volume_source_t *vsphere_volume + ) { + return v1_volume_create_internal ( + aws_elastic_block_store, + azure_disk, + azure_file, + cephfs, + cinder, + config_map, + csi, + downward_api, + empty_dir, + ephemeral, + fc, + flex_volume, + flocker, + gce_persistent_disk, + git_repo, + glusterfs, + host_path, + image, + iscsi, + name, + nfs, + persistent_volume_claim, + photon_persistent_disk, + portworx_volume, + projected, + quobyte, + rbd, + scale_io, + secret, + storageos, + vsphere_volume + ); +} void v1_volume_free(v1_volume_t *v1_volume) { if(NULL == v1_volume){ return ; } + if(v1_volume->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_free"); + return ; + } listEntry_t *listEntry; if (v1_volume->aws_elastic_block_store) { v1_aws_elastic_block_store_volume_source_free(v1_volume->aws_elastic_block_store); @@ -149,6 +223,10 @@ void v1_volume_free(v1_volume_t *v1_volume) { v1_host_path_volume_source_free(v1_volume->host_path); v1_volume->host_path = NULL; } + if (v1_volume->image) { + v1_image_volume_source_free(v1_volume->image); + v1_volume->image = NULL; + } if (v1_volume->iscsi) { v1_iscsi_volume_source_free(v1_volume->iscsi); v1_volume->iscsi = NULL; @@ -428,6 +506,19 @@ cJSON *v1_volume_convertToJSON(v1_volume_t *v1_volume) { } + // v1_volume->image + if(v1_volume->image) { + cJSON *image_local_JSON = v1_image_volume_source_convertToJSON(v1_volume->image); + if(image_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "image", image_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_volume->iscsi if(v1_volume->iscsi) { cJSON *iscsi_local_JSON = v1_iscsi_volume_source_convertToJSON(v1_volume->iscsi); @@ -655,6 +746,9 @@ v1_volume_t *v1_volume_parseFromJSON(cJSON *v1_volumeJSON){ // define the local variable for v1_volume->host_path v1_host_path_volume_source_t *host_path_local_nonprim = NULL; + // define the local variable for v1_volume->image + v1_image_volume_source_t *image_local_nonprim = NULL; + // define the local variable for v1_volume->iscsi v1_iscsi_volume_source_t *iscsi_local_nonprim = NULL; @@ -693,114 +787,180 @@ v1_volume_t *v1_volume_parseFromJSON(cJSON *v1_volumeJSON){ // v1_volume->aws_elastic_block_store cJSON *aws_elastic_block_store = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "awsElasticBlockStore"); + if (cJSON_IsNull(aws_elastic_block_store)) { + aws_elastic_block_store = NULL; + } if (aws_elastic_block_store) { aws_elastic_block_store_local_nonprim = v1_aws_elastic_block_store_volume_source_parseFromJSON(aws_elastic_block_store); //nonprimitive } // v1_volume->azure_disk cJSON *azure_disk = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "azureDisk"); + if (cJSON_IsNull(azure_disk)) { + azure_disk = NULL; + } if (azure_disk) { azure_disk_local_nonprim = v1_azure_disk_volume_source_parseFromJSON(azure_disk); //nonprimitive } // v1_volume->azure_file cJSON *azure_file = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "azureFile"); + if (cJSON_IsNull(azure_file)) { + azure_file = NULL; + } if (azure_file) { azure_file_local_nonprim = v1_azure_file_volume_source_parseFromJSON(azure_file); //nonprimitive } // v1_volume->cephfs cJSON *cephfs = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "cephfs"); + if (cJSON_IsNull(cephfs)) { + cephfs = NULL; + } if (cephfs) { cephfs_local_nonprim = v1_ceph_fs_volume_source_parseFromJSON(cephfs); //nonprimitive } // v1_volume->cinder cJSON *cinder = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "cinder"); + if (cJSON_IsNull(cinder)) { + cinder = NULL; + } if (cinder) { cinder_local_nonprim = v1_cinder_volume_source_parseFromJSON(cinder); //nonprimitive } // v1_volume->config_map cJSON *config_map = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "configMap"); + if (cJSON_IsNull(config_map)) { + config_map = NULL; + } if (config_map) { config_map_local_nonprim = v1_config_map_volume_source_parseFromJSON(config_map); //nonprimitive } // v1_volume->csi cJSON *csi = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "csi"); + if (cJSON_IsNull(csi)) { + csi = NULL; + } if (csi) { csi_local_nonprim = v1_csi_volume_source_parseFromJSON(csi); //nonprimitive } // v1_volume->downward_api cJSON *downward_api = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "downwardAPI"); + if (cJSON_IsNull(downward_api)) { + downward_api = NULL; + } if (downward_api) { downward_api_local_nonprim = v1_downward_api_volume_source_parseFromJSON(downward_api); //nonprimitive } // v1_volume->empty_dir cJSON *empty_dir = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "emptyDir"); + if (cJSON_IsNull(empty_dir)) { + empty_dir = NULL; + } if (empty_dir) { empty_dir_local_nonprim = v1_empty_dir_volume_source_parseFromJSON(empty_dir); //nonprimitive } // v1_volume->ephemeral cJSON *ephemeral = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "ephemeral"); + if (cJSON_IsNull(ephemeral)) { + ephemeral = NULL; + } if (ephemeral) { ephemeral_local_nonprim = v1_ephemeral_volume_source_parseFromJSON(ephemeral); //nonprimitive } // v1_volume->fc cJSON *fc = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "fc"); + if (cJSON_IsNull(fc)) { + fc = NULL; + } if (fc) { fc_local_nonprim = v1_fc_volume_source_parseFromJSON(fc); //nonprimitive } // v1_volume->flex_volume cJSON *flex_volume = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "flexVolume"); + if (cJSON_IsNull(flex_volume)) { + flex_volume = NULL; + } if (flex_volume) { flex_volume_local_nonprim = v1_flex_volume_source_parseFromJSON(flex_volume); //nonprimitive } // v1_volume->flocker cJSON *flocker = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "flocker"); + if (cJSON_IsNull(flocker)) { + flocker = NULL; + } if (flocker) { flocker_local_nonprim = v1_flocker_volume_source_parseFromJSON(flocker); //nonprimitive } // v1_volume->gce_persistent_disk cJSON *gce_persistent_disk = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "gcePersistentDisk"); + if (cJSON_IsNull(gce_persistent_disk)) { + gce_persistent_disk = NULL; + } if (gce_persistent_disk) { gce_persistent_disk_local_nonprim = v1_gce_persistent_disk_volume_source_parseFromJSON(gce_persistent_disk); //nonprimitive } // v1_volume->git_repo cJSON *git_repo = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "gitRepo"); + if (cJSON_IsNull(git_repo)) { + git_repo = NULL; + } if (git_repo) { git_repo_local_nonprim = v1_git_repo_volume_source_parseFromJSON(git_repo); //nonprimitive } // v1_volume->glusterfs cJSON *glusterfs = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "glusterfs"); + if (cJSON_IsNull(glusterfs)) { + glusterfs = NULL; + } if (glusterfs) { glusterfs_local_nonprim = v1_glusterfs_volume_source_parseFromJSON(glusterfs); //nonprimitive } // v1_volume->host_path cJSON *host_path = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "hostPath"); + if (cJSON_IsNull(host_path)) { + host_path = NULL; + } if (host_path) { host_path_local_nonprim = v1_host_path_volume_source_parseFromJSON(host_path); //nonprimitive } + // v1_volume->image + cJSON *image = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "image"); + if (cJSON_IsNull(image)) { + image = NULL; + } + if (image) { + image_local_nonprim = v1_image_volume_source_parseFromJSON(image); //nonprimitive + } + // v1_volume->iscsi cJSON *iscsi = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "iscsi"); + if (cJSON_IsNull(iscsi)) { + iscsi = NULL; + } if (iscsi) { iscsi_local_nonprim = v1_iscsi_volume_source_parseFromJSON(iscsi); //nonprimitive } // v1_volume->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -813,72 +973,105 @@ v1_volume_t *v1_volume_parseFromJSON(cJSON *v1_volumeJSON){ // v1_volume->nfs cJSON *nfs = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "nfs"); + if (cJSON_IsNull(nfs)) { + nfs = NULL; + } if (nfs) { nfs_local_nonprim = v1_nfs_volume_source_parseFromJSON(nfs); //nonprimitive } // v1_volume->persistent_volume_claim cJSON *persistent_volume_claim = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "persistentVolumeClaim"); + if (cJSON_IsNull(persistent_volume_claim)) { + persistent_volume_claim = NULL; + } if (persistent_volume_claim) { persistent_volume_claim_local_nonprim = v1_persistent_volume_claim_volume_source_parseFromJSON(persistent_volume_claim); //nonprimitive } // v1_volume->photon_persistent_disk cJSON *photon_persistent_disk = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "photonPersistentDisk"); + if (cJSON_IsNull(photon_persistent_disk)) { + photon_persistent_disk = NULL; + } if (photon_persistent_disk) { photon_persistent_disk_local_nonprim = v1_photon_persistent_disk_volume_source_parseFromJSON(photon_persistent_disk); //nonprimitive } // v1_volume->portworx_volume cJSON *portworx_volume = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "portworxVolume"); + if (cJSON_IsNull(portworx_volume)) { + portworx_volume = NULL; + } if (portworx_volume) { portworx_volume_local_nonprim = v1_portworx_volume_source_parseFromJSON(portworx_volume); //nonprimitive } // v1_volume->projected cJSON *projected = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "projected"); + if (cJSON_IsNull(projected)) { + projected = NULL; + } if (projected) { projected_local_nonprim = v1_projected_volume_source_parseFromJSON(projected); //nonprimitive } // v1_volume->quobyte cJSON *quobyte = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "quobyte"); + if (cJSON_IsNull(quobyte)) { + quobyte = NULL; + } if (quobyte) { quobyte_local_nonprim = v1_quobyte_volume_source_parseFromJSON(quobyte); //nonprimitive } // v1_volume->rbd cJSON *rbd = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "rbd"); + if (cJSON_IsNull(rbd)) { + rbd = NULL; + } if (rbd) { rbd_local_nonprim = v1_rbd_volume_source_parseFromJSON(rbd); //nonprimitive } // v1_volume->scale_io cJSON *scale_io = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "scaleIO"); + if (cJSON_IsNull(scale_io)) { + scale_io = NULL; + } if (scale_io) { scale_io_local_nonprim = v1_scale_io_volume_source_parseFromJSON(scale_io); //nonprimitive } // v1_volume->secret cJSON *secret = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "secret"); + if (cJSON_IsNull(secret)) { + secret = NULL; + } if (secret) { secret_local_nonprim = v1_secret_volume_source_parseFromJSON(secret); //nonprimitive } // v1_volume->storageos cJSON *storageos = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "storageos"); + if (cJSON_IsNull(storageos)) { + storageos = NULL; + } if (storageos) { storageos_local_nonprim = v1_storage_os_volume_source_parseFromJSON(storageos); //nonprimitive } // v1_volume->vsphere_volume cJSON *vsphere_volume = cJSON_GetObjectItemCaseSensitive(v1_volumeJSON, "vsphereVolume"); + if (cJSON_IsNull(vsphere_volume)) { + vsphere_volume = NULL; + } if (vsphere_volume) { vsphere_volume_local_nonprim = v1_vsphere_virtual_disk_volume_source_parseFromJSON(vsphere_volume); //nonprimitive } - v1_volume_local_var = v1_volume_create ( + v1_volume_local_var = v1_volume_create_internal ( aws_elastic_block_store ? aws_elastic_block_store_local_nonprim : NULL, azure_disk ? azure_disk_local_nonprim : NULL, azure_file ? azure_file_local_nonprim : NULL, @@ -896,6 +1089,7 @@ v1_volume_t *v1_volume_parseFromJSON(cJSON *v1_volumeJSON){ git_repo ? git_repo_local_nonprim : NULL, glusterfs ? glusterfs_local_nonprim : NULL, host_path ? host_path_local_nonprim : NULL, + image ? image_local_nonprim : NULL, iscsi ? iscsi_local_nonprim : NULL, strdup(name->valuestring), nfs ? nfs_local_nonprim : NULL, @@ -981,6 +1175,10 @@ v1_volume_t *v1_volume_parseFromJSON(cJSON *v1_volumeJSON){ v1_host_path_volume_source_free(host_path_local_nonprim); host_path_local_nonprim = NULL; } + if (image_local_nonprim) { + v1_image_volume_source_free(image_local_nonprim); + image_local_nonprim = NULL; + } if (iscsi_local_nonprim) { v1_iscsi_volume_source_free(iscsi_local_nonprim); iscsi_local_nonprim = NULL; diff --git a/kubernetes/model/v1_volume.h b/kubernetes/model/v1_volume.h index ba6b3bba..af072de0 100644 --- a/kubernetes/model/v1_volume.h +++ b/kubernetes/model/v1_volume.h @@ -32,6 +32,7 @@ typedef struct v1_volume_t v1_volume_t; #include "v1_git_repo_volume_source.h" #include "v1_glusterfs_volume_source.h" #include "v1_host_path_volume_source.h" +#include "v1_image_volume_source.h" #include "v1_iscsi_volume_source.h" #include "v1_nfs_volume_source.h" #include "v1_persistent_volume_claim_volume_source.h" @@ -65,6 +66,7 @@ typedef struct v1_volume_t { struct v1_git_repo_volume_source_t *git_repo; //model struct v1_glusterfs_volume_source_t *glusterfs; //model struct v1_host_path_volume_source_t *host_path; //model + struct v1_image_volume_source_t *image; //model struct v1_iscsi_volume_source_t *iscsi; //model char *name; // string struct v1_nfs_volume_source_t *nfs; //model @@ -79,9 +81,10 @@ typedef struct v1_volume_t { struct v1_storage_os_volume_source_t *storageos; //model struct v1_vsphere_virtual_disk_volume_source_t *vsphere_volume; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_t; -v1_volume_t *v1_volume_create( +__attribute__((deprecated)) v1_volume_t *v1_volume_create( v1_aws_elastic_block_store_volume_source_t *aws_elastic_block_store, v1_azure_disk_volume_source_t *azure_disk, v1_azure_file_volume_source_t *azure_file, @@ -99,6 +102,7 @@ v1_volume_t *v1_volume_create( v1_git_repo_volume_source_t *git_repo, v1_glusterfs_volume_source_t *glusterfs, v1_host_path_volume_source_t *host_path, + v1_image_volume_source_t *image, v1_iscsi_volume_source_t *iscsi, char *name, v1_nfs_volume_source_t *nfs, diff --git a/kubernetes/model/v1_volume_attachment.c b/kubernetes/model/v1_volume_attachment.c index 2e59449b..b135adb5 100644 --- a/kubernetes/model/v1_volume_attachment.c +++ b/kubernetes/model/v1_volume_attachment.c @@ -5,7 +5,7 @@ -v1_volume_attachment_t *v1_volume_attachment_create( +static v1_volume_attachment_t *v1_volume_attachment_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1_volume_attachment_t *v1_volume_attachment_create( v1_volume_attachment_local_var->spec = spec; v1_volume_attachment_local_var->status = status; + v1_volume_attachment_local_var->_library_owned = 1; return v1_volume_attachment_local_var; } +__attribute__((deprecated)) v1_volume_attachment_t *v1_volume_attachment_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1_volume_attachment_spec_t *spec, + v1_volume_attachment_status_t *status + ) { + return v1_volume_attachment_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1_volume_attachment_free(v1_volume_attachment_t *v1_volume_attachment) { if(NULL == v1_volume_attachment){ return ; } + if(v1_volume_attachment->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_attachment_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_attachment->api_version) { free(v1_volume_attachment->api_version); @@ -135,6 +155,9 @@ v1_volume_attachment_t *v1_volume_attachment_parseFromJSON(cJSON *v1_volume_atta // v1_volume_attachment->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_volume_attachmentJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -144,6 +167,9 @@ v1_volume_attachment_t *v1_volume_attachment_parseFromJSON(cJSON *v1_volume_atta // v1_volume_attachment->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_volume_attachmentJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -153,12 +179,18 @@ v1_volume_attachment_t *v1_volume_attachment_parseFromJSON(cJSON *v1_volume_atta // v1_volume_attachment->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_volume_attachmentJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1_volume_attachment->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1_volume_attachmentJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -168,12 +200,15 @@ v1_volume_attachment_t *v1_volume_attachment_parseFromJSON(cJSON *v1_volume_atta // v1_volume_attachment->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1_volume_attachmentJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1_volume_attachment_status_parseFromJSON(status); //nonprimitive } - v1_volume_attachment_local_var = v1_volume_attachment_create ( + v1_volume_attachment_local_var = v1_volume_attachment_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1_volume_attachment.h b/kubernetes/model/v1_volume_attachment.h index 010adadf..1ec890cb 100644 --- a/kubernetes/model/v1_volume_attachment.h +++ b/kubernetes/model/v1_volume_attachment.h @@ -28,9 +28,10 @@ typedef struct v1_volume_attachment_t { struct v1_volume_attachment_spec_t *spec; //model struct v1_volume_attachment_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_attachment_t; -v1_volume_attachment_t *v1_volume_attachment_create( +__attribute__((deprecated)) v1_volume_attachment_t *v1_volume_attachment_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1_volume_attachment_list.c b/kubernetes/model/v1_volume_attachment_list.c index cd66980a..e7799d65 100644 --- a/kubernetes/model/v1_volume_attachment_list.c +++ b/kubernetes/model/v1_volume_attachment_list.c @@ -5,7 +5,7 @@ -v1_volume_attachment_list_t *v1_volume_attachment_list_create( +static v1_volume_attachment_list_t *v1_volume_attachment_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_create( v1_volume_attachment_list_local_var->kind = kind; v1_volume_attachment_list_local_var->metadata = metadata; + v1_volume_attachment_list_local_var->_library_owned = 1; return v1_volume_attachment_list_local_var; } +__attribute__((deprecated)) v1_volume_attachment_list_t *v1_volume_attachment_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_volume_attachment_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1_volume_attachment_list_free(v1_volume_attachment_list_t *v1_volume_attachment_list) { if(NULL == v1_volume_attachment_list){ return ; } + if(v1_volume_attachment_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_attachment_list_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_attachment_list->api_version) { free(v1_volume_attachment_list->api_version); @@ -123,6 +141,9 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_parseFromJSON(cJSON *v1_v // v1_volume_attachment_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_parseFromJSON(cJSON *v1_v // v1_volume_attachment_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_parseFromJSON(cJSON *v1_v // v1_volume_attachment_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_parseFromJSON(cJSON *v1_v // v1_volume_attachment_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1_volume_attachment_list_local_var = v1_volume_attachment_list_create ( + v1_volume_attachment_list_local_var = v1_volume_attachment_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1_volume_attachment_list.h b/kubernetes/model/v1_volume_attachment_list.h index 12ceecb9..94b597ed 100644 --- a/kubernetes/model/v1_volume_attachment_list.h +++ b/kubernetes/model/v1_volume_attachment_list.h @@ -26,9 +26,10 @@ typedef struct v1_volume_attachment_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_attachment_list_t; -v1_volume_attachment_list_t *v1_volume_attachment_list_create( +__attribute__((deprecated)) v1_volume_attachment_list_t *v1_volume_attachment_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1_volume_attachment_source.c b/kubernetes/model/v1_volume_attachment_source.c index 1c40642f..b0a803d5 100644 --- a/kubernetes/model/v1_volume_attachment_source.c +++ b/kubernetes/model/v1_volume_attachment_source.c @@ -5,7 +5,7 @@ -v1_volume_attachment_source_t *v1_volume_attachment_source_create( +static v1_volume_attachment_source_t *v1_volume_attachment_source_create_internal( v1_persistent_volume_spec_t *inline_volume_spec, char *persistent_volume_name ) { @@ -16,14 +16,28 @@ v1_volume_attachment_source_t *v1_volume_attachment_source_create( v1_volume_attachment_source_local_var->inline_volume_spec = inline_volume_spec; v1_volume_attachment_source_local_var->persistent_volume_name = persistent_volume_name; + v1_volume_attachment_source_local_var->_library_owned = 1; return v1_volume_attachment_source_local_var; } +__attribute__((deprecated)) v1_volume_attachment_source_t *v1_volume_attachment_source_create( + v1_persistent_volume_spec_t *inline_volume_spec, + char *persistent_volume_name + ) { + return v1_volume_attachment_source_create_internal ( + inline_volume_spec, + persistent_volume_name + ); +} void v1_volume_attachment_source_free(v1_volume_attachment_source_t *v1_volume_attachment_source) { if(NULL == v1_volume_attachment_source){ return ; } + if(v1_volume_attachment_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_attachment_source_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_attachment_source->inline_volume_spec) { v1_persistent_volume_spec_free(v1_volume_attachment_source->inline_volume_spec); @@ -76,12 +90,18 @@ v1_volume_attachment_source_t *v1_volume_attachment_source_parseFromJSON(cJSON * // v1_volume_attachment_source->inline_volume_spec cJSON *inline_volume_spec = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_sourceJSON, "inlineVolumeSpec"); + if (cJSON_IsNull(inline_volume_spec)) { + inline_volume_spec = NULL; + } if (inline_volume_spec) { inline_volume_spec_local_nonprim = v1_persistent_volume_spec_parseFromJSON(inline_volume_spec); //nonprimitive } // v1_volume_attachment_source->persistent_volume_name cJSON *persistent_volume_name = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_sourceJSON, "persistentVolumeName"); + if (cJSON_IsNull(persistent_volume_name)) { + persistent_volume_name = NULL; + } if (persistent_volume_name) { if(!cJSON_IsString(persistent_volume_name) && !cJSON_IsNull(persistent_volume_name)) { @@ -90,7 +110,7 @@ v1_volume_attachment_source_t *v1_volume_attachment_source_parseFromJSON(cJSON * } - v1_volume_attachment_source_local_var = v1_volume_attachment_source_create ( + v1_volume_attachment_source_local_var = v1_volume_attachment_source_create_internal ( inline_volume_spec ? inline_volume_spec_local_nonprim : NULL, persistent_volume_name && !cJSON_IsNull(persistent_volume_name) ? strdup(persistent_volume_name->valuestring) : NULL ); diff --git a/kubernetes/model/v1_volume_attachment_source.h b/kubernetes/model/v1_volume_attachment_source.h index f2c3d331..3f7827ee 100644 --- a/kubernetes/model/v1_volume_attachment_source.h +++ b/kubernetes/model/v1_volume_attachment_source.h @@ -1,7 +1,7 @@ /* * v1_volume_attachment_source.h * - * VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set. + * VolumeAttachmentSource represents a volume that should be attached. Right now only PersistentVolumes can be attached via external attacher, in the future we may allow also inline volumes in pods. Exactly one member can be set. */ #ifndef _v1_volume_attachment_source_H_ @@ -23,9 +23,10 @@ typedef struct v1_volume_attachment_source_t { struct v1_persistent_volume_spec_t *inline_volume_spec; //model char *persistent_volume_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_attachment_source_t; -v1_volume_attachment_source_t *v1_volume_attachment_source_create( +__attribute__((deprecated)) v1_volume_attachment_source_t *v1_volume_attachment_source_create( v1_persistent_volume_spec_t *inline_volume_spec, char *persistent_volume_name ); diff --git a/kubernetes/model/v1_volume_attachment_spec.c b/kubernetes/model/v1_volume_attachment_spec.c index f35e8eba..2de92297 100644 --- a/kubernetes/model/v1_volume_attachment_spec.c +++ b/kubernetes/model/v1_volume_attachment_spec.c @@ -5,7 +5,7 @@ -v1_volume_attachment_spec_t *v1_volume_attachment_spec_create( +static v1_volume_attachment_spec_t *v1_volume_attachment_spec_create_internal( char *attacher, char *node_name, v1_volume_attachment_source_t *source @@ -18,14 +18,30 @@ v1_volume_attachment_spec_t *v1_volume_attachment_spec_create( v1_volume_attachment_spec_local_var->node_name = node_name; v1_volume_attachment_spec_local_var->source = source; + v1_volume_attachment_spec_local_var->_library_owned = 1; return v1_volume_attachment_spec_local_var; } +__attribute__((deprecated)) v1_volume_attachment_spec_t *v1_volume_attachment_spec_create( + char *attacher, + char *node_name, + v1_volume_attachment_source_t *source + ) { + return v1_volume_attachment_spec_create_internal ( + attacher, + node_name, + source + ); +} void v1_volume_attachment_spec_free(v1_volume_attachment_spec_t *v1_volume_attachment_spec) { if(NULL == v1_volume_attachment_spec){ return ; } + if(v1_volume_attachment_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_attachment_spec_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_attachment_spec->attacher) { free(v1_volume_attachment_spec->attacher); @@ -93,6 +109,9 @@ v1_volume_attachment_spec_t *v1_volume_attachment_spec_parseFromJSON(cJSON *v1_v // v1_volume_attachment_spec->attacher cJSON *attacher = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_specJSON, "attacher"); + if (cJSON_IsNull(attacher)) { + attacher = NULL; + } if (!attacher) { goto end; } @@ -105,6 +124,9 @@ v1_volume_attachment_spec_t *v1_volume_attachment_spec_parseFromJSON(cJSON *v1_v // v1_volume_attachment_spec->node_name cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_specJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } if (!node_name) { goto end; } @@ -117,6 +139,9 @@ v1_volume_attachment_spec_t *v1_volume_attachment_spec_parseFromJSON(cJSON *v1_v // v1_volume_attachment_spec->source cJSON *source = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_specJSON, "source"); + if (cJSON_IsNull(source)) { + source = NULL; + } if (!source) { goto end; } @@ -125,7 +150,7 @@ v1_volume_attachment_spec_t *v1_volume_attachment_spec_parseFromJSON(cJSON *v1_v source_local_nonprim = v1_volume_attachment_source_parseFromJSON(source); //nonprimitive - v1_volume_attachment_spec_local_var = v1_volume_attachment_spec_create ( + v1_volume_attachment_spec_local_var = v1_volume_attachment_spec_create_internal ( strdup(attacher->valuestring), strdup(node_name->valuestring), source_local_nonprim diff --git a/kubernetes/model/v1_volume_attachment_spec.h b/kubernetes/model/v1_volume_attachment_spec.h index ff28924d..3b667a86 100644 --- a/kubernetes/model/v1_volume_attachment_spec.h +++ b/kubernetes/model/v1_volume_attachment_spec.h @@ -24,9 +24,10 @@ typedef struct v1_volume_attachment_spec_t { char *node_name; // string struct v1_volume_attachment_source_t *source; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_attachment_spec_t; -v1_volume_attachment_spec_t *v1_volume_attachment_spec_create( +__attribute__((deprecated)) v1_volume_attachment_spec_t *v1_volume_attachment_spec_create( char *attacher, char *node_name, v1_volume_attachment_source_t *source diff --git a/kubernetes/model/v1_volume_attachment_status.c b/kubernetes/model/v1_volume_attachment_status.c index eb8c1cba..f24e850e 100644 --- a/kubernetes/model/v1_volume_attachment_status.c +++ b/kubernetes/model/v1_volume_attachment_status.c @@ -5,7 +5,7 @@ -v1_volume_attachment_status_t *v1_volume_attachment_status_create( +static v1_volume_attachment_status_t *v1_volume_attachment_status_create_internal( v1_volume_error_t *attach_error, int attached, list_t* attachment_metadata, @@ -20,14 +20,32 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_create( v1_volume_attachment_status_local_var->attachment_metadata = attachment_metadata; v1_volume_attachment_status_local_var->detach_error = detach_error; + v1_volume_attachment_status_local_var->_library_owned = 1; return v1_volume_attachment_status_local_var; } +__attribute__((deprecated)) v1_volume_attachment_status_t *v1_volume_attachment_status_create( + v1_volume_error_t *attach_error, + int attached, + list_t* attachment_metadata, + v1_volume_error_t *detach_error + ) { + return v1_volume_attachment_status_create_internal ( + attach_error, + attached, + attachment_metadata, + detach_error + ); +} void v1_volume_attachment_status_free(v1_volume_attachment_status_t *v1_volume_attachment_status) { if(NULL == v1_volume_attachment_status){ return ; } + if(v1_volume_attachment_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_attachment_status_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_attachment_status->attach_error) { v1_volume_error_free(v1_volume_attachment_status->attach_error); @@ -35,7 +53,7 @@ void v1_volume_attachment_status_free(v1_volume_attachment_status_t *v1_volume_a } if (v1_volume_attachment_status->attachment_metadata) { list_ForEach(listEntry, v1_volume_attachment_status->attachment_metadata) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -85,8 +103,8 @@ cJSON *v1_volume_attachment_status_convertToJSON(v1_volume_attachment_status_t * listEntry_t *attachment_metadataListEntry; if (v1_volume_attachment_status->attachment_metadata) { list_ForEach(attachment_metadataListEntry, v1_volume_attachment_status->attachment_metadata) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)attachment_metadataListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = attachment_metadataListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -130,12 +148,18 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * // v1_volume_attachment_status->attach_error cJSON *attach_error = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_statusJSON, "attachError"); + if (cJSON_IsNull(attach_error)) { + attach_error = NULL; + } if (attach_error) { attach_error_local_nonprim = v1_volume_error_parseFromJSON(attach_error); //nonprimitive } // v1_volume_attachment_status->attached cJSON *attached = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_statusJSON, "attached"); + if (cJSON_IsNull(attached)) { + attached = NULL; + } if (!attached) { goto end; } @@ -148,6 +172,9 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * // v1_volume_attachment_status->attachment_metadata cJSON *attachment_metadata = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_statusJSON, "attachmentMetadata"); + if (cJSON_IsNull(attachment_metadata)) { + attachment_metadata = NULL; + } if (attachment_metadata) { cJSON *attachment_metadata_local_map = NULL; if(!cJSON_IsObject(attachment_metadata) && !cJSON_IsNull(attachment_metadata)) @@ -173,12 +200,15 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * // v1_volume_attachment_status->detach_error cJSON *detach_error = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_statusJSON, "detachError"); + if (cJSON_IsNull(detach_error)) { + detach_error = NULL; + } if (detach_error) { detach_error_local_nonprim = v1_volume_error_parseFromJSON(detach_error); //nonprimitive } - v1_volume_attachment_status_local_var = v1_volume_attachment_status_create ( + v1_volume_attachment_status_local_var = v1_volume_attachment_status_create_internal ( attach_error ? attach_error_local_nonprim : NULL, attached->valueint, attachment_metadata ? attachment_metadataList : NULL, @@ -194,7 +224,7 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * if (attachment_metadataList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, attachment_metadataList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_volume_attachment_status.h b/kubernetes/model/v1_volume_attachment_status.h index 48c32a31..23c18149 100644 --- a/kubernetes/model/v1_volume_attachment_status.h +++ b/kubernetes/model/v1_volume_attachment_status.h @@ -25,9 +25,10 @@ typedef struct v1_volume_attachment_status_t { list_t* attachment_metadata; //map struct v1_volume_error_t *detach_error; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_attachment_status_t; -v1_volume_attachment_status_t *v1_volume_attachment_status_create( +__attribute__((deprecated)) v1_volume_attachment_status_t *v1_volume_attachment_status_create( v1_volume_error_t *attach_error, int attached, list_t* attachment_metadata, diff --git a/kubernetes/model/v1_volume_attributes_class.c b/kubernetes/model/v1_volume_attributes_class.c new file mode 100644 index 00000000..803c3a60 --- /dev/null +++ b/kubernetes/model/v1_volume_attributes_class.c @@ -0,0 +1,268 @@ +#include +#include +#include +#include "v1_volume_attributes_class.h" + + + +static v1_volume_attributes_class_t *v1_volume_attributes_class_create_internal( + char *api_version, + char *driver_name, + char *kind, + v1_object_meta_t *metadata, + list_t* parameters + ) { + v1_volume_attributes_class_t *v1_volume_attributes_class_local_var = malloc(sizeof(v1_volume_attributes_class_t)); + if (!v1_volume_attributes_class_local_var) { + return NULL; + } + v1_volume_attributes_class_local_var->api_version = api_version; + v1_volume_attributes_class_local_var->driver_name = driver_name; + v1_volume_attributes_class_local_var->kind = kind; + v1_volume_attributes_class_local_var->metadata = metadata; + v1_volume_attributes_class_local_var->parameters = parameters; + + v1_volume_attributes_class_local_var->_library_owned = 1; + return v1_volume_attributes_class_local_var; +} + +__attribute__((deprecated)) v1_volume_attributes_class_t *v1_volume_attributes_class_create( + char *api_version, + char *driver_name, + char *kind, + v1_object_meta_t *metadata, + list_t* parameters + ) { + return v1_volume_attributes_class_create_internal ( + api_version, + driver_name, + kind, + metadata, + parameters + ); +} + +void v1_volume_attributes_class_free(v1_volume_attributes_class_t *v1_volume_attributes_class) { + if(NULL == v1_volume_attributes_class){ + return ; + } + if(v1_volume_attributes_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_attributes_class_free"); + return ; + } + listEntry_t *listEntry; + if (v1_volume_attributes_class->api_version) { + free(v1_volume_attributes_class->api_version); + v1_volume_attributes_class->api_version = NULL; + } + if (v1_volume_attributes_class->driver_name) { + free(v1_volume_attributes_class->driver_name); + v1_volume_attributes_class->driver_name = NULL; + } + if (v1_volume_attributes_class->kind) { + free(v1_volume_attributes_class->kind); + v1_volume_attributes_class->kind = NULL; + } + if (v1_volume_attributes_class->metadata) { + v1_object_meta_free(v1_volume_attributes_class->metadata); + v1_volume_attributes_class->metadata = NULL; + } + if (v1_volume_attributes_class->parameters) { + list_ForEach(listEntry, v1_volume_attributes_class->parameters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1_volume_attributes_class->parameters); + v1_volume_attributes_class->parameters = NULL; + } + free(v1_volume_attributes_class); +} + +cJSON *v1_volume_attributes_class_convertToJSON(v1_volume_attributes_class_t *v1_volume_attributes_class) { + cJSON *item = cJSON_CreateObject(); + + // v1_volume_attributes_class->api_version + if(v1_volume_attributes_class->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_volume_attributes_class->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_volume_attributes_class->driver_name + if (!v1_volume_attributes_class->driver_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driverName", v1_volume_attributes_class->driver_name) == NULL) { + goto fail; //String + } + + + // v1_volume_attributes_class->kind + if(v1_volume_attributes_class->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_volume_attributes_class->kind) == NULL) { + goto fail; //String + } + } + + + // v1_volume_attributes_class->metadata + if(v1_volume_attributes_class->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1_volume_attributes_class->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1_volume_attributes_class->parameters + if(v1_volume_attributes_class->parameters) { + cJSON *parameters = cJSON_AddObjectToObject(item, "parameters"); + if(parameters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = parameters; + listEntry_t *parametersListEntry; + if (v1_volume_attributes_class->parameters) { + list_ForEach(parametersListEntry, v1_volume_attributes_class->parameters) { + keyValuePair_t *localKeyValue = parametersListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_volume_attributes_class_t *v1_volume_attributes_class_parseFromJSON(cJSON *v1_volume_attributes_classJSON){ + + v1_volume_attributes_class_t *v1_volume_attributes_class_local_var = NULL; + + // define the local variable for v1_volume_attributes_class->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local map for v1_volume_attributes_class->parameters + list_t *parametersList = NULL; + + // v1_volume_attributes_class->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_volume_attributes_class->driver_name + cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_classJSON, "driverName"); + if (cJSON_IsNull(driver_name)) { + driver_name = NULL; + } + if (!driver_name) { + goto end; + } + + + if(!cJSON_IsString(driver_name)) + { + goto end; //String + } + + // v1_volume_attributes_class->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_volume_attributes_class->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1_volume_attributes_class->parameters + cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_classJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } + if (parameters) { + cJSON *parameters_local_map = NULL; + if(!cJSON_IsObject(parameters) && !cJSON_IsNull(parameters)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(parameters)) + { + parametersList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(parameters_local_map, parameters) + { + cJSON *localMapObject = parameters_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(parametersList , localMapKeyPair); + } + } + } + + + v1_volume_attributes_class_local_var = v1_volume_attributes_class_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + strdup(driver_name->valuestring), + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + parameters ? parametersList : NULL + ); + + return v1_volume_attributes_class_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (parametersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, parametersList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(parametersList); + parametersList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_volume_attributes_class.h b/kubernetes/model/v1_volume_attributes_class.h new file mode 100644 index 00000000..873e4452 --- /dev/null +++ b/kubernetes/model/v1_volume_attributes_class.h @@ -0,0 +1,47 @@ +/* + * v1_volume_attributes_class.h + * + * VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. + */ + +#ifndef _v1_volume_attributes_class_H_ +#define _v1_volume_attributes_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_volume_attributes_class_t v1_volume_attributes_class_t; + +#include "v1_object_meta.h" + + + +typedef struct v1_volume_attributes_class_t { + char *api_version; // string + char *driver_name; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + list_t* parameters; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1_volume_attributes_class_t; + +__attribute__((deprecated)) v1_volume_attributes_class_t *v1_volume_attributes_class_create( + char *api_version, + char *driver_name, + char *kind, + v1_object_meta_t *metadata, + list_t* parameters +); + +void v1_volume_attributes_class_free(v1_volume_attributes_class_t *v1_volume_attributes_class); + +v1_volume_attributes_class_t *v1_volume_attributes_class_parseFromJSON(cJSON *v1_volume_attributes_classJSON); + +cJSON *v1_volume_attributes_class_convertToJSON(v1_volume_attributes_class_t *v1_volume_attributes_class); + +#endif /* _v1_volume_attributes_class_H_ */ + diff --git a/kubernetes/model/v1_volume_attributes_class_list.c b/kubernetes/model/v1_volume_attributes_class_list.c new file mode 100644 index 00000000..3b6200d2 --- /dev/null +++ b/kubernetes/model/v1_volume_attributes_class_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1_volume_attributes_class_list.h" + + + +static v1_volume_attributes_class_list_t *v1_volume_attributes_class_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1_volume_attributes_class_list_t *v1_volume_attributes_class_list_local_var = malloc(sizeof(v1_volume_attributes_class_list_t)); + if (!v1_volume_attributes_class_list_local_var) { + return NULL; + } + v1_volume_attributes_class_list_local_var->api_version = api_version; + v1_volume_attributes_class_list_local_var->items = items; + v1_volume_attributes_class_list_local_var->kind = kind; + v1_volume_attributes_class_list_local_var->metadata = metadata; + + v1_volume_attributes_class_list_local_var->_library_owned = 1; + return v1_volume_attributes_class_list_local_var; +} + +__attribute__((deprecated)) v1_volume_attributes_class_list_t *v1_volume_attributes_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1_volume_attributes_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1_volume_attributes_class_list_free(v1_volume_attributes_class_list_t *v1_volume_attributes_class_list) { + if(NULL == v1_volume_attributes_class_list){ + return ; + } + if(v1_volume_attributes_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_attributes_class_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1_volume_attributes_class_list->api_version) { + free(v1_volume_attributes_class_list->api_version); + v1_volume_attributes_class_list->api_version = NULL; + } + if (v1_volume_attributes_class_list->items) { + list_ForEach(listEntry, v1_volume_attributes_class_list->items) { + v1_volume_attributes_class_free(listEntry->data); + } + list_freeList(v1_volume_attributes_class_list->items); + v1_volume_attributes_class_list->items = NULL; + } + if (v1_volume_attributes_class_list->kind) { + free(v1_volume_attributes_class_list->kind); + v1_volume_attributes_class_list->kind = NULL; + } + if (v1_volume_attributes_class_list->metadata) { + v1_list_meta_free(v1_volume_attributes_class_list->metadata); + v1_volume_attributes_class_list->metadata = NULL; + } + free(v1_volume_attributes_class_list); +} + +cJSON *v1_volume_attributes_class_list_convertToJSON(v1_volume_attributes_class_list_t *v1_volume_attributes_class_list) { + cJSON *item = cJSON_CreateObject(); + + // v1_volume_attributes_class_list->api_version + if(v1_volume_attributes_class_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1_volume_attributes_class_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1_volume_attributes_class_list->items + if (!v1_volume_attributes_class_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1_volume_attributes_class_list->items) { + list_ForEach(itemsListEntry, v1_volume_attributes_class_list->items) { + cJSON *itemLocal = v1_volume_attributes_class_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1_volume_attributes_class_list->kind + if(v1_volume_attributes_class_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1_volume_attributes_class_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1_volume_attributes_class_list->metadata + if(v1_volume_attributes_class_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1_volume_attributes_class_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1_volume_attributes_class_list_t *v1_volume_attributes_class_list_parseFromJSON(cJSON *v1_volume_attributes_class_listJSON){ + + v1_volume_attributes_class_list_t *v1_volume_attributes_class_list_local_var = NULL; + + // define the local list for v1_volume_attributes_class_list->items + list_t *itemsList = NULL; + + // define the local variable for v1_volume_attributes_class_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1_volume_attributes_class_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1_volume_attributes_class_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1_volume_attributes_class_t *itemsItem = v1_volume_attributes_class_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1_volume_attributes_class_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1_volume_attributes_class_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1_volume_attributes_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1_volume_attributes_class_list_local_var = v1_volume_attributes_class_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1_volume_attributes_class_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_volume_attributes_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1_volume_attributes_class_list.h b/kubernetes/model/v1_volume_attributes_class_list.h new file mode 100644 index 00000000..441b3b2c --- /dev/null +++ b/kubernetes/model/v1_volume_attributes_class_list.h @@ -0,0 +1,46 @@ +/* + * v1_volume_attributes_class_list.h + * + * VolumeAttributesClassList is a collection of VolumeAttributesClass objects. + */ + +#ifndef _v1_volume_attributes_class_list_H_ +#define _v1_volume_attributes_class_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1_volume_attributes_class_list_t v1_volume_attributes_class_list_t; + +#include "v1_list_meta.h" +#include "v1_volume_attributes_class.h" + + + +typedef struct v1_volume_attributes_class_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1_volume_attributes_class_list_t; + +__attribute__((deprecated)) v1_volume_attributes_class_list_t *v1_volume_attributes_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1_volume_attributes_class_list_free(v1_volume_attributes_class_list_t *v1_volume_attributes_class_list); + +v1_volume_attributes_class_list_t *v1_volume_attributes_class_list_parseFromJSON(cJSON *v1_volume_attributes_class_listJSON); + +cJSON *v1_volume_attributes_class_list_convertToJSON(v1_volume_attributes_class_list_t *v1_volume_attributes_class_list); + +#endif /* _v1_volume_attributes_class_list_H_ */ + diff --git a/kubernetes/model/v1_volume_device.c b/kubernetes/model/v1_volume_device.c index c08c4e4c..32336d29 100644 --- a/kubernetes/model/v1_volume_device.c +++ b/kubernetes/model/v1_volume_device.c @@ -5,7 +5,7 @@ -v1_volume_device_t *v1_volume_device_create( +static v1_volume_device_t *v1_volume_device_create_internal( char *device_path, char *name ) { @@ -16,14 +16,28 @@ v1_volume_device_t *v1_volume_device_create( v1_volume_device_local_var->device_path = device_path; v1_volume_device_local_var->name = name; + v1_volume_device_local_var->_library_owned = 1; return v1_volume_device_local_var; } +__attribute__((deprecated)) v1_volume_device_t *v1_volume_device_create( + char *device_path, + char *name + ) { + return v1_volume_device_create_internal ( + device_path, + name + ); +} void v1_volume_device_free(v1_volume_device_t *v1_volume_device) { if(NULL == v1_volume_device){ return ; } + if(v1_volume_device->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_device_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_device->device_path) { free(v1_volume_device->device_path); @@ -70,6 +84,9 @@ v1_volume_device_t *v1_volume_device_parseFromJSON(cJSON *v1_volume_deviceJSON){ // v1_volume_device->device_path cJSON *device_path = cJSON_GetObjectItemCaseSensitive(v1_volume_deviceJSON, "devicePath"); + if (cJSON_IsNull(device_path)) { + device_path = NULL; + } if (!device_path) { goto end; } @@ -82,6 +99,9 @@ v1_volume_device_t *v1_volume_device_parseFromJSON(cJSON *v1_volume_deviceJSON){ // v1_volume_device->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_volume_deviceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1_volume_device_t *v1_volume_device_parseFromJSON(cJSON *v1_volume_deviceJSON){ } - v1_volume_device_local_var = v1_volume_device_create ( + v1_volume_device_local_var = v1_volume_device_create_internal ( strdup(device_path->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1_volume_device.h b/kubernetes/model/v1_volume_device.h index 27431bd6..eb2488f0 100644 --- a/kubernetes/model/v1_volume_device.h +++ b/kubernetes/model/v1_volume_device.h @@ -22,9 +22,10 @@ typedef struct v1_volume_device_t { char *device_path; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_device_t; -v1_volume_device_t *v1_volume_device_create( +__attribute__((deprecated)) v1_volume_device_t *v1_volume_device_create( char *device_path, char *name ); diff --git a/kubernetes/model/v1_volume_error.c b/kubernetes/model/v1_volume_error.c index c1ac80a4..d50cba25 100644 --- a/kubernetes/model/v1_volume_error.c +++ b/kubernetes/model/v1_volume_error.c @@ -5,7 +5,8 @@ -v1_volume_error_t *v1_volume_error_create( +static v1_volume_error_t *v1_volume_error_create_internal( + int error_code, char *message, char *time ) { @@ -13,17 +14,34 @@ v1_volume_error_t *v1_volume_error_create( if (!v1_volume_error_local_var) { return NULL; } + v1_volume_error_local_var->error_code = error_code; v1_volume_error_local_var->message = message; v1_volume_error_local_var->time = time; + v1_volume_error_local_var->_library_owned = 1; return v1_volume_error_local_var; } +__attribute__((deprecated)) v1_volume_error_t *v1_volume_error_create( + int error_code, + char *message, + char *time + ) { + return v1_volume_error_create_internal ( + error_code, + message, + time + ); +} void v1_volume_error_free(v1_volume_error_t *v1_volume_error) { if(NULL == v1_volume_error){ return ; } + if(v1_volume_error->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_error_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_error->message) { free(v1_volume_error->message); @@ -39,6 +57,14 @@ void v1_volume_error_free(v1_volume_error_t *v1_volume_error) { cJSON *v1_volume_error_convertToJSON(v1_volume_error_t *v1_volume_error) { cJSON *item = cJSON_CreateObject(); + // v1_volume_error->error_code + if(v1_volume_error->error_code) { + if(cJSON_AddNumberToObject(item, "errorCode", v1_volume_error->error_code) == NULL) { + goto fail; //Numeric + } + } + + // v1_volume_error->message if(v1_volume_error->message) { if(cJSON_AddStringToObject(item, "message", v1_volume_error->message) == NULL) { @@ -66,8 +92,23 @@ v1_volume_error_t *v1_volume_error_parseFromJSON(cJSON *v1_volume_errorJSON){ v1_volume_error_t *v1_volume_error_local_var = NULL; + // v1_volume_error->error_code + cJSON *error_code = cJSON_GetObjectItemCaseSensitive(v1_volume_errorJSON, "errorCode"); + if (cJSON_IsNull(error_code)) { + error_code = NULL; + } + if (error_code) { + if(!cJSON_IsNumber(error_code)) + { + goto end; //Numeric + } + } + // v1_volume_error->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1_volume_errorJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -77,6 +118,9 @@ v1_volume_error_t *v1_volume_error_parseFromJSON(cJSON *v1_volume_errorJSON){ // v1_volume_error->time cJSON *time = cJSON_GetObjectItemCaseSensitive(v1_volume_errorJSON, "time"); + if (cJSON_IsNull(time)) { + time = NULL; + } if (time) { if(!cJSON_IsString(time) && !cJSON_IsNull(time)) { @@ -85,7 +129,8 @@ v1_volume_error_t *v1_volume_error_parseFromJSON(cJSON *v1_volume_errorJSON){ } - v1_volume_error_local_var = v1_volume_error_create ( + v1_volume_error_local_var = v1_volume_error_create_internal ( + error_code ? error_code->valuedouble : 0, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, time && !cJSON_IsNull(time) ? strdup(time->valuestring) : NULL ); diff --git a/kubernetes/model/v1_volume_error.h b/kubernetes/model/v1_volume_error.h index 0fc31c5a..b4210a8c 100644 --- a/kubernetes/model/v1_volume_error.h +++ b/kubernetes/model/v1_volume_error.h @@ -19,12 +19,15 @@ typedef struct v1_volume_error_t v1_volume_error_t; typedef struct v1_volume_error_t { + int error_code; //numeric char *message; // string char *time; //date time + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_error_t; -v1_volume_error_t *v1_volume_error_create( +__attribute__((deprecated)) v1_volume_error_t *v1_volume_error_create( + int error_code, char *message, char *time ); diff --git a/kubernetes/model/v1_volume_mount.c b/kubernetes/model/v1_volume_mount.c index 8ea6e865..1ec69005 100644 --- a/kubernetes/model/v1_volume_mount.c +++ b/kubernetes/model/v1_volume_mount.c @@ -5,7 +5,7 @@ -v1_volume_mount_t *v1_volume_mount_create( +static v1_volume_mount_t *v1_volume_mount_create_internal( char *mount_path, char *mount_propagation, char *name, @@ -26,14 +26,38 @@ v1_volume_mount_t *v1_volume_mount_create( v1_volume_mount_local_var->sub_path = sub_path; v1_volume_mount_local_var->sub_path_expr = sub_path_expr; + v1_volume_mount_local_var->_library_owned = 1; return v1_volume_mount_local_var; } +__attribute__((deprecated)) v1_volume_mount_t *v1_volume_mount_create( + char *mount_path, + char *mount_propagation, + char *name, + int read_only, + char *recursive_read_only, + char *sub_path, + char *sub_path_expr + ) { + return v1_volume_mount_create_internal ( + mount_path, + mount_propagation, + name, + read_only, + recursive_read_only, + sub_path, + sub_path_expr + ); +} void v1_volume_mount_free(v1_volume_mount_t *v1_volume_mount) { if(NULL == v1_volume_mount){ return ; } + if(v1_volume_mount->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_mount_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_mount->mount_path) { free(v1_volume_mount->mount_path); @@ -136,6 +160,9 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ // v1_volume_mount->mount_path cJSON *mount_path = cJSON_GetObjectItemCaseSensitive(v1_volume_mountJSON, "mountPath"); + if (cJSON_IsNull(mount_path)) { + mount_path = NULL; + } if (!mount_path) { goto end; } @@ -148,6 +175,9 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ // v1_volume_mount->mount_propagation cJSON *mount_propagation = cJSON_GetObjectItemCaseSensitive(v1_volume_mountJSON, "mountPropagation"); + if (cJSON_IsNull(mount_propagation)) { + mount_propagation = NULL; + } if (mount_propagation) { if(!cJSON_IsString(mount_propagation) && !cJSON_IsNull(mount_propagation)) { @@ -157,6 +187,9 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ // v1_volume_mount->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_volume_mountJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -169,6 +202,9 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ // v1_volume_mount->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_volume_mountJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -178,6 +214,9 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ // v1_volume_mount->recursive_read_only cJSON *recursive_read_only = cJSON_GetObjectItemCaseSensitive(v1_volume_mountJSON, "recursiveReadOnly"); + if (cJSON_IsNull(recursive_read_only)) { + recursive_read_only = NULL; + } if (recursive_read_only) { if(!cJSON_IsString(recursive_read_only) && !cJSON_IsNull(recursive_read_only)) { @@ -187,6 +226,9 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ // v1_volume_mount->sub_path cJSON *sub_path = cJSON_GetObjectItemCaseSensitive(v1_volume_mountJSON, "subPath"); + if (cJSON_IsNull(sub_path)) { + sub_path = NULL; + } if (sub_path) { if(!cJSON_IsString(sub_path) && !cJSON_IsNull(sub_path)) { @@ -196,6 +238,9 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ // v1_volume_mount->sub_path_expr cJSON *sub_path_expr = cJSON_GetObjectItemCaseSensitive(v1_volume_mountJSON, "subPathExpr"); + if (cJSON_IsNull(sub_path_expr)) { + sub_path_expr = NULL; + } if (sub_path_expr) { if(!cJSON_IsString(sub_path_expr) && !cJSON_IsNull(sub_path_expr)) { @@ -204,7 +249,7 @@ v1_volume_mount_t *v1_volume_mount_parseFromJSON(cJSON *v1_volume_mountJSON){ } - v1_volume_mount_local_var = v1_volume_mount_create ( + v1_volume_mount_local_var = v1_volume_mount_create_internal ( strdup(mount_path->valuestring), mount_propagation && !cJSON_IsNull(mount_propagation) ? strdup(mount_propagation->valuestring) : NULL, strdup(name->valuestring), diff --git a/kubernetes/model/v1_volume_mount.h b/kubernetes/model/v1_volume_mount.h index d27dcf1b..e5cbfc13 100644 --- a/kubernetes/model/v1_volume_mount.h +++ b/kubernetes/model/v1_volume_mount.h @@ -27,9 +27,10 @@ typedef struct v1_volume_mount_t { char *sub_path; // string char *sub_path_expr; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_mount_t; -v1_volume_mount_t *v1_volume_mount_create( +__attribute__((deprecated)) v1_volume_mount_t *v1_volume_mount_create( char *mount_path, char *mount_propagation, char *name, diff --git a/kubernetes/model/v1_volume_mount_status.c b/kubernetes/model/v1_volume_mount_status.c index 3bf2e80e..1b67d77f 100644 --- a/kubernetes/model/v1_volume_mount_status.c +++ b/kubernetes/model/v1_volume_mount_status.c @@ -5,7 +5,7 @@ -v1_volume_mount_status_t *v1_volume_mount_status_create( +static v1_volume_mount_status_t *v1_volume_mount_status_create_internal( char *mount_path, char *name, int read_only, @@ -20,14 +20,32 @@ v1_volume_mount_status_t *v1_volume_mount_status_create( v1_volume_mount_status_local_var->read_only = read_only; v1_volume_mount_status_local_var->recursive_read_only = recursive_read_only; + v1_volume_mount_status_local_var->_library_owned = 1; return v1_volume_mount_status_local_var; } +__attribute__((deprecated)) v1_volume_mount_status_t *v1_volume_mount_status_create( + char *mount_path, + char *name, + int read_only, + char *recursive_read_only + ) { + return v1_volume_mount_status_create_internal ( + mount_path, + name, + read_only, + recursive_read_only + ); +} void v1_volume_mount_status_free(v1_volume_mount_status_t *v1_volume_mount_status) { if(NULL == v1_volume_mount_status){ return ; } + if(v1_volume_mount_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_mount_status_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_mount_status->mount_path) { free(v1_volume_mount_status->mount_path); @@ -94,6 +112,9 @@ v1_volume_mount_status_t *v1_volume_mount_status_parseFromJSON(cJSON *v1_volume_ // v1_volume_mount_status->mount_path cJSON *mount_path = cJSON_GetObjectItemCaseSensitive(v1_volume_mount_statusJSON, "mountPath"); + if (cJSON_IsNull(mount_path)) { + mount_path = NULL; + } if (!mount_path) { goto end; } @@ -106,6 +127,9 @@ v1_volume_mount_status_t *v1_volume_mount_status_parseFromJSON(cJSON *v1_volume_ // v1_volume_mount_status->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1_volume_mount_statusJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -118,6 +142,9 @@ v1_volume_mount_status_t *v1_volume_mount_status_parseFromJSON(cJSON *v1_volume_ // v1_volume_mount_status->read_only cJSON *read_only = cJSON_GetObjectItemCaseSensitive(v1_volume_mount_statusJSON, "readOnly"); + if (cJSON_IsNull(read_only)) { + read_only = NULL; + } if (read_only) { if(!cJSON_IsBool(read_only)) { @@ -127,6 +154,9 @@ v1_volume_mount_status_t *v1_volume_mount_status_parseFromJSON(cJSON *v1_volume_ // v1_volume_mount_status->recursive_read_only cJSON *recursive_read_only = cJSON_GetObjectItemCaseSensitive(v1_volume_mount_statusJSON, "recursiveReadOnly"); + if (cJSON_IsNull(recursive_read_only)) { + recursive_read_only = NULL; + } if (recursive_read_only) { if(!cJSON_IsString(recursive_read_only) && !cJSON_IsNull(recursive_read_only)) { @@ -135,7 +165,7 @@ v1_volume_mount_status_t *v1_volume_mount_status_parseFromJSON(cJSON *v1_volume_ } - v1_volume_mount_status_local_var = v1_volume_mount_status_create ( + v1_volume_mount_status_local_var = v1_volume_mount_status_create_internal ( strdup(mount_path->valuestring), strdup(name->valuestring), read_only ? read_only->valueint : 0, diff --git a/kubernetes/model/v1_volume_mount_status.h b/kubernetes/model/v1_volume_mount_status.h index 2191c978..f2121475 100644 --- a/kubernetes/model/v1_volume_mount_status.h +++ b/kubernetes/model/v1_volume_mount_status.h @@ -24,9 +24,10 @@ typedef struct v1_volume_mount_status_t { int read_only; //boolean char *recursive_read_only; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_mount_status_t; -v1_volume_mount_status_t *v1_volume_mount_status_create( +__attribute__((deprecated)) v1_volume_mount_status_t *v1_volume_mount_status_create( char *mount_path, char *name, int read_only, diff --git a/kubernetes/model/v1_volume_node_affinity.c b/kubernetes/model/v1_volume_node_affinity.c index dcb74e98..b4c2cb3d 100644 --- a/kubernetes/model/v1_volume_node_affinity.c +++ b/kubernetes/model/v1_volume_node_affinity.c @@ -5,7 +5,7 @@ -v1_volume_node_affinity_t *v1_volume_node_affinity_create( +static v1_volume_node_affinity_t *v1_volume_node_affinity_create_internal( v1_node_selector_t *required ) { v1_volume_node_affinity_t *v1_volume_node_affinity_local_var = malloc(sizeof(v1_volume_node_affinity_t)); @@ -14,14 +14,26 @@ v1_volume_node_affinity_t *v1_volume_node_affinity_create( } v1_volume_node_affinity_local_var->required = required; + v1_volume_node_affinity_local_var->_library_owned = 1; return v1_volume_node_affinity_local_var; } +__attribute__((deprecated)) v1_volume_node_affinity_t *v1_volume_node_affinity_create( + v1_node_selector_t *required + ) { + return v1_volume_node_affinity_create_internal ( + required + ); +} void v1_volume_node_affinity_free(v1_volume_node_affinity_t *v1_volume_node_affinity) { if(NULL == v1_volume_node_affinity){ return ; } + if(v1_volume_node_affinity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_node_affinity_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_node_affinity->required) { v1_node_selector_free(v1_volume_node_affinity->required); @@ -62,12 +74,15 @@ v1_volume_node_affinity_t *v1_volume_node_affinity_parseFromJSON(cJSON *v1_volum // v1_volume_node_affinity->required cJSON *required = cJSON_GetObjectItemCaseSensitive(v1_volume_node_affinityJSON, "required"); + if (cJSON_IsNull(required)) { + required = NULL; + } if (required) { required_local_nonprim = v1_node_selector_parseFromJSON(required); //nonprimitive } - v1_volume_node_affinity_local_var = v1_volume_node_affinity_create ( + v1_volume_node_affinity_local_var = v1_volume_node_affinity_create_internal ( required ? required_local_nonprim : NULL ); diff --git a/kubernetes/model/v1_volume_node_affinity.h b/kubernetes/model/v1_volume_node_affinity.h index c9ddbe93..4abb24e2 100644 --- a/kubernetes/model/v1_volume_node_affinity.h +++ b/kubernetes/model/v1_volume_node_affinity.h @@ -22,9 +22,10 @@ typedef struct v1_volume_node_affinity_t v1_volume_node_affinity_t; typedef struct v1_volume_node_affinity_t { struct v1_node_selector_t *required; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_node_affinity_t; -v1_volume_node_affinity_t *v1_volume_node_affinity_create( +__attribute__((deprecated)) v1_volume_node_affinity_t *v1_volume_node_affinity_create( v1_node_selector_t *required ); diff --git a/kubernetes/model/v1_volume_node_resources.c b/kubernetes/model/v1_volume_node_resources.c index a3701e3e..9febce63 100644 --- a/kubernetes/model/v1_volume_node_resources.c +++ b/kubernetes/model/v1_volume_node_resources.c @@ -5,7 +5,7 @@ -v1_volume_node_resources_t *v1_volume_node_resources_create( +static v1_volume_node_resources_t *v1_volume_node_resources_create_internal( int count ) { v1_volume_node_resources_t *v1_volume_node_resources_local_var = malloc(sizeof(v1_volume_node_resources_t)); @@ -14,14 +14,26 @@ v1_volume_node_resources_t *v1_volume_node_resources_create( } v1_volume_node_resources_local_var->count = count; + v1_volume_node_resources_local_var->_library_owned = 1; return v1_volume_node_resources_local_var; } +__attribute__((deprecated)) v1_volume_node_resources_t *v1_volume_node_resources_create( + int count + ) { + return v1_volume_node_resources_create_internal ( + count + ); +} void v1_volume_node_resources_free(v1_volume_node_resources_t *v1_volume_node_resources) { if(NULL == v1_volume_node_resources){ return ; } + if(v1_volume_node_resources->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_node_resources_free"); + return ; + } listEntry_t *listEntry; free(v1_volume_node_resources); } @@ -50,6 +62,9 @@ v1_volume_node_resources_t *v1_volume_node_resources_parseFromJSON(cJSON *v1_vol // v1_volume_node_resources->count cJSON *count = cJSON_GetObjectItemCaseSensitive(v1_volume_node_resourcesJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } if (count) { if(!cJSON_IsNumber(count)) { @@ -58,7 +73,7 @@ v1_volume_node_resources_t *v1_volume_node_resources_parseFromJSON(cJSON *v1_vol } - v1_volume_node_resources_local_var = v1_volume_node_resources_create ( + v1_volume_node_resources_local_var = v1_volume_node_resources_create_internal ( count ? count->valuedouble : 0 ); diff --git a/kubernetes/model/v1_volume_node_resources.h b/kubernetes/model/v1_volume_node_resources.h index 0275bfe0..e995ed7b 100644 --- a/kubernetes/model/v1_volume_node_resources.h +++ b/kubernetes/model/v1_volume_node_resources.h @@ -21,9 +21,10 @@ typedef struct v1_volume_node_resources_t v1_volume_node_resources_t; typedef struct v1_volume_node_resources_t { int count; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_node_resources_t; -v1_volume_node_resources_t *v1_volume_node_resources_create( +__attribute__((deprecated)) v1_volume_node_resources_t *v1_volume_node_resources_create( int count ); diff --git a/kubernetes/model/v1_volume_projection.c b/kubernetes/model/v1_volume_projection.c index 20061317..38fc2412 100644 --- a/kubernetes/model/v1_volume_projection.c +++ b/kubernetes/model/v1_volume_projection.c @@ -5,10 +5,11 @@ -v1_volume_projection_t *v1_volume_projection_create( +static v1_volume_projection_t *v1_volume_projection_create_internal( v1_cluster_trust_bundle_projection_t *cluster_trust_bundle, v1_config_map_projection_t *config_map, v1_downward_api_projection_t *downward_api, + v1_pod_certificate_projection_t *pod_certificate, v1_secret_projection_t *secret, v1_service_account_token_projection_t *service_account_token ) { @@ -19,17 +20,40 @@ v1_volume_projection_t *v1_volume_projection_create( v1_volume_projection_local_var->cluster_trust_bundle = cluster_trust_bundle; v1_volume_projection_local_var->config_map = config_map; v1_volume_projection_local_var->downward_api = downward_api; + v1_volume_projection_local_var->pod_certificate = pod_certificate; v1_volume_projection_local_var->secret = secret; v1_volume_projection_local_var->service_account_token = service_account_token; + v1_volume_projection_local_var->_library_owned = 1; return v1_volume_projection_local_var; } +__attribute__((deprecated)) v1_volume_projection_t *v1_volume_projection_create( + v1_cluster_trust_bundle_projection_t *cluster_trust_bundle, + v1_config_map_projection_t *config_map, + v1_downward_api_projection_t *downward_api, + v1_pod_certificate_projection_t *pod_certificate, + v1_secret_projection_t *secret, + v1_service_account_token_projection_t *service_account_token + ) { + return v1_volume_projection_create_internal ( + cluster_trust_bundle, + config_map, + downward_api, + pod_certificate, + secret, + service_account_token + ); +} void v1_volume_projection_free(v1_volume_projection_t *v1_volume_projection) { if(NULL == v1_volume_projection){ return ; } + if(v1_volume_projection->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_projection_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_projection->cluster_trust_bundle) { v1_cluster_trust_bundle_projection_free(v1_volume_projection->cluster_trust_bundle); @@ -43,6 +67,10 @@ void v1_volume_projection_free(v1_volume_projection_t *v1_volume_projection) { v1_downward_api_projection_free(v1_volume_projection->downward_api); v1_volume_projection->downward_api = NULL; } + if (v1_volume_projection->pod_certificate) { + v1_pod_certificate_projection_free(v1_volume_projection->pod_certificate); + v1_volume_projection->pod_certificate = NULL; + } if (v1_volume_projection->secret) { v1_secret_projection_free(v1_volume_projection->secret); v1_volume_projection->secret = NULL; @@ -96,6 +124,19 @@ cJSON *v1_volume_projection_convertToJSON(v1_volume_projection_t *v1_volume_proj } + // v1_volume_projection->pod_certificate + if(v1_volume_projection->pod_certificate) { + cJSON *pod_certificate_local_JSON = v1_pod_certificate_projection_convertToJSON(v1_volume_projection->pod_certificate); + if(pod_certificate_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "podCertificate", pod_certificate_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + // v1_volume_projection->secret if(v1_volume_projection->secret) { cJSON *secret_local_JSON = v1_secret_projection_convertToJSON(v1_volume_projection->secret); @@ -142,6 +183,9 @@ v1_volume_projection_t *v1_volume_projection_parseFromJSON(cJSON *v1_volume_proj // define the local variable for v1_volume_projection->downward_api v1_downward_api_projection_t *downward_api_local_nonprim = NULL; + // define the local variable for v1_volume_projection->pod_certificate + v1_pod_certificate_projection_t *pod_certificate_local_nonprim = NULL; + // define the local variable for v1_volume_projection->secret v1_secret_projection_t *secret_local_nonprim = NULL; @@ -150,39 +194,64 @@ v1_volume_projection_t *v1_volume_projection_parseFromJSON(cJSON *v1_volume_proj // v1_volume_projection->cluster_trust_bundle cJSON *cluster_trust_bundle = cJSON_GetObjectItemCaseSensitive(v1_volume_projectionJSON, "clusterTrustBundle"); + if (cJSON_IsNull(cluster_trust_bundle)) { + cluster_trust_bundle = NULL; + } if (cluster_trust_bundle) { cluster_trust_bundle_local_nonprim = v1_cluster_trust_bundle_projection_parseFromJSON(cluster_trust_bundle); //nonprimitive } // v1_volume_projection->config_map cJSON *config_map = cJSON_GetObjectItemCaseSensitive(v1_volume_projectionJSON, "configMap"); + if (cJSON_IsNull(config_map)) { + config_map = NULL; + } if (config_map) { config_map_local_nonprim = v1_config_map_projection_parseFromJSON(config_map); //nonprimitive } // v1_volume_projection->downward_api cJSON *downward_api = cJSON_GetObjectItemCaseSensitive(v1_volume_projectionJSON, "downwardAPI"); + if (cJSON_IsNull(downward_api)) { + downward_api = NULL; + } if (downward_api) { downward_api_local_nonprim = v1_downward_api_projection_parseFromJSON(downward_api); //nonprimitive } + // v1_volume_projection->pod_certificate + cJSON *pod_certificate = cJSON_GetObjectItemCaseSensitive(v1_volume_projectionJSON, "podCertificate"); + if (cJSON_IsNull(pod_certificate)) { + pod_certificate = NULL; + } + if (pod_certificate) { + pod_certificate_local_nonprim = v1_pod_certificate_projection_parseFromJSON(pod_certificate); //nonprimitive + } + // v1_volume_projection->secret cJSON *secret = cJSON_GetObjectItemCaseSensitive(v1_volume_projectionJSON, "secret"); + if (cJSON_IsNull(secret)) { + secret = NULL; + } if (secret) { secret_local_nonprim = v1_secret_projection_parseFromJSON(secret); //nonprimitive } // v1_volume_projection->service_account_token cJSON *service_account_token = cJSON_GetObjectItemCaseSensitive(v1_volume_projectionJSON, "serviceAccountToken"); + if (cJSON_IsNull(service_account_token)) { + service_account_token = NULL; + } if (service_account_token) { service_account_token_local_nonprim = v1_service_account_token_projection_parseFromJSON(service_account_token); //nonprimitive } - v1_volume_projection_local_var = v1_volume_projection_create ( + v1_volume_projection_local_var = v1_volume_projection_create_internal ( cluster_trust_bundle ? cluster_trust_bundle_local_nonprim : NULL, config_map ? config_map_local_nonprim : NULL, downward_api ? downward_api_local_nonprim : NULL, + pod_certificate ? pod_certificate_local_nonprim : NULL, secret ? secret_local_nonprim : NULL, service_account_token ? service_account_token_local_nonprim : NULL ); @@ -201,6 +270,10 @@ v1_volume_projection_t *v1_volume_projection_parseFromJSON(cJSON *v1_volume_proj v1_downward_api_projection_free(downward_api_local_nonprim); downward_api_local_nonprim = NULL; } + if (pod_certificate_local_nonprim) { + v1_pod_certificate_projection_free(pod_certificate_local_nonprim); + pod_certificate_local_nonprim = NULL; + } if (secret_local_nonprim) { v1_secret_projection_free(secret_local_nonprim); secret_local_nonprim = NULL; diff --git a/kubernetes/model/v1_volume_projection.h b/kubernetes/model/v1_volume_projection.h index 097b06cd..dcd77a72 100644 --- a/kubernetes/model/v1_volume_projection.h +++ b/kubernetes/model/v1_volume_projection.h @@ -1,7 +1,7 @@ /* * v1_volume_projection.h * - * Projection that may be projected along with other supported volume types + * Projection that may be projected along with other supported volume types. Exactly one of these fields must be set. */ #ifndef _v1_volume_projection_H_ @@ -18,6 +18,7 @@ typedef struct v1_volume_projection_t v1_volume_projection_t; #include "v1_cluster_trust_bundle_projection.h" #include "v1_config_map_projection.h" #include "v1_downward_api_projection.h" +#include "v1_pod_certificate_projection.h" #include "v1_secret_projection.h" #include "v1_service_account_token_projection.h" @@ -27,15 +28,18 @@ typedef struct v1_volume_projection_t { struct v1_cluster_trust_bundle_projection_t *cluster_trust_bundle; //model struct v1_config_map_projection_t *config_map; //model struct v1_downward_api_projection_t *downward_api; //model + struct v1_pod_certificate_projection_t *pod_certificate; //model struct v1_secret_projection_t *secret; //model struct v1_service_account_token_projection_t *service_account_token; //model + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_projection_t; -v1_volume_projection_t *v1_volume_projection_create( +__attribute__((deprecated)) v1_volume_projection_t *v1_volume_projection_create( v1_cluster_trust_bundle_projection_t *cluster_trust_bundle, v1_config_map_projection_t *config_map, v1_downward_api_projection_t *downward_api, + v1_pod_certificate_projection_t *pod_certificate, v1_secret_projection_t *secret, v1_service_account_token_projection_t *service_account_token ); diff --git a/kubernetes/model/v1_volume_resource_requirements.c b/kubernetes/model/v1_volume_resource_requirements.c index 05652dcf..058d35b6 100644 --- a/kubernetes/model/v1_volume_resource_requirements.c +++ b/kubernetes/model/v1_volume_resource_requirements.c @@ -5,7 +5,7 @@ -v1_volume_resource_requirements_t *v1_volume_resource_requirements_create( +static v1_volume_resource_requirements_t *v1_volume_resource_requirements_create_internal( list_t* limits, list_t* requests ) { @@ -16,18 +16,32 @@ v1_volume_resource_requirements_t *v1_volume_resource_requirements_create( v1_volume_resource_requirements_local_var->limits = limits; v1_volume_resource_requirements_local_var->requests = requests; + v1_volume_resource_requirements_local_var->_library_owned = 1; return v1_volume_resource_requirements_local_var; } +__attribute__((deprecated)) v1_volume_resource_requirements_t *v1_volume_resource_requirements_create( + list_t* limits, + list_t* requests + ) { + return v1_volume_resource_requirements_create_internal ( + limits, + requests + ); +} void v1_volume_resource_requirements_free(v1_volume_resource_requirements_t *v1_volume_resource_requirements) { if(NULL == v1_volume_resource_requirements){ return ; } + if(v1_volume_resource_requirements->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_volume_resource_requirements_free"); + return ; + } listEntry_t *listEntry; if (v1_volume_resource_requirements->limits) { list_ForEach(listEntry, v1_volume_resource_requirements->limits) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -37,7 +51,7 @@ void v1_volume_resource_requirements_free(v1_volume_resource_requirements_t *v1_ } if (v1_volume_resource_requirements->requests) { list_ForEach(listEntry, v1_volume_resource_requirements->requests) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -61,8 +75,8 @@ cJSON *v1_volume_resource_requirements_convertToJSON(v1_volume_resource_requirem listEntry_t *limitsListEntry; if (v1_volume_resource_requirements->limits) { list_ForEach(limitsListEntry, v1_volume_resource_requirements->limits) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)limitsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = limitsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -81,8 +95,8 @@ cJSON *v1_volume_resource_requirements_convertToJSON(v1_volume_resource_requirem listEntry_t *requestsListEntry; if (v1_volume_resource_requirements->requests) { list_ForEach(requestsListEntry, v1_volume_resource_requirements->requests) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)requestsListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = requestsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -110,6 +124,9 @@ v1_volume_resource_requirements_t *v1_volume_resource_requirements_parseFromJSON // v1_volume_resource_requirements->limits cJSON *limits = cJSON_GetObjectItemCaseSensitive(v1_volume_resource_requirementsJSON, "limits"); + if (cJSON_IsNull(limits)) { + limits = NULL; + } if (limits) { cJSON *limits_local_map = NULL; if(!cJSON_IsObject(limits) && !cJSON_IsNull(limits)) @@ -135,6 +152,9 @@ v1_volume_resource_requirements_t *v1_volume_resource_requirements_parseFromJSON // v1_volume_resource_requirements->requests cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_volume_resource_requirementsJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } if (requests) { cJSON *requests_local_map = NULL; if(!cJSON_IsObject(requests) && !cJSON_IsNull(requests)) @@ -159,7 +179,7 @@ v1_volume_resource_requirements_t *v1_volume_resource_requirements_parseFromJSON } - v1_volume_resource_requirements_local_var = v1_volume_resource_requirements_create ( + v1_volume_resource_requirements_local_var = v1_volume_resource_requirements_create_internal ( limits ? limitsList : NULL, requests ? requestsList : NULL ); @@ -169,7 +189,7 @@ v1_volume_resource_requirements_t *v1_volume_resource_requirements_parseFromJSON if (limitsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, limitsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); @@ -183,7 +203,7 @@ v1_volume_resource_requirements_t *v1_volume_resource_requirements_parseFromJSON if (requestsList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, requestsList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1_volume_resource_requirements.h b/kubernetes/model/v1_volume_resource_requirements.h index 0b21a31b..4e483286 100644 --- a/kubernetes/model/v1_volume_resource_requirements.h +++ b/kubernetes/model/v1_volume_resource_requirements.h @@ -22,9 +22,10 @@ typedef struct v1_volume_resource_requirements_t { list_t* limits; //map list_t* requests; //map + int _library_owned; // Is the library responsible for freeing this object? } v1_volume_resource_requirements_t; -v1_volume_resource_requirements_t *v1_volume_resource_requirements_create( +__attribute__((deprecated)) v1_volume_resource_requirements_t *v1_volume_resource_requirements_create( list_t* limits, list_t* requests ); diff --git a/kubernetes/model/v1_vsphere_virtual_disk_volume_source.c b/kubernetes/model/v1_vsphere_virtual_disk_volume_source.c index d8141f35..a29e9752 100644 --- a/kubernetes/model/v1_vsphere_virtual_disk_volume_source.c +++ b/kubernetes/model/v1_vsphere_virtual_disk_volume_source.c @@ -5,7 +5,7 @@ -v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_create( +static v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_create_internal( char *fs_type, char *storage_policy_id, char *storage_policy_name, @@ -20,14 +20,32 @@ v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_c v1_vsphere_virtual_disk_volume_source_local_var->storage_policy_name = storage_policy_name; v1_vsphere_virtual_disk_volume_source_local_var->volume_path = volume_path; + v1_vsphere_virtual_disk_volume_source_local_var->_library_owned = 1; return v1_vsphere_virtual_disk_volume_source_local_var; } +__attribute__((deprecated)) v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_create( + char *fs_type, + char *storage_policy_id, + char *storage_policy_name, + char *volume_path + ) { + return v1_vsphere_virtual_disk_volume_source_create_internal ( + fs_type, + storage_policy_id, + storage_policy_name, + volume_path + ); +} void v1_vsphere_virtual_disk_volume_source_free(v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source) { if(NULL == v1_vsphere_virtual_disk_volume_source){ return ; } + if(v1_vsphere_virtual_disk_volume_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_vsphere_virtual_disk_volume_source_free"); + return ; + } listEntry_t *listEntry; if (v1_vsphere_virtual_disk_volume_source->fs_type) { free(v1_vsphere_virtual_disk_volume_source->fs_type); @@ -97,6 +115,9 @@ v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_p // v1_vsphere_virtual_disk_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_vsphere_virtual_disk_volume_sourceJSON, "fsType"); + if (cJSON_IsNull(fs_type)) { + fs_type = NULL; + } if (fs_type) { if(!cJSON_IsString(fs_type) && !cJSON_IsNull(fs_type)) { @@ -106,6 +127,9 @@ v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_p // v1_vsphere_virtual_disk_volume_source->storage_policy_id cJSON *storage_policy_id = cJSON_GetObjectItemCaseSensitive(v1_vsphere_virtual_disk_volume_sourceJSON, "storagePolicyID"); + if (cJSON_IsNull(storage_policy_id)) { + storage_policy_id = NULL; + } if (storage_policy_id) { if(!cJSON_IsString(storage_policy_id) && !cJSON_IsNull(storage_policy_id)) { @@ -115,6 +139,9 @@ v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_p // v1_vsphere_virtual_disk_volume_source->storage_policy_name cJSON *storage_policy_name = cJSON_GetObjectItemCaseSensitive(v1_vsphere_virtual_disk_volume_sourceJSON, "storagePolicyName"); + if (cJSON_IsNull(storage_policy_name)) { + storage_policy_name = NULL; + } if (storage_policy_name) { if(!cJSON_IsString(storage_policy_name) && !cJSON_IsNull(storage_policy_name)) { @@ -124,6 +151,9 @@ v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_p // v1_vsphere_virtual_disk_volume_source->volume_path cJSON *volume_path = cJSON_GetObjectItemCaseSensitive(v1_vsphere_virtual_disk_volume_sourceJSON, "volumePath"); + if (cJSON_IsNull(volume_path)) { + volume_path = NULL; + } if (!volume_path) { goto end; } @@ -135,7 +165,7 @@ v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_p } - v1_vsphere_virtual_disk_volume_source_local_var = v1_vsphere_virtual_disk_volume_source_create ( + v1_vsphere_virtual_disk_volume_source_local_var = v1_vsphere_virtual_disk_volume_source_create_internal ( fs_type && !cJSON_IsNull(fs_type) ? strdup(fs_type->valuestring) : NULL, storage_policy_id && !cJSON_IsNull(storage_policy_id) ? strdup(storage_policy_id->valuestring) : NULL, storage_policy_name && !cJSON_IsNull(storage_policy_name) ? strdup(storage_policy_name->valuestring) : NULL, diff --git a/kubernetes/model/v1_vsphere_virtual_disk_volume_source.h b/kubernetes/model/v1_vsphere_virtual_disk_volume_source.h index 1f0187a4..87801e5e 100644 --- a/kubernetes/model/v1_vsphere_virtual_disk_volume_source.h +++ b/kubernetes/model/v1_vsphere_virtual_disk_volume_source.h @@ -24,9 +24,10 @@ typedef struct v1_vsphere_virtual_disk_volume_source_t { char *storage_policy_name; // string char *volume_path; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_vsphere_virtual_disk_volume_source_t; -v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_create( +__attribute__((deprecated)) v1_vsphere_virtual_disk_volume_source_t *v1_vsphere_virtual_disk_volume_source_create( char *fs_type, char *storage_policy_id, char *storage_policy_name, diff --git a/kubernetes/model/v1_watch_event.c b/kubernetes/model/v1_watch_event.c index e23f722c..40b99fa0 100644 --- a/kubernetes/model/v1_watch_event.c +++ b/kubernetes/model/v1_watch_event.c @@ -5,7 +5,7 @@ -v1_watch_event_t *v1_watch_event_create( +static v1_watch_event_t *v1_watch_event_create_internal( object_t *object, char *type ) { @@ -16,14 +16,28 @@ v1_watch_event_t *v1_watch_event_create( v1_watch_event_local_var->object = object; v1_watch_event_local_var->type = type; + v1_watch_event_local_var->_library_owned = 1; return v1_watch_event_local_var; } +__attribute__((deprecated)) v1_watch_event_t *v1_watch_event_create( + object_t *object, + char *type + ) { + return v1_watch_event_create_internal ( + object, + type + ); +} void v1_watch_event_free(v1_watch_event_t *v1_watch_event) { if(NULL == v1_watch_event){ return ; } + if(v1_watch_event->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_watch_event_free"); + return ; + } listEntry_t *listEntry; if (v1_watch_event->object) { object_free(v1_watch_event->object); @@ -75,6 +89,9 @@ v1_watch_event_t *v1_watch_event_parseFromJSON(cJSON *v1_watch_eventJSON){ // v1_watch_event->object cJSON *object = cJSON_GetObjectItemCaseSensitive(v1_watch_eventJSON, "object"); + if (cJSON_IsNull(object)) { + object = NULL; + } if (!object) { goto end; } @@ -85,6 +102,9 @@ v1_watch_event_t *v1_watch_event_parseFromJSON(cJSON *v1_watch_eventJSON){ // v1_watch_event->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1_watch_eventJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -96,7 +116,7 @@ v1_watch_event_t *v1_watch_event_parseFromJSON(cJSON *v1_watch_eventJSON){ } - v1_watch_event_local_var = v1_watch_event_create ( + v1_watch_event_local_var = v1_watch_event_create_internal ( object_local_object, strdup(type->valuestring) ); diff --git a/kubernetes/model/v1_watch_event.h b/kubernetes/model/v1_watch_event.h index 8e484de5..4a273a34 100644 --- a/kubernetes/model/v1_watch_event.h +++ b/kubernetes/model/v1_watch_event.h @@ -23,9 +23,10 @@ typedef struct v1_watch_event_t { object_t *object; //object char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_watch_event_t; -v1_watch_event_t *v1_watch_event_create( +__attribute__((deprecated)) v1_watch_event_t *v1_watch_event_create( object_t *object, char *type ); diff --git a/kubernetes/model/v1_webhook_conversion.c b/kubernetes/model/v1_webhook_conversion.c index 507905a6..dab0e7e0 100644 --- a/kubernetes/model/v1_webhook_conversion.c +++ b/kubernetes/model/v1_webhook_conversion.c @@ -5,7 +5,7 @@ -v1_webhook_conversion_t *v1_webhook_conversion_create( +static v1_webhook_conversion_t *v1_webhook_conversion_create_internal( apiextensions_v1_webhook_client_config_t *client_config, list_t *conversion_review_versions ) { @@ -16,14 +16,28 @@ v1_webhook_conversion_t *v1_webhook_conversion_create( v1_webhook_conversion_local_var->client_config = client_config; v1_webhook_conversion_local_var->conversion_review_versions = conversion_review_versions; + v1_webhook_conversion_local_var->_library_owned = 1; return v1_webhook_conversion_local_var; } +__attribute__((deprecated)) v1_webhook_conversion_t *v1_webhook_conversion_create( + apiextensions_v1_webhook_client_config_t *client_config, + list_t *conversion_review_versions + ) { + return v1_webhook_conversion_create_internal ( + client_config, + conversion_review_versions + ); +} void v1_webhook_conversion_free(v1_webhook_conversion_t *v1_webhook_conversion) { if(NULL == v1_webhook_conversion){ return ; } + if(v1_webhook_conversion->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_webhook_conversion_free"); + return ; + } listEntry_t *listEntry; if (v1_webhook_conversion->client_config) { apiextensions_v1_webhook_client_config_free(v1_webhook_conversion->client_config); @@ -66,7 +80,7 @@ cJSON *v1_webhook_conversion_convertToJSON(v1_webhook_conversion_t *v1_webhook_c listEntry_t *conversion_review_versionsListEntry; list_ForEach(conversion_review_versionsListEntry, v1_webhook_conversion->conversion_review_versions) { - if(cJSON_AddStringToObject(conversion_review_versions, "", (char*)conversion_review_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(conversion_review_versions, "", conversion_review_versionsListEntry->data) == NULL) { goto fail; } @@ -92,12 +106,18 @@ v1_webhook_conversion_t *v1_webhook_conversion_parseFromJSON(cJSON *v1_webhook_c // v1_webhook_conversion->client_config cJSON *client_config = cJSON_GetObjectItemCaseSensitive(v1_webhook_conversionJSON, "clientConfig"); + if (cJSON_IsNull(client_config)) { + client_config = NULL; + } if (client_config) { client_config_local_nonprim = apiextensions_v1_webhook_client_config_parseFromJSON(client_config); //nonprimitive } // v1_webhook_conversion->conversion_review_versions cJSON *conversion_review_versions = cJSON_GetObjectItemCaseSensitive(v1_webhook_conversionJSON, "conversionReviewVersions"); + if (cJSON_IsNull(conversion_review_versions)) { + conversion_review_versions = NULL; + } if (!conversion_review_versions) { goto end; } @@ -119,7 +139,7 @@ v1_webhook_conversion_t *v1_webhook_conversion_parseFromJSON(cJSON *v1_webhook_c } - v1_webhook_conversion_local_var = v1_webhook_conversion_create ( + v1_webhook_conversion_local_var = v1_webhook_conversion_create_internal ( client_config ? client_config_local_nonprim : NULL, conversion_review_versionsList ); diff --git a/kubernetes/model/v1_webhook_conversion.h b/kubernetes/model/v1_webhook_conversion.h index 9f3d36fc..b0bd224f 100644 --- a/kubernetes/model/v1_webhook_conversion.h +++ b/kubernetes/model/v1_webhook_conversion.h @@ -23,9 +23,10 @@ typedef struct v1_webhook_conversion_t { struct apiextensions_v1_webhook_client_config_t *client_config; //model list_t *conversion_review_versions; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1_webhook_conversion_t; -v1_webhook_conversion_t *v1_webhook_conversion_create( +__attribute__((deprecated)) v1_webhook_conversion_t *v1_webhook_conversion_create( apiextensions_v1_webhook_client_config_t *client_config, list_t *conversion_review_versions ); diff --git a/kubernetes/model/v1_weighted_pod_affinity_term.c b/kubernetes/model/v1_weighted_pod_affinity_term.c index 14e715dd..e9de8579 100644 --- a/kubernetes/model/v1_weighted_pod_affinity_term.c +++ b/kubernetes/model/v1_weighted_pod_affinity_term.c @@ -5,7 +5,7 @@ -v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_create( +static v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_create_internal( v1_pod_affinity_term_t *pod_affinity_term, int weight ) { @@ -16,14 +16,28 @@ v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_create( v1_weighted_pod_affinity_term_local_var->pod_affinity_term = pod_affinity_term; v1_weighted_pod_affinity_term_local_var->weight = weight; + v1_weighted_pod_affinity_term_local_var->_library_owned = 1; return v1_weighted_pod_affinity_term_local_var; } +__attribute__((deprecated)) v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_create( + v1_pod_affinity_term_t *pod_affinity_term, + int weight + ) { + return v1_weighted_pod_affinity_term_create_internal ( + pod_affinity_term, + weight + ); +} void v1_weighted_pod_affinity_term_free(v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term) { if(NULL == v1_weighted_pod_affinity_term){ return ; } + if(v1_weighted_pod_affinity_term->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_weighted_pod_affinity_term_free"); + return ; + } listEntry_t *listEntry; if (v1_weighted_pod_affinity_term->pod_affinity_term) { v1_pod_affinity_term_free(v1_weighted_pod_affinity_term->pod_affinity_term); @@ -74,6 +88,9 @@ v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_parseFromJSON(cJS // v1_weighted_pod_affinity_term->pod_affinity_term cJSON *pod_affinity_term = cJSON_GetObjectItemCaseSensitive(v1_weighted_pod_affinity_termJSON, "podAffinityTerm"); + if (cJSON_IsNull(pod_affinity_term)) { + pod_affinity_term = NULL; + } if (!pod_affinity_term) { goto end; } @@ -83,6 +100,9 @@ v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_parseFromJSON(cJS // v1_weighted_pod_affinity_term->weight cJSON *weight = cJSON_GetObjectItemCaseSensitive(v1_weighted_pod_affinity_termJSON, "weight"); + if (cJSON_IsNull(weight)) { + weight = NULL; + } if (!weight) { goto end; } @@ -94,7 +114,7 @@ v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_parseFromJSON(cJS } - v1_weighted_pod_affinity_term_local_var = v1_weighted_pod_affinity_term_create ( + v1_weighted_pod_affinity_term_local_var = v1_weighted_pod_affinity_term_create_internal ( pod_affinity_term_local_nonprim, weight->valuedouble ); diff --git a/kubernetes/model/v1_weighted_pod_affinity_term.h b/kubernetes/model/v1_weighted_pod_affinity_term.h index 3db107c8..1e5ca5fd 100644 --- a/kubernetes/model/v1_weighted_pod_affinity_term.h +++ b/kubernetes/model/v1_weighted_pod_affinity_term.h @@ -23,9 +23,10 @@ typedef struct v1_weighted_pod_affinity_term_t { struct v1_pod_affinity_term_t *pod_affinity_term; //model int weight; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v1_weighted_pod_affinity_term_t; -v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_create( +__attribute__((deprecated)) v1_weighted_pod_affinity_term_t *v1_weighted_pod_affinity_term_create( v1_pod_affinity_term_t *pod_affinity_term, int weight ); diff --git a/kubernetes/model/v1_windows_security_context_options.c b/kubernetes/model/v1_windows_security_context_options.c index 285183dc..def6da7d 100644 --- a/kubernetes/model/v1_windows_security_context_options.c +++ b/kubernetes/model/v1_windows_security_context_options.c @@ -5,7 +5,7 @@ -v1_windows_security_context_options_t *v1_windows_security_context_options_create( +static v1_windows_security_context_options_t *v1_windows_security_context_options_create_internal( char *gmsa_credential_spec, char *gmsa_credential_spec_name, int host_process, @@ -20,14 +20,32 @@ v1_windows_security_context_options_t *v1_windows_security_context_options_creat v1_windows_security_context_options_local_var->host_process = host_process; v1_windows_security_context_options_local_var->run_as_user_name = run_as_user_name; + v1_windows_security_context_options_local_var->_library_owned = 1; return v1_windows_security_context_options_local_var; } +__attribute__((deprecated)) v1_windows_security_context_options_t *v1_windows_security_context_options_create( + char *gmsa_credential_spec, + char *gmsa_credential_spec_name, + int host_process, + char *run_as_user_name + ) { + return v1_windows_security_context_options_create_internal ( + gmsa_credential_spec, + gmsa_credential_spec_name, + host_process, + run_as_user_name + ); +} void v1_windows_security_context_options_free(v1_windows_security_context_options_t *v1_windows_security_context_options) { if(NULL == v1_windows_security_context_options){ return ; } + if(v1_windows_security_context_options->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1_windows_security_context_options_free"); + return ; + } listEntry_t *listEntry; if (v1_windows_security_context_options->gmsa_credential_spec) { free(v1_windows_security_context_options->gmsa_credential_spec); @@ -92,6 +110,9 @@ v1_windows_security_context_options_t *v1_windows_security_context_options_parse // v1_windows_security_context_options->gmsa_credential_spec cJSON *gmsa_credential_spec = cJSON_GetObjectItemCaseSensitive(v1_windows_security_context_optionsJSON, "gmsaCredentialSpec"); + if (cJSON_IsNull(gmsa_credential_spec)) { + gmsa_credential_spec = NULL; + } if (gmsa_credential_spec) { if(!cJSON_IsString(gmsa_credential_spec) && !cJSON_IsNull(gmsa_credential_spec)) { @@ -101,6 +122,9 @@ v1_windows_security_context_options_t *v1_windows_security_context_options_parse // v1_windows_security_context_options->gmsa_credential_spec_name cJSON *gmsa_credential_spec_name = cJSON_GetObjectItemCaseSensitive(v1_windows_security_context_optionsJSON, "gmsaCredentialSpecName"); + if (cJSON_IsNull(gmsa_credential_spec_name)) { + gmsa_credential_spec_name = NULL; + } if (gmsa_credential_spec_name) { if(!cJSON_IsString(gmsa_credential_spec_name) && !cJSON_IsNull(gmsa_credential_spec_name)) { @@ -110,6 +134,9 @@ v1_windows_security_context_options_t *v1_windows_security_context_options_parse // v1_windows_security_context_options->host_process cJSON *host_process = cJSON_GetObjectItemCaseSensitive(v1_windows_security_context_optionsJSON, "hostProcess"); + if (cJSON_IsNull(host_process)) { + host_process = NULL; + } if (host_process) { if(!cJSON_IsBool(host_process)) { @@ -119,6 +146,9 @@ v1_windows_security_context_options_t *v1_windows_security_context_options_parse // v1_windows_security_context_options->run_as_user_name cJSON *run_as_user_name = cJSON_GetObjectItemCaseSensitive(v1_windows_security_context_optionsJSON, "runAsUserName"); + if (cJSON_IsNull(run_as_user_name)) { + run_as_user_name = NULL; + } if (run_as_user_name) { if(!cJSON_IsString(run_as_user_name) && !cJSON_IsNull(run_as_user_name)) { @@ -127,7 +157,7 @@ v1_windows_security_context_options_t *v1_windows_security_context_options_parse } - v1_windows_security_context_options_local_var = v1_windows_security_context_options_create ( + v1_windows_security_context_options_local_var = v1_windows_security_context_options_create_internal ( gmsa_credential_spec && !cJSON_IsNull(gmsa_credential_spec) ? strdup(gmsa_credential_spec->valuestring) : NULL, gmsa_credential_spec_name && !cJSON_IsNull(gmsa_credential_spec_name) ? strdup(gmsa_credential_spec_name->valuestring) : NULL, host_process ? host_process->valueint : 0, diff --git a/kubernetes/model/v1_windows_security_context_options.h b/kubernetes/model/v1_windows_security_context_options.h index 9831867a..d5749423 100644 --- a/kubernetes/model/v1_windows_security_context_options.h +++ b/kubernetes/model/v1_windows_security_context_options.h @@ -24,9 +24,10 @@ typedef struct v1_windows_security_context_options_t { int host_process; //boolean char *run_as_user_name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1_windows_security_context_options_t; -v1_windows_security_context_options_t *v1_windows_security_context_options_create( +__attribute__((deprecated)) v1_windows_security_context_options_t *v1_windows_security_context_options_create( char *gmsa_credential_spec, char *gmsa_credential_spec_name, int host_process, diff --git a/kubernetes/model/v1alpha1_apply_configuration.c b/kubernetes/model/v1alpha1_apply_configuration.c new file mode 100644 index 00000000..099753bf --- /dev/null +++ b/kubernetes/model/v1alpha1_apply_configuration.c @@ -0,0 +1,88 @@ +#include +#include +#include +#include "v1alpha1_apply_configuration.h" + + + +static v1alpha1_apply_configuration_t *v1alpha1_apply_configuration_create_internal( + char *expression + ) { + v1alpha1_apply_configuration_t *v1alpha1_apply_configuration_local_var = malloc(sizeof(v1alpha1_apply_configuration_t)); + if (!v1alpha1_apply_configuration_local_var) { + return NULL; + } + v1alpha1_apply_configuration_local_var->expression = expression; + + v1alpha1_apply_configuration_local_var->_library_owned = 1; + return v1alpha1_apply_configuration_local_var; +} + +__attribute__((deprecated)) v1alpha1_apply_configuration_t *v1alpha1_apply_configuration_create( + char *expression + ) { + return v1alpha1_apply_configuration_create_internal ( + expression + ); +} + +void v1alpha1_apply_configuration_free(v1alpha1_apply_configuration_t *v1alpha1_apply_configuration) { + if(NULL == v1alpha1_apply_configuration){ + return ; + } + if(v1alpha1_apply_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_apply_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_apply_configuration->expression) { + free(v1alpha1_apply_configuration->expression); + v1alpha1_apply_configuration->expression = NULL; + } + free(v1alpha1_apply_configuration); +} + +cJSON *v1alpha1_apply_configuration_convertToJSON(v1alpha1_apply_configuration_t *v1alpha1_apply_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_apply_configuration->expression + if(v1alpha1_apply_configuration->expression) { + if(cJSON_AddStringToObject(item, "expression", v1alpha1_apply_configuration->expression) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_apply_configuration_t *v1alpha1_apply_configuration_parseFromJSON(cJSON *v1alpha1_apply_configurationJSON){ + + v1alpha1_apply_configuration_t *v1alpha1_apply_configuration_local_var = NULL; + + // v1alpha1_apply_configuration->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1alpha1_apply_configurationJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (expression) { + if(!cJSON_IsString(expression) && !cJSON_IsNull(expression)) + { + goto end; //String + } + } + + + v1alpha1_apply_configuration_local_var = v1alpha1_apply_configuration_create_internal ( + expression && !cJSON_IsNull(expression) ? strdup(expression->valuestring) : NULL + ); + + return v1alpha1_apply_configuration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_apply_configuration.h b/kubernetes/model/v1alpha1_apply_configuration.h new file mode 100644 index 00000000..287d5abe --- /dev/null +++ b/kubernetes/model/v1alpha1_apply_configuration.h @@ -0,0 +1,38 @@ +/* + * v1alpha1_apply_configuration.h + * + * ApplyConfiguration defines the desired configuration values of an object. + */ + +#ifndef _v1alpha1_apply_configuration_H_ +#define _v1alpha1_apply_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_apply_configuration_t v1alpha1_apply_configuration_t; + + + + +typedef struct v1alpha1_apply_configuration_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_apply_configuration_t; + +__attribute__((deprecated)) v1alpha1_apply_configuration_t *v1alpha1_apply_configuration_create( + char *expression +); + +void v1alpha1_apply_configuration_free(v1alpha1_apply_configuration_t *v1alpha1_apply_configuration); + +v1alpha1_apply_configuration_t *v1alpha1_apply_configuration_parseFromJSON(cJSON *v1alpha1_apply_configurationJSON); + +cJSON *v1alpha1_apply_configuration_convertToJSON(v1alpha1_apply_configuration_t *v1alpha1_apply_configuration); + +#endif /* _v1alpha1_apply_configuration_H_ */ + diff --git a/kubernetes/model/v1alpha1_audit_annotation.c b/kubernetes/model/v1alpha1_audit_annotation.c deleted file mode 100644 index 5fa13f02..00000000 --- a/kubernetes/model/v1alpha1_audit_annotation.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include "v1alpha1_audit_annotation.h" - - - -v1alpha1_audit_annotation_t *v1alpha1_audit_annotation_create( - char *key, - char *value_expression - ) { - v1alpha1_audit_annotation_t *v1alpha1_audit_annotation_local_var = malloc(sizeof(v1alpha1_audit_annotation_t)); - if (!v1alpha1_audit_annotation_local_var) { - return NULL; - } - v1alpha1_audit_annotation_local_var->key = key; - v1alpha1_audit_annotation_local_var->value_expression = value_expression; - - return v1alpha1_audit_annotation_local_var; -} - - -void v1alpha1_audit_annotation_free(v1alpha1_audit_annotation_t *v1alpha1_audit_annotation) { - if(NULL == v1alpha1_audit_annotation){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_audit_annotation->key) { - free(v1alpha1_audit_annotation->key); - v1alpha1_audit_annotation->key = NULL; - } - if (v1alpha1_audit_annotation->value_expression) { - free(v1alpha1_audit_annotation->value_expression); - v1alpha1_audit_annotation->value_expression = NULL; - } - free(v1alpha1_audit_annotation); -} - -cJSON *v1alpha1_audit_annotation_convertToJSON(v1alpha1_audit_annotation_t *v1alpha1_audit_annotation) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_audit_annotation->key - if (!v1alpha1_audit_annotation->key) { - goto fail; - } - if(cJSON_AddStringToObject(item, "key", v1alpha1_audit_annotation->key) == NULL) { - goto fail; //String - } - - - // v1alpha1_audit_annotation->value_expression - if (!v1alpha1_audit_annotation->value_expression) { - goto fail; - } - if(cJSON_AddStringToObject(item, "valueExpression", v1alpha1_audit_annotation->value_expression) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_audit_annotation_t *v1alpha1_audit_annotation_parseFromJSON(cJSON *v1alpha1_audit_annotationJSON){ - - v1alpha1_audit_annotation_t *v1alpha1_audit_annotation_local_var = NULL; - - // v1alpha1_audit_annotation->key - cJSON *key = cJSON_GetObjectItemCaseSensitive(v1alpha1_audit_annotationJSON, "key"); - if (!key) { - goto end; - } - - - if(!cJSON_IsString(key)) - { - goto end; //String - } - - // v1alpha1_audit_annotation->value_expression - cJSON *value_expression = cJSON_GetObjectItemCaseSensitive(v1alpha1_audit_annotationJSON, "valueExpression"); - if (!value_expression) { - goto end; - } - - - if(!cJSON_IsString(value_expression)) - { - goto end; //String - } - - - v1alpha1_audit_annotation_local_var = v1alpha1_audit_annotation_create ( - strdup(key->valuestring), - strdup(value_expression->valuestring) - ); - - return v1alpha1_audit_annotation_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_audit_annotation.h b/kubernetes/model/v1alpha1_audit_annotation.h deleted file mode 100644 index 595b84f4..00000000 --- a/kubernetes/model/v1alpha1_audit_annotation.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1alpha1_audit_annotation.h - * - * AuditAnnotation describes how to produce an audit annotation for an API request. - */ - -#ifndef _v1alpha1_audit_annotation_H_ -#define _v1alpha1_audit_annotation_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_audit_annotation_t v1alpha1_audit_annotation_t; - - - - -typedef struct v1alpha1_audit_annotation_t { - char *key; // string - char *value_expression; // string - -} v1alpha1_audit_annotation_t; - -v1alpha1_audit_annotation_t *v1alpha1_audit_annotation_create( - char *key, - char *value_expression -); - -void v1alpha1_audit_annotation_free(v1alpha1_audit_annotation_t *v1alpha1_audit_annotation); - -v1alpha1_audit_annotation_t *v1alpha1_audit_annotation_parseFromJSON(cJSON *v1alpha1_audit_annotationJSON); - -cJSON *v1alpha1_audit_annotation_convertToJSON(v1alpha1_audit_annotation_t *v1alpha1_audit_annotation); - -#endif /* _v1alpha1_audit_annotation_H_ */ - diff --git a/kubernetes/model/v1alpha1_cluster_trust_bundle.c b/kubernetes/model/v1alpha1_cluster_trust_bundle.c index a9a3526e..b488c505 100644 --- a/kubernetes/model/v1alpha1_cluster_trust_bundle.c +++ b/kubernetes/model/v1alpha1_cluster_trust_bundle.c @@ -5,7 +5,7 @@ -v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_create( +static v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -20,14 +20,32 @@ v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_create( v1alpha1_cluster_trust_bundle_local_var->metadata = metadata; v1alpha1_cluster_trust_bundle_local_var->spec = spec; + v1alpha1_cluster_trust_bundle_local_var->_library_owned = 1; return v1alpha1_cluster_trust_bundle_local_var; } +__attribute__((deprecated)) v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_cluster_trust_bundle_spec_t *spec + ) { + return v1alpha1_cluster_trust_bundle_create_internal ( + api_version, + kind, + metadata, + spec + ); +} void v1alpha1_cluster_trust_bundle_free(v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle) { if(NULL == v1alpha1_cluster_trust_bundle){ return ; } + if(v1alpha1_cluster_trust_bundle->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_cluster_trust_bundle_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_cluster_trust_bundle->api_version) { free(v1alpha1_cluster_trust_bundle->api_version); @@ -113,6 +131,9 @@ v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_parseFromJSON(cJS // v1alpha1_cluster_trust_bundle->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundleJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -122,6 +143,9 @@ v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_parseFromJSON(cJS // v1alpha1_cluster_trust_bundle->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundleJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -131,12 +155,18 @@ v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_parseFromJSON(cJS // v1alpha1_cluster_trust_bundle->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundleJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1alpha1_cluster_trust_bundle->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundleJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -145,7 +175,7 @@ v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_parseFromJSON(cJS spec_local_nonprim = v1alpha1_cluster_trust_bundle_spec_parseFromJSON(spec); //nonprimitive - v1alpha1_cluster_trust_bundle_local_var = v1alpha1_cluster_trust_bundle_create ( + v1alpha1_cluster_trust_bundle_local_var = v1alpha1_cluster_trust_bundle_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1alpha1_cluster_trust_bundle.h b/kubernetes/model/v1alpha1_cluster_trust_bundle.h index 5fd45f59..184bac71 100644 --- a/kubernetes/model/v1alpha1_cluster_trust_bundle.h +++ b/kubernetes/model/v1alpha1_cluster_trust_bundle.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_cluster_trust_bundle_t { struct v1_object_meta_t *metadata; //model struct v1alpha1_cluster_trust_bundle_spec_t *spec; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_cluster_trust_bundle_t; -v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_create( +__attribute__((deprecated)) v1alpha1_cluster_trust_bundle_t *v1alpha1_cluster_trust_bundle_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1alpha1_cluster_trust_bundle_list.c b/kubernetes/model/v1alpha1_cluster_trust_bundle_list.c index 66212431..63a32db3 100644 --- a/kubernetes/model/v1alpha1_cluster_trust_bundle_list.c +++ b/kubernetes/model/v1alpha1_cluster_trust_bundle_list.c @@ -5,7 +5,7 @@ -v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_create( +static v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_create( v1alpha1_cluster_trust_bundle_list_local_var->kind = kind; v1alpha1_cluster_trust_bundle_list_local_var->metadata = metadata; + v1alpha1_cluster_trust_bundle_list_local_var->_library_owned = 1; return v1alpha1_cluster_trust_bundle_list_local_var; } +__attribute__((deprecated)) v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha1_cluster_trust_bundle_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1alpha1_cluster_trust_bundle_list_free(v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list) { if(NULL == v1alpha1_cluster_trust_bundle_list){ return ; } + if(v1alpha1_cluster_trust_bundle_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_cluster_trust_bundle_list_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_cluster_trust_bundle_list->api_version) { free(v1alpha1_cluster_trust_bundle_list->api_version); @@ -123,6 +141,9 @@ v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_parseFr // v1alpha1_cluster_trust_bundle_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundle_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_parseFr // v1alpha1_cluster_trust_bundle_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundle_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_parseFr // v1alpha1_cluster_trust_bundle_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundle_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_parseFr // v1alpha1_cluster_trust_bundle_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundle_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1alpha1_cluster_trust_bundle_list_local_var = v1alpha1_cluster_trust_bundle_list_create ( + v1alpha1_cluster_trust_bundle_list_local_var = v1alpha1_cluster_trust_bundle_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1alpha1_cluster_trust_bundle_list.h b/kubernetes/model/v1alpha1_cluster_trust_bundle_list.h index e9d30423..81134f30 100644 --- a/kubernetes/model/v1alpha1_cluster_trust_bundle_list.h +++ b/kubernetes/model/v1alpha1_cluster_trust_bundle_list.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_cluster_trust_bundle_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_cluster_trust_bundle_list_t; -v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_create( +__attribute__((deprecated)) v1alpha1_cluster_trust_bundle_list_t *v1alpha1_cluster_trust_bundle_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.c b/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.c index a3ae354a..5c313acf 100644 --- a/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.c +++ b/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.c @@ -5,7 +5,7 @@ -v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_create( +static v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_create_internal( char *signer_name, char *trust_bundle ) { @@ -16,14 +16,28 @@ v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_create( v1alpha1_cluster_trust_bundle_spec_local_var->signer_name = signer_name; v1alpha1_cluster_trust_bundle_spec_local_var->trust_bundle = trust_bundle; + v1alpha1_cluster_trust_bundle_spec_local_var->_library_owned = 1; return v1alpha1_cluster_trust_bundle_spec_local_var; } +__attribute__((deprecated)) v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_create( + char *signer_name, + char *trust_bundle + ) { + return v1alpha1_cluster_trust_bundle_spec_create_internal ( + signer_name, + trust_bundle + ); +} void v1alpha1_cluster_trust_bundle_spec_free(v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec) { if(NULL == v1alpha1_cluster_trust_bundle_spec){ return ; } + if(v1alpha1_cluster_trust_bundle_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_cluster_trust_bundle_spec_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_cluster_trust_bundle_spec->signer_name) { free(v1alpha1_cluster_trust_bundle_spec->signer_name); @@ -69,6 +83,9 @@ v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_parseFr // v1alpha1_cluster_trust_bundle_spec->signer_name cJSON *signer_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundle_specJSON, "signerName"); + if (cJSON_IsNull(signer_name)) { + signer_name = NULL; + } if (signer_name) { if(!cJSON_IsString(signer_name) && !cJSON_IsNull(signer_name)) { @@ -78,6 +95,9 @@ v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_parseFr // v1alpha1_cluster_trust_bundle_spec->trust_bundle cJSON *trust_bundle = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_trust_bundle_specJSON, "trustBundle"); + if (cJSON_IsNull(trust_bundle)) { + trust_bundle = NULL; + } if (!trust_bundle) { goto end; } @@ -89,7 +109,7 @@ v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_parseFr } - v1alpha1_cluster_trust_bundle_spec_local_var = v1alpha1_cluster_trust_bundle_spec_create ( + v1alpha1_cluster_trust_bundle_spec_local_var = v1alpha1_cluster_trust_bundle_spec_create_internal ( signer_name && !cJSON_IsNull(signer_name) ? strdup(signer_name->valuestring) : NULL, strdup(trust_bundle->valuestring) ); diff --git a/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.h b/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.h index 39727a75..3b244b28 100644 --- a/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.h +++ b/kubernetes/model/v1alpha1_cluster_trust_bundle_spec.h @@ -22,9 +22,10 @@ typedef struct v1alpha1_cluster_trust_bundle_spec_t { char *signer_name; // string char *trust_bundle; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_cluster_trust_bundle_spec_t; -v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_create( +__attribute__((deprecated)) v1alpha1_cluster_trust_bundle_spec_t *v1alpha1_cluster_trust_bundle_spec_create( char *signer_name, char *trust_bundle ); diff --git a/kubernetes/model/v1alpha1_expression_warning.c b/kubernetes/model/v1alpha1_expression_warning.c deleted file mode 100644 index 03103441..00000000 --- a/kubernetes/model/v1alpha1_expression_warning.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include "v1alpha1_expression_warning.h" - - - -v1alpha1_expression_warning_t *v1alpha1_expression_warning_create( - char *field_ref, - char *warning - ) { - v1alpha1_expression_warning_t *v1alpha1_expression_warning_local_var = malloc(sizeof(v1alpha1_expression_warning_t)); - if (!v1alpha1_expression_warning_local_var) { - return NULL; - } - v1alpha1_expression_warning_local_var->field_ref = field_ref; - v1alpha1_expression_warning_local_var->warning = warning; - - return v1alpha1_expression_warning_local_var; -} - - -void v1alpha1_expression_warning_free(v1alpha1_expression_warning_t *v1alpha1_expression_warning) { - if(NULL == v1alpha1_expression_warning){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_expression_warning->field_ref) { - free(v1alpha1_expression_warning->field_ref); - v1alpha1_expression_warning->field_ref = NULL; - } - if (v1alpha1_expression_warning->warning) { - free(v1alpha1_expression_warning->warning); - v1alpha1_expression_warning->warning = NULL; - } - free(v1alpha1_expression_warning); -} - -cJSON *v1alpha1_expression_warning_convertToJSON(v1alpha1_expression_warning_t *v1alpha1_expression_warning) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_expression_warning->field_ref - if (!v1alpha1_expression_warning->field_ref) { - goto fail; - } - if(cJSON_AddStringToObject(item, "fieldRef", v1alpha1_expression_warning->field_ref) == NULL) { - goto fail; //String - } - - - // v1alpha1_expression_warning->warning - if (!v1alpha1_expression_warning->warning) { - goto fail; - } - if(cJSON_AddStringToObject(item, "warning", v1alpha1_expression_warning->warning) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_expression_warning_t *v1alpha1_expression_warning_parseFromJSON(cJSON *v1alpha1_expression_warningJSON){ - - v1alpha1_expression_warning_t *v1alpha1_expression_warning_local_var = NULL; - - // v1alpha1_expression_warning->field_ref - cJSON *field_ref = cJSON_GetObjectItemCaseSensitive(v1alpha1_expression_warningJSON, "fieldRef"); - if (!field_ref) { - goto end; - } - - - if(!cJSON_IsString(field_ref)) - { - goto end; //String - } - - // v1alpha1_expression_warning->warning - cJSON *warning = cJSON_GetObjectItemCaseSensitive(v1alpha1_expression_warningJSON, "warning"); - if (!warning) { - goto end; - } - - - if(!cJSON_IsString(warning)) - { - goto end; //String - } - - - v1alpha1_expression_warning_local_var = v1alpha1_expression_warning_create ( - strdup(field_ref->valuestring), - strdup(warning->valuestring) - ); - - return v1alpha1_expression_warning_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_expression_warning.h b/kubernetes/model/v1alpha1_expression_warning.h deleted file mode 100644 index 708affcd..00000000 --- a/kubernetes/model/v1alpha1_expression_warning.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1alpha1_expression_warning.h - * - * ExpressionWarning is a warning information that targets a specific expression. - */ - -#ifndef _v1alpha1_expression_warning_H_ -#define _v1alpha1_expression_warning_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_expression_warning_t v1alpha1_expression_warning_t; - - - - -typedef struct v1alpha1_expression_warning_t { - char *field_ref; // string - char *warning; // string - -} v1alpha1_expression_warning_t; - -v1alpha1_expression_warning_t *v1alpha1_expression_warning_create( - char *field_ref, - char *warning -); - -void v1alpha1_expression_warning_free(v1alpha1_expression_warning_t *v1alpha1_expression_warning); - -v1alpha1_expression_warning_t *v1alpha1_expression_warning_parseFromJSON(cJSON *v1alpha1_expression_warningJSON); - -cJSON *v1alpha1_expression_warning_convertToJSON(v1alpha1_expression_warning_t *v1alpha1_expression_warning); - -#endif /* _v1alpha1_expression_warning_H_ */ - diff --git a/kubernetes/model/v1alpha1_group_version_resource.c b/kubernetes/model/v1alpha1_group_version_resource.c index 360731d5..fdb163cb 100644 --- a/kubernetes/model/v1alpha1_group_version_resource.c +++ b/kubernetes/model/v1alpha1_group_version_resource.c @@ -5,7 +5,7 @@ -v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_create( +static v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_create_internal( char *group, char *resource, char *version @@ -18,14 +18,30 @@ v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_create( v1alpha1_group_version_resource_local_var->resource = resource; v1alpha1_group_version_resource_local_var->version = version; + v1alpha1_group_version_resource_local_var->_library_owned = 1; return v1alpha1_group_version_resource_local_var; } +__attribute__((deprecated)) v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_create( + char *group, + char *resource, + char *version + ) { + return v1alpha1_group_version_resource_create_internal ( + group, + resource, + version + ); +} void v1alpha1_group_version_resource_free(v1alpha1_group_version_resource_t *v1alpha1_group_version_resource) { if(NULL == v1alpha1_group_version_resource){ return ; } + if(v1alpha1_group_version_resource->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_group_version_resource_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_group_version_resource->group) { free(v1alpha1_group_version_resource->group); @@ -82,6 +98,9 @@ v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_parseFromJSON // v1alpha1_group_version_resource->group cJSON *group = cJSON_GetObjectItemCaseSensitive(v1alpha1_group_version_resourceJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } if (group) { if(!cJSON_IsString(group) && !cJSON_IsNull(group)) { @@ -91,6 +110,9 @@ v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_parseFromJSON // v1alpha1_group_version_resource->resource cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1alpha1_group_version_resourceJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } if (resource) { if(!cJSON_IsString(resource) && !cJSON_IsNull(resource)) { @@ -100,6 +122,9 @@ v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_parseFromJSON // v1alpha1_group_version_resource->version cJSON *version = cJSON_GetObjectItemCaseSensitive(v1alpha1_group_version_resourceJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } if (version) { if(!cJSON_IsString(version) && !cJSON_IsNull(version)) { @@ -108,7 +133,7 @@ v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_parseFromJSON } - v1alpha1_group_version_resource_local_var = v1alpha1_group_version_resource_create ( + v1alpha1_group_version_resource_local_var = v1alpha1_group_version_resource_create_internal ( group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, resource && !cJSON_IsNull(resource) ? strdup(resource->valuestring) : NULL, version && !cJSON_IsNull(version) ? strdup(version->valuestring) : NULL diff --git a/kubernetes/model/v1alpha1_group_version_resource.h b/kubernetes/model/v1alpha1_group_version_resource.h index af129d3d..aae84656 100644 --- a/kubernetes/model/v1alpha1_group_version_resource.h +++ b/kubernetes/model/v1alpha1_group_version_resource.h @@ -23,9 +23,10 @@ typedef struct v1alpha1_group_version_resource_t { char *resource; // string char *version; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_group_version_resource_t; -v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_create( +__attribute__((deprecated)) v1alpha1_group_version_resource_t *v1alpha1_group_version_resource_create( char *group, char *resource, char *version diff --git a/kubernetes/model/v1alpha1_ip_address.c b/kubernetes/model/v1alpha1_ip_address.c deleted file mode 100644 index 88a0043d..00000000 --- a/kubernetes/model/v1alpha1_ip_address.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include "v1alpha1_ip_address.h" - - - -v1alpha1_ip_address_t *v1alpha1_ip_address_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_ip_address_spec_t *spec - ) { - v1alpha1_ip_address_t *v1alpha1_ip_address_local_var = malloc(sizeof(v1alpha1_ip_address_t)); - if (!v1alpha1_ip_address_local_var) { - return NULL; - } - v1alpha1_ip_address_local_var->api_version = api_version; - v1alpha1_ip_address_local_var->kind = kind; - v1alpha1_ip_address_local_var->metadata = metadata; - v1alpha1_ip_address_local_var->spec = spec; - - return v1alpha1_ip_address_local_var; -} - - -void v1alpha1_ip_address_free(v1alpha1_ip_address_t *v1alpha1_ip_address) { - if(NULL == v1alpha1_ip_address){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_ip_address->api_version) { - free(v1alpha1_ip_address->api_version); - v1alpha1_ip_address->api_version = NULL; - } - if (v1alpha1_ip_address->kind) { - free(v1alpha1_ip_address->kind); - v1alpha1_ip_address->kind = NULL; - } - if (v1alpha1_ip_address->metadata) { - v1_object_meta_free(v1alpha1_ip_address->metadata); - v1alpha1_ip_address->metadata = NULL; - } - if (v1alpha1_ip_address->spec) { - v1alpha1_ip_address_spec_free(v1alpha1_ip_address->spec); - v1alpha1_ip_address->spec = NULL; - } - free(v1alpha1_ip_address); -} - -cJSON *v1alpha1_ip_address_convertToJSON(v1alpha1_ip_address_t *v1alpha1_ip_address) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_ip_address->api_version - if(v1alpha1_ip_address->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_ip_address->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_ip_address->kind - if(v1alpha1_ip_address->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_ip_address->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_ip_address->metadata - if(v1alpha1_ip_address->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_ip_address->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_ip_address->spec - if(v1alpha1_ip_address->spec) { - cJSON *spec_local_JSON = v1alpha1_ip_address_spec_convertToJSON(v1alpha1_ip_address->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_ip_address_t *v1alpha1_ip_address_parseFromJSON(cJSON *v1alpha1_ip_addressJSON){ - - v1alpha1_ip_address_t *v1alpha1_ip_address_local_var = NULL; - - // define the local variable for v1alpha1_ip_address->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha1_ip_address->spec - v1alpha1_ip_address_spec_t *spec_local_nonprim = NULL; - - // v1alpha1_ip_address->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_addressJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_ip_address->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_addressJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_ip_address->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_addressJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha1_ip_address->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_addressJSON, "spec"); - if (spec) { - spec_local_nonprim = v1alpha1_ip_address_spec_parseFromJSON(spec); //nonprimitive - } - - - v1alpha1_ip_address_local_var = v1alpha1_ip_address_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL - ); - - return v1alpha1_ip_address_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha1_ip_address_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_ip_address.h b/kubernetes/model/v1alpha1_ip_address.h deleted file mode 100644 index 2d77b2a6..00000000 --- a/kubernetes/model/v1alpha1_ip_address.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_ip_address.h - * - * IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 - */ - -#ifndef _v1alpha1_ip_address_H_ -#define _v1alpha1_ip_address_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_ip_address_t v1alpha1_ip_address_t; - -#include "v1_object_meta.h" -#include "v1alpha1_ip_address_spec.h" - - - -typedef struct v1alpha1_ip_address_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha1_ip_address_spec_t *spec; //model - -} v1alpha1_ip_address_t; - -v1alpha1_ip_address_t *v1alpha1_ip_address_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_ip_address_spec_t *spec -); - -void v1alpha1_ip_address_free(v1alpha1_ip_address_t *v1alpha1_ip_address); - -v1alpha1_ip_address_t *v1alpha1_ip_address_parseFromJSON(cJSON *v1alpha1_ip_addressJSON); - -cJSON *v1alpha1_ip_address_convertToJSON(v1alpha1_ip_address_t *v1alpha1_ip_address); - -#endif /* _v1alpha1_ip_address_H_ */ - diff --git a/kubernetes/model/v1alpha1_ip_address_list.c b/kubernetes/model/v1alpha1_ip_address_list.c deleted file mode 100644 index cc23e5da..00000000 --- a/kubernetes/model/v1alpha1_ip_address_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha1_ip_address_list.h" - - - -v1alpha1_ip_address_list_t *v1alpha1_ip_address_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha1_ip_address_list_t *v1alpha1_ip_address_list_local_var = malloc(sizeof(v1alpha1_ip_address_list_t)); - if (!v1alpha1_ip_address_list_local_var) { - return NULL; - } - v1alpha1_ip_address_list_local_var->api_version = api_version; - v1alpha1_ip_address_list_local_var->items = items; - v1alpha1_ip_address_list_local_var->kind = kind; - v1alpha1_ip_address_list_local_var->metadata = metadata; - - return v1alpha1_ip_address_list_local_var; -} - - -void v1alpha1_ip_address_list_free(v1alpha1_ip_address_list_t *v1alpha1_ip_address_list) { - if(NULL == v1alpha1_ip_address_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_ip_address_list->api_version) { - free(v1alpha1_ip_address_list->api_version); - v1alpha1_ip_address_list->api_version = NULL; - } - if (v1alpha1_ip_address_list->items) { - list_ForEach(listEntry, v1alpha1_ip_address_list->items) { - v1alpha1_ip_address_free(listEntry->data); - } - list_freeList(v1alpha1_ip_address_list->items); - v1alpha1_ip_address_list->items = NULL; - } - if (v1alpha1_ip_address_list->kind) { - free(v1alpha1_ip_address_list->kind); - v1alpha1_ip_address_list->kind = NULL; - } - if (v1alpha1_ip_address_list->metadata) { - v1_list_meta_free(v1alpha1_ip_address_list->metadata); - v1alpha1_ip_address_list->metadata = NULL; - } - free(v1alpha1_ip_address_list); -} - -cJSON *v1alpha1_ip_address_list_convertToJSON(v1alpha1_ip_address_list_t *v1alpha1_ip_address_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_ip_address_list->api_version - if(v1alpha1_ip_address_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_ip_address_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_ip_address_list->items - if (!v1alpha1_ip_address_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha1_ip_address_list->items) { - list_ForEach(itemsListEntry, v1alpha1_ip_address_list->items) { - cJSON *itemLocal = v1alpha1_ip_address_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha1_ip_address_list->kind - if(v1alpha1_ip_address_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_ip_address_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_ip_address_list->metadata - if(v1alpha1_ip_address_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha1_ip_address_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_ip_address_list_t *v1alpha1_ip_address_list_parseFromJSON(cJSON *v1alpha1_ip_address_listJSON){ - - v1alpha1_ip_address_list_t *v1alpha1_ip_address_list_local_var = NULL; - - // define the local list for v1alpha1_ip_address_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha1_ip_address_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha1_ip_address_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_address_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_ip_address_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_address_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha1_ip_address_t *itemsItem = v1alpha1_ip_address_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha1_ip_address_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_address_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_ip_address_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_address_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha1_ip_address_list_local_var = v1alpha1_ip_address_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha1_ip_address_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha1_ip_address_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_ip_address_list.h b/kubernetes/model/v1alpha1_ip_address_list.h deleted file mode 100644 index f3297abc..00000000 --- a/kubernetes/model/v1alpha1_ip_address_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_ip_address_list.h - * - * IPAddressList contains a list of IPAddress. - */ - -#ifndef _v1alpha1_ip_address_list_H_ -#define _v1alpha1_ip_address_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_ip_address_list_t v1alpha1_ip_address_list_t; - -#include "v1_list_meta.h" -#include "v1alpha1_ip_address.h" - - - -typedef struct v1alpha1_ip_address_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha1_ip_address_list_t; - -v1alpha1_ip_address_list_t *v1alpha1_ip_address_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha1_ip_address_list_free(v1alpha1_ip_address_list_t *v1alpha1_ip_address_list); - -v1alpha1_ip_address_list_t *v1alpha1_ip_address_list_parseFromJSON(cJSON *v1alpha1_ip_address_listJSON); - -cJSON *v1alpha1_ip_address_list_convertToJSON(v1alpha1_ip_address_list_t *v1alpha1_ip_address_list); - -#endif /* _v1alpha1_ip_address_list_H_ */ - diff --git a/kubernetes/model/v1alpha1_ip_address_spec.c b/kubernetes/model/v1alpha1_ip_address_spec.c deleted file mode 100644 index d4da8390..00000000 --- a/kubernetes/model/v1alpha1_ip_address_spec.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include "v1alpha1_ip_address_spec.h" - - - -v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec_create( - v1alpha1_parent_reference_t *parent_ref - ) { - v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec_local_var = malloc(sizeof(v1alpha1_ip_address_spec_t)); - if (!v1alpha1_ip_address_spec_local_var) { - return NULL; - } - v1alpha1_ip_address_spec_local_var->parent_ref = parent_ref; - - return v1alpha1_ip_address_spec_local_var; -} - - -void v1alpha1_ip_address_spec_free(v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec) { - if(NULL == v1alpha1_ip_address_spec){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_ip_address_spec->parent_ref) { - v1alpha1_parent_reference_free(v1alpha1_ip_address_spec->parent_ref); - v1alpha1_ip_address_spec->parent_ref = NULL; - } - free(v1alpha1_ip_address_spec); -} - -cJSON *v1alpha1_ip_address_spec_convertToJSON(v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_ip_address_spec->parent_ref - if (!v1alpha1_ip_address_spec->parent_ref) { - goto fail; - } - cJSON *parent_ref_local_JSON = v1alpha1_parent_reference_convertToJSON(v1alpha1_ip_address_spec->parent_ref); - if(parent_ref_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "parentRef", parent_ref_local_JSON); - if(item->child == NULL) { - goto fail; - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec_parseFromJSON(cJSON *v1alpha1_ip_address_specJSON){ - - v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec_local_var = NULL; - - // define the local variable for v1alpha1_ip_address_spec->parent_ref - v1alpha1_parent_reference_t *parent_ref_local_nonprim = NULL; - - // v1alpha1_ip_address_spec->parent_ref - cJSON *parent_ref = cJSON_GetObjectItemCaseSensitive(v1alpha1_ip_address_specJSON, "parentRef"); - if (!parent_ref) { - goto end; - } - - - parent_ref_local_nonprim = v1alpha1_parent_reference_parseFromJSON(parent_ref); //nonprimitive - - - v1alpha1_ip_address_spec_local_var = v1alpha1_ip_address_spec_create ( - parent_ref_local_nonprim - ); - - return v1alpha1_ip_address_spec_local_var; -end: - if (parent_ref_local_nonprim) { - v1alpha1_parent_reference_free(parent_ref_local_nonprim); - parent_ref_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_ip_address_spec.h b/kubernetes/model/v1alpha1_ip_address_spec.h deleted file mode 100644 index ac6812b3..00000000 --- a/kubernetes/model/v1alpha1_ip_address_spec.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1alpha1_ip_address_spec.h - * - * IPAddressSpec describe the attributes in an IP Address. - */ - -#ifndef _v1alpha1_ip_address_spec_H_ -#define _v1alpha1_ip_address_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_ip_address_spec_t v1alpha1_ip_address_spec_t; - -#include "v1alpha1_parent_reference.h" - - - -typedef struct v1alpha1_ip_address_spec_t { - struct v1alpha1_parent_reference_t *parent_ref; //model - -} v1alpha1_ip_address_spec_t; - -v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec_create( - v1alpha1_parent_reference_t *parent_ref -); - -void v1alpha1_ip_address_spec_free(v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec); - -v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec_parseFromJSON(cJSON *v1alpha1_ip_address_specJSON); - -cJSON *v1alpha1_ip_address_spec_convertToJSON(v1alpha1_ip_address_spec_t *v1alpha1_ip_address_spec); - -#endif /* _v1alpha1_ip_address_spec_H_ */ - diff --git a/kubernetes/model/v1alpha1_json_patch.c b/kubernetes/model/v1alpha1_json_patch.c new file mode 100644 index 00000000..16ab47ff --- /dev/null +++ b/kubernetes/model/v1alpha1_json_patch.c @@ -0,0 +1,88 @@ +#include +#include +#include +#include "v1alpha1_json_patch.h" + + + +static v1alpha1_json_patch_t *v1alpha1_json_patch_create_internal( + char *expression + ) { + v1alpha1_json_patch_t *v1alpha1_json_patch_local_var = malloc(sizeof(v1alpha1_json_patch_t)); + if (!v1alpha1_json_patch_local_var) { + return NULL; + } + v1alpha1_json_patch_local_var->expression = expression; + + v1alpha1_json_patch_local_var->_library_owned = 1; + return v1alpha1_json_patch_local_var; +} + +__attribute__((deprecated)) v1alpha1_json_patch_t *v1alpha1_json_patch_create( + char *expression + ) { + return v1alpha1_json_patch_create_internal ( + expression + ); +} + +void v1alpha1_json_patch_free(v1alpha1_json_patch_t *v1alpha1_json_patch) { + if(NULL == v1alpha1_json_patch){ + return ; + } + if(v1alpha1_json_patch->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_json_patch_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_json_patch->expression) { + free(v1alpha1_json_patch->expression); + v1alpha1_json_patch->expression = NULL; + } + free(v1alpha1_json_patch); +} + +cJSON *v1alpha1_json_patch_convertToJSON(v1alpha1_json_patch_t *v1alpha1_json_patch) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_json_patch->expression + if(v1alpha1_json_patch->expression) { + if(cJSON_AddStringToObject(item, "expression", v1alpha1_json_patch->expression) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_json_patch_t *v1alpha1_json_patch_parseFromJSON(cJSON *v1alpha1_json_patchJSON){ + + v1alpha1_json_patch_t *v1alpha1_json_patch_local_var = NULL; + + // v1alpha1_json_patch->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1alpha1_json_patchJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (expression) { + if(!cJSON_IsString(expression) && !cJSON_IsNull(expression)) + { + goto end; //String + } + } + + + v1alpha1_json_patch_local_var = v1alpha1_json_patch_create_internal ( + expression && !cJSON_IsNull(expression) ? strdup(expression->valuestring) : NULL + ); + + return v1alpha1_json_patch_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_json_patch.h b/kubernetes/model/v1alpha1_json_patch.h new file mode 100644 index 00000000..d1853e8b --- /dev/null +++ b/kubernetes/model/v1alpha1_json_patch.h @@ -0,0 +1,38 @@ +/* + * v1alpha1_json_patch.h + * + * JSONPatch defines a JSON Patch. + */ + +#ifndef _v1alpha1_json_patch_H_ +#define _v1alpha1_json_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_json_patch_t v1alpha1_json_patch_t; + + + + +typedef struct v1alpha1_json_patch_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_json_patch_t; + +__attribute__((deprecated)) v1alpha1_json_patch_t *v1alpha1_json_patch_create( + char *expression +); + +void v1alpha1_json_patch_free(v1alpha1_json_patch_t *v1alpha1_json_patch); + +v1alpha1_json_patch_t *v1alpha1_json_patch_parseFromJSON(cJSON *v1alpha1_json_patchJSON); + +cJSON *v1alpha1_json_patch_convertToJSON(v1alpha1_json_patch_t *v1alpha1_json_patch); + +#endif /* _v1alpha1_json_patch_H_ */ + diff --git a/kubernetes/model/v1alpha1_match_condition.c b/kubernetes/model/v1alpha1_match_condition.c index e4624e8d..848c7880 100644 --- a/kubernetes/model/v1alpha1_match_condition.c +++ b/kubernetes/model/v1alpha1_match_condition.c @@ -5,7 +5,7 @@ -v1alpha1_match_condition_t *v1alpha1_match_condition_create( +static v1alpha1_match_condition_t *v1alpha1_match_condition_create_internal( char *expression, char *name ) { @@ -16,14 +16,28 @@ v1alpha1_match_condition_t *v1alpha1_match_condition_create( v1alpha1_match_condition_local_var->expression = expression; v1alpha1_match_condition_local_var->name = name; + v1alpha1_match_condition_local_var->_library_owned = 1; return v1alpha1_match_condition_local_var; } +__attribute__((deprecated)) v1alpha1_match_condition_t *v1alpha1_match_condition_create( + char *expression, + char *name + ) { + return v1alpha1_match_condition_create_internal ( + expression, + name + ); +} void v1alpha1_match_condition_free(v1alpha1_match_condition_t *v1alpha1_match_condition) { if(NULL == v1alpha1_match_condition){ return ; } + if(v1alpha1_match_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_match_condition_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_match_condition->expression) { free(v1alpha1_match_condition->expression); @@ -70,6 +84,9 @@ v1alpha1_match_condition_t *v1alpha1_match_condition_parseFromJSON(cJSON *v1alph // v1alpha1_match_condition->expression cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1alpha1_match_conditionJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } if (!expression) { goto end; } @@ -82,6 +99,9 @@ v1alpha1_match_condition_t *v1alpha1_match_condition_parseFromJSON(cJSON *v1alph // v1alpha1_match_condition->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha1_match_conditionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1alpha1_match_condition_t *v1alpha1_match_condition_parseFromJSON(cJSON *v1alph } - v1alpha1_match_condition_local_var = v1alpha1_match_condition_create ( + v1alpha1_match_condition_local_var = v1alpha1_match_condition_create_internal ( strdup(expression->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1alpha1_match_condition.h b/kubernetes/model/v1alpha1_match_condition.h index 291a9c82..4e0b7f40 100644 --- a/kubernetes/model/v1alpha1_match_condition.h +++ b/kubernetes/model/v1alpha1_match_condition.h @@ -22,9 +22,10 @@ typedef struct v1alpha1_match_condition_t { char *expression; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_match_condition_t; -v1alpha1_match_condition_t *v1alpha1_match_condition_create( +__attribute__((deprecated)) v1alpha1_match_condition_t *v1alpha1_match_condition_create( char *expression, char *name ); diff --git a/kubernetes/model/v1alpha1_match_resources.c b/kubernetes/model/v1alpha1_match_resources.c index e363d23d..13969403 100644 --- a/kubernetes/model/v1alpha1_match_resources.c +++ b/kubernetes/model/v1alpha1_match_resources.c @@ -5,7 +5,7 @@ -v1alpha1_match_resources_t *v1alpha1_match_resources_create( +static v1alpha1_match_resources_t *v1alpha1_match_resources_create_internal( list_t *exclude_resource_rules, char *match_policy, v1_label_selector_t *namespace_selector, @@ -22,14 +22,34 @@ v1alpha1_match_resources_t *v1alpha1_match_resources_create( v1alpha1_match_resources_local_var->object_selector = object_selector; v1alpha1_match_resources_local_var->resource_rules = resource_rules; + v1alpha1_match_resources_local_var->_library_owned = 1; return v1alpha1_match_resources_local_var; } +__attribute__((deprecated)) v1alpha1_match_resources_t *v1alpha1_match_resources_create( + list_t *exclude_resource_rules, + char *match_policy, + v1_label_selector_t *namespace_selector, + v1_label_selector_t *object_selector, + list_t *resource_rules + ) { + return v1alpha1_match_resources_create_internal ( + exclude_resource_rules, + match_policy, + namespace_selector, + object_selector, + resource_rules + ); +} void v1alpha1_match_resources_free(v1alpha1_match_resources_t *v1alpha1_match_resources) { if(NULL == v1alpha1_match_resources){ return ; } + if(v1alpha1_match_resources->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_match_resources_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_match_resources->exclude_resource_rules) { list_ForEach(listEntry, v1alpha1_match_resources->exclude_resource_rules) { @@ -162,6 +182,9 @@ v1alpha1_match_resources_t *v1alpha1_match_resources_parseFromJSON(cJSON *v1alph // v1alpha1_match_resources->exclude_resource_rules cJSON *exclude_resource_rules = cJSON_GetObjectItemCaseSensitive(v1alpha1_match_resourcesJSON, "excludeResourceRules"); + if (cJSON_IsNull(exclude_resource_rules)) { + exclude_resource_rules = NULL; + } if (exclude_resource_rules) { cJSON *exclude_resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(exclude_resource_rules)){ @@ -183,6 +206,9 @@ v1alpha1_match_resources_t *v1alpha1_match_resources_parseFromJSON(cJSON *v1alph // v1alpha1_match_resources->match_policy cJSON *match_policy = cJSON_GetObjectItemCaseSensitive(v1alpha1_match_resourcesJSON, "matchPolicy"); + if (cJSON_IsNull(match_policy)) { + match_policy = NULL; + } if (match_policy) { if(!cJSON_IsString(match_policy) && !cJSON_IsNull(match_policy)) { @@ -192,18 +218,27 @@ v1alpha1_match_resources_t *v1alpha1_match_resources_parseFromJSON(cJSON *v1alph // v1alpha1_match_resources->namespace_selector cJSON *namespace_selector = cJSON_GetObjectItemCaseSensitive(v1alpha1_match_resourcesJSON, "namespaceSelector"); + if (cJSON_IsNull(namespace_selector)) { + namespace_selector = NULL; + } if (namespace_selector) { namespace_selector_local_nonprim = v1_label_selector_parseFromJSON(namespace_selector); //nonprimitive } // v1alpha1_match_resources->object_selector cJSON *object_selector = cJSON_GetObjectItemCaseSensitive(v1alpha1_match_resourcesJSON, "objectSelector"); + if (cJSON_IsNull(object_selector)) { + object_selector = NULL; + } if (object_selector) { object_selector_local_nonprim = v1_label_selector_parseFromJSON(object_selector); //nonprimitive } // v1alpha1_match_resources->resource_rules cJSON *resource_rules = cJSON_GetObjectItemCaseSensitive(v1alpha1_match_resourcesJSON, "resourceRules"); + if (cJSON_IsNull(resource_rules)) { + resource_rules = NULL; + } if (resource_rules) { cJSON *resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_rules)){ @@ -224,7 +259,7 @@ v1alpha1_match_resources_t *v1alpha1_match_resources_parseFromJSON(cJSON *v1alph } - v1alpha1_match_resources_local_var = v1alpha1_match_resources_create ( + v1alpha1_match_resources_local_var = v1alpha1_match_resources_create_internal ( exclude_resource_rules ? exclude_resource_rulesList : NULL, match_policy && !cJSON_IsNull(match_policy) ? strdup(match_policy->valuestring) : NULL, namespace_selector ? namespace_selector_local_nonprim : NULL, diff --git a/kubernetes/model/v1alpha1_match_resources.h b/kubernetes/model/v1alpha1_match_resources.h index 168c70d1..2a162f56 100644 --- a/kubernetes/model/v1alpha1_match_resources.h +++ b/kubernetes/model/v1alpha1_match_resources.h @@ -27,9 +27,10 @@ typedef struct v1alpha1_match_resources_t { struct v1_label_selector_t *object_selector; //model list_t *resource_rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_match_resources_t; -v1alpha1_match_resources_t *v1alpha1_match_resources_create( +__attribute__((deprecated)) v1alpha1_match_resources_t *v1alpha1_match_resources_create( list_t *exclude_resource_rules, char *match_policy, v1_label_selector_t *namespace_selector, diff --git a/kubernetes/model/v1alpha1_migration_condition.c b/kubernetes/model/v1alpha1_migration_condition.c index 00f72799..a7c4cd53 100644 --- a/kubernetes/model/v1alpha1_migration_condition.c +++ b/kubernetes/model/v1alpha1_migration_condition.c @@ -5,7 +5,7 @@ -v1alpha1_migration_condition_t *v1alpha1_migration_condition_create( +static v1alpha1_migration_condition_t *v1alpha1_migration_condition_create_internal( char *last_update_time, char *message, char *reason, @@ -22,14 +22,34 @@ v1alpha1_migration_condition_t *v1alpha1_migration_condition_create( v1alpha1_migration_condition_local_var->status = status; v1alpha1_migration_condition_local_var->type = type; + v1alpha1_migration_condition_local_var->_library_owned = 1; return v1alpha1_migration_condition_local_var; } +__attribute__((deprecated)) v1alpha1_migration_condition_t *v1alpha1_migration_condition_create( + char *last_update_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v1alpha1_migration_condition_create_internal ( + last_update_time, + message, + reason, + status, + type + ); +} void v1alpha1_migration_condition_free(v1alpha1_migration_condition_t *v1alpha1_migration_condition) { if(NULL == v1alpha1_migration_condition){ return ; } + if(v1alpha1_migration_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_migration_condition_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_migration_condition->last_update_time) { free(v1alpha1_migration_condition->last_update_time); @@ -112,6 +132,9 @@ v1alpha1_migration_condition_t *v1alpha1_migration_condition_parseFromJSON(cJSON // v1alpha1_migration_condition->last_update_time cJSON *last_update_time = cJSON_GetObjectItemCaseSensitive(v1alpha1_migration_conditionJSON, "lastUpdateTime"); + if (cJSON_IsNull(last_update_time)) { + last_update_time = NULL; + } if (last_update_time) { if(!cJSON_IsString(last_update_time) && !cJSON_IsNull(last_update_time)) { @@ -121,6 +144,9 @@ v1alpha1_migration_condition_t *v1alpha1_migration_condition_parseFromJSON(cJSON // v1alpha1_migration_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1alpha1_migration_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v1alpha1_migration_condition_t *v1alpha1_migration_condition_parseFromJSON(cJSON // v1alpha1_migration_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1alpha1_migration_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v1alpha1_migration_condition_t *v1alpha1_migration_condition_parseFromJSON(cJSON // v1alpha1_migration_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_migration_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v1alpha1_migration_condition_t *v1alpha1_migration_condition_parseFromJSON(cJSON // v1alpha1_migration_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1alpha1_migration_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v1alpha1_migration_condition_t *v1alpha1_migration_condition_parseFromJSON(cJSON } - v1alpha1_migration_condition_local_var = v1alpha1_migration_condition_create ( + v1alpha1_migration_condition_local_var = v1alpha1_migration_condition_create_internal ( last_update_time && !cJSON_IsNull(last_update_time) ? strdup(last_update_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v1alpha1_migration_condition.h b/kubernetes/model/v1alpha1_migration_condition.h index f4b10083..04004fbf 100644 --- a/kubernetes/model/v1alpha1_migration_condition.h +++ b/kubernetes/model/v1alpha1_migration_condition.h @@ -25,9 +25,10 @@ typedef struct v1alpha1_migration_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_migration_condition_t; -v1alpha1_migration_condition_t *v1alpha1_migration_condition_create( +__attribute__((deprecated)) v1alpha1_migration_condition_t *v1alpha1_migration_condition_create( char *last_update_time, char *message, char *reason, diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy.c b/kubernetes/model/v1alpha1_mutating_admission_policy.c new file mode 100644 index 00000000..6fdf5a0a --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1alpha1_mutating_admission_policy.h" + + + +static v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_mutating_admission_policy_spec_t *spec + ) { + v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy_local_var = malloc(sizeof(v1alpha1_mutating_admission_policy_t)); + if (!v1alpha1_mutating_admission_policy_local_var) { + return NULL; + } + v1alpha1_mutating_admission_policy_local_var->api_version = api_version; + v1alpha1_mutating_admission_policy_local_var->kind = kind; + v1alpha1_mutating_admission_policy_local_var->metadata = metadata; + v1alpha1_mutating_admission_policy_local_var->spec = spec; + + v1alpha1_mutating_admission_policy_local_var->_library_owned = 1; + return v1alpha1_mutating_admission_policy_local_var; +} + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_mutating_admission_policy_spec_t *spec + ) { + return v1alpha1_mutating_admission_policy_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1alpha1_mutating_admission_policy_free(v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy) { + if(NULL == v1alpha1_mutating_admission_policy){ + return ; + } + if(v1alpha1_mutating_admission_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_mutating_admission_policy_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_mutating_admission_policy->api_version) { + free(v1alpha1_mutating_admission_policy->api_version); + v1alpha1_mutating_admission_policy->api_version = NULL; + } + if (v1alpha1_mutating_admission_policy->kind) { + free(v1alpha1_mutating_admission_policy->kind); + v1alpha1_mutating_admission_policy->kind = NULL; + } + if (v1alpha1_mutating_admission_policy->metadata) { + v1_object_meta_free(v1alpha1_mutating_admission_policy->metadata); + v1alpha1_mutating_admission_policy->metadata = NULL; + } + if (v1alpha1_mutating_admission_policy->spec) { + v1alpha1_mutating_admission_policy_spec_free(v1alpha1_mutating_admission_policy->spec); + v1alpha1_mutating_admission_policy->spec = NULL; + } + free(v1alpha1_mutating_admission_policy); +} + +cJSON *v1alpha1_mutating_admission_policy_convertToJSON(v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_mutating_admission_policy->api_version + if(v1alpha1_mutating_admission_policy->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_mutating_admission_policy->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy->kind + if(v1alpha1_mutating_admission_policy->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha1_mutating_admission_policy->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy->metadata + if(v1alpha1_mutating_admission_policy->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_mutating_admission_policy->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutating_admission_policy->spec + if(v1alpha1_mutating_admission_policy->spec) { + cJSON *spec_local_JSON = v1alpha1_mutating_admission_policy_spec_convertToJSON(v1alpha1_mutating_admission_policy->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy_parseFromJSON(cJSON *v1alpha1_mutating_admission_policyJSON){ + + v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy_local_var = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy->spec + v1alpha1_mutating_admission_policy_spec_t *spec_local_nonprim = NULL; + + // v1alpha1_mutating_admission_policy->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policyJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policyJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policyJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1alpha1_mutating_admission_policy->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policyJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1alpha1_mutating_admission_policy_spec_parseFromJSON(spec); //nonprimitive + } + + + v1alpha1_mutating_admission_policy_local_var = v1alpha1_mutating_admission_policy_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1alpha1_mutating_admission_policy_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1alpha1_mutating_admission_policy_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy.h b/kubernetes/model/v1alpha1_mutating_admission_policy.h new file mode 100644 index 00000000..d81cee0a --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy.h @@ -0,0 +1,46 @@ +/* + * v1alpha1_mutating_admission_policy.h + * + * MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. + */ + +#ifndef _v1alpha1_mutating_admission_policy_H_ +#define _v1alpha1_mutating_admission_policy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_mutating_admission_policy_t v1alpha1_mutating_admission_policy_t; + +#include "v1_object_meta.h" +#include "v1alpha1_mutating_admission_policy_spec.h" + + + +typedef struct v1alpha1_mutating_admission_policy_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1alpha1_mutating_admission_policy_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_mutating_admission_policy_t; + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_mutating_admission_policy_spec_t *spec +); + +void v1alpha1_mutating_admission_policy_free(v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy); + +v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy_parseFromJSON(cJSON *v1alpha1_mutating_admission_policyJSON); + +cJSON *v1alpha1_mutating_admission_policy_convertToJSON(v1alpha1_mutating_admission_policy_t *v1alpha1_mutating_admission_policy); + +#endif /* _v1alpha1_mutating_admission_policy_H_ */ + diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_binding.c b/kubernetes/model/v1alpha1_mutating_admission_policy_binding.c new file mode 100644 index 00000000..a2db4d32 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_binding.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1alpha1_mutating_admission_policy_binding.h" + + + +static v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_mutating_admission_policy_binding_spec_t *spec + ) { + v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding_local_var = malloc(sizeof(v1alpha1_mutating_admission_policy_binding_t)); + if (!v1alpha1_mutating_admission_policy_binding_local_var) { + return NULL; + } + v1alpha1_mutating_admission_policy_binding_local_var->api_version = api_version; + v1alpha1_mutating_admission_policy_binding_local_var->kind = kind; + v1alpha1_mutating_admission_policy_binding_local_var->metadata = metadata; + v1alpha1_mutating_admission_policy_binding_local_var->spec = spec; + + v1alpha1_mutating_admission_policy_binding_local_var->_library_owned = 1; + return v1alpha1_mutating_admission_policy_binding_local_var; +} + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_mutating_admission_policy_binding_spec_t *spec + ) { + return v1alpha1_mutating_admission_policy_binding_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1alpha1_mutating_admission_policy_binding_free(v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding) { + if(NULL == v1alpha1_mutating_admission_policy_binding){ + return ; + } + if(v1alpha1_mutating_admission_policy_binding->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_mutating_admission_policy_binding_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_mutating_admission_policy_binding->api_version) { + free(v1alpha1_mutating_admission_policy_binding->api_version); + v1alpha1_mutating_admission_policy_binding->api_version = NULL; + } + if (v1alpha1_mutating_admission_policy_binding->kind) { + free(v1alpha1_mutating_admission_policy_binding->kind); + v1alpha1_mutating_admission_policy_binding->kind = NULL; + } + if (v1alpha1_mutating_admission_policy_binding->metadata) { + v1_object_meta_free(v1alpha1_mutating_admission_policy_binding->metadata); + v1alpha1_mutating_admission_policy_binding->metadata = NULL; + } + if (v1alpha1_mutating_admission_policy_binding->spec) { + v1alpha1_mutating_admission_policy_binding_spec_free(v1alpha1_mutating_admission_policy_binding->spec); + v1alpha1_mutating_admission_policy_binding->spec = NULL; + } + free(v1alpha1_mutating_admission_policy_binding); +} + +cJSON *v1alpha1_mutating_admission_policy_binding_convertToJSON(v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_mutating_admission_policy_binding->api_version + if(v1alpha1_mutating_admission_policy_binding->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_mutating_admission_policy_binding->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_binding->kind + if(v1alpha1_mutating_admission_policy_binding->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha1_mutating_admission_policy_binding->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_binding->metadata + if(v1alpha1_mutating_admission_policy_binding->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_mutating_admission_policy_binding->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutating_admission_policy_binding->spec + if(v1alpha1_mutating_admission_policy_binding->spec) { + cJSON *spec_local_JSON = v1alpha1_mutating_admission_policy_binding_spec_convertToJSON(v1alpha1_mutating_admission_policy_binding->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_bindingJSON){ + + v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding_local_var = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_binding->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_binding->spec + v1alpha1_mutating_admission_policy_binding_spec_t *spec_local_nonprim = NULL; + + // v1alpha1_mutating_admission_policy_binding->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_bindingJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_binding->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_bindingJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_binding->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_bindingJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1alpha1_mutating_admission_policy_binding->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_bindingJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1alpha1_mutating_admission_policy_binding_spec_parseFromJSON(spec); //nonprimitive + } + + + v1alpha1_mutating_admission_policy_binding_local_var = v1alpha1_mutating_admission_policy_binding_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1alpha1_mutating_admission_policy_binding_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1alpha1_mutating_admission_policy_binding_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_binding.h b/kubernetes/model/v1alpha1_mutating_admission_policy_binding.h new file mode 100644 index 00000000..74db2417 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_binding.h @@ -0,0 +1,46 @@ +/* + * v1alpha1_mutating_admission_policy_binding.h + * + * MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters. For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget). Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget. + */ + +#ifndef _v1alpha1_mutating_admission_policy_binding_H_ +#define _v1alpha1_mutating_admission_policy_binding_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_mutating_admission_policy_binding_t v1alpha1_mutating_admission_policy_binding_t; + +#include "v1_object_meta.h" +#include "v1alpha1_mutating_admission_policy_binding_spec.h" + + + +typedef struct v1alpha1_mutating_admission_policy_binding_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1alpha1_mutating_admission_policy_binding_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_mutating_admission_policy_binding_t; + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_mutating_admission_policy_binding_spec_t *spec +); + +void v1alpha1_mutating_admission_policy_binding_free(v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding); + +v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_bindingJSON); + +cJSON *v1alpha1_mutating_admission_policy_binding_convertToJSON(v1alpha1_mutating_admission_policy_binding_t *v1alpha1_mutating_admission_policy_binding); + +#endif /* _v1alpha1_mutating_admission_policy_binding_H_ */ + diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_binding_list.c b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_list.c new file mode 100644 index 00000000..f19c45e9 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1alpha1_mutating_admission_policy_binding_list.h" + + + +static v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list_local_var = malloc(sizeof(v1alpha1_mutating_admission_policy_binding_list_t)); + if (!v1alpha1_mutating_admission_policy_binding_list_local_var) { + return NULL; + } + v1alpha1_mutating_admission_policy_binding_list_local_var->api_version = api_version; + v1alpha1_mutating_admission_policy_binding_list_local_var->items = items; + v1alpha1_mutating_admission_policy_binding_list_local_var->kind = kind; + v1alpha1_mutating_admission_policy_binding_list_local_var->metadata = metadata; + + v1alpha1_mutating_admission_policy_binding_list_local_var->_library_owned = 1; + return v1alpha1_mutating_admission_policy_binding_list_local_var; +} + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha1_mutating_admission_policy_binding_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1alpha1_mutating_admission_policy_binding_list_free(v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list) { + if(NULL == v1alpha1_mutating_admission_policy_binding_list){ + return ; + } + if(v1alpha1_mutating_admission_policy_binding_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_mutating_admission_policy_binding_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_mutating_admission_policy_binding_list->api_version) { + free(v1alpha1_mutating_admission_policy_binding_list->api_version); + v1alpha1_mutating_admission_policy_binding_list->api_version = NULL; + } + if (v1alpha1_mutating_admission_policy_binding_list->items) { + list_ForEach(listEntry, v1alpha1_mutating_admission_policy_binding_list->items) { + v1alpha1_mutating_admission_policy_binding_free(listEntry->data); + } + list_freeList(v1alpha1_mutating_admission_policy_binding_list->items); + v1alpha1_mutating_admission_policy_binding_list->items = NULL; + } + if (v1alpha1_mutating_admission_policy_binding_list->kind) { + free(v1alpha1_mutating_admission_policy_binding_list->kind); + v1alpha1_mutating_admission_policy_binding_list->kind = NULL; + } + if (v1alpha1_mutating_admission_policy_binding_list->metadata) { + v1_list_meta_free(v1alpha1_mutating_admission_policy_binding_list->metadata); + v1alpha1_mutating_admission_policy_binding_list->metadata = NULL; + } + free(v1alpha1_mutating_admission_policy_binding_list); +} + +cJSON *v1alpha1_mutating_admission_policy_binding_list_convertToJSON(v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_mutating_admission_policy_binding_list->api_version + if(v1alpha1_mutating_admission_policy_binding_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_mutating_admission_policy_binding_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_binding_list->items + if (!v1alpha1_mutating_admission_policy_binding_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1alpha1_mutating_admission_policy_binding_list->items) { + list_ForEach(itemsListEntry, v1alpha1_mutating_admission_policy_binding_list->items) { + cJSON *itemLocal = v1alpha1_mutating_admission_policy_binding_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1alpha1_mutating_admission_policy_binding_list->kind + if(v1alpha1_mutating_admission_policy_binding_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha1_mutating_admission_policy_binding_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_binding_list->metadata + if(v1alpha1_mutating_admission_policy_binding_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha1_mutating_admission_policy_binding_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_binding_listJSON){ + + v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list_local_var = NULL; + + // define the local list for v1alpha1_mutating_admission_policy_binding_list->items + list_t *itemsList = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_binding_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1alpha1_mutating_admission_policy_binding_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_binding_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_binding_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_binding_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1alpha1_mutating_admission_policy_binding_t *itemsItem = v1alpha1_mutating_admission_policy_binding_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1alpha1_mutating_admission_policy_binding_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_binding_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_binding_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_binding_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1alpha1_mutating_admission_policy_binding_list_local_var = v1alpha1_mutating_admission_policy_binding_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1alpha1_mutating_admission_policy_binding_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_mutating_admission_policy_binding_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_binding_list.h b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_list.h new file mode 100644 index 00000000..33edd318 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_list.h @@ -0,0 +1,46 @@ +/* + * v1alpha1_mutating_admission_policy_binding_list.h + * + * MutatingAdmissionPolicyBindingList is a list of MutatingAdmissionPolicyBinding. + */ + +#ifndef _v1alpha1_mutating_admission_policy_binding_list_H_ +#define _v1alpha1_mutating_admission_policy_binding_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_mutating_admission_policy_binding_list_t v1alpha1_mutating_admission_policy_binding_list_t; + +#include "v1_list_meta.h" +#include "v1alpha1_mutating_admission_policy_binding.h" + + + +typedef struct v1alpha1_mutating_admission_policy_binding_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_mutating_admission_policy_binding_list_t; + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1alpha1_mutating_admission_policy_binding_list_free(v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list); + +v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_binding_listJSON); + +cJSON *v1alpha1_mutating_admission_policy_binding_list_convertToJSON(v1alpha1_mutating_admission_policy_binding_list_t *v1alpha1_mutating_admission_policy_binding_list); + +#endif /* _v1alpha1_mutating_admission_policy_binding_list_H_ */ + diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_binding_spec.c b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_spec.c new file mode 100644 index 00000000..d65343d4 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_spec.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include "v1alpha1_mutating_admission_policy_binding_spec.h" + + + +static v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec_create_internal( + v1alpha1_match_resources_t *match_resources, + v1alpha1_param_ref_t *param_ref, + char *policy_name + ) { + v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec_local_var = malloc(sizeof(v1alpha1_mutating_admission_policy_binding_spec_t)); + if (!v1alpha1_mutating_admission_policy_binding_spec_local_var) { + return NULL; + } + v1alpha1_mutating_admission_policy_binding_spec_local_var->match_resources = match_resources; + v1alpha1_mutating_admission_policy_binding_spec_local_var->param_ref = param_ref; + v1alpha1_mutating_admission_policy_binding_spec_local_var->policy_name = policy_name; + + v1alpha1_mutating_admission_policy_binding_spec_local_var->_library_owned = 1; + return v1alpha1_mutating_admission_policy_binding_spec_local_var; +} + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec_create( + v1alpha1_match_resources_t *match_resources, + v1alpha1_param_ref_t *param_ref, + char *policy_name + ) { + return v1alpha1_mutating_admission_policy_binding_spec_create_internal ( + match_resources, + param_ref, + policy_name + ); +} + +void v1alpha1_mutating_admission_policy_binding_spec_free(v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec) { + if(NULL == v1alpha1_mutating_admission_policy_binding_spec){ + return ; + } + if(v1alpha1_mutating_admission_policy_binding_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_mutating_admission_policy_binding_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_mutating_admission_policy_binding_spec->match_resources) { + v1alpha1_match_resources_free(v1alpha1_mutating_admission_policy_binding_spec->match_resources); + v1alpha1_mutating_admission_policy_binding_spec->match_resources = NULL; + } + if (v1alpha1_mutating_admission_policy_binding_spec->param_ref) { + v1alpha1_param_ref_free(v1alpha1_mutating_admission_policy_binding_spec->param_ref); + v1alpha1_mutating_admission_policy_binding_spec->param_ref = NULL; + } + if (v1alpha1_mutating_admission_policy_binding_spec->policy_name) { + free(v1alpha1_mutating_admission_policy_binding_spec->policy_name); + v1alpha1_mutating_admission_policy_binding_spec->policy_name = NULL; + } + free(v1alpha1_mutating_admission_policy_binding_spec); +} + +cJSON *v1alpha1_mutating_admission_policy_binding_spec_convertToJSON(v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_mutating_admission_policy_binding_spec->match_resources + if(v1alpha1_mutating_admission_policy_binding_spec->match_resources) { + cJSON *match_resources_local_JSON = v1alpha1_match_resources_convertToJSON(v1alpha1_mutating_admission_policy_binding_spec->match_resources); + if(match_resources_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "matchResources", match_resources_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutating_admission_policy_binding_spec->param_ref + if(v1alpha1_mutating_admission_policy_binding_spec->param_ref) { + cJSON *param_ref_local_JSON = v1alpha1_param_ref_convertToJSON(v1alpha1_mutating_admission_policy_binding_spec->param_ref); + if(param_ref_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "paramRef", param_ref_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutating_admission_policy_binding_spec->policy_name + if(v1alpha1_mutating_admission_policy_binding_spec->policy_name) { + if(cJSON_AddStringToObject(item, "policyName", v1alpha1_mutating_admission_policy_binding_spec->policy_name) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_binding_specJSON){ + + v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec_local_var = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_binding_spec->match_resources + v1alpha1_match_resources_t *match_resources_local_nonprim = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_binding_spec->param_ref + v1alpha1_param_ref_t *param_ref_local_nonprim = NULL; + + // v1alpha1_mutating_admission_policy_binding_spec->match_resources + cJSON *match_resources = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_binding_specJSON, "matchResources"); + if (cJSON_IsNull(match_resources)) { + match_resources = NULL; + } + if (match_resources) { + match_resources_local_nonprim = v1alpha1_match_resources_parseFromJSON(match_resources); //nonprimitive + } + + // v1alpha1_mutating_admission_policy_binding_spec->param_ref + cJSON *param_ref = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_binding_specJSON, "paramRef"); + if (cJSON_IsNull(param_ref)) { + param_ref = NULL; + } + if (param_ref) { + param_ref_local_nonprim = v1alpha1_param_ref_parseFromJSON(param_ref); //nonprimitive + } + + // v1alpha1_mutating_admission_policy_binding_spec->policy_name + cJSON *policy_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_binding_specJSON, "policyName"); + if (cJSON_IsNull(policy_name)) { + policy_name = NULL; + } + if (policy_name) { + if(!cJSON_IsString(policy_name) && !cJSON_IsNull(policy_name)) + { + goto end; //String + } + } + + + v1alpha1_mutating_admission_policy_binding_spec_local_var = v1alpha1_mutating_admission_policy_binding_spec_create_internal ( + match_resources ? match_resources_local_nonprim : NULL, + param_ref ? param_ref_local_nonprim : NULL, + policy_name && !cJSON_IsNull(policy_name) ? strdup(policy_name->valuestring) : NULL + ); + + return v1alpha1_mutating_admission_policy_binding_spec_local_var; +end: + if (match_resources_local_nonprim) { + v1alpha1_match_resources_free(match_resources_local_nonprim); + match_resources_local_nonprim = NULL; + } + if (param_ref_local_nonprim) { + v1alpha1_param_ref_free(param_ref_local_nonprim); + param_ref_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_binding_spec.h b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_spec.h new file mode 100644 index 00000000..4770ad38 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_binding_spec.h @@ -0,0 +1,44 @@ +/* + * v1alpha1_mutating_admission_policy_binding_spec.h + * + * MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding. + */ + +#ifndef _v1alpha1_mutating_admission_policy_binding_spec_H_ +#define _v1alpha1_mutating_admission_policy_binding_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_mutating_admission_policy_binding_spec_t v1alpha1_mutating_admission_policy_binding_spec_t; + +#include "v1alpha1_match_resources.h" +#include "v1alpha1_param_ref.h" + + + +typedef struct v1alpha1_mutating_admission_policy_binding_spec_t { + struct v1alpha1_match_resources_t *match_resources; //model + struct v1alpha1_param_ref_t *param_ref; //model + char *policy_name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_mutating_admission_policy_binding_spec_t; + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec_create( + v1alpha1_match_resources_t *match_resources, + v1alpha1_param_ref_t *param_ref, + char *policy_name +); + +void v1alpha1_mutating_admission_policy_binding_spec_free(v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec); + +v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_binding_specJSON); + +cJSON *v1alpha1_mutating_admission_policy_binding_spec_convertToJSON(v1alpha1_mutating_admission_policy_binding_spec_t *v1alpha1_mutating_admission_policy_binding_spec); + +#endif /* _v1alpha1_mutating_admission_policy_binding_spec_H_ */ + diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_list.c b/kubernetes/model/v1alpha1_mutating_admission_policy_list.c new file mode 100644 index 00000000..675f0f34 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1alpha1_mutating_admission_policy_list.h" + + + +static v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list_local_var = malloc(sizeof(v1alpha1_mutating_admission_policy_list_t)); + if (!v1alpha1_mutating_admission_policy_list_local_var) { + return NULL; + } + v1alpha1_mutating_admission_policy_list_local_var->api_version = api_version; + v1alpha1_mutating_admission_policy_list_local_var->items = items; + v1alpha1_mutating_admission_policy_list_local_var->kind = kind; + v1alpha1_mutating_admission_policy_list_local_var->metadata = metadata; + + v1alpha1_mutating_admission_policy_list_local_var->_library_owned = 1; + return v1alpha1_mutating_admission_policy_list_local_var; +} + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha1_mutating_admission_policy_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1alpha1_mutating_admission_policy_list_free(v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list) { + if(NULL == v1alpha1_mutating_admission_policy_list){ + return ; + } + if(v1alpha1_mutating_admission_policy_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_mutating_admission_policy_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_mutating_admission_policy_list->api_version) { + free(v1alpha1_mutating_admission_policy_list->api_version); + v1alpha1_mutating_admission_policy_list->api_version = NULL; + } + if (v1alpha1_mutating_admission_policy_list->items) { + list_ForEach(listEntry, v1alpha1_mutating_admission_policy_list->items) { + v1alpha1_mutating_admission_policy_free(listEntry->data); + } + list_freeList(v1alpha1_mutating_admission_policy_list->items); + v1alpha1_mutating_admission_policy_list->items = NULL; + } + if (v1alpha1_mutating_admission_policy_list->kind) { + free(v1alpha1_mutating_admission_policy_list->kind); + v1alpha1_mutating_admission_policy_list->kind = NULL; + } + if (v1alpha1_mutating_admission_policy_list->metadata) { + v1_list_meta_free(v1alpha1_mutating_admission_policy_list->metadata); + v1alpha1_mutating_admission_policy_list->metadata = NULL; + } + free(v1alpha1_mutating_admission_policy_list); +} + +cJSON *v1alpha1_mutating_admission_policy_list_convertToJSON(v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_mutating_admission_policy_list->api_version + if(v1alpha1_mutating_admission_policy_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_mutating_admission_policy_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_list->items + if (!v1alpha1_mutating_admission_policy_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1alpha1_mutating_admission_policy_list->items) { + list_ForEach(itemsListEntry, v1alpha1_mutating_admission_policy_list->items) { + cJSON *itemLocal = v1alpha1_mutating_admission_policy_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1alpha1_mutating_admission_policy_list->kind + if(v1alpha1_mutating_admission_policy_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha1_mutating_admission_policy_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_list->metadata + if(v1alpha1_mutating_admission_policy_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha1_mutating_admission_policy_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_listJSON){ + + v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list_local_var = NULL; + + // define the local list for v1alpha1_mutating_admission_policy_list->items + list_t *itemsList = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1alpha1_mutating_admission_policy_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1alpha1_mutating_admission_policy_t *itemsItem = v1alpha1_mutating_admission_policy_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1alpha1_mutating_admission_policy_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1alpha1_mutating_admission_policy_list_local_var = v1alpha1_mutating_admission_policy_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1alpha1_mutating_admission_policy_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_mutating_admission_policy_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_list.h b/kubernetes/model/v1alpha1_mutating_admission_policy_list.h new file mode 100644 index 00000000..c9a42674 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_list.h @@ -0,0 +1,46 @@ +/* + * v1alpha1_mutating_admission_policy_list.h + * + * MutatingAdmissionPolicyList is a list of MutatingAdmissionPolicy. + */ + +#ifndef _v1alpha1_mutating_admission_policy_list_H_ +#define _v1alpha1_mutating_admission_policy_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_mutating_admission_policy_list_t v1alpha1_mutating_admission_policy_list_t; + +#include "v1_list_meta.h" +#include "v1alpha1_mutating_admission_policy.h" + + + +typedef struct v1alpha1_mutating_admission_policy_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_mutating_admission_policy_list_t; + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1alpha1_mutating_admission_policy_list_free(v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list); + +v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_listJSON); + +cJSON *v1alpha1_mutating_admission_policy_list_convertToJSON(v1alpha1_mutating_admission_policy_list_t *v1alpha1_mutating_admission_policy_list); + +#endif /* _v1alpha1_mutating_admission_policy_list_H_ */ + diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_spec.c b/kubernetes/model/v1alpha1_mutating_admission_policy_spec.c new file mode 100644 index 00000000..086c7543 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_spec.c @@ -0,0 +1,397 @@ +#include +#include +#include +#include "v1alpha1_mutating_admission_policy_spec.h" + + + +static v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec_create_internal( + char *failure_policy, + list_t *match_conditions, + v1alpha1_match_resources_t *match_constraints, + list_t *mutations, + v1alpha1_param_kind_t *param_kind, + char *reinvocation_policy, + list_t *variables + ) { + v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec_local_var = malloc(sizeof(v1alpha1_mutating_admission_policy_spec_t)); + if (!v1alpha1_mutating_admission_policy_spec_local_var) { + return NULL; + } + v1alpha1_mutating_admission_policy_spec_local_var->failure_policy = failure_policy; + v1alpha1_mutating_admission_policy_spec_local_var->match_conditions = match_conditions; + v1alpha1_mutating_admission_policy_spec_local_var->match_constraints = match_constraints; + v1alpha1_mutating_admission_policy_spec_local_var->mutations = mutations; + v1alpha1_mutating_admission_policy_spec_local_var->param_kind = param_kind; + v1alpha1_mutating_admission_policy_spec_local_var->reinvocation_policy = reinvocation_policy; + v1alpha1_mutating_admission_policy_spec_local_var->variables = variables; + + v1alpha1_mutating_admission_policy_spec_local_var->_library_owned = 1; + return v1alpha1_mutating_admission_policy_spec_local_var; +} + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec_create( + char *failure_policy, + list_t *match_conditions, + v1alpha1_match_resources_t *match_constraints, + list_t *mutations, + v1alpha1_param_kind_t *param_kind, + char *reinvocation_policy, + list_t *variables + ) { + return v1alpha1_mutating_admission_policy_spec_create_internal ( + failure_policy, + match_conditions, + match_constraints, + mutations, + param_kind, + reinvocation_policy, + variables + ); +} + +void v1alpha1_mutating_admission_policy_spec_free(v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec) { + if(NULL == v1alpha1_mutating_admission_policy_spec){ + return ; + } + if(v1alpha1_mutating_admission_policy_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_mutating_admission_policy_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_mutating_admission_policy_spec->failure_policy) { + free(v1alpha1_mutating_admission_policy_spec->failure_policy); + v1alpha1_mutating_admission_policy_spec->failure_policy = NULL; + } + if (v1alpha1_mutating_admission_policy_spec->match_conditions) { + list_ForEach(listEntry, v1alpha1_mutating_admission_policy_spec->match_conditions) { + v1alpha1_match_condition_free(listEntry->data); + } + list_freeList(v1alpha1_mutating_admission_policy_spec->match_conditions); + v1alpha1_mutating_admission_policy_spec->match_conditions = NULL; + } + if (v1alpha1_mutating_admission_policy_spec->match_constraints) { + v1alpha1_match_resources_free(v1alpha1_mutating_admission_policy_spec->match_constraints); + v1alpha1_mutating_admission_policy_spec->match_constraints = NULL; + } + if (v1alpha1_mutating_admission_policy_spec->mutations) { + list_ForEach(listEntry, v1alpha1_mutating_admission_policy_spec->mutations) { + v1alpha1_mutation_free(listEntry->data); + } + list_freeList(v1alpha1_mutating_admission_policy_spec->mutations); + v1alpha1_mutating_admission_policy_spec->mutations = NULL; + } + if (v1alpha1_mutating_admission_policy_spec->param_kind) { + v1alpha1_param_kind_free(v1alpha1_mutating_admission_policy_spec->param_kind); + v1alpha1_mutating_admission_policy_spec->param_kind = NULL; + } + if (v1alpha1_mutating_admission_policy_spec->reinvocation_policy) { + free(v1alpha1_mutating_admission_policy_spec->reinvocation_policy); + v1alpha1_mutating_admission_policy_spec->reinvocation_policy = NULL; + } + if (v1alpha1_mutating_admission_policy_spec->variables) { + list_ForEach(listEntry, v1alpha1_mutating_admission_policy_spec->variables) { + v1alpha1_variable_free(listEntry->data); + } + list_freeList(v1alpha1_mutating_admission_policy_spec->variables); + v1alpha1_mutating_admission_policy_spec->variables = NULL; + } + free(v1alpha1_mutating_admission_policy_spec); +} + +cJSON *v1alpha1_mutating_admission_policy_spec_convertToJSON(v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_mutating_admission_policy_spec->failure_policy + if(v1alpha1_mutating_admission_policy_spec->failure_policy) { + if(cJSON_AddStringToObject(item, "failurePolicy", v1alpha1_mutating_admission_policy_spec->failure_policy) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_spec->match_conditions + if(v1alpha1_mutating_admission_policy_spec->match_conditions) { + cJSON *match_conditions = cJSON_AddArrayToObject(item, "matchConditions"); + if(match_conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *match_conditionsListEntry; + if (v1alpha1_mutating_admission_policy_spec->match_conditions) { + list_ForEach(match_conditionsListEntry, v1alpha1_mutating_admission_policy_spec->match_conditions) { + cJSON *itemLocal = v1alpha1_match_condition_convertToJSON(match_conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(match_conditions, itemLocal); + } + } + } + + + // v1alpha1_mutating_admission_policy_spec->match_constraints + if(v1alpha1_mutating_admission_policy_spec->match_constraints) { + cJSON *match_constraints_local_JSON = v1alpha1_match_resources_convertToJSON(v1alpha1_mutating_admission_policy_spec->match_constraints); + if(match_constraints_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "matchConstraints", match_constraints_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutating_admission_policy_spec->mutations + if(v1alpha1_mutating_admission_policy_spec->mutations) { + cJSON *mutations = cJSON_AddArrayToObject(item, "mutations"); + if(mutations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *mutationsListEntry; + if (v1alpha1_mutating_admission_policy_spec->mutations) { + list_ForEach(mutationsListEntry, v1alpha1_mutating_admission_policy_spec->mutations) { + cJSON *itemLocal = v1alpha1_mutation_convertToJSON(mutationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(mutations, itemLocal); + } + } + } + + + // v1alpha1_mutating_admission_policy_spec->param_kind + if(v1alpha1_mutating_admission_policy_spec->param_kind) { + cJSON *param_kind_local_JSON = v1alpha1_param_kind_convertToJSON(v1alpha1_mutating_admission_policy_spec->param_kind); + if(param_kind_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "paramKind", param_kind_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutating_admission_policy_spec->reinvocation_policy + if(v1alpha1_mutating_admission_policy_spec->reinvocation_policy) { + if(cJSON_AddStringToObject(item, "reinvocationPolicy", v1alpha1_mutating_admission_policy_spec->reinvocation_policy) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_mutating_admission_policy_spec->variables + if(v1alpha1_mutating_admission_policy_spec->variables) { + cJSON *variables = cJSON_AddArrayToObject(item, "variables"); + if(variables == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *variablesListEntry; + if (v1alpha1_mutating_admission_policy_spec->variables) { + list_ForEach(variablesListEntry, v1alpha1_mutating_admission_policy_spec->variables) { + cJSON *itemLocal = v1alpha1_variable_convertToJSON(variablesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(variables, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_specJSON){ + + v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec_local_var = NULL; + + // define the local list for v1alpha1_mutating_admission_policy_spec->match_conditions + list_t *match_conditionsList = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_spec->match_constraints + v1alpha1_match_resources_t *match_constraints_local_nonprim = NULL; + + // define the local list for v1alpha1_mutating_admission_policy_spec->mutations + list_t *mutationsList = NULL; + + // define the local variable for v1alpha1_mutating_admission_policy_spec->param_kind + v1alpha1_param_kind_t *param_kind_local_nonprim = NULL; + + // define the local list for v1alpha1_mutating_admission_policy_spec->variables + list_t *variablesList = NULL; + + // v1alpha1_mutating_admission_policy_spec->failure_policy + cJSON *failure_policy = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_specJSON, "failurePolicy"); + if (cJSON_IsNull(failure_policy)) { + failure_policy = NULL; + } + if (failure_policy) { + if(!cJSON_IsString(failure_policy) && !cJSON_IsNull(failure_policy)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_spec->match_conditions + cJSON *match_conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_specJSON, "matchConditions"); + if (cJSON_IsNull(match_conditions)) { + match_conditions = NULL; + } + if (match_conditions) { + cJSON *match_conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(match_conditions)){ + goto end; //nonprimitive container + } + + match_conditionsList = list_createList(); + + cJSON_ArrayForEach(match_conditions_local_nonprimitive,match_conditions ) + { + if(!cJSON_IsObject(match_conditions_local_nonprimitive)){ + goto end; + } + v1alpha1_match_condition_t *match_conditionsItem = v1alpha1_match_condition_parseFromJSON(match_conditions_local_nonprimitive); + + list_addElement(match_conditionsList, match_conditionsItem); + } + } + + // v1alpha1_mutating_admission_policy_spec->match_constraints + cJSON *match_constraints = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_specJSON, "matchConstraints"); + if (cJSON_IsNull(match_constraints)) { + match_constraints = NULL; + } + if (match_constraints) { + match_constraints_local_nonprim = v1alpha1_match_resources_parseFromJSON(match_constraints); //nonprimitive + } + + // v1alpha1_mutating_admission_policy_spec->mutations + cJSON *mutations = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_specJSON, "mutations"); + if (cJSON_IsNull(mutations)) { + mutations = NULL; + } + if (mutations) { + cJSON *mutations_local_nonprimitive = NULL; + if(!cJSON_IsArray(mutations)){ + goto end; //nonprimitive container + } + + mutationsList = list_createList(); + + cJSON_ArrayForEach(mutations_local_nonprimitive,mutations ) + { + if(!cJSON_IsObject(mutations_local_nonprimitive)){ + goto end; + } + v1alpha1_mutation_t *mutationsItem = v1alpha1_mutation_parseFromJSON(mutations_local_nonprimitive); + + list_addElement(mutationsList, mutationsItem); + } + } + + // v1alpha1_mutating_admission_policy_spec->param_kind + cJSON *param_kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_specJSON, "paramKind"); + if (cJSON_IsNull(param_kind)) { + param_kind = NULL; + } + if (param_kind) { + param_kind_local_nonprim = v1alpha1_param_kind_parseFromJSON(param_kind); //nonprimitive + } + + // v1alpha1_mutating_admission_policy_spec->reinvocation_policy + cJSON *reinvocation_policy = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_specJSON, "reinvocationPolicy"); + if (cJSON_IsNull(reinvocation_policy)) { + reinvocation_policy = NULL; + } + if (reinvocation_policy) { + if(!cJSON_IsString(reinvocation_policy) && !cJSON_IsNull(reinvocation_policy)) + { + goto end; //String + } + } + + // v1alpha1_mutating_admission_policy_spec->variables + cJSON *variables = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutating_admission_policy_specJSON, "variables"); + if (cJSON_IsNull(variables)) { + variables = NULL; + } + if (variables) { + cJSON *variables_local_nonprimitive = NULL; + if(!cJSON_IsArray(variables)){ + goto end; //nonprimitive container + } + + variablesList = list_createList(); + + cJSON_ArrayForEach(variables_local_nonprimitive,variables ) + { + if(!cJSON_IsObject(variables_local_nonprimitive)){ + goto end; + } + v1alpha1_variable_t *variablesItem = v1alpha1_variable_parseFromJSON(variables_local_nonprimitive); + + list_addElement(variablesList, variablesItem); + } + } + + + v1alpha1_mutating_admission_policy_spec_local_var = v1alpha1_mutating_admission_policy_spec_create_internal ( + failure_policy && !cJSON_IsNull(failure_policy) ? strdup(failure_policy->valuestring) : NULL, + match_conditions ? match_conditionsList : NULL, + match_constraints ? match_constraints_local_nonprim : NULL, + mutations ? mutationsList : NULL, + param_kind ? param_kind_local_nonprim : NULL, + reinvocation_policy && !cJSON_IsNull(reinvocation_policy) ? strdup(reinvocation_policy->valuestring) : NULL, + variables ? variablesList : NULL + ); + + return v1alpha1_mutating_admission_policy_spec_local_var; +end: + if (match_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_conditionsList) { + v1alpha1_match_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(match_conditionsList); + match_conditionsList = NULL; + } + if (match_constraints_local_nonprim) { + v1alpha1_match_resources_free(match_constraints_local_nonprim); + match_constraints_local_nonprim = NULL; + } + if (mutationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, mutationsList) { + v1alpha1_mutation_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(mutationsList); + mutationsList = NULL; + } + if (param_kind_local_nonprim) { + v1alpha1_param_kind_free(param_kind_local_nonprim); + param_kind_local_nonprim = NULL; + } + if (variablesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, variablesList) { + v1alpha1_variable_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(variablesList); + variablesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_mutating_admission_policy_spec.h b/kubernetes/model/v1alpha1_mutating_admission_policy_spec.h new file mode 100644 index 00000000..85d2a961 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutating_admission_policy_spec.h @@ -0,0 +1,55 @@ +/* + * v1alpha1_mutating_admission_policy_spec.h + * + * MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy. + */ + +#ifndef _v1alpha1_mutating_admission_policy_spec_H_ +#define _v1alpha1_mutating_admission_policy_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_mutating_admission_policy_spec_t v1alpha1_mutating_admission_policy_spec_t; + +#include "v1alpha1_match_condition.h" +#include "v1alpha1_match_resources.h" +#include "v1alpha1_mutation.h" +#include "v1alpha1_param_kind.h" +#include "v1alpha1_variable.h" + + + +typedef struct v1alpha1_mutating_admission_policy_spec_t { + char *failure_policy; // string + list_t *match_conditions; //nonprimitive container + struct v1alpha1_match_resources_t *match_constraints; //model + list_t *mutations; //nonprimitive container + struct v1alpha1_param_kind_t *param_kind; //model + char *reinvocation_policy; // string + list_t *variables; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_mutating_admission_policy_spec_t; + +__attribute__((deprecated)) v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec_create( + char *failure_policy, + list_t *match_conditions, + v1alpha1_match_resources_t *match_constraints, + list_t *mutations, + v1alpha1_param_kind_t *param_kind, + char *reinvocation_policy, + list_t *variables +); + +void v1alpha1_mutating_admission_policy_spec_free(v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec); + +v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec_parseFromJSON(cJSON *v1alpha1_mutating_admission_policy_specJSON); + +cJSON *v1alpha1_mutating_admission_policy_spec_convertToJSON(v1alpha1_mutating_admission_policy_spec_t *v1alpha1_mutating_admission_policy_spec); + +#endif /* _v1alpha1_mutating_admission_policy_spec_H_ */ + diff --git a/kubernetes/model/v1alpha1_mutation.c b/kubernetes/model/v1alpha1_mutation.c new file mode 100644 index 00000000..cf97efbe --- /dev/null +++ b/kubernetes/model/v1alpha1_mutation.c @@ -0,0 +1,168 @@ +#include +#include +#include +#include "v1alpha1_mutation.h" + + + +static v1alpha1_mutation_t *v1alpha1_mutation_create_internal( + v1alpha1_apply_configuration_t *apply_configuration, + v1alpha1_json_patch_t *json_patch, + char *patch_type + ) { + v1alpha1_mutation_t *v1alpha1_mutation_local_var = malloc(sizeof(v1alpha1_mutation_t)); + if (!v1alpha1_mutation_local_var) { + return NULL; + } + v1alpha1_mutation_local_var->apply_configuration = apply_configuration; + v1alpha1_mutation_local_var->json_patch = json_patch; + v1alpha1_mutation_local_var->patch_type = patch_type; + + v1alpha1_mutation_local_var->_library_owned = 1; + return v1alpha1_mutation_local_var; +} + +__attribute__((deprecated)) v1alpha1_mutation_t *v1alpha1_mutation_create( + v1alpha1_apply_configuration_t *apply_configuration, + v1alpha1_json_patch_t *json_patch, + char *patch_type + ) { + return v1alpha1_mutation_create_internal ( + apply_configuration, + json_patch, + patch_type + ); +} + +void v1alpha1_mutation_free(v1alpha1_mutation_t *v1alpha1_mutation) { + if(NULL == v1alpha1_mutation){ + return ; + } + if(v1alpha1_mutation->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_mutation_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_mutation->apply_configuration) { + v1alpha1_apply_configuration_free(v1alpha1_mutation->apply_configuration); + v1alpha1_mutation->apply_configuration = NULL; + } + if (v1alpha1_mutation->json_patch) { + v1alpha1_json_patch_free(v1alpha1_mutation->json_patch); + v1alpha1_mutation->json_patch = NULL; + } + if (v1alpha1_mutation->patch_type) { + free(v1alpha1_mutation->patch_type); + v1alpha1_mutation->patch_type = NULL; + } + free(v1alpha1_mutation); +} + +cJSON *v1alpha1_mutation_convertToJSON(v1alpha1_mutation_t *v1alpha1_mutation) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_mutation->apply_configuration + if(v1alpha1_mutation->apply_configuration) { + cJSON *apply_configuration_local_JSON = v1alpha1_apply_configuration_convertToJSON(v1alpha1_mutation->apply_configuration); + if(apply_configuration_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "applyConfiguration", apply_configuration_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutation->json_patch + if(v1alpha1_mutation->json_patch) { + cJSON *json_patch_local_JSON = v1alpha1_json_patch_convertToJSON(v1alpha1_mutation->json_patch); + if(json_patch_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "jsonPatch", json_patch_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_mutation->patch_type + if (!v1alpha1_mutation->patch_type) { + goto fail; + } + if(cJSON_AddStringToObject(item, "patchType", v1alpha1_mutation->patch_type) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_mutation_t *v1alpha1_mutation_parseFromJSON(cJSON *v1alpha1_mutationJSON){ + + v1alpha1_mutation_t *v1alpha1_mutation_local_var = NULL; + + // define the local variable for v1alpha1_mutation->apply_configuration + v1alpha1_apply_configuration_t *apply_configuration_local_nonprim = NULL; + + // define the local variable for v1alpha1_mutation->json_patch + v1alpha1_json_patch_t *json_patch_local_nonprim = NULL; + + // v1alpha1_mutation->apply_configuration + cJSON *apply_configuration = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutationJSON, "applyConfiguration"); + if (cJSON_IsNull(apply_configuration)) { + apply_configuration = NULL; + } + if (apply_configuration) { + apply_configuration_local_nonprim = v1alpha1_apply_configuration_parseFromJSON(apply_configuration); //nonprimitive + } + + // v1alpha1_mutation->json_patch + cJSON *json_patch = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutationJSON, "jsonPatch"); + if (cJSON_IsNull(json_patch)) { + json_patch = NULL; + } + if (json_patch) { + json_patch_local_nonprim = v1alpha1_json_patch_parseFromJSON(json_patch); //nonprimitive + } + + // v1alpha1_mutation->patch_type + cJSON *patch_type = cJSON_GetObjectItemCaseSensitive(v1alpha1_mutationJSON, "patchType"); + if (cJSON_IsNull(patch_type)) { + patch_type = NULL; + } + if (!patch_type) { + goto end; + } + + + if(!cJSON_IsString(patch_type)) + { + goto end; //String + } + + + v1alpha1_mutation_local_var = v1alpha1_mutation_create_internal ( + apply_configuration ? apply_configuration_local_nonprim : NULL, + json_patch ? json_patch_local_nonprim : NULL, + strdup(patch_type->valuestring) + ); + + return v1alpha1_mutation_local_var; +end: + if (apply_configuration_local_nonprim) { + v1alpha1_apply_configuration_free(apply_configuration_local_nonprim); + apply_configuration_local_nonprim = NULL; + } + if (json_patch_local_nonprim) { + v1alpha1_json_patch_free(json_patch_local_nonprim); + json_patch_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_mutation.h b/kubernetes/model/v1alpha1_mutation.h new file mode 100644 index 00000000..a2584ed0 --- /dev/null +++ b/kubernetes/model/v1alpha1_mutation.h @@ -0,0 +1,44 @@ +/* + * v1alpha1_mutation.h + * + * Mutation specifies the CEL expression which is used to apply the Mutation. + */ + +#ifndef _v1alpha1_mutation_H_ +#define _v1alpha1_mutation_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_mutation_t v1alpha1_mutation_t; + +#include "v1alpha1_apply_configuration.h" +#include "v1alpha1_json_patch.h" + + + +typedef struct v1alpha1_mutation_t { + struct v1alpha1_apply_configuration_t *apply_configuration; //model + struct v1alpha1_json_patch_t *json_patch; //model + char *patch_type; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_mutation_t; + +__attribute__((deprecated)) v1alpha1_mutation_t *v1alpha1_mutation_create( + v1alpha1_apply_configuration_t *apply_configuration, + v1alpha1_json_patch_t *json_patch, + char *patch_type +); + +void v1alpha1_mutation_free(v1alpha1_mutation_t *v1alpha1_mutation); + +v1alpha1_mutation_t *v1alpha1_mutation_parseFromJSON(cJSON *v1alpha1_mutationJSON); + +cJSON *v1alpha1_mutation_convertToJSON(v1alpha1_mutation_t *v1alpha1_mutation); + +#endif /* _v1alpha1_mutation_H_ */ + diff --git a/kubernetes/model/v1alpha1_named_rule_with_operations.c b/kubernetes/model/v1alpha1_named_rule_with_operations.c index 014667bb..79835b3e 100644 --- a/kubernetes/model/v1alpha1_named_rule_with_operations.c +++ b/kubernetes/model/v1alpha1_named_rule_with_operations.c @@ -5,7 +5,7 @@ -v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_create( +static v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_create_internal( list_t *api_groups, list_t *api_versions, list_t *operations, @@ -24,14 +24,36 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_creat v1alpha1_named_rule_with_operations_local_var->resources = resources; v1alpha1_named_rule_with_operations_local_var->scope = scope; + v1alpha1_named_rule_with_operations_local_var->_library_owned = 1; return v1alpha1_named_rule_with_operations_local_var; } +__attribute__((deprecated)) v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_create( + list_t *api_groups, + list_t *api_versions, + list_t *operations, + list_t *resource_names, + list_t *resources, + char *scope + ) { + return v1alpha1_named_rule_with_operations_create_internal ( + api_groups, + api_versions, + operations, + resource_names, + resources, + scope + ); +} void v1alpha1_named_rule_with_operations_free(v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations) { if(NULL == v1alpha1_named_rule_with_operations){ return ; } + if(v1alpha1_named_rule_with_operations->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_named_rule_with_operations_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_named_rule_with_operations->api_groups) { list_ForEach(listEntry, v1alpha1_named_rule_with_operations->api_groups) { @@ -87,7 +109,7 @@ cJSON *v1alpha1_named_rule_with_operations_convertToJSON(v1alpha1_named_rule_wit listEntry_t *api_groupsListEntry; list_ForEach(api_groupsListEntry, v1alpha1_named_rule_with_operations->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_groups, "", api_groupsListEntry->data) == NULL) { goto fail; } @@ -104,7 +126,7 @@ cJSON *v1alpha1_named_rule_with_operations_convertToJSON(v1alpha1_named_rule_wit listEntry_t *api_versionsListEntry; list_ForEach(api_versionsListEntry, v1alpha1_named_rule_with_operations->api_versions) { - if(cJSON_AddStringToObject(api_versions, "", (char*)api_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_versions, "", api_versionsListEntry->data) == NULL) { goto fail; } @@ -121,7 +143,7 @@ cJSON *v1alpha1_named_rule_with_operations_convertToJSON(v1alpha1_named_rule_wit listEntry_t *operationsListEntry; list_ForEach(operationsListEntry, v1alpha1_named_rule_with_operations->operations) { - if(cJSON_AddStringToObject(operations, "", (char*)operationsListEntry->data) == NULL) + if(cJSON_AddStringToObject(operations, "", operationsListEntry->data) == NULL) { goto fail; } @@ -138,7 +160,7 @@ cJSON *v1alpha1_named_rule_with_operations_convertToJSON(v1alpha1_named_rule_wit listEntry_t *resource_namesListEntry; list_ForEach(resource_namesListEntry, v1alpha1_named_rule_with_operations->resource_names) { - if(cJSON_AddStringToObject(resource_names, "", (char*)resource_namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resource_names, "", resource_namesListEntry->data) == NULL) { goto fail; } @@ -155,7 +177,7 @@ cJSON *v1alpha1_named_rule_with_operations_convertToJSON(v1alpha1_named_rule_wit listEntry_t *resourcesListEntry; list_ForEach(resourcesListEntry, v1alpha1_named_rule_with_operations->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resources, "", resourcesListEntry->data) == NULL) { goto fail; } @@ -199,6 +221,9 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_parse // v1alpha1_named_rule_with_operations->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1alpha1_named_rule_with_operationsJSON, "apiGroups"); + if (cJSON_IsNull(api_groups)) { + api_groups = NULL; + } if (api_groups) { cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { @@ -218,6 +243,9 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_parse // v1alpha1_named_rule_with_operations->api_versions cJSON *api_versions = cJSON_GetObjectItemCaseSensitive(v1alpha1_named_rule_with_operationsJSON, "apiVersions"); + if (cJSON_IsNull(api_versions)) { + api_versions = NULL; + } if (api_versions) { cJSON *api_versions_local = NULL; if(!cJSON_IsArray(api_versions)) { @@ -237,6 +265,9 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_parse // v1alpha1_named_rule_with_operations->operations cJSON *operations = cJSON_GetObjectItemCaseSensitive(v1alpha1_named_rule_with_operationsJSON, "operations"); + if (cJSON_IsNull(operations)) { + operations = NULL; + } if (operations) { cJSON *operations_local = NULL; if(!cJSON_IsArray(operations)) { @@ -256,6 +287,9 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_parse // v1alpha1_named_rule_with_operations->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1alpha1_named_rule_with_operationsJSON, "resourceNames"); + if (cJSON_IsNull(resource_names)) { + resource_names = NULL; + } if (resource_names) { cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { @@ -275,6 +309,9 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_parse // v1alpha1_named_rule_with_operations->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1alpha1_named_rule_with_operationsJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { @@ -294,6 +331,9 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_parse // v1alpha1_named_rule_with_operations->scope cJSON *scope = cJSON_GetObjectItemCaseSensitive(v1alpha1_named_rule_with_operationsJSON, "scope"); + if (cJSON_IsNull(scope)) { + scope = NULL; + } if (scope) { if(!cJSON_IsString(scope) && !cJSON_IsNull(scope)) { @@ -302,7 +342,7 @@ v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_parse } - v1alpha1_named_rule_with_operations_local_var = v1alpha1_named_rule_with_operations_create ( + v1alpha1_named_rule_with_operations_local_var = v1alpha1_named_rule_with_operations_create_internal ( api_groups ? api_groupsList : NULL, api_versions ? api_versionsList : NULL, operations ? operationsList : NULL, diff --git a/kubernetes/model/v1alpha1_named_rule_with_operations.h b/kubernetes/model/v1alpha1_named_rule_with_operations.h index 8138d79b..07698fb4 100644 --- a/kubernetes/model/v1alpha1_named_rule_with_operations.h +++ b/kubernetes/model/v1alpha1_named_rule_with_operations.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_named_rule_with_operations_t { list_t *resources; //primitive container char *scope; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_named_rule_with_operations_t; -v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_create( +__attribute__((deprecated)) v1alpha1_named_rule_with_operations_t *v1alpha1_named_rule_with_operations_create( list_t *api_groups, list_t *api_versions, list_t *operations, diff --git a/kubernetes/model/v1alpha1_param_kind.c b/kubernetes/model/v1alpha1_param_kind.c index a25f8eb3..722467ac 100644 --- a/kubernetes/model/v1alpha1_param_kind.c +++ b/kubernetes/model/v1alpha1_param_kind.c @@ -5,7 +5,7 @@ -v1alpha1_param_kind_t *v1alpha1_param_kind_create( +static v1alpha1_param_kind_t *v1alpha1_param_kind_create_internal( char *api_version, char *kind ) { @@ -16,14 +16,28 @@ v1alpha1_param_kind_t *v1alpha1_param_kind_create( v1alpha1_param_kind_local_var->api_version = api_version; v1alpha1_param_kind_local_var->kind = kind; + v1alpha1_param_kind_local_var->_library_owned = 1; return v1alpha1_param_kind_local_var; } +__attribute__((deprecated)) v1alpha1_param_kind_t *v1alpha1_param_kind_create( + char *api_version, + char *kind + ) { + return v1alpha1_param_kind_create_internal ( + api_version, + kind + ); +} void v1alpha1_param_kind_free(v1alpha1_param_kind_t *v1alpha1_param_kind) { if(NULL == v1alpha1_param_kind){ return ; } + if(v1alpha1_param_kind->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_param_kind_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_param_kind->api_version) { free(v1alpha1_param_kind->api_version); @@ -68,6 +82,9 @@ v1alpha1_param_kind_t *v1alpha1_param_kind_parseFromJSON(cJSON *v1alpha1_param_k // v1alpha1_param_kind->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_param_kindJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -77,6 +94,9 @@ v1alpha1_param_kind_t *v1alpha1_param_kind_parseFromJSON(cJSON *v1alpha1_param_k // v1alpha1_param_kind->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_param_kindJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -85,7 +105,7 @@ v1alpha1_param_kind_t *v1alpha1_param_kind_parseFromJSON(cJSON *v1alpha1_param_k } - v1alpha1_param_kind_local_var = v1alpha1_param_kind_create ( + v1alpha1_param_kind_local_var = v1alpha1_param_kind_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL ); diff --git a/kubernetes/model/v1alpha1_param_kind.h b/kubernetes/model/v1alpha1_param_kind.h index 4fb04f43..e41b45b1 100644 --- a/kubernetes/model/v1alpha1_param_kind.h +++ b/kubernetes/model/v1alpha1_param_kind.h @@ -22,9 +22,10 @@ typedef struct v1alpha1_param_kind_t { char *api_version; // string char *kind; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_param_kind_t; -v1alpha1_param_kind_t *v1alpha1_param_kind_create( +__attribute__((deprecated)) v1alpha1_param_kind_t *v1alpha1_param_kind_create( char *api_version, char *kind ); diff --git a/kubernetes/model/v1alpha1_param_ref.c b/kubernetes/model/v1alpha1_param_ref.c index b0b740cb..8b5154e0 100644 --- a/kubernetes/model/v1alpha1_param_ref.c +++ b/kubernetes/model/v1alpha1_param_ref.c @@ -5,7 +5,7 @@ -v1alpha1_param_ref_t *v1alpha1_param_ref_create( +static v1alpha1_param_ref_t *v1alpha1_param_ref_create_internal( char *name, char *_namespace, char *parameter_not_found_action, @@ -20,14 +20,32 @@ v1alpha1_param_ref_t *v1alpha1_param_ref_create( v1alpha1_param_ref_local_var->parameter_not_found_action = parameter_not_found_action; v1alpha1_param_ref_local_var->selector = selector; + v1alpha1_param_ref_local_var->_library_owned = 1; return v1alpha1_param_ref_local_var; } +__attribute__((deprecated)) v1alpha1_param_ref_t *v1alpha1_param_ref_create( + char *name, + char *_namespace, + char *parameter_not_found_action, + v1_label_selector_t *selector + ) { + return v1alpha1_param_ref_create_internal ( + name, + _namespace, + parameter_not_found_action, + selector + ); +} void v1alpha1_param_ref_free(v1alpha1_param_ref_t *v1alpha1_param_ref) { if(NULL == v1alpha1_param_ref){ return ; } + if(v1alpha1_param_ref->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_param_ref_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_param_ref->name) { free(v1alpha1_param_ref->name); @@ -104,6 +122,9 @@ v1alpha1_param_ref_t *v1alpha1_param_ref_parseFromJSON(cJSON *v1alpha1_param_ref // v1alpha1_param_ref->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha1_param_refJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -113,6 +134,9 @@ v1alpha1_param_ref_t *v1alpha1_param_ref_parseFromJSON(cJSON *v1alpha1_param_ref // v1alpha1_param_ref->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1alpha1_param_refJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -122,6 +146,9 @@ v1alpha1_param_ref_t *v1alpha1_param_ref_parseFromJSON(cJSON *v1alpha1_param_ref // v1alpha1_param_ref->parameter_not_found_action cJSON *parameter_not_found_action = cJSON_GetObjectItemCaseSensitive(v1alpha1_param_refJSON, "parameterNotFoundAction"); + if (cJSON_IsNull(parameter_not_found_action)) { + parameter_not_found_action = NULL; + } if (parameter_not_found_action) { if(!cJSON_IsString(parameter_not_found_action) && !cJSON_IsNull(parameter_not_found_action)) { @@ -131,12 +158,15 @@ v1alpha1_param_ref_t *v1alpha1_param_ref_parseFromJSON(cJSON *v1alpha1_param_ref // v1alpha1_param_ref->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1alpha1_param_refJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { selector_local_nonprim = v1_label_selector_parseFromJSON(selector); //nonprimitive } - v1alpha1_param_ref_local_var = v1alpha1_param_ref_create ( + v1alpha1_param_ref_local_var = v1alpha1_param_ref_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, parameter_not_found_action && !cJSON_IsNull(parameter_not_found_action) ? strdup(parameter_not_found_action->valuestring) : NULL, diff --git a/kubernetes/model/v1alpha1_param_ref.h b/kubernetes/model/v1alpha1_param_ref.h index f9fa1e05..1dc56224 100644 --- a/kubernetes/model/v1alpha1_param_ref.h +++ b/kubernetes/model/v1alpha1_param_ref.h @@ -25,9 +25,10 @@ typedef struct v1alpha1_param_ref_t { char *parameter_not_found_action; // string struct v1_label_selector_t *selector; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_param_ref_t; -v1alpha1_param_ref_t *v1alpha1_param_ref_create( +__attribute__((deprecated)) v1alpha1_param_ref_t *v1alpha1_param_ref_create( char *name, char *_namespace, char *parameter_not_found_action, diff --git a/kubernetes/model/v1alpha1_parent_reference.c b/kubernetes/model/v1alpha1_parent_reference.c deleted file mode 100644 index adb6b620..00000000 --- a/kubernetes/model/v1alpha1_parent_reference.c +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include "v1alpha1_parent_reference.h" - - - -v1alpha1_parent_reference_t *v1alpha1_parent_reference_create( - char *group, - char *name, - char *_namespace, - char *resource - ) { - v1alpha1_parent_reference_t *v1alpha1_parent_reference_local_var = malloc(sizeof(v1alpha1_parent_reference_t)); - if (!v1alpha1_parent_reference_local_var) { - return NULL; - } - v1alpha1_parent_reference_local_var->group = group; - v1alpha1_parent_reference_local_var->name = name; - v1alpha1_parent_reference_local_var->_namespace = _namespace; - v1alpha1_parent_reference_local_var->resource = resource; - - return v1alpha1_parent_reference_local_var; -} - - -void v1alpha1_parent_reference_free(v1alpha1_parent_reference_t *v1alpha1_parent_reference) { - if(NULL == v1alpha1_parent_reference){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_parent_reference->group) { - free(v1alpha1_parent_reference->group); - v1alpha1_parent_reference->group = NULL; - } - if (v1alpha1_parent_reference->name) { - free(v1alpha1_parent_reference->name); - v1alpha1_parent_reference->name = NULL; - } - if (v1alpha1_parent_reference->_namespace) { - free(v1alpha1_parent_reference->_namespace); - v1alpha1_parent_reference->_namespace = NULL; - } - if (v1alpha1_parent_reference->resource) { - free(v1alpha1_parent_reference->resource); - v1alpha1_parent_reference->resource = NULL; - } - free(v1alpha1_parent_reference); -} - -cJSON *v1alpha1_parent_reference_convertToJSON(v1alpha1_parent_reference_t *v1alpha1_parent_reference) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_parent_reference->group - if(v1alpha1_parent_reference->group) { - if(cJSON_AddStringToObject(item, "group", v1alpha1_parent_reference->group) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_parent_reference->name - if (!v1alpha1_parent_reference->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1alpha1_parent_reference->name) == NULL) { - goto fail; //String - } - - - // v1alpha1_parent_reference->_namespace - if(v1alpha1_parent_reference->_namespace) { - if(cJSON_AddStringToObject(item, "namespace", v1alpha1_parent_reference->_namespace) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_parent_reference->resource - if (!v1alpha1_parent_reference->resource) { - goto fail; - } - if(cJSON_AddStringToObject(item, "resource", v1alpha1_parent_reference->resource) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_parent_reference_t *v1alpha1_parent_reference_parseFromJSON(cJSON *v1alpha1_parent_referenceJSON){ - - v1alpha1_parent_reference_t *v1alpha1_parent_reference_local_var = NULL; - - // v1alpha1_parent_reference->group - cJSON *group = cJSON_GetObjectItemCaseSensitive(v1alpha1_parent_referenceJSON, "group"); - if (group) { - if(!cJSON_IsString(group) && !cJSON_IsNull(group)) - { - goto end; //String - } - } - - // v1alpha1_parent_reference->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha1_parent_referenceJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - // v1alpha1_parent_reference->_namespace - cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1alpha1_parent_referenceJSON, "namespace"); - if (_namespace) { - if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) - { - goto end; //String - } - } - - // v1alpha1_parent_reference->resource - cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1alpha1_parent_referenceJSON, "resource"); - if (!resource) { - goto end; - } - - - if(!cJSON_IsString(resource)) - { - goto end; //String - } - - - v1alpha1_parent_reference_local_var = v1alpha1_parent_reference_create ( - group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, - strdup(name->valuestring), - _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, - strdup(resource->valuestring) - ); - - return v1alpha1_parent_reference_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_parent_reference.h b/kubernetes/model/v1alpha1_parent_reference.h deleted file mode 100644 index 1ca3df78..00000000 --- a/kubernetes/model/v1alpha1_parent_reference.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1alpha1_parent_reference.h - * - * ParentReference describes a reference to a parent object. - */ - -#ifndef _v1alpha1_parent_reference_H_ -#define _v1alpha1_parent_reference_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_parent_reference_t v1alpha1_parent_reference_t; - - - - -typedef struct v1alpha1_parent_reference_t { - char *group; // string - char *name; // string - char *_namespace; // string - char *resource; // string - -} v1alpha1_parent_reference_t; - -v1alpha1_parent_reference_t *v1alpha1_parent_reference_create( - char *group, - char *name, - char *_namespace, - char *resource -); - -void v1alpha1_parent_reference_free(v1alpha1_parent_reference_t *v1alpha1_parent_reference); - -v1alpha1_parent_reference_t *v1alpha1_parent_reference_parseFromJSON(cJSON *v1alpha1_parent_referenceJSON); - -cJSON *v1alpha1_parent_reference_convertToJSON(v1alpha1_parent_reference_t *v1alpha1_parent_reference); - -#endif /* _v1alpha1_parent_reference_H_ */ - diff --git a/kubernetes/model/v1alpha1_pod_certificate_request.c b/kubernetes/model/v1alpha1_pod_certificate_request.c new file mode 100644 index 00000000..63fd9ee9 --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request.c @@ -0,0 +1,235 @@ +#include +#include +#include +#include "v1alpha1_pod_certificate_request.h" + + + +static v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_pod_certificate_request_spec_t *spec, + v1alpha1_pod_certificate_request_status_t *status + ) { + v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request_local_var = malloc(sizeof(v1alpha1_pod_certificate_request_t)); + if (!v1alpha1_pod_certificate_request_local_var) { + return NULL; + } + v1alpha1_pod_certificate_request_local_var->api_version = api_version; + v1alpha1_pod_certificate_request_local_var->kind = kind; + v1alpha1_pod_certificate_request_local_var->metadata = metadata; + v1alpha1_pod_certificate_request_local_var->spec = spec; + v1alpha1_pod_certificate_request_local_var->status = status; + + v1alpha1_pod_certificate_request_local_var->_library_owned = 1; + return v1alpha1_pod_certificate_request_local_var; +} + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_pod_certificate_request_spec_t *spec, + v1alpha1_pod_certificate_request_status_t *status + ) { + return v1alpha1_pod_certificate_request_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} + +void v1alpha1_pod_certificate_request_free(v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request) { + if(NULL == v1alpha1_pod_certificate_request){ + return ; + } + if(v1alpha1_pod_certificate_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_pod_certificate_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_pod_certificate_request->api_version) { + free(v1alpha1_pod_certificate_request->api_version); + v1alpha1_pod_certificate_request->api_version = NULL; + } + if (v1alpha1_pod_certificate_request->kind) { + free(v1alpha1_pod_certificate_request->kind); + v1alpha1_pod_certificate_request->kind = NULL; + } + if (v1alpha1_pod_certificate_request->metadata) { + v1_object_meta_free(v1alpha1_pod_certificate_request->metadata); + v1alpha1_pod_certificate_request->metadata = NULL; + } + if (v1alpha1_pod_certificate_request->spec) { + v1alpha1_pod_certificate_request_spec_free(v1alpha1_pod_certificate_request->spec); + v1alpha1_pod_certificate_request->spec = NULL; + } + if (v1alpha1_pod_certificate_request->status) { + v1alpha1_pod_certificate_request_status_free(v1alpha1_pod_certificate_request->status); + v1alpha1_pod_certificate_request->status = NULL; + } + free(v1alpha1_pod_certificate_request); +} + +cJSON *v1alpha1_pod_certificate_request_convertToJSON(v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_pod_certificate_request->api_version + if(v1alpha1_pod_certificate_request->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_pod_certificate_request->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_pod_certificate_request->kind + if(v1alpha1_pod_certificate_request->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha1_pod_certificate_request->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_pod_certificate_request->metadata + if(v1alpha1_pod_certificate_request->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_pod_certificate_request->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha1_pod_certificate_request->spec + if (!v1alpha1_pod_certificate_request->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1alpha1_pod_certificate_request_spec_convertToJSON(v1alpha1_pod_certificate_request->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + + // v1alpha1_pod_certificate_request->status + if(v1alpha1_pod_certificate_request->status) { + cJSON *status_local_JSON = v1alpha1_pod_certificate_request_status_convertToJSON(v1alpha1_pod_certificate_request->status); + if(status_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "status", status_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request_parseFromJSON(cJSON *v1alpha1_pod_certificate_requestJSON){ + + v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request_local_var = NULL; + + // define the local variable for v1alpha1_pod_certificate_request->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1alpha1_pod_certificate_request->spec + v1alpha1_pod_certificate_request_spec_t *spec_local_nonprim = NULL; + + // define the local variable for v1alpha1_pod_certificate_request->status + v1alpha1_pod_certificate_request_status_t *status_local_nonprim = NULL; + + // v1alpha1_pod_certificate_request->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_requestJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha1_pod_certificate_request->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_requestJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha1_pod_certificate_request->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_requestJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1alpha1_pod_certificate_request->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_requestJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1alpha1_pod_certificate_request_spec_parseFromJSON(spec); //nonprimitive + + // v1alpha1_pod_certificate_request->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_requestJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } + if (status) { + status_local_nonprim = v1alpha1_pod_certificate_request_status_parseFromJSON(status); //nonprimitive + } + + + v1alpha1_pod_certificate_request_local_var = v1alpha1_pod_certificate_request_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim, + status ? status_local_nonprim : NULL + ); + + return v1alpha1_pod_certificate_request_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1alpha1_pod_certificate_request_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + if (status_local_nonprim) { + v1alpha1_pod_certificate_request_status_free(status_local_nonprim); + status_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_pod_certificate_request.h b/kubernetes/model/v1alpha1_pod_certificate_request.h new file mode 100644 index 00000000..3e49ae06 --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request.h @@ -0,0 +1,49 @@ +/* + * v1alpha1_pod_certificate_request.h + * + * PodCertificateRequest encodes a pod requesting a certificate from a given signer. Kubelets use this API to implement podCertificate projected volumes + */ + +#ifndef _v1alpha1_pod_certificate_request_H_ +#define _v1alpha1_pod_certificate_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_pod_certificate_request_t v1alpha1_pod_certificate_request_t; + +#include "v1_object_meta.h" +#include "v1alpha1_pod_certificate_request_spec.h" +#include "v1alpha1_pod_certificate_request_status.h" + + + +typedef struct v1alpha1_pod_certificate_request_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1alpha1_pod_certificate_request_spec_t *spec; //model + struct v1alpha1_pod_certificate_request_status_t *status; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_pod_certificate_request_t; + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_pod_certificate_request_spec_t *spec, + v1alpha1_pod_certificate_request_status_t *status +); + +void v1alpha1_pod_certificate_request_free(v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request); + +v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request_parseFromJSON(cJSON *v1alpha1_pod_certificate_requestJSON); + +cJSON *v1alpha1_pod_certificate_request_convertToJSON(v1alpha1_pod_certificate_request_t *v1alpha1_pod_certificate_request); + +#endif /* _v1alpha1_pod_certificate_request_H_ */ + diff --git a/kubernetes/model/v1alpha1_pod_certificate_request_list.c b/kubernetes/model/v1alpha1_pod_certificate_request_list.c new file mode 100644 index 00000000..dcdb485f --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1alpha1_pod_certificate_request_list.h" + + + +static v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list_local_var = malloc(sizeof(v1alpha1_pod_certificate_request_list_t)); + if (!v1alpha1_pod_certificate_request_list_local_var) { + return NULL; + } + v1alpha1_pod_certificate_request_list_local_var->api_version = api_version; + v1alpha1_pod_certificate_request_list_local_var->items = items; + v1alpha1_pod_certificate_request_list_local_var->kind = kind; + v1alpha1_pod_certificate_request_list_local_var->metadata = metadata; + + v1alpha1_pod_certificate_request_list_local_var->_library_owned = 1; + return v1alpha1_pod_certificate_request_list_local_var; +} + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha1_pod_certificate_request_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1alpha1_pod_certificate_request_list_free(v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list) { + if(NULL == v1alpha1_pod_certificate_request_list){ + return ; + } + if(v1alpha1_pod_certificate_request_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_pod_certificate_request_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_pod_certificate_request_list->api_version) { + free(v1alpha1_pod_certificate_request_list->api_version); + v1alpha1_pod_certificate_request_list->api_version = NULL; + } + if (v1alpha1_pod_certificate_request_list->items) { + list_ForEach(listEntry, v1alpha1_pod_certificate_request_list->items) { + v1alpha1_pod_certificate_request_free(listEntry->data); + } + list_freeList(v1alpha1_pod_certificate_request_list->items); + v1alpha1_pod_certificate_request_list->items = NULL; + } + if (v1alpha1_pod_certificate_request_list->kind) { + free(v1alpha1_pod_certificate_request_list->kind); + v1alpha1_pod_certificate_request_list->kind = NULL; + } + if (v1alpha1_pod_certificate_request_list->metadata) { + v1_list_meta_free(v1alpha1_pod_certificate_request_list->metadata); + v1alpha1_pod_certificate_request_list->metadata = NULL; + } + free(v1alpha1_pod_certificate_request_list); +} + +cJSON *v1alpha1_pod_certificate_request_list_convertToJSON(v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_pod_certificate_request_list->api_version + if(v1alpha1_pod_certificate_request_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_pod_certificate_request_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_pod_certificate_request_list->items + if (!v1alpha1_pod_certificate_request_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1alpha1_pod_certificate_request_list->items) { + list_ForEach(itemsListEntry, v1alpha1_pod_certificate_request_list->items) { + cJSON *itemLocal = v1alpha1_pod_certificate_request_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1alpha1_pod_certificate_request_list->kind + if(v1alpha1_pod_certificate_request_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha1_pod_certificate_request_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_pod_certificate_request_list->metadata + if(v1alpha1_pod_certificate_request_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha1_pod_certificate_request_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list_parseFromJSON(cJSON *v1alpha1_pod_certificate_request_listJSON){ + + v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list_local_var = NULL; + + // define the local list for v1alpha1_pod_certificate_request_list->items + list_t *itemsList = NULL; + + // define the local variable for v1alpha1_pod_certificate_request_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1alpha1_pod_certificate_request_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha1_pod_certificate_request_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1alpha1_pod_certificate_request_t *itemsItem = v1alpha1_pod_certificate_request_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1alpha1_pod_certificate_request_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha1_pod_certificate_request_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1alpha1_pod_certificate_request_list_local_var = v1alpha1_pod_certificate_request_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1alpha1_pod_certificate_request_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_pod_certificate_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_pod_certificate_request_list.h b/kubernetes/model/v1alpha1_pod_certificate_request_list.h new file mode 100644 index 00000000..47704198 --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request_list.h @@ -0,0 +1,46 @@ +/* + * v1alpha1_pod_certificate_request_list.h + * + * PodCertificateRequestList is a collection of PodCertificateRequest objects + */ + +#ifndef _v1alpha1_pod_certificate_request_list_H_ +#define _v1alpha1_pod_certificate_request_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_pod_certificate_request_list_t v1alpha1_pod_certificate_request_list_t; + +#include "v1_list_meta.h" +#include "v1alpha1_pod_certificate_request.h" + + + +typedef struct v1alpha1_pod_certificate_request_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_pod_certificate_request_list_t; + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1alpha1_pod_certificate_request_list_free(v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list); + +v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list_parseFromJSON(cJSON *v1alpha1_pod_certificate_request_listJSON); + +cJSON *v1alpha1_pod_certificate_request_list_convertToJSON(v1alpha1_pod_certificate_request_list_t *v1alpha1_pod_certificate_request_list); + +#endif /* _v1alpha1_pod_certificate_request_list_H_ */ + diff --git a/kubernetes/model/v1alpha1_pod_certificate_request_spec.c b/kubernetes/model/v1alpha1_pod_certificate_request_spec.c new file mode 100644 index 00000000..6fc79444 --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request_spec.c @@ -0,0 +1,381 @@ +#include +#include +#include +#include "v1alpha1_pod_certificate_request_spec.h" + + + +static v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec_create_internal( + int max_expiration_seconds, + char *node_name, + char *node_uid, + char *pkix_public_key, + char *pod_name, + char *pod_uid, + char *proof_of_possession, + char *service_account_name, + char *service_account_uid, + char *signer_name + ) { + v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec_local_var = malloc(sizeof(v1alpha1_pod_certificate_request_spec_t)); + if (!v1alpha1_pod_certificate_request_spec_local_var) { + return NULL; + } + v1alpha1_pod_certificate_request_spec_local_var->max_expiration_seconds = max_expiration_seconds; + v1alpha1_pod_certificate_request_spec_local_var->node_name = node_name; + v1alpha1_pod_certificate_request_spec_local_var->node_uid = node_uid; + v1alpha1_pod_certificate_request_spec_local_var->pkix_public_key = pkix_public_key; + v1alpha1_pod_certificate_request_spec_local_var->pod_name = pod_name; + v1alpha1_pod_certificate_request_spec_local_var->pod_uid = pod_uid; + v1alpha1_pod_certificate_request_spec_local_var->proof_of_possession = proof_of_possession; + v1alpha1_pod_certificate_request_spec_local_var->service_account_name = service_account_name; + v1alpha1_pod_certificate_request_spec_local_var->service_account_uid = service_account_uid; + v1alpha1_pod_certificate_request_spec_local_var->signer_name = signer_name; + + v1alpha1_pod_certificate_request_spec_local_var->_library_owned = 1; + return v1alpha1_pod_certificate_request_spec_local_var; +} + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec_create( + int max_expiration_seconds, + char *node_name, + char *node_uid, + char *pkix_public_key, + char *pod_name, + char *pod_uid, + char *proof_of_possession, + char *service_account_name, + char *service_account_uid, + char *signer_name + ) { + return v1alpha1_pod_certificate_request_spec_create_internal ( + max_expiration_seconds, + node_name, + node_uid, + pkix_public_key, + pod_name, + pod_uid, + proof_of_possession, + service_account_name, + service_account_uid, + signer_name + ); +} + +void v1alpha1_pod_certificate_request_spec_free(v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec) { + if(NULL == v1alpha1_pod_certificate_request_spec){ + return ; + } + if(v1alpha1_pod_certificate_request_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_pod_certificate_request_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_pod_certificate_request_spec->node_name) { + free(v1alpha1_pod_certificate_request_spec->node_name); + v1alpha1_pod_certificate_request_spec->node_name = NULL; + } + if (v1alpha1_pod_certificate_request_spec->node_uid) { + free(v1alpha1_pod_certificate_request_spec->node_uid); + v1alpha1_pod_certificate_request_spec->node_uid = NULL; + } + if (v1alpha1_pod_certificate_request_spec->pkix_public_key) { + free(v1alpha1_pod_certificate_request_spec->pkix_public_key); + v1alpha1_pod_certificate_request_spec->pkix_public_key = NULL; + } + if (v1alpha1_pod_certificate_request_spec->pod_name) { + free(v1alpha1_pod_certificate_request_spec->pod_name); + v1alpha1_pod_certificate_request_spec->pod_name = NULL; + } + if (v1alpha1_pod_certificate_request_spec->pod_uid) { + free(v1alpha1_pod_certificate_request_spec->pod_uid); + v1alpha1_pod_certificate_request_spec->pod_uid = NULL; + } + if (v1alpha1_pod_certificate_request_spec->proof_of_possession) { + free(v1alpha1_pod_certificate_request_spec->proof_of_possession); + v1alpha1_pod_certificate_request_spec->proof_of_possession = NULL; + } + if (v1alpha1_pod_certificate_request_spec->service_account_name) { + free(v1alpha1_pod_certificate_request_spec->service_account_name); + v1alpha1_pod_certificate_request_spec->service_account_name = NULL; + } + if (v1alpha1_pod_certificate_request_spec->service_account_uid) { + free(v1alpha1_pod_certificate_request_spec->service_account_uid); + v1alpha1_pod_certificate_request_spec->service_account_uid = NULL; + } + if (v1alpha1_pod_certificate_request_spec->signer_name) { + free(v1alpha1_pod_certificate_request_spec->signer_name); + v1alpha1_pod_certificate_request_spec->signer_name = NULL; + } + free(v1alpha1_pod_certificate_request_spec); +} + +cJSON *v1alpha1_pod_certificate_request_spec_convertToJSON(v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_pod_certificate_request_spec->max_expiration_seconds + if(v1alpha1_pod_certificate_request_spec->max_expiration_seconds) { + if(cJSON_AddNumberToObject(item, "maxExpirationSeconds", v1alpha1_pod_certificate_request_spec->max_expiration_seconds) == NULL) { + goto fail; //Numeric + } + } + + + // v1alpha1_pod_certificate_request_spec->node_name + if (!v1alpha1_pod_certificate_request_spec->node_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "nodeName", v1alpha1_pod_certificate_request_spec->node_name) == NULL) { + goto fail; //String + } + + + // v1alpha1_pod_certificate_request_spec->node_uid + if (!v1alpha1_pod_certificate_request_spec->node_uid) { + goto fail; + } + if(cJSON_AddStringToObject(item, "nodeUID", v1alpha1_pod_certificate_request_spec->node_uid) == NULL) { + goto fail; //String + } + + + // v1alpha1_pod_certificate_request_spec->pkix_public_key + if (!v1alpha1_pod_certificate_request_spec->pkix_public_key) { + goto fail; + } + if(cJSON_AddStringToObject(item, "pkixPublicKey", v1alpha1_pod_certificate_request_spec->pkix_public_key) == NULL) { + goto fail; //ByteArray + } + + + // v1alpha1_pod_certificate_request_spec->pod_name + if (!v1alpha1_pod_certificate_request_spec->pod_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "podName", v1alpha1_pod_certificate_request_spec->pod_name) == NULL) { + goto fail; //String + } + + + // v1alpha1_pod_certificate_request_spec->pod_uid + if (!v1alpha1_pod_certificate_request_spec->pod_uid) { + goto fail; + } + if(cJSON_AddStringToObject(item, "podUID", v1alpha1_pod_certificate_request_spec->pod_uid) == NULL) { + goto fail; //String + } + + + // v1alpha1_pod_certificate_request_spec->proof_of_possession + if (!v1alpha1_pod_certificate_request_spec->proof_of_possession) { + goto fail; + } + if(cJSON_AddStringToObject(item, "proofOfPossession", v1alpha1_pod_certificate_request_spec->proof_of_possession) == NULL) { + goto fail; //ByteArray + } + + + // v1alpha1_pod_certificate_request_spec->service_account_name + if (!v1alpha1_pod_certificate_request_spec->service_account_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "serviceAccountName", v1alpha1_pod_certificate_request_spec->service_account_name) == NULL) { + goto fail; //String + } + + + // v1alpha1_pod_certificate_request_spec->service_account_uid + if (!v1alpha1_pod_certificate_request_spec->service_account_uid) { + goto fail; + } + if(cJSON_AddStringToObject(item, "serviceAccountUID", v1alpha1_pod_certificate_request_spec->service_account_uid) == NULL) { + goto fail; //String + } + + + // v1alpha1_pod_certificate_request_spec->signer_name + if (!v1alpha1_pod_certificate_request_spec->signer_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "signerName", v1alpha1_pod_certificate_request_spec->signer_name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec_parseFromJSON(cJSON *v1alpha1_pod_certificate_request_specJSON){ + + v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec_local_var = NULL; + + // v1alpha1_pod_certificate_request_spec->max_expiration_seconds + cJSON *max_expiration_seconds = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "maxExpirationSeconds"); + if (cJSON_IsNull(max_expiration_seconds)) { + max_expiration_seconds = NULL; + } + if (max_expiration_seconds) { + if(!cJSON_IsNumber(max_expiration_seconds)) + { + goto end; //Numeric + } + } + + // v1alpha1_pod_certificate_request_spec->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } + if (!node_name) { + goto end; + } + + + if(!cJSON_IsString(node_name)) + { + goto end; //String + } + + // v1alpha1_pod_certificate_request_spec->node_uid + cJSON *node_uid = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "nodeUID"); + if (cJSON_IsNull(node_uid)) { + node_uid = NULL; + } + if (!node_uid) { + goto end; + } + + + if(!cJSON_IsString(node_uid)) + { + goto end; //String + } + + // v1alpha1_pod_certificate_request_spec->pkix_public_key + cJSON *pkix_public_key = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "pkixPublicKey"); + if (cJSON_IsNull(pkix_public_key)) { + pkix_public_key = NULL; + } + if (!pkix_public_key) { + goto end; + } + + + if(!cJSON_IsString(pkix_public_key)) + { + goto end; //ByteArray + } + + // v1alpha1_pod_certificate_request_spec->pod_name + cJSON *pod_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "podName"); + if (cJSON_IsNull(pod_name)) { + pod_name = NULL; + } + if (!pod_name) { + goto end; + } + + + if(!cJSON_IsString(pod_name)) + { + goto end; //String + } + + // v1alpha1_pod_certificate_request_spec->pod_uid + cJSON *pod_uid = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "podUID"); + if (cJSON_IsNull(pod_uid)) { + pod_uid = NULL; + } + if (!pod_uid) { + goto end; + } + + + if(!cJSON_IsString(pod_uid)) + { + goto end; //String + } + + // v1alpha1_pod_certificate_request_spec->proof_of_possession + cJSON *proof_of_possession = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "proofOfPossession"); + if (cJSON_IsNull(proof_of_possession)) { + proof_of_possession = NULL; + } + if (!proof_of_possession) { + goto end; + } + + + if(!cJSON_IsString(proof_of_possession)) + { + goto end; //ByteArray + } + + // v1alpha1_pod_certificate_request_spec->service_account_name + cJSON *service_account_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "serviceAccountName"); + if (cJSON_IsNull(service_account_name)) { + service_account_name = NULL; + } + if (!service_account_name) { + goto end; + } + + + if(!cJSON_IsString(service_account_name)) + { + goto end; //String + } + + // v1alpha1_pod_certificate_request_spec->service_account_uid + cJSON *service_account_uid = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "serviceAccountUID"); + if (cJSON_IsNull(service_account_uid)) { + service_account_uid = NULL; + } + if (!service_account_uid) { + goto end; + } + + + if(!cJSON_IsString(service_account_uid)) + { + goto end; //String + } + + // v1alpha1_pod_certificate_request_spec->signer_name + cJSON *signer_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_specJSON, "signerName"); + if (cJSON_IsNull(signer_name)) { + signer_name = NULL; + } + if (!signer_name) { + goto end; + } + + + if(!cJSON_IsString(signer_name)) + { + goto end; //String + } + + + v1alpha1_pod_certificate_request_spec_local_var = v1alpha1_pod_certificate_request_spec_create_internal ( + max_expiration_seconds ? max_expiration_seconds->valuedouble : 0, + strdup(node_name->valuestring), + strdup(node_uid->valuestring), + strdup(pkix_public_key->valuestring), + strdup(pod_name->valuestring), + strdup(pod_uid->valuestring), + strdup(proof_of_possession->valuestring), + strdup(service_account_name->valuestring), + strdup(service_account_uid->valuestring), + strdup(signer_name->valuestring) + ); + + return v1alpha1_pod_certificate_request_spec_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_pod_certificate_request_spec.h b/kubernetes/model/v1alpha1_pod_certificate_request_spec.h new file mode 100644 index 00000000..3c53afcb --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request_spec.h @@ -0,0 +1,56 @@ +/* + * v1alpha1_pod_certificate_request_spec.h + * + * PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation. + */ + +#ifndef _v1alpha1_pod_certificate_request_spec_H_ +#define _v1alpha1_pod_certificate_request_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_pod_certificate_request_spec_t v1alpha1_pod_certificate_request_spec_t; + + + + +typedef struct v1alpha1_pod_certificate_request_spec_t { + int max_expiration_seconds; //numeric + char *node_name; // string + char *node_uid; // string + char *pkix_public_key; //ByteArray + char *pod_name; // string + char *pod_uid; // string + char *proof_of_possession; //ByteArray + char *service_account_name; // string + char *service_account_uid; // string + char *signer_name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_pod_certificate_request_spec_t; + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec_create( + int max_expiration_seconds, + char *node_name, + char *node_uid, + char *pkix_public_key, + char *pod_name, + char *pod_uid, + char *proof_of_possession, + char *service_account_name, + char *service_account_uid, + char *signer_name +); + +void v1alpha1_pod_certificate_request_spec_free(v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec); + +v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec_parseFromJSON(cJSON *v1alpha1_pod_certificate_request_specJSON); + +cJSON *v1alpha1_pod_certificate_request_spec_convertToJSON(v1alpha1_pod_certificate_request_spec_t *v1alpha1_pod_certificate_request_spec); + +#endif /* _v1alpha1_pod_certificate_request_spec_H_ */ + diff --git a/kubernetes/model/v1alpha1_pod_certificate_request_status.c b/kubernetes/model/v1alpha1_pod_certificate_request_status.c new file mode 100644 index 00000000..6427a9ba --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request_status.c @@ -0,0 +1,243 @@ +#include +#include +#include +#include "v1alpha1_pod_certificate_request_status.h" + + + +static v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status_create_internal( + char *begin_refresh_at, + char *certificate_chain, + list_t *conditions, + char *not_after, + char *not_before + ) { + v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status_local_var = malloc(sizeof(v1alpha1_pod_certificate_request_status_t)); + if (!v1alpha1_pod_certificate_request_status_local_var) { + return NULL; + } + v1alpha1_pod_certificate_request_status_local_var->begin_refresh_at = begin_refresh_at; + v1alpha1_pod_certificate_request_status_local_var->certificate_chain = certificate_chain; + v1alpha1_pod_certificate_request_status_local_var->conditions = conditions; + v1alpha1_pod_certificate_request_status_local_var->not_after = not_after; + v1alpha1_pod_certificate_request_status_local_var->not_before = not_before; + + v1alpha1_pod_certificate_request_status_local_var->_library_owned = 1; + return v1alpha1_pod_certificate_request_status_local_var; +} + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status_create( + char *begin_refresh_at, + char *certificate_chain, + list_t *conditions, + char *not_after, + char *not_before + ) { + return v1alpha1_pod_certificate_request_status_create_internal ( + begin_refresh_at, + certificate_chain, + conditions, + not_after, + not_before + ); +} + +void v1alpha1_pod_certificate_request_status_free(v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status) { + if(NULL == v1alpha1_pod_certificate_request_status){ + return ; + } + if(v1alpha1_pod_certificate_request_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_pod_certificate_request_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha1_pod_certificate_request_status->begin_refresh_at) { + free(v1alpha1_pod_certificate_request_status->begin_refresh_at); + v1alpha1_pod_certificate_request_status->begin_refresh_at = NULL; + } + if (v1alpha1_pod_certificate_request_status->certificate_chain) { + free(v1alpha1_pod_certificate_request_status->certificate_chain); + v1alpha1_pod_certificate_request_status->certificate_chain = NULL; + } + if (v1alpha1_pod_certificate_request_status->conditions) { + list_ForEach(listEntry, v1alpha1_pod_certificate_request_status->conditions) { + v1_condition_free(listEntry->data); + } + list_freeList(v1alpha1_pod_certificate_request_status->conditions); + v1alpha1_pod_certificate_request_status->conditions = NULL; + } + if (v1alpha1_pod_certificate_request_status->not_after) { + free(v1alpha1_pod_certificate_request_status->not_after); + v1alpha1_pod_certificate_request_status->not_after = NULL; + } + if (v1alpha1_pod_certificate_request_status->not_before) { + free(v1alpha1_pod_certificate_request_status->not_before); + v1alpha1_pod_certificate_request_status->not_before = NULL; + } + free(v1alpha1_pod_certificate_request_status); +} + +cJSON *v1alpha1_pod_certificate_request_status_convertToJSON(v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha1_pod_certificate_request_status->begin_refresh_at + if(v1alpha1_pod_certificate_request_status->begin_refresh_at) { + if(cJSON_AddStringToObject(item, "beginRefreshAt", v1alpha1_pod_certificate_request_status->begin_refresh_at) == NULL) { + goto fail; //Date-Time + } + } + + + // v1alpha1_pod_certificate_request_status->certificate_chain + if(v1alpha1_pod_certificate_request_status->certificate_chain) { + if(cJSON_AddStringToObject(item, "certificateChain", v1alpha1_pod_certificate_request_status->certificate_chain) == NULL) { + goto fail; //String + } + } + + + // v1alpha1_pod_certificate_request_status->conditions + if(v1alpha1_pod_certificate_request_status->conditions) { + cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); + if(conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *conditionsListEntry; + if (v1alpha1_pod_certificate_request_status->conditions) { + list_ForEach(conditionsListEntry, v1alpha1_pod_certificate_request_status->conditions) { + cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(conditions, itemLocal); + } + } + } + + + // v1alpha1_pod_certificate_request_status->not_after + if(v1alpha1_pod_certificate_request_status->not_after) { + if(cJSON_AddStringToObject(item, "notAfter", v1alpha1_pod_certificate_request_status->not_after) == NULL) { + goto fail; //Date-Time + } + } + + + // v1alpha1_pod_certificate_request_status->not_before + if(v1alpha1_pod_certificate_request_status->not_before) { + if(cJSON_AddStringToObject(item, "notBefore", v1alpha1_pod_certificate_request_status->not_before) == NULL) { + goto fail; //Date-Time + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status_parseFromJSON(cJSON *v1alpha1_pod_certificate_request_statusJSON){ + + v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status_local_var = NULL; + + // define the local list for v1alpha1_pod_certificate_request_status->conditions + list_t *conditionsList = NULL; + + // v1alpha1_pod_certificate_request_status->begin_refresh_at + cJSON *begin_refresh_at = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_statusJSON, "beginRefreshAt"); + if (cJSON_IsNull(begin_refresh_at)) { + begin_refresh_at = NULL; + } + if (begin_refresh_at) { + if(!cJSON_IsString(begin_refresh_at) && !cJSON_IsNull(begin_refresh_at)) + { + goto end; //DateTime + } + } + + // v1alpha1_pod_certificate_request_status->certificate_chain + cJSON *certificate_chain = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_statusJSON, "certificateChain"); + if (cJSON_IsNull(certificate_chain)) { + certificate_chain = NULL; + } + if (certificate_chain) { + if(!cJSON_IsString(certificate_chain) && !cJSON_IsNull(certificate_chain)) + { + goto end; //String + } + } + + // v1alpha1_pod_certificate_request_status->conditions + cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } + if (conditions) { + cJSON *conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(conditions)){ + goto end; //nonprimitive container + } + + conditionsList = list_createList(); + + cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) + { + if(!cJSON_IsObject(conditions_local_nonprimitive)){ + goto end; + } + v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); + + list_addElement(conditionsList, conditionsItem); + } + } + + // v1alpha1_pod_certificate_request_status->not_after + cJSON *not_after = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_statusJSON, "notAfter"); + if (cJSON_IsNull(not_after)) { + not_after = NULL; + } + if (not_after) { + if(!cJSON_IsString(not_after) && !cJSON_IsNull(not_after)) + { + goto end; //DateTime + } + } + + // v1alpha1_pod_certificate_request_status->not_before + cJSON *not_before = cJSON_GetObjectItemCaseSensitive(v1alpha1_pod_certificate_request_statusJSON, "notBefore"); + if (cJSON_IsNull(not_before)) { + not_before = NULL; + } + if (not_before) { + if(!cJSON_IsString(not_before) && !cJSON_IsNull(not_before)) + { + goto end; //DateTime + } + } + + + v1alpha1_pod_certificate_request_status_local_var = v1alpha1_pod_certificate_request_status_create_internal ( + begin_refresh_at && !cJSON_IsNull(begin_refresh_at) ? strdup(begin_refresh_at->valuestring) : NULL, + certificate_chain && !cJSON_IsNull(certificate_chain) ? strdup(certificate_chain->valuestring) : NULL, + conditions ? conditionsList : NULL, + not_after && !cJSON_IsNull(not_after) ? strdup(not_after->valuestring) : NULL, + not_before && !cJSON_IsNull(not_before) ? strdup(not_before->valuestring) : NULL + ); + + return v1alpha1_pod_certificate_request_status_local_var; +end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha1_pod_certificate_request_status.h b/kubernetes/model/v1alpha1_pod_certificate_request_status.h new file mode 100644 index 00000000..58ec2039 --- /dev/null +++ b/kubernetes/model/v1alpha1_pod_certificate_request_status.h @@ -0,0 +1,47 @@ +/* + * v1alpha1_pod_certificate_request_status.h + * + * PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued. + */ + +#ifndef _v1alpha1_pod_certificate_request_status_H_ +#define _v1alpha1_pod_certificate_request_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha1_pod_certificate_request_status_t v1alpha1_pod_certificate_request_status_t; + +#include "v1_condition.h" + + + +typedef struct v1alpha1_pod_certificate_request_status_t { + char *begin_refresh_at; //date time + char *certificate_chain; // string + list_t *conditions; //nonprimitive container + char *not_after; //date time + char *not_before; //date time + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha1_pod_certificate_request_status_t; + +__attribute__((deprecated)) v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status_create( + char *begin_refresh_at, + char *certificate_chain, + list_t *conditions, + char *not_after, + char *not_before +); + +void v1alpha1_pod_certificate_request_status_free(v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status); + +v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status_parseFromJSON(cJSON *v1alpha1_pod_certificate_request_statusJSON); + +cJSON *v1alpha1_pod_certificate_request_status_convertToJSON(v1alpha1_pod_certificate_request_status_t *v1alpha1_pod_certificate_request_status); + +#endif /* _v1alpha1_pod_certificate_request_status_H_ */ + diff --git a/kubernetes/model/v1alpha1_self_subject_review.c b/kubernetes/model/v1alpha1_self_subject_review.c deleted file mode 100644 index 557ecc30..00000000 --- a/kubernetes/model/v1alpha1_self_subject_review.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include "v1alpha1_self_subject_review.h" - - - -v1alpha1_self_subject_review_t *v1alpha1_self_subject_review_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_self_subject_review_status_t *status - ) { - v1alpha1_self_subject_review_t *v1alpha1_self_subject_review_local_var = malloc(sizeof(v1alpha1_self_subject_review_t)); - if (!v1alpha1_self_subject_review_local_var) { - return NULL; - } - v1alpha1_self_subject_review_local_var->api_version = api_version; - v1alpha1_self_subject_review_local_var->kind = kind; - v1alpha1_self_subject_review_local_var->metadata = metadata; - v1alpha1_self_subject_review_local_var->status = status; - - return v1alpha1_self_subject_review_local_var; -} - - -void v1alpha1_self_subject_review_free(v1alpha1_self_subject_review_t *v1alpha1_self_subject_review) { - if(NULL == v1alpha1_self_subject_review){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_self_subject_review->api_version) { - free(v1alpha1_self_subject_review->api_version); - v1alpha1_self_subject_review->api_version = NULL; - } - if (v1alpha1_self_subject_review->kind) { - free(v1alpha1_self_subject_review->kind); - v1alpha1_self_subject_review->kind = NULL; - } - if (v1alpha1_self_subject_review->metadata) { - v1_object_meta_free(v1alpha1_self_subject_review->metadata); - v1alpha1_self_subject_review->metadata = NULL; - } - if (v1alpha1_self_subject_review->status) { - v1alpha1_self_subject_review_status_free(v1alpha1_self_subject_review->status); - v1alpha1_self_subject_review->status = NULL; - } - free(v1alpha1_self_subject_review); -} - -cJSON *v1alpha1_self_subject_review_convertToJSON(v1alpha1_self_subject_review_t *v1alpha1_self_subject_review) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_self_subject_review->api_version - if(v1alpha1_self_subject_review->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_self_subject_review->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_self_subject_review->kind - if(v1alpha1_self_subject_review->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_self_subject_review->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_self_subject_review->metadata - if(v1alpha1_self_subject_review->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_self_subject_review->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_self_subject_review->status - if(v1alpha1_self_subject_review->status) { - cJSON *status_local_JSON = v1alpha1_self_subject_review_status_convertToJSON(v1alpha1_self_subject_review->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_self_subject_review_t *v1alpha1_self_subject_review_parseFromJSON(cJSON *v1alpha1_self_subject_reviewJSON){ - - v1alpha1_self_subject_review_t *v1alpha1_self_subject_review_local_var = NULL; - - // define the local variable for v1alpha1_self_subject_review->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha1_self_subject_review->status - v1alpha1_self_subject_review_status_t *status_local_nonprim = NULL; - - // v1alpha1_self_subject_review->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_self_subject_reviewJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_self_subject_review->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_self_subject_reviewJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_self_subject_review->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_self_subject_reviewJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha1_self_subject_review->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_self_subject_reviewJSON, "status"); - if (status) { - status_local_nonprim = v1alpha1_self_subject_review_status_parseFromJSON(status); //nonprimitive - } - - - v1alpha1_self_subject_review_local_var = v1alpha1_self_subject_review_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - status ? status_local_nonprim : NULL - ); - - return v1alpha1_self_subject_review_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1alpha1_self_subject_review_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_self_subject_review.h b/kubernetes/model/v1alpha1_self_subject_review.h deleted file mode 100644 index 543c9acc..00000000 --- a/kubernetes/model/v1alpha1_self_subject_review.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_self_subject_review.h - * - * SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. When using impersonation, users will receive the user info of the user being impersonated. If impersonation or request header authentication is used, any extra keys will have their case ignored and returned as lowercase. - */ - -#ifndef _v1alpha1_self_subject_review_H_ -#define _v1alpha1_self_subject_review_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_self_subject_review_t v1alpha1_self_subject_review_t; - -#include "v1_object_meta.h" -#include "v1alpha1_self_subject_review_status.h" - - - -typedef struct v1alpha1_self_subject_review_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha1_self_subject_review_status_t *status; //model - -} v1alpha1_self_subject_review_t; - -v1alpha1_self_subject_review_t *v1alpha1_self_subject_review_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_self_subject_review_status_t *status -); - -void v1alpha1_self_subject_review_free(v1alpha1_self_subject_review_t *v1alpha1_self_subject_review); - -v1alpha1_self_subject_review_t *v1alpha1_self_subject_review_parseFromJSON(cJSON *v1alpha1_self_subject_reviewJSON); - -cJSON *v1alpha1_self_subject_review_convertToJSON(v1alpha1_self_subject_review_t *v1alpha1_self_subject_review); - -#endif /* _v1alpha1_self_subject_review_H_ */ - diff --git a/kubernetes/model/v1alpha1_self_subject_review_status.c b/kubernetes/model/v1alpha1_self_subject_review_status.c deleted file mode 100644 index b30367eb..00000000 --- a/kubernetes/model/v1alpha1_self_subject_review_status.c +++ /dev/null @@ -1,82 +0,0 @@ -#include -#include -#include -#include "v1alpha1_self_subject_review_status.h" - - - -v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status_create( - v1_user_info_t *user_info - ) { - v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status_local_var = malloc(sizeof(v1alpha1_self_subject_review_status_t)); - if (!v1alpha1_self_subject_review_status_local_var) { - return NULL; - } - v1alpha1_self_subject_review_status_local_var->user_info = user_info; - - return v1alpha1_self_subject_review_status_local_var; -} - - -void v1alpha1_self_subject_review_status_free(v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status) { - if(NULL == v1alpha1_self_subject_review_status){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_self_subject_review_status->user_info) { - v1_user_info_free(v1alpha1_self_subject_review_status->user_info); - v1alpha1_self_subject_review_status->user_info = NULL; - } - free(v1alpha1_self_subject_review_status); -} - -cJSON *v1alpha1_self_subject_review_status_convertToJSON(v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_self_subject_review_status->user_info - if(v1alpha1_self_subject_review_status->user_info) { - cJSON *user_info_local_JSON = v1_user_info_convertToJSON(v1alpha1_self_subject_review_status->user_info); - if(user_info_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "userInfo", user_info_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status_parseFromJSON(cJSON *v1alpha1_self_subject_review_statusJSON){ - - v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status_local_var = NULL; - - // define the local variable for v1alpha1_self_subject_review_status->user_info - v1_user_info_t *user_info_local_nonprim = NULL; - - // v1alpha1_self_subject_review_status->user_info - cJSON *user_info = cJSON_GetObjectItemCaseSensitive(v1alpha1_self_subject_review_statusJSON, "userInfo"); - if (user_info) { - user_info_local_nonprim = v1_user_info_parseFromJSON(user_info); //nonprimitive - } - - - v1alpha1_self_subject_review_status_local_var = v1alpha1_self_subject_review_status_create ( - user_info ? user_info_local_nonprim : NULL - ); - - return v1alpha1_self_subject_review_status_local_var; -end: - if (user_info_local_nonprim) { - v1_user_info_free(user_info_local_nonprim); - user_info_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_self_subject_review_status.h b/kubernetes/model/v1alpha1_self_subject_review_status.h deleted file mode 100644 index 8e2b3aa6..00000000 --- a/kubernetes/model/v1alpha1_self_subject_review_status.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1alpha1_self_subject_review_status.h - * - * SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user. - */ - -#ifndef _v1alpha1_self_subject_review_status_H_ -#define _v1alpha1_self_subject_review_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_self_subject_review_status_t v1alpha1_self_subject_review_status_t; - -#include "v1_user_info.h" - - - -typedef struct v1alpha1_self_subject_review_status_t { - struct v1_user_info_t *user_info; //model - -} v1alpha1_self_subject_review_status_t; - -v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status_create( - v1_user_info_t *user_info -); - -void v1alpha1_self_subject_review_status_free(v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status); - -v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status_parseFromJSON(cJSON *v1alpha1_self_subject_review_statusJSON); - -cJSON *v1alpha1_self_subject_review_status_convertToJSON(v1alpha1_self_subject_review_status_t *v1alpha1_self_subject_review_status); - -#endif /* _v1alpha1_self_subject_review_status_H_ */ - diff --git a/kubernetes/model/v1alpha1_server_storage_version.c b/kubernetes/model/v1alpha1_server_storage_version.c index fafc7d22..412e94e7 100644 --- a/kubernetes/model/v1alpha1_server_storage_version.c +++ b/kubernetes/model/v1alpha1_server_storage_version.c @@ -5,7 +5,7 @@ -v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_create( +static v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_create_internal( char *api_server_id, list_t *decodable_versions, char *encoding_version, @@ -20,14 +20,32 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_create( v1alpha1_server_storage_version_local_var->encoding_version = encoding_version; v1alpha1_server_storage_version_local_var->served_versions = served_versions; + v1alpha1_server_storage_version_local_var->_library_owned = 1; return v1alpha1_server_storage_version_local_var; } +__attribute__((deprecated)) v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_create( + char *api_server_id, + list_t *decodable_versions, + char *encoding_version, + list_t *served_versions + ) { + return v1alpha1_server_storage_version_create_internal ( + api_server_id, + decodable_versions, + encoding_version, + served_versions + ); +} void v1alpha1_server_storage_version_free(v1alpha1_server_storage_version_t *v1alpha1_server_storage_version) { if(NULL == v1alpha1_server_storage_version){ return ; } + if(v1alpha1_server_storage_version->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_server_storage_version_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_server_storage_version->api_server_id) { free(v1alpha1_server_storage_version->api_server_id); @@ -74,7 +92,7 @@ cJSON *v1alpha1_server_storage_version_convertToJSON(v1alpha1_server_storage_ver listEntry_t *decodable_versionsListEntry; list_ForEach(decodable_versionsListEntry, v1alpha1_server_storage_version->decodable_versions) { - if(cJSON_AddStringToObject(decodable_versions, "", (char*)decodable_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(decodable_versions, "", decodable_versionsListEntry->data) == NULL) { goto fail; } @@ -99,7 +117,7 @@ cJSON *v1alpha1_server_storage_version_convertToJSON(v1alpha1_server_storage_ver listEntry_t *served_versionsListEntry; list_ForEach(served_versionsListEntry, v1alpha1_server_storage_version->served_versions) { - if(cJSON_AddStringToObject(served_versions, "", (char*)served_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(served_versions, "", served_versionsListEntry->data) == NULL) { goto fail; } @@ -126,6 +144,9 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON // v1alpha1_server_storage_version->api_server_id cJSON *api_server_id = cJSON_GetObjectItemCaseSensitive(v1alpha1_server_storage_versionJSON, "apiServerID"); + if (cJSON_IsNull(api_server_id)) { + api_server_id = NULL; + } if (api_server_id) { if(!cJSON_IsString(api_server_id) && !cJSON_IsNull(api_server_id)) { @@ -135,6 +156,9 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON // v1alpha1_server_storage_version->decodable_versions cJSON *decodable_versions = cJSON_GetObjectItemCaseSensitive(v1alpha1_server_storage_versionJSON, "decodableVersions"); + if (cJSON_IsNull(decodable_versions)) { + decodable_versions = NULL; + } if (decodable_versions) { cJSON *decodable_versions_local = NULL; if(!cJSON_IsArray(decodable_versions)) { @@ -154,6 +178,9 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON // v1alpha1_server_storage_version->encoding_version cJSON *encoding_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_server_storage_versionJSON, "encodingVersion"); + if (cJSON_IsNull(encoding_version)) { + encoding_version = NULL; + } if (encoding_version) { if(!cJSON_IsString(encoding_version) && !cJSON_IsNull(encoding_version)) { @@ -163,6 +190,9 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON // v1alpha1_server_storage_version->served_versions cJSON *served_versions = cJSON_GetObjectItemCaseSensitive(v1alpha1_server_storage_versionJSON, "servedVersions"); + if (cJSON_IsNull(served_versions)) { + served_versions = NULL; + } if (served_versions) { cJSON *served_versions_local = NULL; if(!cJSON_IsArray(served_versions)) { @@ -181,7 +211,7 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON } - v1alpha1_server_storage_version_local_var = v1alpha1_server_storage_version_create ( + v1alpha1_server_storage_version_local_var = v1alpha1_server_storage_version_create_internal ( api_server_id && !cJSON_IsNull(api_server_id) ? strdup(api_server_id->valuestring) : NULL, decodable_versions ? decodable_versionsList : NULL, encoding_version && !cJSON_IsNull(encoding_version) ? strdup(encoding_version->valuestring) : NULL, diff --git a/kubernetes/model/v1alpha1_server_storage_version.h b/kubernetes/model/v1alpha1_server_storage_version.h index a0883e2c..185fae05 100644 --- a/kubernetes/model/v1alpha1_server_storage_version.h +++ b/kubernetes/model/v1alpha1_server_storage_version.h @@ -24,9 +24,10 @@ typedef struct v1alpha1_server_storage_version_t { char *encoding_version; // string list_t *served_versions; //primitive container + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_server_storage_version_t; -v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_create( +__attribute__((deprecated)) v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_create( char *api_server_id, list_t *decodable_versions, char *encoding_version, diff --git a/kubernetes/model/v1alpha1_service_cidr.c b/kubernetes/model/v1alpha1_service_cidr.c deleted file mode 100644 index 3f3224b4..00000000 --- a/kubernetes/model/v1alpha1_service_cidr.c +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include -#include -#include "v1alpha1_service_cidr.h" - - - -v1alpha1_service_cidr_t *v1alpha1_service_cidr_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_service_cidr_spec_t *spec, - v1alpha1_service_cidr_status_t *status - ) { - v1alpha1_service_cidr_t *v1alpha1_service_cidr_local_var = malloc(sizeof(v1alpha1_service_cidr_t)); - if (!v1alpha1_service_cidr_local_var) { - return NULL; - } - v1alpha1_service_cidr_local_var->api_version = api_version; - v1alpha1_service_cidr_local_var->kind = kind; - v1alpha1_service_cidr_local_var->metadata = metadata; - v1alpha1_service_cidr_local_var->spec = spec; - v1alpha1_service_cidr_local_var->status = status; - - return v1alpha1_service_cidr_local_var; -} - - -void v1alpha1_service_cidr_free(v1alpha1_service_cidr_t *v1alpha1_service_cidr) { - if(NULL == v1alpha1_service_cidr){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_service_cidr->api_version) { - free(v1alpha1_service_cidr->api_version); - v1alpha1_service_cidr->api_version = NULL; - } - if (v1alpha1_service_cidr->kind) { - free(v1alpha1_service_cidr->kind); - v1alpha1_service_cidr->kind = NULL; - } - if (v1alpha1_service_cidr->metadata) { - v1_object_meta_free(v1alpha1_service_cidr->metadata); - v1alpha1_service_cidr->metadata = NULL; - } - if (v1alpha1_service_cidr->spec) { - v1alpha1_service_cidr_spec_free(v1alpha1_service_cidr->spec); - v1alpha1_service_cidr->spec = NULL; - } - if (v1alpha1_service_cidr->status) { - v1alpha1_service_cidr_status_free(v1alpha1_service_cidr->status); - v1alpha1_service_cidr->status = NULL; - } - free(v1alpha1_service_cidr); -} - -cJSON *v1alpha1_service_cidr_convertToJSON(v1alpha1_service_cidr_t *v1alpha1_service_cidr) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_service_cidr->api_version - if(v1alpha1_service_cidr->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_service_cidr->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_service_cidr->kind - if(v1alpha1_service_cidr->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_service_cidr->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_service_cidr->metadata - if(v1alpha1_service_cidr->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_service_cidr->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_service_cidr->spec - if(v1alpha1_service_cidr->spec) { - cJSON *spec_local_JSON = v1alpha1_service_cidr_spec_convertToJSON(v1alpha1_service_cidr->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_service_cidr->status - if(v1alpha1_service_cidr->status) { - cJSON *status_local_JSON = v1alpha1_service_cidr_status_convertToJSON(v1alpha1_service_cidr->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_service_cidr_t *v1alpha1_service_cidr_parseFromJSON(cJSON *v1alpha1_service_cidrJSON){ - - v1alpha1_service_cidr_t *v1alpha1_service_cidr_local_var = NULL; - - // define the local variable for v1alpha1_service_cidr->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha1_service_cidr->spec - v1alpha1_service_cidr_spec_t *spec_local_nonprim = NULL; - - // define the local variable for v1alpha1_service_cidr->status - v1alpha1_service_cidr_status_t *status_local_nonprim = NULL; - - // v1alpha1_service_cidr->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidrJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_service_cidr->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidrJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_service_cidr->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidrJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha1_service_cidr->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidrJSON, "spec"); - if (spec) { - spec_local_nonprim = v1alpha1_service_cidr_spec_parseFromJSON(spec); //nonprimitive - } - - // v1alpha1_service_cidr->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidrJSON, "status"); - if (status) { - status_local_nonprim = v1alpha1_service_cidr_status_parseFromJSON(status); //nonprimitive - } - - - v1alpha1_service_cidr_local_var = v1alpha1_service_cidr_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL, - status ? status_local_nonprim : NULL - ); - - return v1alpha1_service_cidr_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha1_service_cidr_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1alpha1_service_cidr_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_service_cidr.h b/kubernetes/model/v1alpha1_service_cidr.h deleted file mode 100644 index 6f8d5b55..00000000 --- a/kubernetes/model/v1alpha1_service_cidr.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * v1alpha1_service_cidr.h - * - * ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects. - */ - -#ifndef _v1alpha1_service_cidr_H_ -#define _v1alpha1_service_cidr_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_service_cidr_t v1alpha1_service_cidr_t; - -#include "v1_object_meta.h" -#include "v1alpha1_service_cidr_spec.h" -#include "v1alpha1_service_cidr_status.h" - - - -typedef struct v1alpha1_service_cidr_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha1_service_cidr_spec_t *spec; //model - struct v1alpha1_service_cidr_status_t *status; //model - -} v1alpha1_service_cidr_t; - -v1alpha1_service_cidr_t *v1alpha1_service_cidr_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_service_cidr_spec_t *spec, - v1alpha1_service_cidr_status_t *status -); - -void v1alpha1_service_cidr_free(v1alpha1_service_cidr_t *v1alpha1_service_cidr); - -v1alpha1_service_cidr_t *v1alpha1_service_cidr_parseFromJSON(cJSON *v1alpha1_service_cidrJSON); - -cJSON *v1alpha1_service_cidr_convertToJSON(v1alpha1_service_cidr_t *v1alpha1_service_cidr); - -#endif /* _v1alpha1_service_cidr_H_ */ - diff --git a/kubernetes/model/v1alpha1_service_cidr_list.c b/kubernetes/model/v1alpha1_service_cidr_list.c deleted file mode 100644 index 2610903d..00000000 --- a/kubernetes/model/v1alpha1_service_cidr_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha1_service_cidr_list.h" - - - -v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list_local_var = malloc(sizeof(v1alpha1_service_cidr_list_t)); - if (!v1alpha1_service_cidr_list_local_var) { - return NULL; - } - v1alpha1_service_cidr_list_local_var->api_version = api_version; - v1alpha1_service_cidr_list_local_var->items = items; - v1alpha1_service_cidr_list_local_var->kind = kind; - v1alpha1_service_cidr_list_local_var->metadata = metadata; - - return v1alpha1_service_cidr_list_local_var; -} - - -void v1alpha1_service_cidr_list_free(v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list) { - if(NULL == v1alpha1_service_cidr_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_service_cidr_list->api_version) { - free(v1alpha1_service_cidr_list->api_version); - v1alpha1_service_cidr_list->api_version = NULL; - } - if (v1alpha1_service_cidr_list->items) { - list_ForEach(listEntry, v1alpha1_service_cidr_list->items) { - v1alpha1_service_cidr_free(listEntry->data); - } - list_freeList(v1alpha1_service_cidr_list->items); - v1alpha1_service_cidr_list->items = NULL; - } - if (v1alpha1_service_cidr_list->kind) { - free(v1alpha1_service_cidr_list->kind); - v1alpha1_service_cidr_list->kind = NULL; - } - if (v1alpha1_service_cidr_list->metadata) { - v1_list_meta_free(v1alpha1_service_cidr_list->metadata); - v1alpha1_service_cidr_list->metadata = NULL; - } - free(v1alpha1_service_cidr_list); -} - -cJSON *v1alpha1_service_cidr_list_convertToJSON(v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_service_cidr_list->api_version - if(v1alpha1_service_cidr_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_service_cidr_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_service_cidr_list->items - if (!v1alpha1_service_cidr_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha1_service_cidr_list->items) { - list_ForEach(itemsListEntry, v1alpha1_service_cidr_list->items) { - cJSON *itemLocal = v1alpha1_service_cidr_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha1_service_cidr_list->kind - if(v1alpha1_service_cidr_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_service_cidr_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_service_cidr_list->metadata - if(v1alpha1_service_cidr_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha1_service_cidr_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list_parseFromJSON(cJSON *v1alpha1_service_cidr_listJSON){ - - v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list_local_var = NULL; - - // define the local list for v1alpha1_service_cidr_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha1_service_cidr_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha1_service_cidr_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidr_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_service_cidr_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidr_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha1_service_cidr_t *itemsItem = v1alpha1_service_cidr_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha1_service_cidr_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidr_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_service_cidr_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidr_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha1_service_cidr_list_local_var = v1alpha1_service_cidr_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha1_service_cidr_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha1_service_cidr_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_service_cidr_list.h b/kubernetes/model/v1alpha1_service_cidr_list.h deleted file mode 100644 index 23852457..00000000 --- a/kubernetes/model/v1alpha1_service_cidr_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_service_cidr_list.h - * - * ServiceCIDRList contains a list of ServiceCIDR objects. - */ - -#ifndef _v1alpha1_service_cidr_list_H_ -#define _v1alpha1_service_cidr_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_service_cidr_list_t v1alpha1_service_cidr_list_t; - -#include "v1_list_meta.h" -#include "v1alpha1_service_cidr.h" - - - -typedef struct v1alpha1_service_cidr_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha1_service_cidr_list_t; - -v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha1_service_cidr_list_free(v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list); - -v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list_parseFromJSON(cJSON *v1alpha1_service_cidr_listJSON); - -cJSON *v1alpha1_service_cidr_list_convertToJSON(v1alpha1_service_cidr_list_t *v1alpha1_service_cidr_list); - -#endif /* _v1alpha1_service_cidr_list_H_ */ - diff --git a/kubernetes/model/v1alpha1_service_cidr_spec.c b/kubernetes/model/v1alpha1_service_cidr_spec.c deleted file mode 100644 index 5423a8c1..00000000 --- a/kubernetes/model/v1alpha1_service_cidr_spec.c +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include -#include -#include "v1alpha1_service_cidr_spec.h" - - - -v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec_create( - list_t *cidrs - ) { - v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec_local_var = malloc(sizeof(v1alpha1_service_cidr_spec_t)); - if (!v1alpha1_service_cidr_spec_local_var) { - return NULL; - } - v1alpha1_service_cidr_spec_local_var->cidrs = cidrs; - - return v1alpha1_service_cidr_spec_local_var; -} - - -void v1alpha1_service_cidr_spec_free(v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec) { - if(NULL == v1alpha1_service_cidr_spec){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_service_cidr_spec->cidrs) { - list_ForEach(listEntry, v1alpha1_service_cidr_spec->cidrs) { - free(listEntry->data); - } - list_freeList(v1alpha1_service_cidr_spec->cidrs); - v1alpha1_service_cidr_spec->cidrs = NULL; - } - free(v1alpha1_service_cidr_spec); -} - -cJSON *v1alpha1_service_cidr_spec_convertToJSON(v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_service_cidr_spec->cidrs - if(v1alpha1_service_cidr_spec->cidrs) { - cJSON *cidrs = cJSON_AddArrayToObject(item, "cidrs"); - if(cidrs == NULL) { - goto fail; //primitive container - } - - listEntry_t *cidrsListEntry; - list_ForEach(cidrsListEntry, v1alpha1_service_cidr_spec->cidrs) { - if(cJSON_AddStringToObject(cidrs, "", (char*)cidrsListEntry->data) == NULL) - { - goto fail; - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec_parseFromJSON(cJSON *v1alpha1_service_cidr_specJSON){ - - v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec_local_var = NULL; - - // define the local list for v1alpha1_service_cidr_spec->cidrs - list_t *cidrsList = NULL; - - // v1alpha1_service_cidr_spec->cidrs - cJSON *cidrs = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidr_specJSON, "cidrs"); - if (cidrs) { - cJSON *cidrs_local = NULL; - if(!cJSON_IsArray(cidrs)) { - goto end;//primitive container - } - cidrsList = list_createList(); - - cJSON_ArrayForEach(cidrs_local, cidrs) - { - if(!cJSON_IsString(cidrs_local)) - { - goto end; - } - list_addElement(cidrsList , strdup(cidrs_local->valuestring)); - } - } - - - v1alpha1_service_cidr_spec_local_var = v1alpha1_service_cidr_spec_create ( - cidrs ? cidrsList : NULL - ); - - return v1alpha1_service_cidr_spec_local_var; -end: - if (cidrsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, cidrsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(cidrsList); - cidrsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_service_cidr_spec.h b/kubernetes/model/v1alpha1_service_cidr_spec.h deleted file mode 100644 index 15682865..00000000 --- a/kubernetes/model/v1alpha1_service_cidr_spec.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1alpha1_service_cidr_spec.h - * - * ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. - */ - -#ifndef _v1alpha1_service_cidr_spec_H_ -#define _v1alpha1_service_cidr_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_service_cidr_spec_t v1alpha1_service_cidr_spec_t; - - - - -typedef struct v1alpha1_service_cidr_spec_t { - list_t *cidrs; //primitive container - -} v1alpha1_service_cidr_spec_t; - -v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec_create( - list_t *cidrs -); - -void v1alpha1_service_cidr_spec_free(v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec); - -v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec_parseFromJSON(cJSON *v1alpha1_service_cidr_specJSON); - -cJSON *v1alpha1_service_cidr_spec_convertToJSON(v1alpha1_service_cidr_spec_t *v1alpha1_service_cidr_spec); - -#endif /* _v1alpha1_service_cidr_spec_H_ */ - diff --git a/kubernetes/model/v1alpha1_service_cidr_status.c b/kubernetes/model/v1alpha1_service_cidr_status.c deleted file mode 100644 index 5ebdab26..00000000 --- a/kubernetes/model/v1alpha1_service_cidr_status.c +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include "v1alpha1_service_cidr_status.h" - - - -v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status_create( - list_t *conditions - ) { - v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status_local_var = malloc(sizeof(v1alpha1_service_cidr_status_t)); - if (!v1alpha1_service_cidr_status_local_var) { - return NULL; - } - v1alpha1_service_cidr_status_local_var->conditions = conditions; - - return v1alpha1_service_cidr_status_local_var; -} - - -void v1alpha1_service_cidr_status_free(v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status) { - if(NULL == v1alpha1_service_cidr_status){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_service_cidr_status->conditions) { - list_ForEach(listEntry, v1alpha1_service_cidr_status->conditions) { - v1_condition_free(listEntry->data); - } - list_freeList(v1alpha1_service_cidr_status->conditions); - v1alpha1_service_cidr_status->conditions = NULL; - } - free(v1alpha1_service_cidr_status); -} - -cJSON *v1alpha1_service_cidr_status_convertToJSON(v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_service_cidr_status->conditions - if(v1alpha1_service_cidr_status->conditions) { - cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); - if(conditions == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *conditionsListEntry; - if (v1alpha1_service_cidr_status->conditions) { - list_ForEach(conditionsListEntry, v1alpha1_service_cidr_status->conditions) { - cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(conditions, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status_parseFromJSON(cJSON *v1alpha1_service_cidr_statusJSON){ - - v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status_local_var = NULL; - - // define the local list for v1alpha1_service_cidr_status->conditions - list_t *conditionsList = NULL; - - // v1alpha1_service_cidr_status->conditions - cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_service_cidr_statusJSON, "conditions"); - if (conditions) { - cJSON *conditions_local_nonprimitive = NULL; - if(!cJSON_IsArray(conditions)){ - goto end; //nonprimitive container - } - - conditionsList = list_createList(); - - cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) - { - if(!cJSON_IsObject(conditions_local_nonprimitive)){ - goto end; - } - v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); - - list_addElement(conditionsList, conditionsItem); - } - } - - - v1alpha1_service_cidr_status_local_var = v1alpha1_service_cidr_status_create ( - conditions ? conditionsList : NULL - ); - - return v1alpha1_service_cidr_status_local_var; -end: - if (conditionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, conditionsList) { - v1_condition_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(conditionsList); - conditionsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_service_cidr_status.h b/kubernetes/model/v1alpha1_service_cidr_status.h deleted file mode 100644 index 2f6762d5..00000000 --- a/kubernetes/model/v1alpha1_service_cidr_status.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1alpha1_service_cidr_status.h - * - * ServiceCIDRStatus describes the current state of the ServiceCIDR. - */ - -#ifndef _v1alpha1_service_cidr_status_H_ -#define _v1alpha1_service_cidr_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_service_cidr_status_t v1alpha1_service_cidr_status_t; - -#include "v1_condition.h" - - - -typedef struct v1alpha1_service_cidr_status_t { - list_t *conditions; //nonprimitive container - -} v1alpha1_service_cidr_status_t; - -v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status_create( - list_t *conditions -); - -void v1alpha1_service_cidr_status_free(v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status); - -v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status_parseFromJSON(cJSON *v1alpha1_service_cidr_statusJSON); - -cJSON *v1alpha1_service_cidr_status_convertToJSON(v1alpha1_service_cidr_status_t *v1alpha1_service_cidr_status); - -#endif /* _v1alpha1_service_cidr_status_H_ */ - diff --git a/kubernetes/model/v1alpha1_storage_version.c b/kubernetes/model/v1alpha1_storage_version.c index e6f35e5d..146b45aa 100644 --- a/kubernetes/model/v1alpha1_storage_version.c +++ b/kubernetes/model/v1alpha1_storage_version.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_t *v1alpha1_storage_version_create( +static v1alpha1_storage_version_t *v1alpha1_storage_version_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1alpha1_storage_version_t *v1alpha1_storage_version_create( v1alpha1_storage_version_local_var->spec = spec; v1alpha1_storage_version_local_var->status = status; + v1alpha1_storage_version_local_var->_library_owned = 1; return v1alpha1_storage_version_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_t *v1alpha1_storage_version_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + object_t *spec, + v1alpha1_storage_version_status_t *status + ) { + return v1alpha1_storage_version_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1alpha1_storage_version_free(v1alpha1_storage_version_t *v1alpha1_storage_version) { if(NULL == v1alpha1_storage_version){ return ; } + if(v1alpha1_storage_version->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version->api_version) { free(v1alpha1_storage_version->api_version); @@ -133,6 +153,9 @@ v1alpha1_storage_version_t *v1alpha1_storage_version_parseFromJSON(cJSON *v1alph // v1alpha1_storage_version->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_versionJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -142,6 +165,9 @@ v1alpha1_storage_version_t *v1alpha1_storage_version_parseFromJSON(cJSON *v1alph // v1alpha1_storage_version->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_versionJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -151,12 +177,18 @@ v1alpha1_storage_version_t *v1alpha1_storage_version_parseFromJSON(cJSON *v1alph // v1alpha1_storage_version->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_versionJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1alpha1_storage_version->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_versionJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (!spec) { goto end; } @@ -167,6 +199,9 @@ v1alpha1_storage_version_t *v1alpha1_storage_version_parseFromJSON(cJSON *v1alph // v1alpha1_storage_version->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_versionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -175,7 +210,7 @@ v1alpha1_storage_version_t *v1alpha1_storage_version_parseFromJSON(cJSON *v1alph status_local_nonprim = v1alpha1_storage_version_status_parseFromJSON(status); //nonprimitive - v1alpha1_storage_version_local_var = v1alpha1_storage_version_create ( + v1alpha1_storage_version_local_var = v1alpha1_storage_version_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1alpha1_storage_version.h b/kubernetes/model/v1alpha1_storage_version.h index 2be415a2..80983192 100644 --- a/kubernetes/model/v1alpha1_storage_version.h +++ b/kubernetes/model/v1alpha1_storage_version.h @@ -28,9 +28,10 @@ typedef struct v1alpha1_storage_version_t { object_t *spec; //object struct v1alpha1_storage_version_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_t; -v1alpha1_storage_version_t *v1alpha1_storage_version_create( +__attribute__((deprecated)) v1alpha1_storage_version_t *v1alpha1_storage_version_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1alpha1_storage_version_condition.c b/kubernetes/model/v1alpha1_storage_version_condition.c index 4ab62d50..81f6fcdd 100644 --- a/kubernetes/model/v1alpha1_storage_version_condition.c +++ b/kubernetes/model/v1alpha1_storage_version_condition.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_create( +static v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_create_internal( char *last_transition_time, char *message, long observed_generation, @@ -24,14 +24,36 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_create( v1alpha1_storage_version_condition_local_var->status = status; v1alpha1_storage_version_condition_local_var->type = type; + v1alpha1_storage_version_condition_local_var->_library_owned = 1; return v1alpha1_storage_version_condition_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_create( + char *last_transition_time, + char *message, + long observed_generation, + char *reason, + char *status, + char *type + ) { + return v1alpha1_storage_version_condition_create_internal ( + last_transition_time, + message, + observed_generation, + reason, + status, + type + ); +} void v1alpha1_storage_version_condition_free(v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition) { if(NULL == v1alpha1_storage_version_condition){ return ; } + if(v1alpha1_storage_version_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_condition_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version_condition->last_transition_time) { free(v1alpha1_storage_version_condition->last_transition_time); @@ -124,6 +146,9 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_parseFr // v1alpha1_storage_version_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -133,6 +158,9 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_parseFr // v1alpha1_storage_version_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (!message) { goto end; } @@ -145,6 +173,9 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_parseFr // v1alpha1_storage_version_condition->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_conditionJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -154,6 +185,9 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_parseFr // v1alpha1_storage_version_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (!reason) { goto end; } @@ -166,6 +200,9 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_parseFr // v1alpha1_storage_version_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -178,6 +215,9 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_parseFr // v1alpha1_storage_version_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -189,7 +229,7 @@ v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_parseFr } - v1alpha1_storage_version_condition_local_var = v1alpha1_storage_version_condition_create ( + v1alpha1_storage_version_condition_local_var = v1alpha1_storage_version_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, strdup(message->valuestring), observed_generation ? observed_generation->valuedouble : 0, diff --git a/kubernetes/model/v1alpha1_storage_version_condition.h b/kubernetes/model/v1alpha1_storage_version_condition.h index 1ee022b3..7da13903 100644 --- a/kubernetes/model/v1alpha1_storage_version_condition.h +++ b/kubernetes/model/v1alpha1_storage_version_condition.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_storage_version_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_condition_t; -v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_create( +__attribute__((deprecated)) v1alpha1_storage_version_condition_t *v1alpha1_storage_version_condition_create( char *last_transition_time, char *message, long observed_generation, diff --git a/kubernetes/model/v1alpha1_storage_version_list.c b/kubernetes/model/v1alpha1_storage_version_list.c index 1303db0b..43cef29f 100644 --- a/kubernetes/model/v1alpha1_storage_version_list.c +++ b/kubernetes/model/v1alpha1_storage_version_list.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_create( +static v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_create( v1alpha1_storage_version_list_local_var->kind = kind; v1alpha1_storage_version_list_local_var->metadata = metadata; + v1alpha1_storage_version_list_local_var->_library_owned = 1; return v1alpha1_storage_version_list_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha1_storage_version_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1alpha1_storage_version_list_free(v1alpha1_storage_version_list_t *v1alpha1_storage_version_list) { if(NULL == v1alpha1_storage_version_list){ return ; } + if(v1alpha1_storage_version_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_list_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version_list->api_version) { free(v1alpha1_storage_version_list->api_version); @@ -123,6 +141,9 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_parseFromJSON(cJS // v1alpha1_storage_version_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_parseFromJSON(cJS // v1alpha1_storage_version_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_parseFromJSON(cJS // v1alpha1_storage_version_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_parseFromJSON(cJS // v1alpha1_storage_version_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1alpha1_storage_version_list_local_var = v1alpha1_storage_version_list_create ( + v1alpha1_storage_version_list_local_var = v1alpha1_storage_version_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1alpha1_storage_version_list.h b/kubernetes/model/v1alpha1_storage_version_list.h index 522da080..739fcaad 100644 --- a/kubernetes/model/v1alpha1_storage_version_list.h +++ b/kubernetes/model/v1alpha1_storage_version_list.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_storage_version_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_list_t; -v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_create( +__attribute__((deprecated)) v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1alpha1_storage_version_migration.c b/kubernetes/model/v1alpha1_storage_version_migration.c index 77102c84..37b94307 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration.c +++ b/kubernetes/model/v1alpha1_storage_version_migration.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_create( +static v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_create( v1alpha1_storage_version_migration_local_var->spec = spec; v1alpha1_storage_version_migration_local_var->status = status; + v1alpha1_storage_version_migration_local_var->_library_owned = 1; return v1alpha1_storage_version_migration_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha1_storage_version_migration_spec_t *spec, + v1alpha1_storage_version_migration_status_t *status + ) { + return v1alpha1_storage_version_migration_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v1alpha1_storage_version_migration_free(v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration) { if(NULL == v1alpha1_storage_version_migration){ return ; } + if(v1alpha1_storage_version_migration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_migration_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version_migration->api_version) { free(v1alpha1_storage_version_migration->api_version); @@ -134,6 +154,9 @@ v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_parseFr // v1alpha1_storage_version_migration->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migrationJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_parseFr // v1alpha1_storage_version_migration->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migrationJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_parseFr // v1alpha1_storage_version_migration->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migrationJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1alpha1_storage_version_migration->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migrationJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v1alpha1_storage_version_migration_spec_parseFromJSON(spec); //nonprimitive } // v1alpha1_storage_version_migration->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migrationJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v1alpha1_storage_version_migration_status_parseFromJSON(status); //nonprimitive } - v1alpha1_storage_version_migration_local_var = v1alpha1_storage_version_migration_create ( + v1alpha1_storage_version_migration_local_var = v1alpha1_storage_version_migration_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v1alpha1_storage_version_migration.h b/kubernetes/model/v1alpha1_storage_version_migration.h index 75950d0a..6bf036c3 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration.h +++ b/kubernetes/model/v1alpha1_storage_version_migration.h @@ -28,9 +28,10 @@ typedef struct v1alpha1_storage_version_migration_t { struct v1alpha1_storage_version_migration_spec_t *spec; //model struct v1alpha1_storage_version_migration_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_migration_t; -v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_create( +__attribute__((deprecated)) v1alpha1_storage_version_migration_t *v1alpha1_storage_version_migration_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v1alpha1_storage_version_migration_list.c b/kubernetes/model/v1alpha1_storage_version_migration_list.c index fa758df4..aeb268bb 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration_list.c +++ b/kubernetes/model/v1alpha1_storage_version_migration_list.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_list_create( +static v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_li v1alpha1_storage_version_migration_list_local_var->kind = kind; v1alpha1_storage_version_migration_list_local_var->metadata = metadata; + v1alpha1_storage_version_migration_list_local_var->_library_owned = 1; return v1alpha1_storage_version_migration_list_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha1_storage_version_migration_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1alpha1_storage_version_migration_list_free(v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_list) { if(NULL == v1alpha1_storage_version_migration_list){ return ; } + if(v1alpha1_storage_version_migration_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_migration_list_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version_migration_list->api_version) { free(v1alpha1_storage_version_migration_list->api_version); @@ -123,6 +141,9 @@ v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_li // v1alpha1_storage_version_migration_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_li // v1alpha1_storage_version_migration_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_li // v1alpha1_storage_version_migration_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_li // v1alpha1_storage_version_migration_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1alpha1_storage_version_migration_list_local_var = v1alpha1_storage_version_migration_list_create ( + v1alpha1_storage_version_migration_list_local_var = v1alpha1_storage_version_migration_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1alpha1_storage_version_migration_list.h b/kubernetes/model/v1alpha1_storage_version_migration_list.h index ff93ecd8..2af6edbe 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration_list.h +++ b/kubernetes/model/v1alpha1_storage_version_migration_list.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_storage_version_migration_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_migration_list_t; -v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_list_create( +__attribute__((deprecated)) v1alpha1_storage_version_migration_list_t *v1alpha1_storage_version_migration_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1alpha1_storage_version_migration_spec.c b/kubernetes/model/v1alpha1_storage_version_migration_spec.c index 9a4bc092..33448a59 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration_spec.c +++ b/kubernetes/model/v1alpha1_storage_version_migration_spec.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_spec_create( +static v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_spec_create_internal( char *continue_token, v1alpha1_group_version_resource_t *resource ) { @@ -16,14 +16,28 @@ v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_sp v1alpha1_storage_version_migration_spec_local_var->continue_token = continue_token; v1alpha1_storage_version_migration_spec_local_var->resource = resource; + v1alpha1_storage_version_migration_spec_local_var->_library_owned = 1; return v1alpha1_storage_version_migration_spec_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_spec_create( + char *continue_token, + v1alpha1_group_version_resource_t *resource + ) { + return v1alpha1_storage_version_migration_spec_create_internal ( + continue_token, + resource + ); +} void v1alpha1_storage_version_migration_spec_free(v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_spec) { if(NULL == v1alpha1_storage_version_migration_spec){ return ; } + if(v1alpha1_storage_version_migration_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_migration_spec_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version_migration_spec->continue_token) { free(v1alpha1_storage_version_migration_spec->continue_token); @@ -77,6 +91,9 @@ v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_sp // v1alpha1_storage_version_migration_spec->continue_token cJSON *continue_token = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_specJSON, "continueToken"); + if (cJSON_IsNull(continue_token)) { + continue_token = NULL; + } if (continue_token) { if(!cJSON_IsString(continue_token) && !cJSON_IsNull(continue_token)) { @@ -86,6 +103,9 @@ v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_sp // v1alpha1_storage_version_migration_spec->resource cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_specJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } if (!resource) { goto end; } @@ -94,7 +114,7 @@ v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_sp resource_local_nonprim = v1alpha1_group_version_resource_parseFromJSON(resource); //nonprimitive - v1alpha1_storage_version_migration_spec_local_var = v1alpha1_storage_version_migration_spec_create ( + v1alpha1_storage_version_migration_spec_local_var = v1alpha1_storage_version_migration_spec_create_internal ( continue_token && !cJSON_IsNull(continue_token) ? strdup(continue_token->valuestring) : NULL, resource_local_nonprim ); diff --git a/kubernetes/model/v1alpha1_storage_version_migration_spec.h b/kubernetes/model/v1alpha1_storage_version_migration_spec.h index 72058b6d..8be3434a 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration_spec.h +++ b/kubernetes/model/v1alpha1_storage_version_migration_spec.h @@ -23,9 +23,10 @@ typedef struct v1alpha1_storage_version_migration_spec_t { char *continue_token; // string struct v1alpha1_group_version_resource_t *resource; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_migration_spec_t; -v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_spec_create( +__attribute__((deprecated)) v1alpha1_storage_version_migration_spec_t *v1alpha1_storage_version_migration_spec_create( char *continue_token, v1alpha1_group_version_resource_t *resource ); diff --git a/kubernetes/model/v1alpha1_storage_version_migration_status.c b/kubernetes/model/v1alpha1_storage_version_migration_status.c index 63eaaffc..5b8e584d 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration_status.c +++ b/kubernetes/model/v1alpha1_storage_version_migration_status.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_status_create( +static v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_status_create_internal( list_t *conditions, char *resource_version ) { @@ -16,14 +16,28 @@ v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_ v1alpha1_storage_version_migration_status_local_var->conditions = conditions; v1alpha1_storage_version_migration_status_local_var->resource_version = resource_version; + v1alpha1_storage_version_migration_status_local_var->_library_owned = 1; return v1alpha1_storage_version_migration_status_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_status_create( + list_t *conditions, + char *resource_version + ) { + return v1alpha1_storage_version_migration_status_create_internal ( + conditions, + resource_version + ); +} void v1alpha1_storage_version_migration_status_free(v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_status) { if(NULL == v1alpha1_storage_version_migration_status){ return ; } + if(v1alpha1_storage_version_migration_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_migration_status_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version_migration_status->conditions) { list_ForEach(listEntry, v1alpha1_storage_version_migration_status->conditions) { @@ -86,6 +100,9 @@ v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_ // v1alpha1_storage_version_migration_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -107,6 +124,9 @@ v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_ // v1alpha1_storage_version_migration_status->resource_version cJSON *resource_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_migration_statusJSON, "resourceVersion"); + if (cJSON_IsNull(resource_version)) { + resource_version = NULL; + } if (resource_version) { if(!cJSON_IsString(resource_version) && !cJSON_IsNull(resource_version)) { @@ -115,7 +135,7 @@ v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_ } - v1alpha1_storage_version_migration_status_local_var = v1alpha1_storage_version_migration_status_create ( + v1alpha1_storage_version_migration_status_local_var = v1alpha1_storage_version_migration_status_create_internal ( conditions ? conditionsList : NULL, resource_version && !cJSON_IsNull(resource_version) ? strdup(resource_version->valuestring) : NULL ); diff --git a/kubernetes/model/v1alpha1_storage_version_migration_status.h b/kubernetes/model/v1alpha1_storage_version_migration_status.h index d6527700..8b6e72ae 100644 --- a/kubernetes/model/v1alpha1_storage_version_migration_status.h +++ b/kubernetes/model/v1alpha1_storage_version_migration_status.h @@ -23,9 +23,10 @@ typedef struct v1alpha1_storage_version_migration_status_t { list_t *conditions; //nonprimitive container char *resource_version; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_migration_status_t; -v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_status_create( +__attribute__((deprecated)) v1alpha1_storage_version_migration_status_t *v1alpha1_storage_version_migration_status_create( list_t *conditions, char *resource_version ); diff --git a/kubernetes/model/v1alpha1_storage_version_status.c b/kubernetes/model/v1alpha1_storage_version_status.c index acb68803..28a17c9c 100644 --- a/kubernetes/model/v1alpha1_storage_version_status.c +++ b/kubernetes/model/v1alpha1_storage_version_status.c @@ -5,7 +5,7 @@ -v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_create( +static v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_create_internal( char *common_encoding_version, list_t *conditions, list_t *storage_versions @@ -18,14 +18,30 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_create( v1alpha1_storage_version_status_local_var->conditions = conditions; v1alpha1_storage_version_status_local_var->storage_versions = storage_versions; + v1alpha1_storage_version_status_local_var->_library_owned = 1; return v1alpha1_storage_version_status_local_var; } +__attribute__((deprecated)) v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_create( + char *common_encoding_version, + list_t *conditions, + list_t *storage_versions + ) { + return v1alpha1_storage_version_status_create_internal ( + common_encoding_version, + conditions, + storage_versions + ); +} void v1alpha1_storage_version_status_free(v1alpha1_storage_version_status_t *v1alpha1_storage_version_status) { if(NULL == v1alpha1_storage_version_status){ return ; } + if(v1alpha1_storage_version_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_storage_version_status_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_storage_version_status->common_encoding_version) { free(v1alpha1_storage_version_status->common_encoding_version); @@ -118,6 +134,9 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON // v1alpha1_storage_version_status->common_encoding_version cJSON *common_encoding_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_statusJSON, "commonEncodingVersion"); + if (cJSON_IsNull(common_encoding_version)) { + common_encoding_version = NULL; + } if (common_encoding_version) { if(!cJSON_IsString(common_encoding_version) && !cJSON_IsNull(common_encoding_version)) { @@ -127,6 +146,9 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON // v1alpha1_storage_version_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -148,6 +170,9 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON // v1alpha1_storage_version_status->storage_versions cJSON *storage_versions = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_statusJSON, "storageVersions"); + if (cJSON_IsNull(storage_versions)) { + storage_versions = NULL; + } if (storage_versions) { cJSON *storage_versions_local_nonprimitive = NULL; if(!cJSON_IsArray(storage_versions)){ @@ -168,7 +193,7 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON } - v1alpha1_storage_version_status_local_var = v1alpha1_storage_version_status_create ( + v1alpha1_storage_version_status_local_var = v1alpha1_storage_version_status_create_internal ( common_encoding_version && !cJSON_IsNull(common_encoding_version) ? strdup(common_encoding_version->valuestring) : NULL, conditions ? conditionsList : NULL, storage_versions ? storage_versionsList : NULL diff --git a/kubernetes/model/v1alpha1_storage_version_status.h b/kubernetes/model/v1alpha1_storage_version_status.h index f0e1aeea..b84a2514 100644 --- a/kubernetes/model/v1alpha1_storage_version_status.h +++ b/kubernetes/model/v1alpha1_storage_version_status.h @@ -25,9 +25,10 @@ typedef struct v1alpha1_storage_version_status_t { list_t *conditions; //nonprimitive container list_t *storage_versions; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_storage_version_status_t; -v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_create( +__attribute__((deprecated)) v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_create( char *common_encoding_version, list_t *conditions, list_t *storage_versions diff --git a/kubernetes/model/v1alpha1_type_checking.c b/kubernetes/model/v1alpha1_type_checking.c deleted file mode 100644 index ceb21910..00000000 --- a/kubernetes/model/v1alpha1_type_checking.c +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include "v1alpha1_type_checking.h" - - - -v1alpha1_type_checking_t *v1alpha1_type_checking_create( - list_t *expression_warnings - ) { - v1alpha1_type_checking_t *v1alpha1_type_checking_local_var = malloc(sizeof(v1alpha1_type_checking_t)); - if (!v1alpha1_type_checking_local_var) { - return NULL; - } - v1alpha1_type_checking_local_var->expression_warnings = expression_warnings; - - return v1alpha1_type_checking_local_var; -} - - -void v1alpha1_type_checking_free(v1alpha1_type_checking_t *v1alpha1_type_checking) { - if(NULL == v1alpha1_type_checking){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_type_checking->expression_warnings) { - list_ForEach(listEntry, v1alpha1_type_checking->expression_warnings) { - v1alpha1_expression_warning_free(listEntry->data); - } - list_freeList(v1alpha1_type_checking->expression_warnings); - v1alpha1_type_checking->expression_warnings = NULL; - } - free(v1alpha1_type_checking); -} - -cJSON *v1alpha1_type_checking_convertToJSON(v1alpha1_type_checking_t *v1alpha1_type_checking) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_type_checking->expression_warnings - if(v1alpha1_type_checking->expression_warnings) { - cJSON *expression_warnings = cJSON_AddArrayToObject(item, "expressionWarnings"); - if(expression_warnings == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *expression_warningsListEntry; - if (v1alpha1_type_checking->expression_warnings) { - list_ForEach(expression_warningsListEntry, v1alpha1_type_checking->expression_warnings) { - cJSON *itemLocal = v1alpha1_expression_warning_convertToJSON(expression_warningsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(expression_warnings, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_type_checking_t *v1alpha1_type_checking_parseFromJSON(cJSON *v1alpha1_type_checkingJSON){ - - v1alpha1_type_checking_t *v1alpha1_type_checking_local_var = NULL; - - // define the local list for v1alpha1_type_checking->expression_warnings - list_t *expression_warningsList = NULL; - - // v1alpha1_type_checking->expression_warnings - cJSON *expression_warnings = cJSON_GetObjectItemCaseSensitive(v1alpha1_type_checkingJSON, "expressionWarnings"); - if (expression_warnings) { - cJSON *expression_warnings_local_nonprimitive = NULL; - if(!cJSON_IsArray(expression_warnings)){ - goto end; //nonprimitive container - } - - expression_warningsList = list_createList(); - - cJSON_ArrayForEach(expression_warnings_local_nonprimitive,expression_warnings ) - { - if(!cJSON_IsObject(expression_warnings_local_nonprimitive)){ - goto end; - } - v1alpha1_expression_warning_t *expression_warningsItem = v1alpha1_expression_warning_parseFromJSON(expression_warnings_local_nonprimitive); - - list_addElement(expression_warningsList, expression_warningsItem); - } - } - - - v1alpha1_type_checking_local_var = v1alpha1_type_checking_create ( - expression_warnings ? expression_warningsList : NULL - ); - - return v1alpha1_type_checking_local_var; -end: - if (expression_warningsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, expression_warningsList) { - v1alpha1_expression_warning_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(expression_warningsList); - expression_warningsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_type_checking.h b/kubernetes/model/v1alpha1_type_checking.h deleted file mode 100644 index 2a95fc09..00000000 --- a/kubernetes/model/v1alpha1_type_checking.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1alpha1_type_checking.h - * - * TypeChecking contains results of type checking the expressions in the ValidatingAdmissionPolicy - */ - -#ifndef _v1alpha1_type_checking_H_ -#define _v1alpha1_type_checking_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_type_checking_t v1alpha1_type_checking_t; - -#include "v1alpha1_expression_warning.h" - - - -typedef struct v1alpha1_type_checking_t { - list_t *expression_warnings; //nonprimitive container - -} v1alpha1_type_checking_t; - -v1alpha1_type_checking_t *v1alpha1_type_checking_create( - list_t *expression_warnings -); - -void v1alpha1_type_checking_free(v1alpha1_type_checking_t *v1alpha1_type_checking); - -v1alpha1_type_checking_t *v1alpha1_type_checking_parseFromJSON(cJSON *v1alpha1_type_checkingJSON); - -cJSON *v1alpha1_type_checking_convertToJSON(v1alpha1_type_checking_t *v1alpha1_type_checking); - -#endif /* _v1alpha1_type_checking_H_ */ - diff --git a/kubernetes/model/v1alpha1_validating_admission_policy.c b/kubernetes/model/v1alpha1_validating_admission_policy.c deleted file mode 100644 index 72323522..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy.c +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validating_admission_policy.h" - - - -v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_validating_admission_policy_spec_t *spec, - v1alpha1_validating_admission_policy_status_t *status - ) { - v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy_local_var = malloc(sizeof(v1alpha1_validating_admission_policy_t)); - if (!v1alpha1_validating_admission_policy_local_var) { - return NULL; - } - v1alpha1_validating_admission_policy_local_var->api_version = api_version; - v1alpha1_validating_admission_policy_local_var->kind = kind; - v1alpha1_validating_admission_policy_local_var->metadata = metadata; - v1alpha1_validating_admission_policy_local_var->spec = spec; - v1alpha1_validating_admission_policy_local_var->status = status; - - return v1alpha1_validating_admission_policy_local_var; -} - - -void v1alpha1_validating_admission_policy_free(v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy) { - if(NULL == v1alpha1_validating_admission_policy){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validating_admission_policy->api_version) { - free(v1alpha1_validating_admission_policy->api_version); - v1alpha1_validating_admission_policy->api_version = NULL; - } - if (v1alpha1_validating_admission_policy->kind) { - free(v1alpha1_validating_admission_policy->kind); - v1alpha1_validating_admission_policy->kind = NULL; - } - if (v1alpha1_validating_admission_policy->metadata) { - v1_object_meta_free(v1alpha1_validating_admission_policy->metadata); - v1alpha1_validating_admission_policy->metadata = NULL; - } - if (v1alpha1_validating_admission_policy->spec) { - v1alpha1_validating_admission_policy_spec_free(v1alpha1_validating_admission_policy->spec); - v1alpha1_validating_admission_policy->spec = NULL; - } - if (v1alpha1_validating_admission_policy->status) { - v1alpha1_validating_admission_policy_status_free(v1alpha1_validating_admission_policy->status); - v1alpha1_validating_admission_policy->status = NULL; - } - free(v1alpha1_validating_admission_policy); -} - -cJSON *v1alpha1_validating_admission_policy_convertToJSON(v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validating_admission_policy->api_version - if(v1alpha1_validating_admission_policy->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_validating_admission_policy->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy->kind - if(v1alpha1_validating_admission_policy->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_validating_admission_policy->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy->metadata - if(v1alpha1_validating_admission_policy->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_validating_admission_policy->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_validating_admission_policy->spec - if(v1alpha1_validating_admission_policy->spec) { - cJSON *spec_local_JSON = v1alpha1_validating_admission_policy_spec_convertToJSON(v1alpha1_validating_admission_policy->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_validating_admission_policy->status - if(v1alpha1_validating_admission_policy->status) { - cJSON *status_local_JSON = v1alpha1_validating_admission_policy_status_convertToJSON(v1alpha1_validating_admission_policy->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy_parseFromJSON(cJSON *v1alpha1_validating_admission_policyJSON){ - - v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy_local_var = NULL; - - // define the local variable for v1alpha1_validating_admission_policy->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha1_validating_admission_policy->spec - v1alpha1_validating_admission_policy_spec_t *spec_local_nonprim = NULL; - - // define the local variable for v1alpha1_validating_admission_policy->status - v1alpha1_validating_admission_policy_status_t *status_local_nonprim = NULL; - - // v1alpha1_validating_admission_policy->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policyJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policyJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policyJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha1_validating_admission_policy->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policyJSON, "spec"); - if (spec) { - spec_local_nonprim = v1alpha1_validating_admission_policy_spec_parseFromJSON(spec); //nonprimitive - } - - // v1alpha1_validating_admission_policy->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policyJSON, "status"); - if (status) { - status_local_nonprim = v1alpha1_validating_admission_policy_status_parseFromJSON(status); //nonprimitive - } - - - v1alpha1_validating_admission_policy_local_var = v1alpha1_validating_admission_policy_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL, - status ? status_local_nonprim : NULL - ); - - return v1alpha1_validating_admission_policy_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha1_validating_admission_policy_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1alpha1_validating_admission_policy_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validating_admission_policy.h b/kubernetes/model/v1alpha1_validating_admission_policy.h deleted file mode 100644 index f006d88b..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * v1alpha1_validating_admission_policy.h - * - * ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. - */ - -#ifndef _v1alpha1_validating_admission_policy_H_ -#define _v1alpha1_validating_admission_policy_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validating_admission_policy_t v1alpha1_validating_admission_policy_t; - -#include "v1_object_meta.h" -#include "v1alpha1_validating_admission_policy_spec.h" -#include "v1alpha1_validating_admission_policy_status.h" - - - -typedef struct v1alpha1_validating_admission_policy_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha1_validating_admission_policy_spec_t *spec; //model - struct v1alpha1_validating_admission_policy_status_t *status; //model - -} v1alpha1_validating_admission_policy_t; - -v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_validating_admission_policy_spec_t *spec, - v1alpha1_validating_admission_policy_status_t *status -); - -void v1alpha1_validating_admission_policy_free(v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy); - -v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy_parseFromJSON(cJSON *v1alpha1_validating_admission_policyJSON); - -cJSON *v1alpha1_validating_admission_policy_convertToJSON(v1alpha1_validating_admission_policy_t *v1alpha1_validating_admission_policy); - -#endif /* _v1alpha1_validating_admission_policy_H_ */ - diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_binding.c b/kubernetes/model/v1alpha1_validating_admission_policy_binding.c deleted file mode 100644 index 4d35e305..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_binding.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validating_admission_policy_binding.h" - - - -v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_validating_admission_policy_binding_spec_t *spec - ) { - v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding_local_var = malloc(sizeof(v1alpha1_validating_admission_policy_binding_t)); - if (!v1alpha1_validating_admission_policy_binding_local_var) { - return NULL; - } - v1alpha1_validating_admission_policy_binding_local_var->api_version = api_version; - v1alpha1_validating_admission_policy_binding_local_var->kind = kind; - v1alpha1_validating_admission_policy_binding_local_var->metadata = metadata; - v1alpha1_validating_admission_policy_binding_local_var->spec = spec; - - return v1alpha1_validating_admission_policy_binding_local_var; -} - - -void v1alpha1_validating_admission_policy_binding_free(v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding) { - if(NULL == v1alpha1_validating_admission_policy_binding){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validating_admission_policy_binding->api_version) { - free(v1alpha1_validating_admission_policy_binding->api_version); - v1alpha1_validating_admission_policy_binding->api_version = NULL; - } - if (v1alpha1_validating_admission_policy_binding->kind) { - free(v1alpha1_validating_admission_policy_binding->kind); - v1alpha1_validating_admission_policy_binding->kind = NULL; - } - if (v1alpha1_validating_admission_policy_binding->metadata) { - v1_object_meta_free(v1alpha1_validating_admission_policy_binding->metadata); - v1alpha1_validating_admission_policy_binding->metadata = NULL; - } - if (v1alpha1_validating_admission_policy_binding->spec) { - v1alpha1_validating_admission_policy_binding_spec_free(v1alpha1_validating_admission_policy_binding->spec); - v1alpha1_validating_admission_policy_binding->spec = NULL; - } - free(v1alpha1_validating_admission_policy_binding); -} - -cJSON *v1alpha1_validating_admission_policy_binding_convertToJSON(v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validating_admission_policy_binding->api_version - if(v1alpha1_validating_admission_policy_binding->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_validating_admission_policy_binding->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_binding->kind - if(v1alpha1_validating_admission_policy_binding->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_validating_admission_policy_binding->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_binding->metadata - if(v1alpha1_validating_admission_policy_binding->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha1_validating_admission_policy_binding->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_validating_admission_policy_binding->spec - if(v1alpha1_validating_admission_policy_binding->spec) { - cJSON *spec_local_JSON = v1alpha1_validating_admission_policy_binding_spec_convertToJSON(v1alpha1_validating_admission_policy_binding->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_bindingJSON){ - - v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding_local_var = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_binding->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_binding->spec - v1alpha1_validating_admission_policy_binding_spec_t *spec_local_nonprim = NULL; - - // v1alpha1_validating_admission_policy_binding->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_bindingJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_binding->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_bindingJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_binding->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_bindingJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha1_validating_admission_policy_binding->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_bindingJSON, "spec"); - if (spec) { - spec_local_nonprim = v1alpha1_validating_admission_policy_binding_spec_parseFromJSON(spec); //nonprimitive - } - - - v1alpha1_validating_admission_policy_binding_local_var = v1alpha1_validating_admission_policy_binding_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL - ); - - return v1alpha1_validating_admission_policy_binding_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha1_validating_admission_policy_binding_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_binding.h b/kubernetes/model/v1alpha1_validating_admission_policy_binding.h deleted file mode 100644 index 209c377b..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_binding.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_validating_admission_policy_binding.h - * - * ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters. For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget. - */ - -#ifndef _v1alpha1_validating_admission_policy_binding_H_ -#define _v1alpha1_validating_admission_policy_binding_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validating_admission_policy_binding_t v1alpha1_validating_admission_policy_binding_t; - -#include "v1_object_meta.h" -#include "v1alpha1_validating_admission_policy_binding_spec.h" - - - -typedef struct v1alpha1_validating_admission_policy_binding_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha1_validating_admission_policy_binding_spec_t *spec; //model - -} v1alpha1_validating_admission_policy_binding_t; - -v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha1_validating_admission_policy_binding_spec_t *spec -); - -void v1alpha1_validating_admission_policy_binding_free(v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding); - -v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_bindingJSON); - -cJSON *v1alpha1_validating_admission_policy_binding_convertToJSON(v1alpha1_validating_admission_policy_binding_t *v1alpha1_validating_admission_policy_binding); - -#endif /* _v1alpha1_validating_admission_policy_binding_H_ */ - diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_binding_list.c b/kubernetes/model/v1alpha1_validating_admission_policy_binding_list.c deleted file mode 100644 index 5a4dc110..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_binding_list.c +++ /dev/null @@ -1,193 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validating_admission_policy_binding_list.h" - - - -v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list_local_var = malloc(sizeof(v1alpha1_validating_admission_policy_binding_list_t)); - if (!v1alpha1_validating_admission_policy_binding_list_local_var) { - return NULL; - } - v1alpha1_validating_admission_policy_binding_list_local_var->api_version = api_version; - v1alpha1_validating_admission_policy_binding_list_local_var->items = items; - v1alpha1_validating_admission_policy_binding_list_local_var->kind = kind; - v1alpha1_validating_admission_policy_binding_list_local_var->metadata = metadata; - - return v1alpha1_validating_admission_policy_binding_list_local_var; -} - - -void v1alpha1_validating_admission_policy_binding_list_free(v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list) { - if(NULL == v1alpha1_validating_admission_policy_binding_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validating_admission_policy_binding_list->api_version) { - free(v1alpha1_validating_admission_policy_binding_list->api_version); - v1alpha1_validating_admission_policy_binding_list->api_version = NULL; - } - if (v1alpha1_validating_admission_policy_binding_list->items) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_binding_list->items) { - v1alpha1_validating_admission_policy_binding_free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_binding_list->items); - v1alpha1_validating_admission_policy_binding_list->items = NULL; - } - if (v1alpha1_validating_admission_policy_binding_list->kind) { - free(v1alpha1_validating_admission_policy_binding_list->kind); - v1alpha1_validating_admission_policy_binding_list->kind = NULL; - } - if (v1alpha1_validating_admission_policy_binding_list->metadata) { - v1_list_meta_free(v1alpha1_validating_admission_policy_binding_list->metadata); - v1alpha1_validating_admission_policy_binding_list->metadata = NULL; - } - free(v1alpha1_validating_admission_policy_binding_list); -} - -cJSON *v1alpha1_validating_admission_policy_binding_list_convertToJSON(v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validating_admission_policy_binding_list->api_version - if(v1alpha1_validating_admission_policy_binding_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_validating_admission_policy_binding_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_binding_list->items - if(v1alpha1_validating_admission_policy_binding_list->items) { - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha1_validating_admission_policy_binding_list->items) { - list_ForEach(itemsListEntry, v1alpha1_validating_admission_policy_binding_list->items) { - cJSON *itemLocal = v1alpha1_validating_admission_policy_binding_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - } - - - // v1alpha1_validating_admission_policy_binding_list->kind - if(v1alpha1_validating_admission_policy_binding_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_validating_admission_policy_binding_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_binding_list->metadata - if(v1alpha1_validating_admission_policy_binding_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha1_validating_admission_policy_binding_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_binding_listJSON){ - - v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list_local_var = NULL; - - // define the local list for v1alpha1_validating_admission_policy_binding_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_binding_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha1_validating_admission_policy_binding_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_binding_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_listJSON, "items"); - if (items) { - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha1_validating_admission_policy_binding_t *itemsItem = v1alpha1_validating_admission_policy_binding_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - } - - // v1alpha1_validating_admission_policy_binding_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_binding_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha1_validating_admission_policy_binding_list_local_var = v1alpha1_validating_admission_policy_binding_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - items ? itemsList : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha1_validating_admission_policy_binding_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha1_validating_admission_policy_binding_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_binding_list.h b/kubernetes/model/v1alpha1_validating_admission_policy_binding_list.h deleted file mode 100644 index 527aa2b5..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_binding_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_validating_admission_policy_binding_list.h - * - * ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding. - */ - -#ifndef _v1alpha1_validating_admission_policy_binding_list_H_ -#define _v1alpha1_validating_admission_policy_binding_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validating_admission_policy_binding_list_t v1alpha1_validating_admission_policy_binding_list_t; - -#include "v1_list_meta.h" -#include "v1alpha1_validating_admission_policy_binding.h" - - - -typedef struct v1alpha1_validating_admission_policy_binding_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha1_validating_admission_policy_binding_list_t; - -v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha1_validating_admission_policy_binding_list_free(v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list); - -v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_binding_listJSON); - -cJSON *v1alpha1_validating_admission_policy_binding_list_convertToJSON(v1alpha1_validating_admission_policy_binding_list_t *v1alpha1_validating_admission_policy_binding_list); - -#endif /* _v1alpha1_validating_admission_policy_binding_list_H_ */ - diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_binding_spec.c b/kubernetes/model/v1alpha1_validating_admission_policy_binding_spec.c deleted file mode 100644 index c9cab792..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_binding_spec.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validating_admission_policy_binding_spec.h" - - - -v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec_create( - v1alpha1_match_resources_t *match_resources, - v1alpha1_param_ref_t *param_ref, - char *policy_name, - list_t *validation_actions - ) { - v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec_local_var = malloc(sizeof(v1alpha1_validating_admission_policy_binding_spec_t)); - if (!v1alpha1_validating_admission_policy_binding_spec_local_var) { - return NULL; - } - v1alpha1_validating_admission_policy_binding_spec_local_var->match_resources = match_resources; - v1alpha1_validating_admission_policy_binding_spec_local_var->param_ref = param_ref; - v1alpha1_validating_admission_policy_binding_spec_local_var->policy_name = policy_name; - v1alpha1_validating_admission_policy_binding_spec_local_var->validation_actions = validation_actions; - - return v1alpha1_validating_admission_policy_binding_spec_local_var; -} - - -void v1alpha1_validating_admission_policy_binding_spec_free(v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec) { - if(NULL == v1alpha1_validating_admission_policy_binding_spec){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validating_admission_policy_binding_spec->match_resources) { - v1alpha1_match_resources_free(v1alpha1_validating_admission_policy_binding_spec->match_resources); - v1alpha1_validating_admission_policy_binding_spec->match_resources = NULL; - } - if (v1alpha1_validating_admission_policy_binding_spec->param_ref) { - v1alpha1_param_ref_free(v1alpha1_validating_admission_policy_binding_spec->param_ref); - v1alpha1_validating_admission_policy_binding_spec->param_ref = NULL; - } - if (v1alpha1_validating_admission_policy_binding_spec->policy_name) { - free(v1alpha1_validating_admission_policy_binding_spec->policy_name); - v1alpha1_validating_admission_policy_binding_spec->policy_name = NULL; - } - if (v1alpha1_validating_admission_policy_binding_spec->validation_actions) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_binding_spec->validation_actions) { - free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_binding_spec->validation_actions); - v1alpha1_validating_admission_policy_binding_spec->validation_actions = NULL; - } - free(v1alpha1_validating_admission_policy_binding_spec); -} - -cJSON *v1alpha1_validating_admission_policy_binding_spec_convertToJSON(v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validating_admission_policy_binding_spec->match_resources - if(v1alpha1_validating_admission_policy_binding_spec->match_resources) { - cJSON *match_resources_local_JSON = v1alpha1_match_resources_convertToJSON(v1alpha1_validating_admission_policy_binding_spec->match_resources); - if(match_resources_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "matchResources", match_resources_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_validating_admission_policy_binding_spec->param_ref - if(v1alpha1_validating_admission_policy_binding_spec->param_ref) { - cJSON *param_ref_local_JSON = v1alpha1_param_ref_convertToJSON(v1alpha1_validating_admission_policy_binding_spec->param_ref); - if(param_ref_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "paramRef", param_ref_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_validating_admission_policy_binding_spec->policy_name - if(v1alpha1_validating_admission_policy_binding_spec->policy_name) { - if(cJSON_AddStringToObject(item, "policyName", v1alpha1_validating_admission_policy_binding_spec->policy_name) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_binding_spec->validation_actions - if(v1alpha1_validating_admission_policy_binding_spec->validation_actions) { - cJSON *validation_actions = cJSON_AddArrayToObject(item, "validationActions"); - if(validation_actions == NULL) { - goto fail; //primitive container - } - - listEntry_t *validation_actionsListEntry; - list_ForEach(validation_actionsListEntry, v1alpha1_validating_admission_policy_binding_spec->validation_actions) { - if(cJSON_AddStringToObject(validation_actions, "", (char*)validation_actionsListEntry->data) == NULL) - { - goto fail; - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_binding_specJSON){ - - v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec_local_var = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_binding_spec->match_resources - v1alpha1_match_resources_t *match_resources_local_nonprim = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_binding_spec->param_ref - v1alpha1_param_ref_t *param_ref_local_nonprim = NULL; - - // define the local list for v1alpha1_validating_admission_policy_binding_spec->validation_actions - list_t *validation_actionsList = NULL; - - // v1alpha1_validating_admission_policy_binding_spec->match_resources - cJSON *match_resources = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_specJSON, "matchResources"); - if (match_resources) { - match_resources_local_nonprim = v1alpha1_match_resources_parseFromJSON(match_resources); //nonprimitive - } - - // v1alpha1_validating_admission_policy_binding_spec->param_ref - cJSON *param_ref = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_specJSON, "paramRef"); - if (param_ref) { - param_ref_local_nonprim = v1alpha1_param_ref_parseFromJSON(param_ref); //nonprimitive - } - - // v1alpha1_validating_admission_policy_binding_spec->policy_name - cJSON *policy_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_specJSON, "policyName"); - if (policy_name) { - if(!cJSON_IsString(policy_name) && !cJSON_IsNull(policy_name)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_binding_spec->validation_actions - cJSON *validation_actions = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_binding_specJSON, "validationActions"); - if (validation_actions) { - cJSON *validation_actions_local = NULL; - if(!cJSON_IsArray(validation_actions)) { - goto end;//primitive container - } - validation_actionsList = list_createList(); - - cJSON_ArrayForEach(validation_actions_local, validation_actions) - { - if(!cJSON_IsString(validation_actions_local)) - { - goto end; - } - list_addElement(validation_actionsList , strdup(validation_actions_local->valuestring)); - } - } - - - v1alpha1_validating_admission_policy_binding_spec_local_var = v1alpha1_validating_admission_policy_binding_spec_create ( - match_resources ? match_resources_local_nonprim : NULL, - param_ref ? param_ref_local_nonprim : NULL, - policy_name && !cJSON_IsNull(policy_name) ? strdup(policy_name->valuestring) : NULL, - validation_actions ? validation_actionsList : NULL - ); - - return v1alpha1_validating_admission_policy_binding_spec_local_var; -end: - if (match_resources_local_nonprim) { - v1alpha1_match_resources_free(match_resources_local_nonprim); - match_resources_local_nonprim = NULL; - } - if (param_ref_local_nonprim) { - v1alpha1_param_ref_free(param_ref_local_nonprim); - param_ref_local_nonprim = NULL; - } - if (validation_actionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, validation_actionsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(validation_actionsList); - validation_actionsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_binding_spec.h b/kubernetes/model/v1alpha1_validating_admission_policy_binding_spec.h deleted file mode 100644 index 9592b606..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_binding_spec.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_validating_admission_policy_binding_spec.h - * - * ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding. - */ - -#ifndef _v1alpha1_validating_admission_policy_binding_spec_H_ -#define _v1alpha1_validating_admission_policy_binding_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validating_admission_policy_binding_spec_t v1alpha1_validating_admission_policy_binding_spec_t; - -#include "v1alpha1_match_resources.h" -#include "v1alpha1_param_ref.h" - - - -typedef struct v1alpha1_validating_admission_policy_binding_spec_t { - struct v1alpha1_match_resources_t *match_resources; //model - struct v1alpha1_param_ref_t *param_ref; //model - char *policy_name; // string - list_t *validation_actions; //primitive container - -} v1alpha1_validating_admission_policy_binding_spec_t; - -v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec_create( - v1alpha1_match_resources_t *match_resources, - v1alpha1_param_ref_t *param_ref, - char *policy_name, - list_t *validation_actions -); - -void v1alpha1_validating_admission_policy_binding_spec_free(v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec); - -v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_binding_specJSON); - -cJSON *v1alpha1_validating_admission_policy_binding_spec_convertToJSON(v1alpha1_validating_admission_policy_binding_spec_t *v1alpha1_validating_admission_policy_binding_spec); - -#endif /* _v1alpha1_validating_admission_policy_binding_spec_H_ */ - diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_list.c b/kubernetes/model/v1alpha1_validating_admission_policy_list.c deleted file mode 100644 index 27f584c3..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_list.c +++ /dev/null @@ -1,193 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validating_admission_policy_list.h" - - - -v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list_local_var = malloc(sizeof(v1alpha1_validating_admission_policy_list_t)); - if (!v1alpha1_validating_admission_policy_list_local_var) { - return NULL; - } - v1alpha1_validating_admission_policy_list_local_var->api_version = api_version; - v1alpha1_validating_admission_policy_list_local_var->items = items; - v1alpha1_validating_admission_policy_list_local_var->kind = kind; - v1alpha1_validating_admission_policy_list_local_var->metadata = metadata; - - return v1alpha1_validating_admission_policy_list_local_var; -} - - -void v1alpha1_validating_admission_policy_list_free(v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list) { - if(NULL == v1alpha1_validating_admission_policy_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validating_admission_policy_list->api_version) { - free(v1alpha1_validating_admission_policy_list->api_version); - v1alpha1_validating_admission_policy_list->api_version = NULL; - } - if (v1alpha1_validating_admission_policy_list->items) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_list->items) { - v1alpha1_validating_admission_policy_free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_list->items); - v1alpha1_validating_admission_policy_list->items = NULL; - } - if (v1alpha1_validating_admission_policy_list->kind) { - free(v1alpha1_validating_admission_policy_list->kind); - v1alpha1_validating_admission_policy_list->kind = NULL; - } - if (v1alpha1_validating_admission_policy_list->metadata) { - v1_list_meta_free(v1alpha1_validating_admission_policy_list->metadata); - v1alpha1_validating_admission_policy_list->metadata = NULL; - } - free(v1alpha1_validating_admission_policy_list); -} - -cJSON *v1alpha1_validating_admission_policy_list_convertToJSON(v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validating_admission_policy_list->api_version - if(v1alpha1_validating_admission_policy_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha1_validating_admission_policy_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_list->items - if(v1alpha1_validating_admission_policy_list->items) { - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha1_validating_admission_policy_list->items) { - list_ForEach(itemsListEntry, v1alpha1_validating_admission_policy_list->items) { - cJSON *itemLocal = v1alpha1_validating_admission_policy_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - } - - - // v1alpha1_validating_admission_policy_list->kind - if(v1alpha1_validating_admission_policy_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha1_validating_admission_policy_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_list->metadata - if(v1alpha1_validating_admission_policy_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha1_validating_admission_policy_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_listJSON){ - - v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list_local_var = NULL; - - // define the local list for v1alpha1_validating_admission_policy_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha1_validating_admission_policy_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_listJSON, "items"); - if (items) { - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha1_validating_admission_policy_t *itemsItem = v1alpha1_validating_admission_policy_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - } - - // v1alpha1_validating_admission_policy_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha1_validating_admission_policy_list_local_var = v1alpha1_validating_admission_policy_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - items ? itemsList : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha1_validating_admission_policy_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha1_validating_admission_policy_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_list.h b/kubernetes/model/v1alpha1_validating_admission_policy_list.h deleted file mode 100644 index fef55fcd..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha1_validating_admission_policy_list.h - * - * ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy. - */ - -#ifndef _v1alpha1_validating_admission_policy_list_H_ -#define _v1alpha1_validating_admission_policy_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validating_admission_policy_list_t v1alpha1_validating_admission_policy_list_t; - -#include "v1_list_meta.h" -#include "v1alpha1_validating_admission_policy.h" - - - -typedef struct v1alpha1_validating_admission_policy_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha1_validating_admission_policy_list_t; - -v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha1_validating_admission_policy_list_free(v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list); - -v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_listJSON); - -cJSON *v1alpha1_validating_admission_policy_list_convertToJSON(v1alpha1_validating_admission_policy_list_t *v1alpha1_validating_admission_policy_list); - -#endif /* _v1alpha1_validating_admission_policy_list_H_ */ - diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_spec.c b/kubernetes/model/v1alpha1_validating_admission_policy_spec.c deleted file mode 100644 index 00fc4bdd..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_spec.c +++ /dev/null @@ -1,391 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validating_admission_policy_spec.h" - - - -v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec_create( - list_t *audit_annotations, - char *failure_policy, - list_t *match_conditions, - v1alpha1_match_resources_t *match_constraints, - v1alpha1_param_kind_t *param_kind, - list_t *validations, - list_t *variables - ) { - v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec_local_var = malloc(sizeof(v1alpha1_validating_admission_policy_spec_t)); - if (!v1alpha1_validating_admission_policy_spec_local_var) { - return NULL; - } - v1alpha1_validating_admission_policy_spec_local_var->audit_annotations = audit_annotations; - v1alpha1_validating_admission_policy_spec_local_var->failure_policy = failure_policy; - v1alpha1_validating_admission_policy_spec_local_var->match_conditions = match_conditions; - v1alpha1_validating_admission_policy_spec_local_var->match_constraints = match_constraints; - v1alpha1_validating_admission_policy_spec_local_var->param_kind = param_kind; - v1alpha1_validating_admission_policy_spec_local_var->validations = validations; - v1alpha1_validating_admission_policy_spec_local_var->variables = variables; - - return v1alpha1_validating_admission_policy_spec_local_var; -} - - -void v1alpha1_validating_admission_policy_spec_free(v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec) { - if(NULL == v1alpha1_validating_admission_policy_spec){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validating_admission_policy_spec->audit_annotations) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_spec->audit_annotations) { - v1alpha1_audit_annotation_free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_spec->audit_annotations); - v1alpha1_validating_admission_policy_spec->audit_annotations = NULL; - } - if (v1alpha1_validating_admission_policy_spec->failure_policy) { - free(v1alpha1_validating_admission_policy_spec->failure_policy); - v1alpha1_validating_admission_policy_spec->failure_policy = NULL; - } - if (v1alpha1_validating_admission_policy_spec->match_conditions) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_spec->match_conditions) { - v1alpha1_match_condition_free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_spec->match_conditions); - v1alpha1_validating_admission_policy_spec->match_conditions = NULL; - } - if (v1alpha1_validating_admission_policy_spec->match_constraints) { - v1alpha1_match_resources_free(v1alpha1_validating_admission_policy_spec->match_constraints); - v1alpha1_validating_admission_policy_spec->match_constraints = NULL; - } - if (v1alpha1_validating_admission_policy_spec->param_kind) { - v1alpha1_param_kind_free(v1alpha1_validating_admission_policy_spec->param_kind); - v1alpha1_validating_admission_policy_spec->param_kind = NULL; - } - if (v1alpha1_validating_admission_policy_spec->validations) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_spec->validations) { - v1alpha1_validation_free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_spec->validations); - v1alpha1_validating_admission_policy_spec->validations = NULL; - } - if (v1alpha1_validating_admission_policy_spec->variables) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_spec->variables) { - v1alpha1_variable_free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_spec->variables); - v1alpha1_validating_admission_policy_spec->variables = NULL; - } - free(v1alpha1_validating_admission_policy_spec); -} - -cJSON *v1alpha1_validating_admission_policy_spec_convertToJSON(v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validating_admission_policy_spec->audit_annotations - if(v1alpha1_validating_admission_policy_spec->audit_annotations) { - cJSON *audit_annotations = cJSON_AddArrayToObject(item, "auditAnnotations"); - if(audit_annotations == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *audit_annotationsListEntry; - if (v1alpha1_validating_admission_policy_spec->audit_annotations) { - list_ForEach(audit_annotationsListEntry, v1alpha1_validating_admission_policy_spec->audit_annotations) { - cJSON *itemLocal = v1alpha1_audit_annotation_convertToJSON(audit_annotationsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(audit_annotations, itemLocal); - } - } - } - - - // v1alpha1_validating_admission_policy_spec->failure_policy - if(v1alpha1_validating_admission_policy_spec->failure_policy) { - if(cJSON_AddStringToObject(item, "failurePolicy", v1alpha1_validating_admission_policy_spec->failure_policy) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validating_admission_policy_spec->match_conditions - if(v1alpha1_validating_admission_policy_spec->match_conditions) { - cJSON *match_conditions = cJSON_AddArrayToObject(item, "matchConditions"); - if(match_conditions == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *match_conditionsListEntry; - if (v1alpha1_validating_admission_policy_spec->match_conditions) { - list_ForEach(match_conditionsListEntry, v1alpha1_validating_admission_policy_spec->match_conditions) { - cJSON *itemLocal = v1alpha1_match_condition_convertToJSON(match_conditionsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(match_conditions, itemLocal); - } - } - } - - - // v1alpha1_validating_admission_policy_spec->match_constraints - if(v1alpha1_validating_admission_policy_spec->match_constraints) { - cJSON *match_constraints_local_JSON = v1alpha1_match_resources_convertToJSON(v1alpha1_validating_admission_policy_spec->match_constraints); - if(match_constraints_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "matchConstraints", match_constraints_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_validating_admission_policy_spec->param_kind - if(v1alpha1_validating_admission_policy_spec->param_kind) { - cJSON *param_kind_local_JSON = v1alpha1_param_kind_convertToJSON(v1alpha1_validating_admission_policy_spec->param_kind); - if(param_kind_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "paramKind", param_kind_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha1_validating_admission_policy_spec->validations - if(v1alpha1_validating_admission_policy_spec->validations) { - cJSON *validations = cJSON_AddArrayToObject(item, "validations"); - if(validations == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *validationsListEntry; - if (v1alpha1_validating_admission_policy_spec->validations) { - list_ForEach(validationsListEntry, v1alpha1_validating_admission_policy_spec->validations) { - cJSON *itemLocal = v1alpha1_validation_convertToJSON(validationsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(validations, itemLocal); - } - } - } - - - // v1alpha1_validating_admission_policy_spec->variables - if(v1alpha1_validating_admission_policy_spec->variables) { - cJSON *variables = cJSON_AddArrayToObject(item, "variables"); - if(variables == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *variablesListEntry; - if (v1alpha1_validating_admission_policy_spec->variables) { - list_ForEach(variablesListEntry, v1alpha1_validating_admission_policy_spec->variables) { - cJSON *itemLocal = v1alpha1_variable_convertToJSON(variablesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(variables, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_specJSON){ - - v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec_local_var = NULL; - - // define the local list for v1alpha1_validating_admission_policy_spec->audit_annotations - list_t *audit_annotationsList = NULL; - - // define the local list for v1alpha1_validating_admission_policy_spec->match_conditions - list_t *match_conditionsList = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_spec->match_constraints - v1alpha1_match_resources_t *match_constraints_local_nonprim = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_spec->param_kind - v1alpha1_param_kind_t *param_kind_local_nonprim = NULL; - - // define the local list for v1alpha1_validating_admission_policy_spec->validations - list_t *validationsList = NULL; - - // define the local list for v1alpha1_validating_admission_policy_spec->variables - list_t *variablesList = NULL; - - // v1alpha1_validating_admission_policy_spec->audit_annotations - cJSON *audit_annotations = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_specJSON, "auditAnnotations"); - if (audit_annotations) { - cJSON *audit_annotations_local_nonprimitive = NULL; - if(!cJSON_IsArray(audit_annotations)){ - goto end; //nonprimitive container - } - - audit_annotationsList = list_createList(); - - cJSON_ArrayForEach(audit_annotations_local_nonprimitive,audit_annotations ) - { - if(!cJSON_IsObject(audit_annotations_local_nonprimitive)){ - goto end; - } - v1alpha1_audit_annotation_t *audit_annotationsItem = v1alpha1_audit_annotation_parseFromJSON(audit_annotations_local_nonprimitive); - - list_addElement(audit_annotationsList, audit_annotationsItem); - } - } - - // v1alpha1_validating_admission_policy_spec->failure_policy - cJSON *failure_policy = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_specJSON, "failurePolicy"); - if (failure_policy) { - if(!cJSON_IsString(failure_policy) && !cJSON_IsNull(failure_policy)) - { - goto end; //String - } - } - - // v1alpha1_validating_admission_policy_spec->match_conditions - cJSON *match_conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_specJSON, "matchConditions"); - if (match_conditions) { - cJSON *match_conditions_local_nonprimitive = NULL; - if(!cJSON_IsArray(match_conditions)){ - goto end; //nonprimitive container - } - - match_conditionsList = list_createList(); - - cJSON_ArrayForEach(match_conditions_local_nonprimitive,match_conditions ) - { - if(!cJSON_IsObject(match_conditions_local_nonprimitive)){ - goto end; - } - v1alpha1_match_condition_t *match_conditionsItem = v1alpha1_match_condition_parseFromJSON(match_conditions_local_nonprimitive); - - list_addElement(match_conditionsList, match_conditionsItem); - } - } - - // v1alpha1_validating_admission_policy_spec->match_constraints - cJSON *match_constraints = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_specJSON, "matchConstraints"); - if (match_constraints) { - match_constraints_local_nonprim = v1alpha1_match_resources_parseFromJSON(match_constraints); //nonprimitive - } - - // v1alpha1_validating_admission_policy_spec->param_kind - cJSON *param_kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_specJSON, "paramKind"); - if (param_kind) { - param_kind_local_nonprim = v1alpha1_param_kind_parseFromJSON(param_kind); //nonprimitive - } - - // v1alpha1_validating_admission_policy_spec->validations - cJSON *validations = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_specJSON, "validations"); - if (validations) { - cJSON *validations_local_nonprimitive = NULL; - if(!cJSON_IsArray(validations)){ - goto end; //nonprimitive container - } - - validationsList = list_createList(); - - cJSON_ArrayForEach(validations_local_nonprimitive,validations ) - { - if(!cJSON_IsObject(validations_local_nonprimitive)){ - goto end; - } - v1alpha1_validation_t *validationsItem = v1alpha1_validation_parseFromJSON(validations_local_nonprimitive); - - list_addElement(validationsList, validationsItem); - } - } - - // v1alpha1_validating_admission_policy_spec->variables - cJSON *variables = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_specJSON, "variables"); - if (variables) { - cJSON *variables_local_nonprimitive = NULL; - if(!cJSON_IsArray(variables)){ - goto end; //nonprimitive container - } - - variablesList = list_createList(); - - cJSON_ArrayForEach(variables_local_nonprimitive,variables ) - { - if(!cJSON_IsObject(variables_local_nonprimitive)){ - goto end; - } - v1alpha1_variable_t *variablesItem = v1alpha1_variable_parseFromJSON(variables_local_nonprimitive); - - list_addElement(variablesList, variablesItem); - } - } - - - v1alpha1_validating_admission_policy_spec_local_var = v1alpha1_validating_admission_policy_spec_create ( - audit_annotations ? audit_annotationsList : NULL, - failure_policy && !cJSON_IsNull(failure_policy) ? strdup(failure_policy->valuestring) : NULL, - match_conditions ? match_conditionsList : NULL, - match_constraints ? match_constraints_local_nonprim : NULL, - param_kind ? param_kind_local_nonprim : NULL, - validations ? validationsList : NULL, - variables ? variablesList : NULL - ); - - return v1alpha1_validating_admission_policy_spec_local_var; -end: - if (audit_annotationsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, audit_annotationsList) { - v1alpha1_audit_annotation_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(audit_annotationsList); - audit_annotationsList = NULL; - } - if (match_conditionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, match_conditionsList) { - v1alpha1_match_condition_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(match_conditionsList); - match_conditionsList = NULL; - } - if (match_constraints_local_nonprim) { - v1alpha1_match_resources_free(match_constraints_local_nonprim); - match_constraints_local_nonprim = NULL; - } - if (param_kind_local_nonprim) { - v1alpha1_param_kind_free(param_kind_local_nonprim); - param_kind_local_nonprim = NULL; - } - if (validationsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, validationsList) { - v1alpha1_validation_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(validationsList); - validationsList = NULL; - } - if (variablesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, variablesList) { - v1alpha1_variable_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(variablesList); - variablesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_spec.h b/kubernetes/model/v1alpha1_validating_admission_policy_spec.h deleted file mode 100644 index a59ef9b0..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_spec.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * v1alpha1_validating_admission_policy_spec.h - * - * ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy. - */ - -#ifndef _v1alpha1_validating_admission_policy_spec_H_ -#define _v1alpha1_validating_admission_policy_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validating_admission_policy_spec_t v1alpha1_validating_admission_policy_spec_t; - -#include "v1alpha1_audit_annotation.h" -#include "v1alpha1_match_condition.h" -#include "v1alpha1_match_resources.h" -#include "v1alpha1_param_kind.h" -#include "v1alpha1_validation.h" -#include "v1alpha1_variable.h" - - - -typedef struct v1alpha1_validating_admission_policy_spec_t { - list_t *audit_annotations; //nonprimitive container - char *failure_policy; // string - list_t *match_conditions; //nonprimitive container - struct v1alpha1_match_resources_t *match_constraints; //model - struct v1alpha1_param_kind_t *param_kind; //model - list_t *validations; //nonprimitive container - list_t *variables; //nonprimitive container - -} v1alpha1_validating_admission_policy_spec_t; - -v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec_create( - list_t *audit_annotations, - char *failure_policy, - list_t *match_conditions, - v1alpha1_match_resources_t *match_constraints, - v1alpha1_param_kind_t *param_kind, - list_t *validations, - list_t *variables -); - -void v1alpha1_validating_admission_policy_spec_free(v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec); - -v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_specJSON); - -cJSON *v1alpha1_validating_admission_policy_spec_convertToJSON(v1alpha1_validating_admission_policy_spec_t *v1alpha1_validating_admission_policy_spec); - -#endif /* _v1alpha1_validating_admission_policy_spec_H_ */ - diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_status.c b/kubernetes/model/v1alpha1_validating_admission_policy_status.c deleted file mode 100644 index bc85cd99..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_status.c +++ /dev/null @@ -1,165 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validating_admission_policy_status.h" - - - -v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status_create( - list_t *conditions, - long observed_generation, - v1alpha1_type_checking_t *type_checking - ) { - v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status_local_var = malloc(sizeof(v1alpha1_validating_admission_policy_status_t)); - if (!v1alpha1_validating_admission_policy_status_local_var) { - return NULL; - } - v1alpha1_validating_admission_policy_status_local_var->conditions = conditions; - v1alpha1_validating_admission_policy_status_local_var->observed_generation = observed_generation; - v1alpha1_validating_admission_policy_status_local_var->type_checking = type_checking; - - return v1alpha1_validating_admission_policy_status_local_var; -} - - -void v1alpha1_validating_admission_policy_status_free(v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status) { - if(NULL == v1alpha1_validating_admission_policy_status){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validating_admission_policy_status->conditions) { - list_ForEach(listEntry, v1alpha1_validating_admission_policy_status->conditions) { - v1_condition_free(listEntry->data); - } - list_freeList(v1alpha1_validating_admission_policy_status->conditions); - v1alpha1_validating_admission_policy_status->conditions = NULL; - } - if (v1alpha1_validating_admission_policy_status->type_checking) { - v1alpha1_type_checking_free(v1alpha1_validating_admission_policy_status->type_checking); - v1alpha1_validating_admission_policy_status->type_checking = NULL; - } - free(v1alpha1_validating_admission_policy_status); -} - -cJSON *v1alpha1_validating_admission_policy_status_convertToJSON(v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validating_admission_policy_status->conditions - if(v1alpha1_validating_admission_policy_status->conditions) { - cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); - if(conditions == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *conditionsListEntry; - if (v1alpha1_validating_admission_policy_status->conditions) { - list_ForEach(conditionsListEntry, v1alpha1_validating_admission_policy_status->conditions) { - cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(conditions, itemLocal); - } - } - } - - - // v1alpha1_validating_admission_policy_status->observed_generation - if(v1alpha1_validating_admission_policy_status->observed_generation) { - if(cJSON_AddNumberToObject(item, "observedGeneration", v1alpha1_validating_admission_policy_status->observed_generation) == NULL) { - goto fail; //Numeric - } - } - - - // v1alpha1_validating_admission_policy_status->type_checking - if(v1alpha1_validating_admission_policy_status->type_checking) { - cJSON *type_checking_local_JSON = v1alpha1_type_checking_convertToJSON(v1alpha1_validating_admission_policy_status->type_checking); - if(type_checking_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "typeChecking", type_checking_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_statusJSON){ - - v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status_local_var = NULL; - - // define the local list for v1alpha1_validating_admission_policy_status->conditions - list_t *conditionsList = NULL; - - // define the local variable for v1alpha1_validating_admission_policy_status->type_checking - v1alpha1_type_checking_t *type_checking_local_nonprim = NULL; - - // v1alpha1_validating_admission_policy_status->conditions - cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_statusJSON, "conditions"); - if (conditions) { - cJSON *conditions_local_nonprimitive = NULL; - if(!cJSON_IsArray(conditions)){ - goto end; //nonprimitive container - } - - conditionsList = list_createList(); - - cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) - { - if(!cJSON_IsObject(conditions_local_nonprimitive)){ - goto end; - } - v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); - - list_addElement(conditionsList, conditionsItem); - } - } - - // v1alpha1_validating_admission_policy_status->observed_generation - cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_statusJSON, "observedGeneration"); - if (observed_generation) { - if(!cJSON_IsNumber(observed_generation)) - { - goto end; //Numeric - } - } - - // v1alpha1_validating_admission_policy_status->type_checking - cJSON *type_checking = cJSON_GetObjectItemCaseSensitive(v1alpha1_validating_admission_policy_statusJSON, "typeChecking"); - if (type_checking) { - type_checking_local_nonprim = v1alpha1_type_checking_parseFromJSON(type_checking); //nonprimitive - } - - - v1alpha1_validating_admission_policy_status_local_var = v1alpha1_validating_admission_policy_status_create ( - conditions ? conditionsList : NULL, - observed_generation ? observed_generation->valuedouble : 0, - type_checking ? type_checking_local_nonprim : NULL - ); - - return v1alpha1_validating_admission_policy_status_local_var; -end: - if (conditionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, conditionsList) { - v1_condition_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(conditionsList); - conditionsList = NULL; - } - if (type_checking_local_nonprim) { - v1alpha1_type_checking_free(type_checking_local_nonprim); - type_checking_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validating_admission_policy_status.h b/kubernetes/model/v1alpha1_validating_admission_policy_status.h deleted file mode 100644 index 97f4d6d2..00000000 --- a/kubernetes/model/v1alpha1_validating_admission_policy_status.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1alpha1_validating_admission_policy_status.h - * - * ValidatingAdmissionPolicyStatus represents the status of a ValidatingAdmissionPolicy. - */ - -#ifndef _v1alpha1_validating_admission_policy_status_H_ -#define _v1alpha1_validating_admission_policy_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validating_admission_policy_status_t v1alpha1_validating_admission_policy_status_t; - -#include "v1_condition.h" -#include "v1alpha1_type_checking.h" - - - -typedef struct v1alpha1_validating_admission_policy_status_t { - list_t *conditions; //nonprimitive container - long observed_generation; //numeric - struct v1alpha1_type_checking_t *type_checking; //model - -} v1alpha1_validating_admission_policy_status_t; - -v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status_create( - list_t *conditions, - long observed_generation, - v1alpha1_type_checking_t *type_checking -); - -void v1alpha1_validating_admission_policy_status_free(v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status); - -v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status_parseFromJSON(cJSON *v1alpha1_validating_admission_policy_statusJSON); - -cJSON *v1alpha1_validating_admission_policy_status_convertToJSON(v1alpha1_validating_admission_policy_status_t *v1alpha1_validating_admission_policy_status); - -#endif /* _v1alpha1_validating_admission_policy_status_H_ */ - diff --git a/kubernetes/model/v1alpha1_validation.c b/kubernetes/model/v1alpha1_validation.c deleted file mode 100644 index efef2c5a..00000000 --- a/kubernetes/model/v1alpha1_validation.c +++ /dev/null @@ -1,149 +0,0 @@ -#include -#include -#include -#include "v1alpha1_validation.h" - - - -v1alpha1_validation_t *v1alpha1_validation_create( - char *expression, - char *message, - char *message_expression, - char *reason - ) { - v1alpha1_validation_t *v1alpha1_validation_local_var = malloc(sizeof(v1alpha1_validation_t)); - if (!v1alpha1_validation_local_var) { - return NULL; - } - v1alpha1_validation_local_var->expression = expression; - v1alpha1_validation_local_var->message = message; - v1alpha1_validation_local_var->message_expression = message_expression; - v1alpha1_validation_local_var->reason = reason; - - return v1alpha1_validation_local_var; -} - - -void v1alpha1_validation_free(v1alpha1_validation_t *v1alpha1_validation) { - if(NULL == v1alpha1_validation){ - return ; - } - listEntry_t *listEntry; - if (v1alpha1_validation->expression) { - free(v1alpha1_validation->expression); - v1alpha1_validation->expression = NULL; - } - if (v1alpha1_validation->message) { - free(v1alpha1_validation->message); - v1alpha1_validation->message = NULL; - } - if (v1alpha1_validation->message_expression) { - free(v1alpha1_validation->message_expression); - v1alpha1_validation->message_expression = NULL; - } - if (v1alpha1_validation->reason) { - free(v1alpha1_validation->reason); - v1alpha1_validation->reason = NULL; - } - free(v1alpha1_validation); -} - -cJSON *v1alpha1_validation_convertToJSON(v1alpha1_validation_t *v1alpha1_validation) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha1_validation->expression - if (!v1alpha1_validation->expression) { - goto fail; - } - if(cJSON_AddStringToObject(item, "expression", v1alpha1_validation->expression) == NULL) { - goto fail; //String - } - - - // v1alpha1_validation->message - if(v1alpha1_validation->message) { - if(cJSON_AddStringToObject(item, "message", v1alpha1_validation->message) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validation->message_expression - if(v1alpha1_validation->message_expression) { - if(cJSON_AddStringToObject(item, "messageExpression", v1alpha1_validation->message_expression) == NULL) { - goto fail; //String - } - } - - - // v1alpha1_validation->reason - if(v1alpha1_validation->reason) { - if(cJSON_AddStringToObject(item, "reason", v1alpha1_validation->reason) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha1_validation_t *v1alpha1_validation_parseFromJSON(cJSON *v1alpha1_validationJSON){ - - v1alpha1_validation_t *v1alpha1_validation_local_var = NULL; - - // v1alpha1_validation->expression - cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1alpha1_validationJSON, "expression"); - if (!expression) { - goto end; - } - - - if(!cJSON_IsString(expression)) - { - goto end; //String - } - - // v1alpha1_validation->message - cJSON *message = cJSON_GetObjectItemCaseSensitive(v1alpha1_validationJSON, "message"); - if (message) { - if(!cJSON_IsString(message) && !cJSON_IsNull(message)) - { - goto end; //String - } - } - - // v1alpha1_validation->message_expression - cJSON *message_expression = cJSON_GetObjectItemCaseSensitive(v1alpha1_validationJSON, "messageExpression"); - if (message_expression) { - if(!cJSON_IsString(message_expression) && !cJSON_IsNull(message_expression)) - { - goto end; //String - } - } - - // v1alpha1_validation->reason - cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1alpha1_validationJSON, "reason"); - if (reason) { - if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) - { - goto end; //String - } - } - - - v1alpha1_validation_local_var = v1alpha1_validation_create ( - strdup(expression->valuestring), - message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, - message_expression && !cJSON_IsNull(message_expression) ? strdup(message_expression->valuestring) : NULL, - reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL - ); - - return v1alpha1_validation_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha1_validation.h b/kubernetes/model/v1alpha1_validation.h deleted file mode 100644 index a76cb45b..00000000 --- a/kubernetes/model/v1alpha1_validation.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1alpha1_validation.h - * - * Validation specifies the CEL expression which is used to apply the validation. - */ - -#ifndef _v1alpha1_validation_H_ -#define _v1alpha1_validation_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha1_validation_t v1alpha1_validation_t; - - - - -typedef struct v1alpha1_validation_t { - char *expression; // string - char *message; // string - char *message_expression; // string - char *reason; // string - -} v1alpha1_validation_t; - -v1alpha1_validation_t *v1alpha1_validation_create( - char *expression, - char *message, - char *message_expression, - char *reason -); - -void v1alpha1_validation_free(v1alpha1_validation_t *v1alpha1_validation); - -v1alpha1_validation_t *v1alpha1_validation_parseFromJSON(cJSON *v1alpha1_validationJSON); - -cJSON *v1alpha1_validation_convertToJSON(v1alpha1_validation_t *v1alpha1_validation); - -#endif /* _v1alpha1_validation_H_ */ - diff --git a/kubernetes/model/v1alpha1_variable.c b/kubernetes/model/v1alpha1_variable.c index 8f580d0a..2f529640 100644 --- a/kubernetes/model/v1alpha1_variable.c +++ b/kubernetes/model/v1alpha1_variable.c @@ -5,7 +5,7 @@ -v1alpha1_variable_t *v1alpha1_variable_create( +static v1alpha1_variable_t *v1alpha1_variable_create_internal( char *expression, char *name ) { @@ -16,14 +16,28 @@ v1alpha1_variable_t *v1alpha1_variable_create( v1alpha1_variable_local_var->expression = expression; v1alpha1_variable_local_var->name = name; + v1alpha1_variable_local_var->_library_owned = 1; return v1alpha1_variable_local_var; } +__attribute__((deprecated)) v1alpha1_variable_t *v1alpha1_variable_create( + char *expression, + char *name + ) { + return v1alpha1_variable_create_internal ( + expression, + name + ); +} void v1alpha1_variable_free(v1alpha1_variable_t *v1alpha1_variable) { if(NULL == v1alpha1_variable){ return ; } + if(v1alpha1_variable->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_variable_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_variable->expression) { free(v1alpha1_variable->expression); @@ -70,6 +84,9 @@ v1alpha1_variable_t *v1alpha1_variable_parseFromJSON(cJSON *v1alpha1_variableJSO // v1alpha1_variable->expression cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1alpha1_variableJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } if (!expression) { goto end; } @@ -82,6 +99,9 @@ v1alpha1_variable_t *v1alpha1_variable_parseFromJSON(cJSON *v1alpha1_variableJSO // v1alpha1_variable->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha1_variableJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1alpha1_variable_t *v1alpha1_variable_parseFromJSON(cJSON *v1alpha1_variableJSO } - v1alpha1_variable_local_var = v1alpha1_variable_create ( + v1alpha1_variable_local_var = v1alpha1_variable_create_internal ( strdup(expression->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1alpha1_variable.h b/kubernetes/model/v1alpha1_variable.h index 8a151e52..9b0a703c 100644 --- a/kubernetes/model/v1alpha1_variable.h +++ b/kubernetes/model/v1alpha1_variable.h @@ -22,9 +22,10 @@ typedef struct v1alpha1_variable_t { char *expression; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_variable_t; -v1alpha1_variable_t *v1alpha1_variable_create( +__attribute__((deprecated)) v1alpha1_variable_t *v1alpha1_variable_create( char *expression, char *name ); diff --git a/kubernetes/model/v1alpha1_volume_attributes_class.c b/kubernetes/model/v1alpha1_volume_attributes_class.c index 1f327f56..bdec9dfa 100644 --- a/kubernetes/model/v1alpha1_volume_attributes_class.c +++ b/kubernetes/model/v1alpha1_volume_attributes_class.c @@ -5,7 +5,7 @@ -v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_create( +static v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_create_internal( char *api_version, char *driver_name, char *kind, @@ -22,14 +22,34 @@ v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_create( v1alpha1_volume_attributes_class_local_var->metadata = metadata; v1alpha1_volume_attributes_class_local_var->parameters = parameters; + v1alpha1_volume_attributes_class_local_var->_library_owned = 1; return v1alpha1_volume_attributes_class_local_var; } +__attribute__((deprecated)) v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_create( + char *api_version, + char *driver_name, + char *kind, + v1_object_meta_t *metadata, + list_t* parameters + ) { + return v1alpha1_volume_attributes_class_create_internal ( + api_version, + driver_name, + kind, + metadata, + parameters + ); +} void v1alpha1_volume_attributes_class_free(v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class) { if(NULL == v1alpha1_volume_attributes_class){ return ; } + if(v1alpha1_volume_attributes_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_volume_attributes_class_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_volume_attributes_class->api_version) { free(v1alpha1_volume_attributes_class->api_version); @@ -49,7 +69,7 @@ void v1alpha1_volume_attributes_class_free(v1alpha1_volume_attributes_class_t *v } if (v1alpha1_volume_attributes_class->parameters) { list_ForEach(listEntry, v1alpha1_volume_attributes_class->parameters) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free (localKeyValue->key); free (localKeyValue->value); keyValuePair_free(localKeyValue); @@ -111,8 +131,8 @@ cJSON *v1alpha1_volume_attributes_class_convertToJSON(v1alpha1_volume_attributes listEntry_t *parametersListEntry; if (v1alpha1_volume_attributes_class->parameters) { list_ForEach(parametersListEntry, v1alpha1_volume_attributes_class->parameters) { - keyValuePair_t *localKeyValue = (keyValuePair_t*)parametersListEntry->data; - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) + keyValuePair_t *localKeyValue = parametersListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) { goto fail; } @@ -140,6 +160,9 @@ v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_parseFromJS // v1alpha1_volume_attributes_class->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -149,6 +172,9 @@ v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_parseFromJS // v1alpha1_volume_attributes_class->driver_name cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_classJSON, "driverName"); + if (cJSON_IsNull(driver_name)) { + driver_name = NULL; + } if (!driver_name) { goto end; } @@ -161,6 +187,9 @@ v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_parseFromJS // v1alpha1_volume_attributes_class->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -170,12 +199,18 @@ v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_parseFromJS // v1alpha1_volume_attributes_class->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v1alpha1_volume_attributes_class->parameters cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_classJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } if (parameters) { cJSON *parameters_local_map = NULL; if(!cJSON_IsObject(parameters) && !cJSON_IsNull(parameters)) @@ -200,7 +235,7 @@ v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_parseFromJS } - v1alpha1_volume_attributes_class_local_var = v1alpha1_volume_attributes_class_create ( + v1alpha1_volume_attributes_class_local_var = v1alpha1_volume_attributes_class_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, strdup(driver_name->valuestring), kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, @@ -217,7 +252,7 @@ v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_parseFromJS if (parametersList) { listEntry_t *listEntry = NULL; list_ForEach(listEntry, parametersList) { - keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + keyValuePair_t *localKeyValue = listEntry->data; free(localKeyValue->key); localKeyValue->key = NULL; free(localKeyValue->value); diff --git a/kubernetes/model/v1alpha1_volume_attributes_class.h b/kubernetes/model/v1alpha1_volume_attributes_class.h index 92becf5f..ad966459 100644 --- a/kubernetes/model/v1alpha1_volume_attributes_class.h +++ b/kubernetes/model/v1alpha1_volume_attributes_class.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_volume_attributes_class_t { struct v1_object_meta_t *metadata; //model list_t* parameters; //map + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_volume_attributes_class_t; -v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_create( +__attribute__((deprecated)) v1alpha1_volume_attributes_class_t *v1alpha1_volume_attributes_class_create( char *api_version, char *driver_name, char *kind, diff --git a/kubernetes/model/v1alpha1_volume_attributes_class_list.c b/kubernetes/model/v1alpha1_volume_attributes_class_list.c index 646aa831..657f269a 100644 --- a/kubernetes/model/v1alpha1_volume_attributes_class_list.c +++ b/kubernetes/model/v1alpha1_volume_attributes_class_list.c @@ -5,7 +5,7 @@ -v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_create( +static v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_c v1alpha1_volume_attributes_class_list_local_var->kind = kind; v1alpha1_volume_attributes_class_list_local_var->metadata = metadata; + v1alpha1_volume_attributes_class_list_local_var->_library_owned = 1; return v1alpha1_volume_attributes_class_list_local_var; } +__attribute__((deprecated)) v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha1_volume_attributes_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v1alpha1_volume_attributes_class_list_free(v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list) { if(NULL == v1alpha1_volume_attributes_class_list){ return ; } + if(v1alpha1_volume_attributes_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha1_volume_attributes_class_list_free"); + return ; + } listEntry_t *listEntry; if (v1alpha1_volume_attributes_class_list->api_version) { free(v1alpha1_volume_attributes_class_list->api_version); @@ -123,6 +141,9 @@ v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_p // v1alpha1_volume_attributes_class_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_p // v1alpha1_volume_attributes_class_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_p // v1alpha1_volume_attributes_class_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_p // v1alpha1_volume_attributes_class_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attributes_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v1alpha1_volume_attributes_class_list_local_var = v1alpha1_volume_attributes_class_list_create ( + v1alpha1_volume_attributes_class_list_local_var = v1alpha1_volume_attributes_class_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v1alpha1_volume_attributes_class_list.h b/kubernetes/model/v1alpha1_volume_attributes_class_list.h index 2e339839..9c99fe2a 100644 --- a/kubernetes/model/v1alpha1_volume_attributes_class_list.h +++ b/kubernetes/model/v1alpha1_volume_attributes_class_list.h @@ -26,9 +26,10 @@ typedef struct v1alpha1_volume_attributes_class_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v1alpha1_volume_attributes_class_list_t; -v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_create( +__attribute__((deprecated)) v1alpha1_volume_attributes_class_list_t *v1alpha1_volume_attributes_class_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v1alpha2_allocation_result.c b/kubernetes/model/v1alpha2_allocation_result.c deleted file mode 100644 index 326d3182..00000000 --- a/kubernetes/model/v1alpha2_allocation_result.c +++ /dev/null @@ -1,165 +0,0 @@ -#include -#include -#include -#include "v1alpha2_allocation_result.h" - - - -v1alpha2_allocation_result_t *v1alpha2_allocation_result_create( - v1_node_selector_t *available_on_nodes, - list_t *resource_handles, - int shareable - ) { - v1alpha2_allocation_result_t *v1alpha2_allocation_result_local_var = malloc(sizeof(v1alpha2_allocation_result_t)); - if (!v1alpha2_allocation_result_local_var) { - return NULL; - } - v1alpha2_allocation_result_local_var->available_on_nodes = available_on_nodes; - v1alpha2_allocation_result_local_var->resource_handles = resource_handles; - v1alpha2_allocation_result_local_var->shareable = shareable; - - return v1alpha2_allocation_result_local_var; -} - - -void v1alpha2_allocation_result_free(v1alpha2_allocation_result_t *v1alpha2_allocation_result) { - if(NULL == v1alpha2_allocation_result){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_allocation_result->available_on_nodes) { - v1_node_selector_free(v1alpha2_allocation_result->available_on_nodes); - v1alpha2_allocation_result->available_on_nodes = NULL; - } - if (v1alpha2_allocation_result->resource_handles) { - list_ForEach(listEntry, v1alpha2_allocation_result->resource_handles) { - v1alpha2_resource_handle_free(listEntry->data); - } - list_freeList(v1alpha2_allocation_result->resource_handles); - v1alpha2_allocation_result->resource_handles = NULL; - } - free(v1alpha2_allocation_result); -} - -cJSON *v1alpha2_allocation_result_convertToJSON(v1alpha2_allocation_result_t *v1alpha2_allocation_result) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_allocation_result->available_on_nodes - if(v1alpha2_allocation_result->available_on_nodes) { - cJSON *available_on_nodes_local_JSON = v1_node_selector_convertToJSON(v1alpha2_allocation_result->available_on_nodes); - if(available_on_nodes_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "availableOnNodes", available_on_nodes_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_allocation_result->resource_handles - if(v1alpha2_allocation_result->resource_handles) { - cJSON *resource_handles = cJSON_AddArrayToObject(item, "resourceHandles"); - if(resource_handles == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *resource_handlesListEntry; - if (v1alpha2_allocation_result->resource_handles) { - list_ForEach(resource_handlesListEntry, v1alpha2_allocation_result->resource_handles) { - cJSON *itemLocal = v1alpha2_resource_handle_convertToJSON(resource_handlesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(resource_handles, itemLocal); - } - } - } - - - // v1alpha2_allocation_result->shareable - if(v1alpha2_allocation_result->shareable) { - if(cJSON_AddBoolToObject(item, "shareable", v1alpha2_allocation_result->shareable) == NULL) { - goto fail; //Bool - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_allocation_result_t *v1alpha2_allocation_result_parseFromJSON(cJSON *v1alpha2_allocation_resultJSON){ - - v1alpha2_allocation_result_t *v1alpha2_allocation_result_local_var = NULL; - - // define the local variable for v1alpha2_allocation_result->available_on_nodes - v1_node_selector_t *available_on_nodes_local_nonprim = NULL; - - // define the local list for v1alpha2_allocation_result->resource_handles - list_t *resource_handlesList = NULL; - - // v1alpha2_allocation_result->available_on_nodes - cJSON *available_on_nodes = cJSON_GetObjectItemCaseSensitive(v1alpha2_allocation_resultJSON, "availableOnNodes"); - if (available_on_nodes) { - available_on_nodes_local_nonprim = v1_node_selector_parseFromJSON(available_on_nodes); //nonprimitive - } - - // v1alpha2_allocation_result->resource_handles - cJSON *resource_handles = cJSON_GetObjectItemCaseSensitive(v1alpha2_allocation_resultJSON, "resourceHandles"); - if (resource_handles) { - cJSON *resource_handles_local_nonprimitive = NULL; - if(!cJSON_IsArray(resource_handles)){ - goto end; //nonprimitive container - } - - resource_handlesList = list_createList(); - - cJSON_ArrayForEach(resource_handles_local_nonprimitive,resource_handles ) - { - if(!cJSON_IsObject(resource_handles_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_handle_t *resource_handlesItem = v1alpha2_resource_handle_parseFromJSON(resource_handles_local_nonprimitive); - - list_addElement(resource_handlesList, resource_handlesItem); - } - } - - // v1alpha2_allocation_result->shareable - cJSON *shareable = cJSON_GetObjectItemCaseSensitive(v1alpha2_allocation_resultJSON, "shareable"); - if (shareable) { - if(!cJSON_IsBool(shareable)) - { - goto end; //Bool - } - } - - - v1alpha2_allocation_result_local_var = v1alpha2_allocation_result_create ( - available_on_nodes ? available_on_nodes_local_nonprim : NULL, - resource_handles ? resource_handlesList : NULL, - shareable ? shareable->valueint : 0 - ); - - return v1alpha2_allocation_result_local_var; -end: - if (available_on_nodes_local_nonprim) { - v1_node_selector_free(available_on_nodes_local_nonprim); - available_on_nodes_local_nonprim = NULL; - } - if (resource_handlesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, resource_handlesList) { - v1alpha2_resource_handle_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(resource_handlesList); - resource_handlesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_allocation_result.h b/kubernetes/model/v1alpha2_allocation_result.h deleted file mode 100644 index 75d963d6..00000000 --- a/kubernetes/model/v1alpha2_allocation_result.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1alpha2_allocation_result.h - * - * AllocationResult contains attributes of an allocated resource. - */ - -#ifndef _v1alpha2_allocation_result_H_ -#define _v1alpha2_allocation_result_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_allocation_result_t v1alpha2_allocation_result_t; - -#include "v1_node_selector.h" -#include "v1alpha2_resource_handle.h" - - - -typedef struct v1alpha2_allocation_result_t { - struct v1_node_selector_t *available_on_nodes; //model - list_t *resource_handles; //nonprimitive container - int shareable; //boolean - -} v1alpha2_allocation_result_t; - -v1alpha2_allocation_result_t *v1alpha2_allocation_result_create( - v1_node_selector_t *available_on_nodes, - list_t *resource_handles, - int shareable -); - -void v1alpha2_allocation_result_free(v1alpha2_allocation_result_t *v1alpha2_allocation_result); - -v1alpha2_allocation_result_t *v1alpha2_allocation_result_parseFromJSON(cJSON *v1alpha2_allocation_resultJSON); - -cJSON *v1alpha2_allocation_result_convertToJSON(v1alpha2_allocation_result_t *v1alpha2_allocation_result); - -#endif /* _v1alpha2_allocation_result_H_ */ - diff --git a/kubernetes/model/v1alpha2_driver_allocation_result.c b/kubernetes/model/v1alpha2_driver_allocation_result.c deleted file mode 100644 index a6a8471d..00000000 --- a/kubernetes/model/v1alpha2_driver_allocation_result.c +++ /dev/null @@ -1,109 +0,0 @@ -#include -#include -#include -#include "v1alpha2_driver_allocation_result.h" - - - -v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result_create( - v1alpha2_named_resources_allocation_result_t *named_resources, - object_t *vendor_request_parameters - ) { - v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result_local_var = malloc(sizeof(v1alpha2_driver_allocation_result_t)); - if (!v1alpha2_driver_allocation_result_local_var) { - return NULL; - } - v1alpha2_driver_allocation_result_local_var->named_resources = named_resources; - v1alpha2_driver_allocation_result_local_var->vendor_request_parameters = vendor_request_parameters; - - return v1alpha2_driver_allocation_result_local_var; -} - - -void v1alpha2_driver_allocation_result_free(v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result) { - if(NULL == v1alpha2_driver_allocation_result){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_driver_allocation_result->named_resources) { - v1alpha2_named_resources_allocation_result_free(v1alpha2_driver_allocation_result->named_resources); - v1alpha2_driver_allocation_result->named_resources = NULL; - } - if (v1alpha2_driver_allocation_result->vendor_request_parameters) { - object_free(v1alpha2_driver_allocation_result->vendor_request_parameters); - v1alpha2_driver_allocation_result->vendor_request_parameters = NULL; - } - free(v1alpha2_driver_allocation_result); -} - -cJSON *v1alpha2_driver_allocation_result_convertToJSON(v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_driver_allocation_result->named_resources - if(v1alpha2_driver_allocation_result->named_resources) { - cJSON *named_resources_local_JSON = v1alpha2_named_resources_allocation_result_convertToJSON(v1alpha2_driver_allocation_result->named_resources); - if(named_resources_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "namedResources", named_resources_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_driver_allocation_result->vendor_request_parameters - if(v1alpha2_driver_allocation_result->vendor_request_parameters) { - cJSON *vendor_request_parameters_object = object_convertToJSON(v1alpha2_driver_allocation_result->vendor_request_parameters); - if(vendor_request_parameters_object == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "vendorRequestParameters", vendor_request_parameters_object); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result_parseFromJSON(cJSON *v1alpha2_driver_allocation_resultJSON){ - - v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result_local_var = NULL; - - // define the local variable for v1alpha2_driver_allocation_result->named_resources - v1alpha2_named_resources_allocation_result_t *named_resources_local_nonprim = NULL; - - // v1alpha2_driver_allocation_result->named_resources - cJSON *named_resources = cJSON_GetObjectItemCaseSensitive(v1alpha2_driver_allocation_resultJSON, "namedResources"); - if (named_resources) { - named_resources_local_nonprim = v1alpha2_named_resources_allocation_result_parseFromJSON(named_resources); //nonprimitive - } - - // v1alpha2_driver_allocation_result->vendor_request_parameters - cJSON *vendor_request_parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_driver_allocation_resultJSON, "vendorRequestParameters"); - object_t *vendor_request_parameters_local_object = NULL; - if (vendor_request_parameters) { - vendor_request_parameters_local_object = object_parseFromJSON(vendor_request_parameters); //object - } - - - v1alpha2_driver_allocation_result_local_var = v1alpha2_driver_allocation_result_create ( - named_resources ? named_resources_local_nonprim : NULL, - vendor_request_parameters ? vendor_request_parameters_local_object : NULL - ); - - return v1alpha2_driver_allocation_result_local_var; -end: - if (named_resources_local_nonprim) { - v1alpha2_named_resources_allocation_result_free(named_resources_local_nonprim); - named_resources_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_driver_allocation_result.h b/kubernetes/model/v1alpha2_driver_allocation_result.h deleted file mode 100644 index 8b186e5a..00000000 --- a/kubernetes/model/v1alpha2_driver_allocation_result.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * v1alpha2_driver_allocation_result.h - * - * DriverAllocationResult contains vendor parameters and the allocation result for one request. - */ - -#ifndef _v1alpha2_driver_allocation_result_H_ -#define _v1alpha2_driver_allocation_result_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_driver_allocation_result_t v1alpha2_driver_allocation_result_t; - -#include "object.h" -#include "v1alpha2_named_resources_allocation_result.h" - - - -typedef struct v1alpha2_driver_allocation_result_t { - struct v1alpha2_named_resources_allocation_result_t *named_resources; //model - object_t *vendor_request_parameters; //object - -} v1alpha2_driver_allocation_result_t; - -v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result_create( - v1alpha2_named_resources_allocation_result_t *named_resources, - object_t *vendor_request_parameters -); - -void v1alpha2_driver_allocation_result_free(v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result); - -v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result_parseFromJSON(cJSON *v1alpha2_driver_allocation_resultJSON); - -cJSON *v1alpha2_driver_allocation_result_convertToJSON(v1alpha2_driver_allocation_result_t *v1alpha2_driver_allocation_result); - -#endif /* _v1alpha2_driver_allocation_result_H_ */ - diff --git a/kubernetes/model/v1alpha2_driver_requests.c b/kubernetes/model/v1alpha2_driver_requests.c deleted file mode 100644 index 5c27d273..00000000 --- a/kubernetes/model/v1alpha2_driver_requests.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include "v1alpha2_driver_requests.h" - - - -v1alpha2_driver_requests_t *v1alpha2_driver_requests_create( - char *driver_name, - list_t *requests, - object_t *vendor_parameters - ) { - v1alpha2_driver_requests_t *v1alpha2_driver_requests_local_var = malloc(sizeof(v1alpha2_driver_requests_t)); - if (!v1alpha2_driver_requests_local_var) { - return NULL; - } - v1alpha2_driver_requests_local_var->driver_name = driver_name; - v1alpha2_driver_requests_local_var->requests = requests; - v1alpha2_driver_requests_local_var->vendor_parameters = vendor_parameters; - - return v1alpha2_driver_requests_local_var; -} - - -void v1alpha2_driver_requests_free(v1alpha2_driver_requests_t *v1alpha2_driver_requests) { - if(NULL == v1alpha2_driver_requests){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_driver_requests->driver_name) { - free(v1alpha2_driver_requests->driver_name); - v1alpha2_driver_requests->driver_name = NULL; - } - if (v1alpha2_driver_requests->requests) { - list_ForEach(listEntry, v1alpha2_driver_requests->requests) { - v1alpha2_resource_request_free(listEntry->data); - } - list_freeList(v1alpha2_driver_requests->requests); - v1alpha2_driver_requests->requests = NULL; - } - if (v1alpha2_driver_requests->vendor_parameters) { - object_free(v1alpha2_driver_requests->vendor_parameters); - v1alpha2_driver_requests->vendor_parameters = NULL; - } - free(v1alpha2_driver_requests); -} - -cJSON *v1alpha2_driver_requests_convertToJSON(v1alpha2_driver_requests_t *v1alpha2_driver_requests) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_driver_requests->driver_name - if(v1alpha2_driver_requests->driver_name) { - if(cJSON_AddStringToObject(item, "driverName", v1alpha2_driver_requests->driver_name) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_driver_requests->requests - if(v1alpha2_driver_requests->requests) { - cJSON *requests = cJSON_AddArrayToObject(item, "requests"); - if(requests == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *requestsListEntry; - if (v1alpha2_driver_requests->requests) { - list_ForEach(requestsListEntry, v1alpha2_driver_requests->requests) { - cJSON *itemLocal = v1alpha2_resource_request_convertToJSON(requestsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(requests, itemLocal); - } - } - } - - - // v1alpha2_driver_requests->vendor_parameters - if(v1alpha2_driver_requests->vendor_parameters) { - cJSON *vendor_parameters_object = object_convertToJSON(v1alpha2_driver_requests->vendor_parameters); - if(vendor_parameters_object == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "vendorParameters", vendor_parameters_object); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_driver_requests_t *v1alpha2_driver_requests_parseFromJSON(cJSON *v1alpha2_driver_requestsJSON){ - - v1alpha2_driver_requests_t *v1alpha2_driver_requests_local_var = NULL; - - // define the local list for v1alpha2_driver_requests->requests - list_t *requestsList = NULL; - - // v1alpha2_driver_requests->driver_name - cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_driver_requestsJSON, "driverName"); - if (driver_name) { - if(!cJSON_IsString(driver_name) && !cJSON_IsNull(driver_name)) - { - goto end; //String - } - } - - // v1alpha2_driver_requests->requests - cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1alpha2_driver_requestsJSON, "requests"); - if (requests) { - cJSON *requests_local_nonprimitive = NULL; - if(!cJSON_IsArray(requests)){ - goto end; //nonprimitive container - } - - requestsList = list_createList(); - - cJSON_ArrayForEach(requests_local_nonprimitive,requests ) - { - if(!cJSON_IsObject(requests_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_request_t *requestsItem = v1alpha2_resource_request_parseFromJSON(requests_local_nonprimitive); - - list_addElement(requestsList, requestsItem); - } - } - - // v1alpha2_driver_requests->vendor_parameters - cJSON *vendor_parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_driver_requestsJSON, "vendorParameters"); - object_t *vendor_parameters_local_object = NULL; - if (vendor_parameters) { - vendor_parameters_local_object = object_parseFromJSON(vendor_parameters); //object - } - - - v1alpha2_driver_requests_local_var = v1alpha2_driver_requests_create ( - driver_name && !cJSON_IsNull(driver_name) ? strdup(driver_name->valuestring) : NULL, - requests ? requestsList : NULL, - vendor_parameters ? vendor_parameters_local_object : NULL - ); - - return v1alpha2_driver_requests_local_var; -end: - if (requestsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, requestsList) { - v1alpha2_resource_request_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(requestsList); - requestsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_driver_requests.h b/kubernetes/model/v1alpha2_driver_requests.h deleted file mode 100644 index f8425f4e..00000000 --- a/kubernetes/model/v1alpha2_driver_requests.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1alpha2_driver_requests.h - * - * DriverRequests describes all resources that are needed from one particular driver. - */ - -#ifndef _v1alpha2_driver_requests_H_ -#define _v1alpha2_driver_requests_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_driver_requests_t v1alpha2_driver_requests_t; - -#include "object.h" -#include "v1alpha2_resource_request.h" - - - -typedef struct v1alpha2_driver_requests_t { - char *driver_name; // string - list_t *requests; //nonprimitive container - object_t *vendor_parameters; //object - -} v1alpha2_driver_requests_t; - -v1alpha2_driver_requests_t *v1alpha2_driver_requests_create( - char *driver_name, - list_t *requests, - object_t *vendor_parameters -); - -void v1alpha2_driver_requests_free(v1alpha2_driver_requests_t *v1alpha2_driver_requests); - -v1alpha2_driver_requests_t *v1alpha2_driver_requests_parseFromJSON(cJSON *v1alpha2_driver_requestsJSON); - -cJSON *v1alpha2_driver_requests_convertToJSON(v1alpha2_driver_requests_t *v1alpha2_driver_requests); - -#endif /* _v1alpha2_driver_requests_H_ */ - diff --git a/kubernetes/model/v1alpha2_lease_candidate.c b/kubernetes/model/v1alpha2_lease_candidate.c new file mode 100644 index 00000000..cec2aca2 --- /dev/null +++ b/kubernetes/model/v1alpha2_lease_candidate.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1alpha2_lease_candidate.h" + + + +static v1alpha2_lease_candidate_t *v1alpha2_lease_candidate_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha2_lease_candidate_spec_t *spec + ) { + v1alpha2_lease_candidate_t *v1alpha2_lease_candidate_local_var = malloc(sizeof(v1alpha2_lease_candidate_t)); + if (!v1alpha2_lease_candidate_local_var) { + return NULL; + } + v1alpha2_lease_candidate_local_var->api_version = api_version; + v1alpha2_lease_candidate_local_var->kind = kind; + v1alpha2_lease_candidate_local_var->metadata = metadata; + v1alpha2_lease_candidate_local_var->spec = spec; + + v1alpha2_lease_candidate_local_var->_library_owned = 1; + return v1alpha2_lease_candidate_local_var; +} + +__attribute__((deprecated)) v1alpha2_lease_candidate_t *v1alpha2_lease_candidate_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha2_lease_candidate_spec_t *spec + ) { + return v1alpha2_lease_candidate_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1alpha2_lease_candidate_free(v1alpha2_lease_candidate_t *v1alpha2_lease_candidate) { + if(NULL == v1alpha2_lease_candidate){ + return ; + } + if(v1alpha2_lease_candidate->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha2_lease_candidate_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha2_lease_candidate->api_version) { + free(v1alpha2_lease_candidate->api_version); + v1alpha2_lease_candidate->api_version = NULL; + } + if (v1alpha2_lease_candidate->kind) { + free(v1alpha2_lease_candidate->kind); + v1alpha2_lease_candidate->kind = NULL; + } + if (v1alpha2_lease_candidate->metadata) { + v1_object_meta_free(v1alpha2_lease_candidate->metadata); + v1alpha2_lease_candidate->metadata = NULL; + } + if (v1alpha2_lease_candidate->spec) { + v1alpha2_lease_candidate_spec_free(v1alpha2_lease_candidate->spec); + v1alpha2_lease_candidate->spec = NULL; + } + free(v1alpha2_lease_candidate); +} + +cJSON *v1alpha2_lease_candidate_convertToJSON(v1alpha2_lease_candidate_t *v1alpha2_lease_candidate) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha2_lease_candidate->api_version + if(v1alpha2_lease_candidate->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_lease_candidate->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha2_lease_candidate->kind + if(v1alpha2_lease_candidate->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha2_lease_candidate->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha2_lease_candidate->metadata + if(v1alpha2_lease_candidate->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_lease_candidate->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha2_lease_candidate->spec + if(v1alpha2_lease_candidate->spec) { + cJSON *spec_local_JSON = v1alpha2_lease_candidate_spec_convertToJSON(v1alpha2_lease_candidate->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha2_lease_candidate_t *v1alpha2_lease_candidate_parseFromJSON(cJSON *v1alpha2_lease_candidateJSON){ + + v1alpha2_lease_candidate_t *v1alpha2_lease_candidate_local_var = NULL; + + // define the local variable for v1alpha2_lease_candidate->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1alpha2_lease_candidate->spec + v1alpha2_lease_candidate_spec_t *spec_local_nonprim = NULL; + + // v1alpha2_lease_candidate->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidateJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha2_lease_candidate->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidateJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha2_lease_candidate->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidateJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1alpha2_lease_candidate->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidateJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1alpha2_lease_candidate_spec_parseFromJSON(spec); //nonprimitive + } + + + v1alpha2_lease_candidate_local_var = v1alpha2_lease_candidate_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1alpha2_lease_candidate_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1alpha2_lease_candidate_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha2_lease_candidate.h b/kubernetes/model/v1alpha2_lease_candidate.h new file mode 100644 index 00000000..4937e641 --- /dev/null +++ b/kubernetes/model/v1alpha2_lease_candidate.h @@ -0,0 +1,46 @@ +/* + * v1alpha2_lease_candidate.h + * + * LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. + */ + +#ifndef _v1alpha2_lease_candidate_H_ +#define _v1alpha2_lease_candidate_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha2_lease_candidate_t v1alpha2_lease_candidate_t; + +#include "v1_object_meta.h" +#include "v1alpha2_lease_candidate_spec.h" + + + +typedef struct v1alpha2_lease_candidate_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1alpha2_lease_candidate_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha2_lease_candidate_t; + +__attribute__((deprecated)) v1alpha2_lease_candidate_t *v1alpha2_lease_candidate_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha2_lease_candidate_spec_t *spec +); + +void v1alpha2_lease_candidate_free(v1alpha2_lease_candidate_t *v1alpha2_lease_candidate); + +v1alpha2_lease_candidate_t *v1alpha2_lease_candidate_parseFromJSON(cJSON *v1alpha2_lease_candidateJSON); + +cJSON *v1alpha2_lease_candidate_convertToJSON(v1alpha2_lease_candidate_t *v1alpha2_lease_candidate); + +#endif /* _v1alpha2_lease_candidate_H_ */ + diff --git a/kubernetes/model/v1alpha2_lease_candidate_list.c b/kubernetes/model/v1alpha2_lease_candidate_list.c new file mode 100644 index 00000000..39e41679 --- /dev/null +++ b/kubernetes/model/v1alpha2_lease_candidate_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1alpha2_lease_candidate_list.h" + + + +static v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list_local_var = malloc(sizeof(v1alpha2_lease_candidate_list_t)); + if (!v1alpha2_lease_candidate_list_local_var) { + return NULL; + } + v1alpha2_lease_candidate_list_local_var->api_version = api_version; + v1alpha2_lease_candidate_list_local_var->items = items; + v1alpha2_lease_candidate_list_local_var->kind = kind; + v1alpha2_lease_candidate_list_local_var->metadata = metadata; + + v1alpha2_lease_candidate_list_local_var->_library_owned = 1; + return v1alpha2_lease_candidate_list_local_var; +} + +__attribute__((deprecated)) v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha2_lease_candidate_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1alpha2_lease_candidate_list_free(v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list) { + if(NULL == v1alpha2_lease_candidate_list){ + return ; + } + if(v1alpha2_lease_candidate_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha2_lease_candidate_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha2_lease_candidate_list->api_version) { + free(v1alpha2_lease_candidate_list->api_version); + v1alpha2_lease_candidate_list->api_version = NULL; + } + if (v1alpha2_lease_candidate_list->items) { + list_ForEach(listEntry, v1alpha2_lease_candidate_list->items) { + v1alpha2_lease_candidate_free(listEntry->data); + } + list_freeList(v1alpha2_lease_candidate_list->items); + v1alpha2_lease_candidate_list->items = NULL; + } + if (v1alpha2_lease_candidate_list->kind) { + free(v1alpha2_lease_candidate_list->kind); + v1alpha2_lease_candidate_list->kind = NULL; + } + if (v1alpha2_lease_candidate_list->metadata) { + v1_list_meta_free(v1alpha2_lease_candidate_list->metadata); + v1alpha2_lease_candidate_list->metadata = NULL; + } + free(v1alpha2_lease_candidate_list); +} + +cJSON *v1alpha2_lease_candidate_list_convertToJSON(v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha2_lease_candidate_list->api_version + if(v1alpha2_lease_candidate_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_lease_candidate_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha2_lease_candidate_list->items + if (!v1alpha2_lease_candidate_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1alpha2_lease_candidate_list->items) { + list_ForEach(itemsListEntry, v1alpha2_lease_candidate_list->items) { + cJSON *itemLocal = v1alpha2_lease_candidate_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1alpha2_lease_candidate_list->kind + if(v1alpha2_lease_candidate_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha2_lease_candidate_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha2_lease_candidate_list->metadata + if(v1alpha2_lease_candidate_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_lease_candidate_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list_parseFromJSON(cJSON *v1alpha2_lease_candidate_listJSON){ + + v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list_local_var = NULL; + + // define the local list for v1alpha2_lease_candidate_list->items + list_t *itemsList = NULL; + + // define the local variable for v1alpha2_lease_candidate_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1alpha2_lease_candidate_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha2_lease_candidate_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1alpha2_lease_candidate_t *itemsItem = v1alpha2_lease_candidate_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1alpha2_lease_candidate_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha2_lease_candidate_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1alpha2_lease_candidate_list_local_var = v1alpha2_lease_candidate_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1alpha2_lease_candidate_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha2_lease_candidate_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha2_lease_candidate_list.h b/kubernetes/model/v1alpha2_lease_candidate_list.h new file mode 100644 index 00000000..ada1255b --- /dev/null +++ b/kubernetes/model/v1alpha2_lease_candidate_list.h @@ -0,0 +1,46 @@ +/* + * v1alpha2_lease_candidate_list.h + * + * LeaseCandidateList is a list of Lease objects. + */ + +#ifndef _v1alpha2_lease_candidate_list_H_ +#define _v1alpha2_lease_candidate_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha2_lease_candidate_list_t v1alpha2_lease_candidate_list_t; + +#include "v1_list_meta.h" +#include "v1alpha2_lease_candidate.h" + + + +typedef struct v1alpha2_lease_candidate_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha2_lease_candidate_list_t; + +__attribute__((deprecated)) v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1alpha2_lease_candidate_list_free(v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list); + +v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list_parseFromJSON(cJSON *v1alpha2_lease_candidate_listJSON); + +cJSON *v1alpha2_lease_candidate_list_convertToJSON(v1alpha2_lease_candidate_list_t *v1alpha2_lease_candidate_list); + +#endif /* _v1alpha2_lease_candidate_list_H_ */ + diff --git a/kubernetes/model/v1alpha2_lease_candidate_spec.c b/kubernetes/model/v1alpha2_lease_candidate_spec.c new file mode 100644 index 00000000..57052a0c --- /dev/null +++ b/kubernetes/model/v1alpha2_lease_candidate_spec.c @@ -0,0 +1,245 @@ +#include +#include +#include +#include "v1alpha2_lease_candidate_spec.h" + + + +static v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec_create_internal( + char *binary_version, + char *emulation_version, + char *lease_name, + char *ping_time, + char *renew_time, + char *strategy + ) { + v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec_local_var = malloc(sizeof(v1alpha2_lease_candidate_spec_t)); + if (!v1alpha2_lease_candidate_spec_local_var) { + return NULL; + } + v1alpha2_lease_candidate_spec_local_var->binary_version = binary_version; + v1alpha2_lease_candidate_spec_local_var->emulation_version = emulation_version; + v1alpha2_lease_candidate_spec_local_var->lease_name = lease_name; + v1alpha2_lease_candidate_spec_local_var->ping_time = ping_time; + v1alpha2_lease_candidate_spec_local_var->renew_time = renew_time; + v1alpha2_lease_candidate_spec_local_var->strategy = strategy; + + v1alpha2_lease_candidate_spec_local_var->_library_owned = 1; + return v1alpha2_lease_candidate_spec_local_var; +} + +__attribute__((deprecated)) v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec_create( + char *binary_version, + char *emulation_version, + char *lease_name, + char *ping_time, + char *renew_time, + char *strategy + ) { + return v1alpha2_lease_candidate_spec_create_internal ( + binary_version, + emulation_version, + lease_name, + ping_time, + renew_time, + strategy + ); +} + +void v1alpha2_lease_candidate_spec_free(v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec) { + if(NULL == v1alpha2_lease_candidate_spec){ + return ; + } + if(v1alpha2_lease_candidate_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha2_lease_candidate_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha2_lease_candidate_spec->binary_version) { + free(v1alpha2_lease_candidate_spec->binary_version); + v1alpha2_lease_candidate_spec->binary_version = NULL; + } + if (v1alpha2_lease_candidate_spec->emulation_version) { + free(v1alpha2_lease_candidate_spec->emulation_version); + v1alpha2_lease_candidate_spec->emulation_version = NULL; + } + if (v1alpha2_lease_candidate_spec->lease_name) { + free(v1alpha2_lease_candidate_spec->lease_name); + v1alpha2_lease_candidate_spec->lease_name = NULL; + } + if (v1alpha2_lease_candidate_spec->ping_time) { + free(v1alpha2_lease_candidate_spec->ping_time); + v1alpha2_lease_candidate_spec->ping_time = NULL; + } + if (v1alpha2_lease_candidate_spec->renew_time) { + free(v1alpha2_lease_candidate_spec->renew_time); + v1alpha2_lease_candidate_spec->renew_time = NULL; + } + if (v1alpha2_lease_candidate_spec->strategy) { + free(v1alpha2_lease_candidate_spec->strategy); + v1alpha2_lease_candidate_spec->strategy = NULL; + } + free(v1alpha2_lease_candidate_spec); +} + +cJSON *v1alpha2_lease_candidate_spec_convertToJSON(v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha2_lease_candidate_spec->binary_version + if (!v1alpha2_lease_candidate_spec->binary_version) { + goto fail; + } + if(cJSON_AddStringToObject(item, "binaryVersion", v1alpha2_lease_candidate_spec->binary_version) == NULL) { + goto fail; //String + } + + + // v1alpha2_lease_candidate_spec->emulation_version + if(v1alpha2_lease_candidate_spec->emulation_version) { + if(cJSON_AddStringToObject(item, "emulationVersion", v1alpha2_lease_candidate_spec->emulation_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha2_lease_candidate_spec->lease_name + if (!v1alpha2_lease_candidate_spec->lease_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "leaseName", v1alpha2_lease_candidate_spec->lease_name) == NULL) { + goto fail; //String + } + + + // v1alpha2_lease_candidate_spec->ping_time + if(v1alpha2_lease_candidate_spec->ping_time) { + if(cJSON_AddStringToObject(item, "pingTime", v1alpha2_lease_candidate_spec->ping_time) == NULL) { + goto fail; //Date-Time + } + } + + + // v1alpha2_lease_candidate_spec->renew_time + if(v1alpha2_lease_candidate_spec->renew_time) { + if(cJSON_AddStringToObject(item, "renewTime", v1alpha2_lease_candidate_spec->renew_time) == NULL) { + goto fail; //Date-Time + } + } + + + // v1alpha2_lease_candidate_spec->strategy + if (!v1alpha2_lease_candidate_spec->strategy) { + goto fail; + } + if(cJSON_AddStringToObject(item, "strategy", v1alpha2_lease_candidate_spec->strategy) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec_parseFromJSON(cJSON *v1alpha2_lease_candidate_specJSON){ + + v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec_local_var = NULL; + + // v1alpha2_lease_candidate_spec->binary_version + cJSON *binary_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_specJSON, "binaryVersion"); + if (cJSON_IsNull(binary_version)) { + binary_version = NULL; + } + if (!binary_version) { + goto end; + } + + + if(!cJSON_IsString(binary_version)) + { + goto end; //String + } + + // v1alpha2_lease_candidate_spec->emulation_version + cJSON *emulation_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_specJSON, "emulationVersion"); + if (cJSON_IsNull(emulation_version)) { + emulation_version = NULL; + } + if (emulation_version) { + if(!cJSON_IsString(emulation_version) && !cJSON_IsNull(emulation_version)) + { + goto end; //String + } + } + + // v1alpha2_lease_candidate_spec->lease_name + cJSON *lease_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_specJSON, "leaseName"); + if (cJSON_IsNull(lease_name)) { + lease_name = NULL; + } + if (!lease_name) { + goto end; + } + + + if(!cJSON_IsString(lease_name)) + { + goto end; //String + } + + // v1alpha2_lease_candidate_spec->ping_time + cJSON *ping_time = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_specJSON, "pingTime"); + if (cJSON_IsNull(ping_time)) { + ping_time = NULL; + } + if (ping_time) { + if(!cJSON_IsString(ping_time) && !cJSON_IsNull(ping_time)) + { + goto end; //DateTime + } + } + + // v1alpha2_lease_candidate_spec->renew_time + cJSON *renew_time = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_specJSON, "renewTime"); + if (cJSON_IsNull(renew_time)) { + renew_time = NULL; + } + if (renew_time) { + if(!cJSON_IsString(renew_time) && !cJSON_IsNull(renew_time)) + { + goto end; //DateTime + } + } + + // v1alpha2_lease_candidate_spec->strategy + cJSON *strategy = cJSON_GetObjectItemCaseSensitive(v1alpha2_lease_candidate_specJSON, "strategy"); + if (cJSON_IsNull(strategy)) { + strategy = NULL; + } + if (!strategy) { + goto end; + } + + + if(!cJSON_IsString(strategy)) + { + goto end; //String + } + + + v1alpha2_lease_candidate_spec_local_var = v1alpha2_lease_candidate_spec_create_internal ( + strdup(binary_version->valuestring), + emulation_version && !cJSON_IsNull(emulation_version) ? strdup(emulation_version->valuestring) : NULL, + strdup(lease_name->valuestring), + ping_time && !cJSON_IsNull(ping_time) ? strdup(ping_time->valuestring) : NULL, + renew_time && !cJSON_IsNull(renew_time) ? strdup(renew_time->valuestring) : NULL, + strdup(strategy->valuestring) + ); + + return v1alpha2_lease_candidate_spec_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha2_lease_candidate_spec.h b/kubernetes/model/v1alpha2_lease_candidate_spec.h new file mode 100644 index 00000000..8559f0a9 --- /dev/null +++ b/kubernetes/model/v1alpha2_lease_candidate_spec.h @@ -0,0 +1,48 @@ +/* + * v1alpha2_lease_candidate_spec.h + * + * LeaseCandidateSpec is a specification of a Lease. + */ + +#ifndef _v1alpha2_lease_candidate_spec_H_ +#define _v1alpha2_lease_candidate_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha2_lease_candidate_spec_t v1alpha2_lease_candidate_spec_t; + + + + +typedef struct v1alpha2_lease_candidate_spec_t { + char *binary_version; // string + char *emulation_version; // string + char *lease_name; // string + char *ping_time; //date time + char *renew_time; //date time + char *strategy; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha2_lease_candidate_spec_t; + +__attribute__((deprecated)) v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec_create( + char *binary_version, + char *emulation_version, + char *lease_name, + char *ping_time, + char *renew_time, + char *strategy +); + +void v1alpha2_lease_candidate_spec_free(v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec); + +v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec_parseFromJSON(cJSON *v1alpha2_lease_candidate_specJSON); + +cJSON *v1alpha2_lease_candidate_spec_convertToJSON(v1alpha2_lease_candidate_spec_t *v1alpha2_lease_candidate_spec); + +#endif /* _v1alpha2_lease_candidate_spec_H_ */ + diff --git a/kubernetes/model/v1alpha2_named_resources_allocation_result.c b/kubernetes/model/v1alpha2_named_resources_allocation_result.c deleted file mode 100644 index ce4881bf..00000000 --- a/kubernetes/model/v1alpha2_named_resources_allocation_result.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_allocation_result.h" - - - -v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result_create( - char *name - ) { - v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result_local_var = malloc(sizeof(v1alpha2_named_resources_allocation_result_t)); - if (!v1alpha2_named_resources_allocation_result_local_var) { - return NULL; - } - v1alpha2_named_resources_allocation_result_local_var->name = name; - - return v1alpha2_named_resources_allocation_result_local_var; -} - - -void v1alpha2_named_resources_allocation_result_free(v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result) { - if(NULL == v1alpha2_named_resources_allocation_result){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_allocation_result->name) { - free(v1alpha2_named_resources_allocation_result->name); - v1alpha2_named_resources_allocation_result->name = NULL; - } - free(v1alpha2_named_resources_allocation_result); -} - -cJSON *v1alpha2_named_resources_allocation_result_convertToJSON(v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_allocation_result->name - if (!v1alpha2_named_resources_allocation_result->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1alpha2_named_resources_allocation_result->name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result_parseFromJSON(cJSON *v1alpha2_named_resources_allocation_resultJSON){ - - v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result_local_var = NULL; - - // v1alpha2_named_resources_allocation_result->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_allocation_resultJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - - v1alpha2_named_resources_allocation_result_local_var = v1alpha2_named_resources_allocation_result_create ( - strdup(name->valuestring) - ); - - return v1alpha2_named_resources_allocation_result_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_allocation_result.h b/kubernetes/model/v1alpha2_named_resources_allocation_result.h deleted file mode 100644 index 3bf71909..00000000 --- a/kubernetes/model/v1alpha2_named_resources_allocation_result.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1alpha2_named_resources_allocation_result.h - * - * NamedResourcesAllocationResult is used in AllocationResultModel. - */ - -#ifndef _v1alpha2_named_resources_allocation_result_H_ -#define _v1alpha2_named_resources_allocation_result_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_allocation_result_t v1alpha2_named_resources_allocation_result_t; - - - - -typedef struct v1alpha2_named_resources_allocation_result_t { - char *name; // string - -} v1alpha2_named_resources_allocation_result_t; - -v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result_create( - char *name -); - -void v1alpha2_named_resources_allocation_result_free(v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result); - -v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result_parseFromJSON(cJSON *v1alpha2_named_resources_allocation_resultJSON); - -cJSON *v1alpha2_named_resources_allocation_result_convertToJSON(v1alpha2_named_resources_allocation_result_t *v1alpha2_named_resources_allocation_result); - -#endif /* _v1alpha2_named_resources_allocation_result_H_ */ - diff --git a/kubernetes/model/v1alpha2_named_resources_attribute.c b/kubernetes/model/v1alpha2_named_resources_attribute.c deleted file mode 100644 index 493e2278..00000000 --- a/kubernetes/model/v1alpha2_named_resources_attribute.c +++ /dev/null @@ -1,255 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_attribute.h" - - - -v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute_create( - int _bool, - long _int, - v1alpha2_named_resources_int_slice_t *int_slice, - char *name, - char *quantity, - char *string, - v1alpha2_named_resources_string_slice_t *string_slice, - char *version - ) { - v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute_local_var = malloc(sizeof(v1alpha2_named_resources_attribute_t)); - if (!v1alpha2_named_resources_attribute_local_var) { - return NULL; - } - v1alpha2_named_resources_attribute_local_var->_bool = _bool; - v1alpha2_named_resources_attribute_local_var->_int = _int; - v1alpha2_named_resources_attribute_local_var->int_slice = int_slice; - v1alpha2_named_resources_attribute_local_var->name = name; - v1alpha2_named_resources_attribute_local_var->quantity = quantity; - v1alpha2_named_resources_attribute_local_var->string = string; - v1alpha2_named_resources_attribute_local_var->string_slice = string_slice; - v1alpha2_named_resources_attribute_local_var->version = version; - - return v1alpha2_named_resources_attribute_local_var; -} - - -void v1alpha2_named_resources_attribute_free(v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute) { - if(NULL == v1alpha2_named_resources_attribute){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_attribute->int_slice) { - v1alpha2_named_resources_int_slice_free(v1alpha2_named_resources_attribute->int_slice); - v1alpha2_named_resources_attribute->int_slice = NULL; - } - if (v1alpha2_named_resources_attribute->name) { - free(v1alpha2_named_resources_attribute->name); - v1alpha2_named_resources_attribute->name = NULL; - } - if (v1alpha2_named_resources_attribute->quantity) { - free(v1alpha2_named_resources_attribute->quantity); - v1alpha2_named_resources_attribute->quantity = NULL; - } - if (v1alpha2_named_resources_attribute->string) { - free(v1alpha2_named_resources_attribute->string); - v1alpha2_named_resources_attribute->string = NULL; - } - if (v1alpha2_named_resources_attribute->string_slice) { - v1alpha2_named_resources_string_slice_free(v1alpha2_named_resources_attribute->string_slice); - v1alpha2_named_resources_attribute->string_slice = NULL; - } - if (v1alpha2_named_resources_attribute->version) { - free(v1alpha2_named_resources_attribute->version); - v1alpha2_named_resources_attribute->version = NULL; - } - free(v1alpha2_named_resources_attribute); -} - -cJSON *v1alpha2_named_resources_attribute_convertToJSON(v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_attribute->_bool - if(v1alpha2_named_resources_attribute->_bool) { - if(cJSON_AddBoolToObject(item, "bool", v1alpha2_named_resources_attribute->_bool) == NULL) { - goto fail; //Bool - } - } - - - // v1alpha2_named_resources_attribute->_int - if(v1alpha2_named_resources_attribute->_int) { - if(cJSON_AddNumberToObject(item, "int", v1alpha2_named_resources_attribute->_int) == NULL) { - goto fail; //Numeric - } - } - - - // v1alpha2_named_resources_attribute->int_slice - if(v1alpha2_named_resources_attribute->int_slice) { - cJSON *int_slice_local_JSON = v1alpha2_named_resources_int_slice_convertToJSON(v1alpha2_named_resources_attribute->int_slice); - if(int_slice_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "intSlice", int_slice_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_named_resources_attribute->name - if (!v1alpha2_named_resources_attribute->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1alpha2_named_resources_attribute->name) == NULL) { - goto fail; //String - } - - - // v1alpha2_named_resources_attribute->quantity - if(v1alpha2_named_resources_attribute->quantity) { - if(cJSON_AddStringToObject(item, "quantity", v1alpha2_named_resources_attribute->quantity) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_named_resources_attribute->string - if(v1alpha2_named_resources_attribute->string) { - if(cJSON_AddStringToObject(item, "string", v1alpha2_named_resources_attribute->string) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_named_resources_attribute->string_slice - if(v1alpha2_named_resources_attribute->string_slice) { - cJSON *string_slice_local_JSON = v1alpha2_named_resources_string_slice_convertToJSON(v1alpha2_named_resources_attribute->string_slice); - if(string_slice_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "stringSlice", string_slice_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_named_resources_attribute->version - if(v1alpha2_named_resources_attribute->version) { - if(cJSON_AddStringToObject(item, "version", v1alpha2_named_resources_attribute->version) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute_parseFromJSON(cJSON *v1alpha2_named_resources_attributeJSON){ - - v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute_local_var = NULL; - - // define the local variable for v1alpha2_named_resources_attribute->int_slice - v1alpha2_named_resources_int_slice_t *int_slice_local_nonprim = NULL; - - // define the local variable for v1alpha2_named_resources_attribute->string_slice - v1alpha2_named_resources_string_slice_t *string_slice_local_nonprim = NULL; - - // v1alpha2_named_resources_attribute->_bool - cJSON *_bool = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "bool"); - if (_bool) { - if(!cJSON_IsBool(_bool)) - { - goto end; //Bool - } - } - - // v1alpha2_named_resources_attribute->_int - cJSON *_int = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "int"); - if (_int) { - if(!cJSON_IsNumber(_int)) - { - goto end; //Numeric - } - } - - // v1alpha2_named_resources_attribute->int_slice - cJSON *int_slice = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "intSlice"); - if (int_slice) { - int_slice_local_nonprim = v1alpha2_named_resources_int_slice_parseFromJSON(int_slice); //nonprimitive - } - - // v1alpha2_named_resources_attribute->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - // v1alpha2_named_resources_attribute->quantity - cJSON *quantity = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "quantity"); - if (quantity) { - if(!cJSON_IsString(quantity) && !cJSON_IsNull(quantity)) - { - goto end; //String - } - } - - // v1alpha2_named_resources_attribute->string - cJSON *string = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "string"); - if (string) { - if(!cJSON_IsString(string) && !cJSON_IsNull(string)) - { - goto end; //String - } - } - - // v1alpha2_named_resources_attribute->string_slice - cJSON *string_slice = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "stringSlice"); - if (string_slice) { - string_slice_local_nonprim = v1alpha2_named_resources_string_slice_parseFromJSON(string_slice); //nonprimitive - } - - // v1alpha2_named_resources_attribute->version - cJSON *version = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_attributeJSON, "version"); - if (version) { - if(!cJSON_IsString(version) && !cJSON_IsNull(version)) - { - goto end; //String - } - } - - - v1alpha2_named_resources_attribute_local_var = v1alpha2_named_resources_attribute_create ( - _bool ? _bool->valueint : 0, - _int ? _int->valuedouble : 0, - int_slice ? int_slice_local_nonprim : NULL, - strdup(name->valuestring), - quantity && !cJSON_IsNull(quantity) ? strdup(quantity->valuestring) : NULL, - string && !cJSON_IsNull(string) ? strdup(string->valuestring) : NULL, - string_slice ? string_slice_local_nonprim : NULL, - version && !cJSON_IsNull(version) ? strdup(version->valuestring) : NULL - ); - - return v1alpha2_named_resources_attribute_local_var; -end: - if (int_slice_local_nonprim) { - v1alpha2_named_resources_int_slice_free(int_slice_local_nonprim); - int_slice_local_nonprim = NULL; - } - if (string_slice_local_nonprim) { - v1alpha2_named_resources_string_slice_free(string_slice_local_nonprim); - string_slice_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_attribute.h b/kubernetes/model/v1alpha2_named_resources_attribute.h deleted file mode 100644 index 0bdab997..00000000 --- a/kubernetes/model/v1alpha2_named_resources_attribute.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * v1alpha2_named_resources_attribute.h - * - * NamedResourcesAttribute is a combination of an attribute name and its value. - */ - -#ifndef _v1alpha2_named_resources_attribute_H_ -#define _v1alpha2_named_resources_attribute_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_attribute_t v1alpha2_named_resources_attribute_t; - -#include "v1alpha2_named_resources_int_slice.h" -#include "v1alpha2_named_resources_string_slice.h" - - - -typedef struct v1alpha2_named_resources_attribute_t { - int _bool; //boolean - long _int; //numeric - struct v1alpha2_named_resources_int_slice_t *int_slice; //model - char *name; // string - char *quantity; // string - char *string; // string - struct v1alpha2_named_resources_string_slice_t *string_slice; //model - char *version; // string - -} v1alpha2_named_resources_attribute_t; - -v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute_create( - int _bool, - long _int, - v1alpha2_named_resources_int_slice_t *int_slice, - char *name, - char *quantity, - char *string, - v1alpha2_named_resources_string_slice_t *string_slice, - char *version -); - -void v1alpha2_named_resources_attribute_free(v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute); - -v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute_parseFromJSON(cJSON *v1alpha2_named_resources_attributeJSON); - -cJSON *v1alpha2_named_resources_attribute_convertToJSON(v1alpha2_named_resources_attribute_t *v1alpha2_named_resources_attribute); - -#endif /* _v1alpha2_named_resources_attribute_H_ */ - diff --git a/kubernetes/model/v1alpha2_named_resources_filter.c b/kubernetes/model/v1alpha2_named_resources_filter.c deleted file mode 100644 index 0b4723fd..00000000 --- a/kubernetes/model/v1alpha2_named_resources_filter.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_filter.h" - - - -v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter_create( - char *selector - ) { - v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter_local_var = malloc(sizeof(v1alpha2_named_resources_filter_t)); - if (!v1alpha2_named_resources_filter_local_var) { - return NULL; - } - v1alpha2_named_resources_filter_local_var->selector = selector; - - return v1alpha2_named_resources_filter_local_var; -} - - -void v1alpha2_named_resources_filter_free(v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter) { - if(NULL == v1alpha2_named_resources_filter){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_filter->selector) { - free(v1alpha2_named_resources_filter->selector); - v1alpha2_named_resources_filter->selector = NULL; - } - free(v1alpha2_named_resources_filter); -} - -cJSON *v1alpha2_named_resources_filter_convertToJSON(v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_filter->selector - if (!v1alpha2_named_resources_filter->selector) { - goto fail; - } - if(cJSON_AddStringToObject(item, "selector", v1alpha2_named_resources_filter->selector) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter_parseFromJSON(cJSON *v1alpha2_named_resources_filterJSON){ - - v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter_local_var = NULL; - - // v1alpha2_named_resources_filter->selector - cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_filterJSON, "selector"); - if (!selector) { - goto end; - } - - - if(!cJSON_IsString(selector)) - { - goto end; //String - } - - - v1alpha2_named_resources_filter_local_var = v1alpha2_named_resources_filter_create ( - strdup(selector->valuestring) - ); - - return v1alpha2_named_resources_filter_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_filter.h b/kubernetes/model/v1alpha2_named_resources_filter.h deleted file mode 100644 index 612662de..00000000 --- a/kubernetes/model/v1alpha2_named_resources_filter.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1alpha2_named_resources_filter.h - * - * NamedResourcesFilter is used in ResourceFilterModel. - */ - -#ifndef _v1alpha2_named_resources_filter_H_ -#define _v1alpha2_named_resources_filter_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_filter_t v1alpha2_named_resources_filter_t; - - - - -typedef struct v1alpha2_named_resources_filter_t { - char *selector; // string - -} v1alpha2_named_resources_filter_t; - -v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter_create( - char *selector -); - -void v1alpha2_named_resources_filter_free(v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter); - -v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter_parseFromJSON(cJSON *v1alpha2_named_resources_filterJSON); - -cJSON *v1alpha2_named_resources_filter_convertToJSON(v1alpha2_named_resources_filter_t *v1alpha2_named_resources_filter); - -#endif /* _v1alpha2_named_resources_filter_H_ */ - diff --git a/kubernetes/model/v1alpha2_named_resources_instance.c b/kubernetes/model/v1alpha2_named_resources_instance.c deleted file mode 100644 index cfb6ec34..00000000 --- a/kubernetes/model/v1alpha2_named_resources_instance.c +++ /dev/null @@ -1,140 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_instance.h" - - - -v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance_create( - list_t *attributes, - char *name - ) { - v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance_local_var = malloc(sizeof(v1alpha2_named_resources_instance_t)); - if (!v1alpha2_named_resources_instance_local_var) { - return NULL; - } - v1alpha2_named_resources_instance_local_var->attributes = attributes; - v1alpha2_named_resources_instance_local_var->name = name; - - return v1alpha2_named_resources_instance_local_var; -} - - -void v1alpha2_named_resources_instance_free(v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance) { - if(NULL == v1alpha2_named_resources_instance){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_instance->attributes) { - list_ForEach(listEntry, v1alpha2_named_resources_instance->attributes) { - v1alpha2_named_resources_attribute_free(listEntry->data); - } - list_freeList(v1alpha2_named_resources_instance->attributes); - v1alpha2_named_resources_instance->attributes = NULL; - } - if (v1alpha2_named_resources_instance->name) { - free(v1alpha2_named_resources_instance->name); - v1alpha2_named_resources_instance->name = NULL; - } - free(v1alpha2_named_resources_instance); -} - -cJSON *v1alpha2_named_resources_instance_convertToJSON(v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_instance->attributes - if(v1alpha2_named_resources_instance->attributes) { - cJSON *attributes = cJSON_AddArrayToObject(item, "attributes"); - if(attributes == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *attributesListEntry; - if (v1alpha2_named_resources_instance->attributes) { - list_ForEach(attributesListEntry, v1alpha2_named_resources_instance->attributes) { - cJSON *itemLocal = v1alpha2_named_resources_attribute_convertToJSON(attributesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(attributes, itemLocal); - } - } - } - - - // v1alpha2_named_resources_instance->name - if (!v1alpha2_named_resources_instance->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1alpha2_named_resources_instance->name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance_parseFromJSON(cJSON *v1alpha2_named_resources_instanceJSON){ - - v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance_local_var = NULL; - - // define the local list for v1alpha2_named_resources_instance->attributes - list_t *attributesList = NULL; - - // v1alpha2_named_resources_instance->attributes - cJSON *attributes = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_instanceJSON, "attributes"); - if (attributes) { - cJSON *attributes_local_nonprimitive = NULL; - if(!cJSON_IsArray(attributes)){ - goto end; //nonprimitive container - } - - attributesList = list_createList(); - - cJSON_ArrayForEach(attributes_local_nonprimitive,attributes ) - { - if(!cJSON_IsObject(attributes_local_nonprimitive)){ - goto end; - } - v1alpha2_named_resources_attribute_t *attributesItem = v1alpha2_named_resources_attribute_parseFromJSON(attributes_local_nonprimitive); - - list_addElement(attributesList, attributesItem); - } - } - - // v1alpha2_named_resources_instance->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_instanceJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - - v1alpha2_named_resources_instance_local_var = v1alpha2_named_resources_instance_create ( - attributes ? attributesList : NULL, - strdup(name->valuestring) - ); - - return v1alpha2_named_resources_instance_local_var; -end: - if (attributesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, attributesList) { - v1alpha2_named_resources_attribute_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(attributesList); - attributesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_instance.h b/kubernetes/model/v1alpha2_named_resources_instance.h deleted file mode 100644 index 8548891c..00000000 --- a/kubernetes/model/v1alpha2_named_resources_instance.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * v1alpha2_named_resources_instance.h - * - * NamedResourcesInstance represents one individual hardware instance that can be selected based on its attributes. - */ - -#ifndef _v1alpha2_named_resources_instance_H_ -#define _v1alpha2_named_resources_instance_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_instance_t v1alpha2_named_resources_instance_t; - -#include "v1alpha2_named_resources_attribute.h" - - - -typedef struct v1alpha2_named_resources_instance_t { - list_t *attributes; //nonprimitive container - char *name; // string - -} v1alpha2_named_resources_instance_t; - -v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance_create( - list_t *attributes, - char *name -); - -void v1alpha2_named_resources_instance_free(v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance); - -v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance_parseFromJSON(cJSON *v1alpha2_named_resources_instanceJSON); - -cJSON *v1alpha2_named_resources_instance_convertToJSON(v1alpha2_named_resources_instance_t *v1alpha2_named_resources_instance); - -#endif /* _v1alpha2_named_resources_instance_H_ */ - diff --git a/kubernetes/model/v1alpha2_named_resources_int_slice.c b/kubernetes/model/v1alpha2_named_resources_int_slice.c deleted file mode 100644 index 61dcccaa..00000000 --- a/kubernetes/model/v1alpha2_named_resources_int_slice.c +++ /dev/null @@ -1,117 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_int_slice.h" - - - -v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice_create( - list_t *ints - ) { - v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice_local_var = malloc(sizeof(v1alpha2_named_resources_int_slice_t)); - if (!v1alpha2_named_resources_int_slice_local_var) { - return NULL; - } - v1alpha2_named_resources_int_slice_local_var->ints = ints; - - return v1alpha2_named_resources_int_slice_local_var; -} - - -void v1alpha2_named_resources_int_slice_free(v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice) { - if(NULL == v1alpha2_named_resources_int_slice){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_int_slice->ints) { - list_ForEach(listEntry, v1alpha2_named_resources_int_slice->ints) { - free(listEntry->data); - } - list_freeList(v1alpha2_named_resources_int_slice->ints); - v1alpha2_named_resources_int_slice->ints = NULL; - } - free(v1alpha2_named_resources_int_slice); -} - -cJSON *v1alpha2_named_resources_int_slice_convertToJSON(v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_int_slice->ints - if (!v1alpha2_named_resources_int_slice->ints) { - goto fail; - } - cJSON *ints = cJSON_AddArrayToObject(item, "ints"); - if(ints == NULL) { - goto fail; //primitive container - } - - listEntry_t *intsListEntry; - list_ForEach(intsListEntry, v1alpha2_named_resources_int_slice->ints) { - if(cJSON_AddNumberToObject(ints, "", *(double *)intsListEntry->data) == NULL) - { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice_parseFromJSON(cJSON *v1alpha2_named_resources_int_sliceJSON){ - - v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice_local_var = NULL; - - // define the local list for v1alpha2_named_resources_int_slice->ints - list_t *intsList = NULL; - - // v1alpha2_named_resources_int_slice->ints - cJSON *ints = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_int_sliceJSON, "ints"); - if (!ints) { - goto end; - } - - - cJSON *ints_local = NULL; - if(!cJSON_IsArray(ints)) { - goto end;//primitive container - } - intsList = list_createList(); - - cJSON_ArrayForEach(ints_local, ints) - { - if(!cJSON_IsNumber(ints_local)) - { - goto end; - } - double *ints_local_value = (double *)calloc(1, sizeof(double)); - if(!ints_local_value) - { - goto end; - } - *ints_local_value = ints_local->valuedouble; - list_addElement(intsList , ints_local_value); - } - - - v1alpha2_named_resources_int_slice_local_var = v1alpha2_named_resources_int_slice_create ( - intsList - ); - - return v1alpha2_named_resources_int_slice_local_var; -end: - if (intsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, intsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(intsList); - intsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_int_slice.h b/kubernetes/model/v1alpha2_named_resources_int_slice.h deleted file mode 100644 index 6217e42c..00000000 --- a/kubernetes/model/v1alpha2_named_resources_int_slice.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1alpha2_named_resources_int_slice.h - * - * NamedResourcesIntSlice contains a slice of 64-bit integers. - */ - -#ifndef _v1alpha2_named_resources_int_slice_H_ -#define _v1alpha2_named_resources_int_slice_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_int_slice_t v1alpha2_named_resources_int_slice_t; - - - - -typedef struct v1alpha2_named_resources_int_slice_t { - list_t *ints; //primitive container - -} v1alpha2_named_resources_int_slice_t; - -v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice_create( - list_t *ints -); - -void v1alpha2_named_resources_int_slice_free(v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice); - -v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice_parseFromJSON(cJSON *v1alpha2_named_resources_int_sliceJSON); - -cJSON *v1alpha2_named_resources_int_slice_convertToJSON(v1alpha2_named_resources_int_slice_t *v1alpha2_named_resources_int_slice); - -#endif /* _v1alpha2_named_resources_int_slice_H_ */ - diff --git a/kubernetes/model/v1alpha2_named_resources_request.c b/kubernetes/model/v1alpha2_named_resources_request.c deleted file mode 100644 index 18199198..00000000 --- a/kubernetes/model/v1alpha2_named_resources_request.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_request.h" - - - -v1alpha2_named_resources_request_t *v1alpha2_named_resources_request_create( - char *selector - ) { - v1alpha2_named_resources_request_t *v1alpha2_named_resources_request_local_var = malloc(sizeof(v1alpha2_named_resources_request_t)); - if (!v1alpha2_named_resources_request_local_var) { - return NULL; - } - v1alpha2_named_resources_request_local_var->selector = selector; - - return v1alpha2_named_resources_request_local_var; -} - - -void v1alpha2_named_resources_request_free(v1alpha2_named_resources_request_t *v1alpha2_named_resources_request) { - if(NULL == v1alpha2_named_resources_request){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_request->selector) { - free(v1alpha2_named_resources_request->selector); - v1alpha2_named_resources_request->selector = NULL; - } - free(v1alpha2_named_resources_request); -} - -cJSON *v1alpha2_named_resources_request_convertToJSON(v1alpha2_named_resources_request_t *v1alpha2_named_resources_request) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_request->selector - if (!v1alpha2_named_resources_request->selector) { - goto fail; - } - if(cJSON_AddStringToObject(item, "selector", v1alpha2_named_resources_request->selector) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_request_t *v1alpha2_named_resources_request_parseFromJSON(cJSON *v1alpha2_named_resources_requestJSON){ - - v1alpha2_named_resources_request_t *v1alpha2_named_resources_request_local_var = NULL; - - // v1alpha2_named_resources_request->selector - cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_requestJSON, "selector"); - if (!selector) { - goto end; - } - - - if(!cJSON_IsString(selector)) - { - goto end; //String - } - - - v1alpha2_named_resources_request_local_var = v1alpha2_named_resources_request_create ( - strdup(selector->valuestring) - ); - - return v1alpha2_named_resources_request_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_request.h b/kubernetes/model/v1alpha2_named_resources_request.h deleted file mode 100644 index 0c06d23b..00000000 --- a/kubernetes/model/v1alpha2_named_resources_request.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1alpha2_named_resources_request.h - * - * NamedResourcesRequest is used in ResourceRequestModel. - */ - -#ifndef _v1alpha2_named_resources_request_H_ -#define _v1alpha2_named_resources_request_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_request_t v1alpha2_named_resources_request_t; - - - - -typedef struct v1alpha2_named_resources_request_t { - char *selector; // string - -} v1alpha2_named_resources_request_t; - -v1alpha2_named_resources_request_t *v1alpha2_named_resources_request_create( - char *selector -); - -void v1alpha2_named_resources_request_free(v1alpha2_named_resources_request_t *v1alpha2_named_resources_request); - -v1alpha2_named_resources_request_t *v1alpha2_named_resources_request_parseFromJSON(cJSON *v1alpha2_named_resources_requestJSON); - -cJSON *v1alpha2_named_resources_request_convertToJSON(v1alpha2_named_resources_request_t *v1alpha2_named_resources_request); - -#endif /* _v1alpha2_named_resources_request_H_ */ - diff --git a/kubernetes/model/v1alpha2_named_resources_resources.c b/kubernetes/model/v1alpha2_named_resources_resources.c deleted file mode 100644 index 7410f2ce..00000000 --- a/kubernetes/model/v1alpha2_named_resources_resources.c +++ /dev/null @@ -1,116 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_resources.h" - - - -v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources_create( - list_t *instances - ) { - v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources_local_var = malloc(sizeof(v1alpha2_named_resources_resources_t)); - if (!v1alpha2_named_resources_resources_local_var) { - return NULL; - } - v1alpha2_named_resources_resources_local_var->instances = instances; - - return v1alpha2_named_resources_resources_local_var; -} - - -void v1alpha2_named_resources_resources_free(v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources) { - if(NULL == v1alpha2_named_resources_resources){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_resources->instances) { - list_ForEach(listEntry, v1alpha2_named_resources_resources->instances) { - v1alpha2_named_resources_instance_free(listEntry->data); - } - list_freeList(v1alpha2_named_resources_resources->instances); - v1alpha2_named_resources_resources->instances = NULL; - } - free(v1alpha2_named_resources_resources); -} - -cJSON *v1alpha2_named_resources_resources_convertToJSON(v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_resources->instances - if (!v1alpha2_named_resources_resources->instances) { - goto fail; - } - cJSON *instances = cJSON_AddArrayToObject(item, "instances"); - if(instances == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *instancesListEntry; - if (v1alpha2_named_resources_resources->instances) { - list_ForEach(instancesListEntry, v1alpha2_named_resources_resources->instances) { - cJSON *itemLocal = v1alpha2_named_resources_instance_convertToJSON(instancesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(instances, itemLocal); - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources_parseFromJSON(cJSON *v1alpha2_named_resources_resourcesJSON){ - - v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources_local_var = NULL; - - // define the local list for v1alpha2_named_resources_resources->instances - list_t *instancesList = NULL; - - // v1alpha2_named_resources_resources->instances - cJSON *instances = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_resourcesJSON, "instances"); - if (!instances) { - goto end; - } - - - cJSON *instances_local_nonprimitive = NULL; - if(!cJSON_IsArray(instances)){ - goto end; //nonprimitive container - } - - instancesList = list_createList(); - - cJSON_ArrayForEach(instances_local_nonprimitive,instances ) - { - if(!cJSON_IsObject(instances_local_nonprimitive)){ - goto end; - } - v1alpha2_named_resources_instance_t *instancesItem = v1alpha2_named_resources_instance_parseFromJSON(instances_local_nonprimitive); - - list_addElement(instancesList, instancesItem); - } - - - v1alpha2_named_resources_resources_local_var = v1alpha2_named_resources_resources_create ( - instancesList - ); - - return v1alpha2_named_resources_resources_local_var; -end: - if (instancesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, instancesList) { - v1alpha2_named_resources_instance_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(instancesList); - instancesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_resources.h b/kubernetes/model/v1alpha2_named_resources_resources.h deleted file mode 100644 index 65e8e529..00000000 --- a/kubernetes/model/v1alpha2_named_resources_resources.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1alpha2_named_resources_resources.h - * - * NamedResourcesResources is used in ResourceModel. - */ - -#ifndef _v1alpha2_named_resources_resources_H_ -#define _v1alpha2_named_resources_resources_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_resources_t v1alpha2_named_resources_resources_t; - -#include "v1alpha2_named_resources_instance.h" - - - -typedef struct v1alpha2_named_resources_resources_t { - list_t *instances; //nonprimitive container - -} v1alpha2_named_resources_resources_t; - -v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources_create( - list_t *instances -); - -void v1alpha2_named_resources_resources_free(v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources); - -v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources_parseFromJSON(cJSON *v1alpha2_named_resources_resourcesJSON); - -cJSON *v1alpha2_named_resources_resources_convertToJSON(v1alpha2_named_resources_resources_t *v1alpha2_named_resources_resources); - -#endif /* _v1alpha2_named_resources_resources_H_ */ - diff --git a/kubernetes/model/v1alpha2_named_resources_string_slice.c b/kubernetes/model/v1alpha2_named_resources_string_slice.c deleted file mode 100644 index 9a87dc87..00000000 --- a/kubernetes/model/v1alpha2_named_resources_string_slice.c +++ /dev/null @@ -1,111 +0,0 @@ -#include -#include -#include -#include "v1alpha2_named_resources_string_slice.h" - - - -v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice_create( - list_t *strings - ) { - v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice_local_var = malloc(sizeof(v1alpha2_named_resources_string_slice_t)); - if (!v1alpha2_named_resources_string_slice_local_var) { - return NULL; - } - v1alpha2_named_resources_string_slice_local_var->strings = strings; - - return v1alpha2_named_resources_string_slice_local_var; -} - - -void v1alpha2_named_resources_string_slice_free(v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice) { - if(NULL == v1alpha2_named_resources_string_slice){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_named_resources_string_slice->strings) { - list_ForEach(listEntry, v1alpha2_named_resources_string_slice->strings) { - free(listEntry->data); - } - list_freeList(v1alpha2_named_resources_string_slice->strings); - v1alpha2_named_resources_string_slice->strings = NULL; - } - free(v1alpha2_named_resources_string_slice); -} - -cJSON *v1alpha2_named_resources_string_slice_convertToJSON(v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_named_resources_string_slice->strings - if (!v1alpha2_named_resources_string_slice->strings) { - goto fail; - } - cJSON *strings = cJSON_AddArrayToObject(item, "strings"); - if(strings == NULL) { - goto fail; //primitive container - } - - listEntry_t *stringsListEntry; - list_ForEach(stringsListEntry, v1alpha2_named_resources_string_slice->strings) { - if(cJSON_AddStringToObject(strings, "", (char*)stringsListEntry->data) == NULL) - { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice_parseFromJSON(cJSON *v1alpha2_named_resources_string_sliceJSON){ - - v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice_local_var = NULL; - - // define the local list for v1alpha2_named_resources_string_slice->strings - list_t *stringsList = NULL; - - // v1alpha2_named_resources_string_slice->strings - cJSON *strings = cJSON_GetObjectItemCaseSensitive(v1alpha2_named_resources_string_sliceJSON, "strings"); - if (!strings) { - goto end; - } - - - cJSON *strings_local = NULL; - if(!cJSON_IsArray(strings)) { - goto end;//primitive container - } - stringsList = list_createList(); - - cJSON_ArrayForEach(strings_local, strings) - { - if(!cJSON_IsString(strings_local)) - { - goto end; - } - list_addElement(stringsList , strdup(strings_local->valuestring)); - } - - - v1alpha2_named_resources_string_slice_local_var = v1alpha2_named_resources_string_slice_create ( - stringsList - ); - - return v1alpha2_named_resources_string_slice_local_var; -end: - if (stringsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, stringsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(stringsList); - stringsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_named_resources_string_slice.h b/kubernetes/model/v1alpha2_named_resources_string_slice.h deleted file mode 100644 index 6a1c884a..00000000 --- a/kubernetes/model/v1alpha2_named_resources_string_slice.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1alpha2_named_resources_string_slice.h - * - * NamedResourcesStringSlice contains a slice of strings. - */ - -#ifndef _v1alpha2_named_resources_string_slice_H_ -#define _v1alpha2_named_resources_string_slice_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_named_resources_string_slice_t v1alpha2_named_resources_string_slice_t; - - - - -typedef struct v1alpha2_named_resources_string_slice_t { - list_t *strings; //primitive container - -} v1alpha2_named_resources_string_slice_t; - -v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice_create( - list_t *strings -); - -void v1alpha2_named_resources_string_slice_free(v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice); - -v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice_parseFromJSON(cJSON *v1alpha2_named_resources_string_sliceJSON); - -cJSON *v1alpha2_named_resources_string_slice_convertToJSON(v1alpha2_named_resources_string_slice_t *v1alpha2_named_resources_string_slice); - -#endif /* _v1alpha2_named_resources_string_slice_H_ */ - diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context.c b/kubernetes/model/v1alpha2_pod_scheduling_context.c deleted file mode 100644 index 7c0c8cd8..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context.c +++ /dev/null @@ -1,200 +0,0 @@ -#include -#include -#include -#include "v1alpha2_pod_scheduling_context.h" - - - -v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_pod_scheduling_context_spec_t *spec, - v1alpha2_pod_scheduling_context_status_t *status - ) { - v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context_local_var = malloc(sizeof(v1alpha2_pod_scheduling_context_t)); - if (!v1alpha2_pod_scheduling_context_local_var) { - return NULL; - } - v1alpha2_pod_scheduling_context_local_var->api_version = api_version; - v1alpha2_pod_scheduling_context_local_var->kind = kind; - v1alpha2_pod_scheduling_context_local_var->metadata = metadata; - v1alpha2_pod_scheduling_context_local_var->spec = spec; - v1alpha2_pod_scheduling_context_local_var->status = status; - - return v1alpha2_pod_scheduling_context_local_var; -} - - -void v1alpha2_pod_scheduling_context_free(v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context) { - if(NULL == v1alpha2_pod_scheduling_context){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_pod_scheduling_context->api_version) { - free(v1alpha2_pod_scheduling_context->api_version); - v1alpha2_pod_scheduling_context->api_version = NULL; - } - if (v1alpha2_pod_scheduling_context->kind) { - free(v1alpha2_pod_scheduling_context->kind); - v1alpha2_pod_scheduling_context->kind = NULL; - } - if (v1alpha2_pod_scheduling_context->metadata) { - v1_object_meta_free(v1alpha2_pod_scheduling_context->metadata); - v1alpha2_pod_scheduling_context->metadata = NULL; - } - if (v1alpha2_pod_scheduling_context->spec) { - v1alpha2_pod_scheduling_context_spec_free(v1alpha2_pod_scheduling_context->spec); - v1alpha2_pod_scheduling_context->spec = NULL; - } - if (v1alpha2_pod_scheduling_context->status) { - v1alpha2_pod_scheduling_context_status_free(v1alpha2_pod_scheduling_context->status); - v1alpha2_pod_scheduling_context->status = NULL; - } - free(v1alpha2_pod_scheduling_context); -} - -cJSON *v1alpha2_pod_scheduling_context_convertToJSON(v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_pod_scheduling_context->api_version - if(v1alpha2_pod_scheduling_context->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_pod_scheduling_context->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_pod_scheduling_context->kind - if(v1alpha2_pod_scheduling_context->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_pod_scheduling_context->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_pod_scheduling_context->metadata - if(v1alpha2_pod_scheduling_context->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_pod_scheduling_context->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_pod_scheduling_context->spec - if (!v1alpha2_pod_scheduling_context->spec) { - goto fail; - } - cJSON *spec_local_JSON = v1alpha2_pod_scheduling_context_spec_convertToJSON(v1alpha2_pod_scheduling_context->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - - - // v1alpha2_pod_scheduling_context->status - if(v1alpha2_pod_scheduling_context->status) { - cJSON *status_local_JSON = v1alpha2_pod_scheduling_context_status_convertToJSON(v1alpha2_pod_scheduling_context->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context_parseFromJSON(cJSON *v1alpha2_pod_scheduling_contextJSON){ - - v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context_local_var = NULL; - - // define the local variable for v1alpha2_pod_scheduling_context->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha2_pod_scheduling_context->spec - v1alpha2_pod_scheduling_context_spec_t *spec_local_nonprim = NULL; - - // define the local variable for v1alpha2_pod_scheduling_context->status - v1alpha2_pod_scheduling_context_status_t *status_local_nonprim = NULL; - - // v1alpha2_pod_scheduling_context->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_contextJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_pod_scheduling_context->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_contextJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_pod_scheduling_context->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_contextJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_pod_scheduling_context->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_contextJSON, "spec"); - if (!spec) { - goto end; - } - - - spec_local_nonprim = v1alpha2_pod_scheduling_context_spec_parseFromJSON(spec); //nonprimitive - - // v1alpha2_pod_scheduling_context->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_contextJSON, "status"); - if (status) { - status_local_nonprim = v1alpha2_pod_scheduling_context_status_parseFromJSON(status); //nonprimitive - } - - - v1alpha2_pod_scheduling_context_local_var = v1alpha2_pod_scheduling_context_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec_local_nonprim, - status ? status_local_nonprim : NULL - ); - - return v1alpha2_pod_scheduling_context_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha2_pod_scheduling_context_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1alpha2_pod_scheduling_context_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context.h b/kubernetes/model/v1alpha2_pod_scheduling_context.h deleted file mode 100644 index 0af901a2..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * v1alpha2_pod_scheduling_context.h - * - * PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. - */ - -#ifndef _v1alpha2_pod_scheduling_context_H_ -#define _v1alpha2_pod_scheduling_context_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_pod_scheduling_context_t v1alpha2_pod_scheduling_context_t; - -#include "v1_object_meta.h" -#include "v1alpha2_pod_scheduling_context_spec.h" -#include "v1alpha2_pod_scheduling_context_status.h" - - - -typedef struct v1alpha2_pod_scheduling_context_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha2_pod_scheduling_context_spec_t *spec; //model - struct v1alpha2_pod_scheduling_context_status_t *status; //model - -} v1alpha2_pod_scheduling_context_t; - -v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_pod_scheduling_context_spec_t *spec, - v1alpha2_pod_scheduling_context_status_t *status -); - -void v1alpha2_pod_scheduling_context_free(v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context); - -v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context_parseFromJSON(cJSON *v1alpha2_pod_scheduling_contextJSON); - -cJSON *v1alpha2_pod_scheduling_context_convertToJSON(v1alpha2_pod_scheduling_context_t *v1alpha2_pod_scheduling_context); - -#endif /* _v1alpha2_pod_scheduling_context_H_ */ - diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context_list.c b/kubernetes/model/v1alpha2_pod_scheduling_context_list.c deleted file mode 100644 index 3464da3d..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha2_pod_scheduling_context_list.h" - - - -v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list_local_var = malloc(sizeof(v1alpha2_pod_scheduling_context_list_t)); - if (!v1alpha2_pod_scheduling_context_list_local_var) { - return NULL; - } - v1alpha2_pod_scheduling_context_list_local_var->api_version = api_version; - v1alpha2_pod_scheduling_context_list_local_var->items = items; - v1alpha2_pod_scheduling_context_list_local_var->kind = kind; - v1alpha2_pod_scheduling_context_list_local_var->metadata = metadata; - - return v1alpha2_pod_scheduling_context_list_local_var; -} - - -void v1alpha2_pod_scheduling_context_list_free(v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list) { - if(NULL == v1alpha2_pod_scheduling_context_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_pod_scheduling_context_list->api_version) { - free(v1alpha2_pod_scheduling_context_list->api_version); - v1alpha2_pod_scheduling_context_list->api_version = NULL; - } - if (v1alpha2_pod_scheduling_context_list->items) { - list_ForEach(listEntry, v1alpha2_pod_scheduling_context_list->items) { - v1alpha2_pod_scheduling_context_free(listEntry->data); - } - list_freeList(v1alpha2_pod_scheduling_context_list->items); - v1alpha2_pod_scheduling_context_list->items = NULL; - } - if (v1alpha2_pod_scheduling_context_list->kind) { - free(v1alpha2_pod_scheduling_context_list->kind); - v1alpha2_pod_scheduling_context_list->kind = NULL; - } - if (v1alpha2_pod_scheduling_context_list->metadata) { - v1_list_meta_free(v1alpha2_pod_scheduling_context_list->metadata); - v1alpha2_pod_scheduling_context_list->metadata = NULL; - } - free(v1alpha2_pod_scheduling_context_list); -} - -cJSON *v1alpha2_pod_scheduling_context_list_convertToJSON(v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_pod_scheduling_context_list->api_version - if(v1alpha2_pod_scheduling_context_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_pod_scheduling_context_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_pod_scheduling_context_list->items - if (!v1alpha2_pod_scheduling_context_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha2_pod_scheduling_context_list->items) { - list_ForEach(itemsListEntry, v1alpha2_pod_scheduling_context_list->items) { - cJSON *itemLocal = v1alpha2_pod_scheduling_context_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha2_pod_scheduling_context_list->kind - if(v1alpha2_pod_scheduling_context_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_pod_scheduling_context_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_pod_scheduling_context_list->metadata - if(v1alpha2_pod_scheduling_context_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_pod_scheduling_context_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list_parseFromJSON(cJSON *v1alpha2_pod_scheduling_context_listJSON){ - - v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list_local_var = NULL; - - // define the local list for v1alpha2_pod_scheduling_context_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha2_pod_scheduling_context_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_pod_scheduling_context_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_context_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_pod_scheduling_context_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_context_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha2_pod_scheduling_context_t *itemsItem = v1alpha2_pod_scheduling_context_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha2_pod_scheduling_context_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_context_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_pod_scheduling_context_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_context_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha2_pod_scheduling_context_list_local_var = v1alpha2_pod_scheduling_context_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha2_pod_scheduling_context_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha2_pod_scheduling_context_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context_list.h b/kubernetes/model/v1alpha2_pod_scheduling_context_list.h deleted file mode 100644 index 04f81bad..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_pod_scheduling_context_list.h - * - * PodSchedulingContextList is a collection of Pod scheduling objects. - */ - -#ifndef _v1alpha2_pod_scheduling_context_list_H_ -#define _v1alpha2_pod_scheduling_context_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_pod_scheduling_context_list_t v1alpha2_pod_scheduling_context_list_t; - -#include "v1_list_meta.h" -#include "v1alpha2_pod_scheduling_context.h" - - - -typedef struct v1alpha2_pod_scheduling_context_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha2_pod_scheduling_context_list_t; - -v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha2_pod_scheduling_context_list_free(v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list); - -v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list_parseFromJSON(cJSON *v1alpha2_pod_scheduling_context_listJSON); - -cJSON *v1alpha2_pod_scheduling_context_list_convertToJSON(v1alpha2_pod_scheduling_context_list_t *v1alpha2_pod_scheduling_context_list); - -#endif /* _v1alpha2_pod_scheduling_context_list_H_ */ - diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context_spec.c b/kubernetes/model/v1alpha2_pod_scheduling_context_spec.c deleted file mode 100644 index 7061338a..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context_spec.c +++ /dev/null @@ -1,131 +0,0 @@ -#include -#include -#include -#include "v1alpha2_pod_scheduling_context_spec.h" - - - -v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec_create( - list_t *potential_nodes, - char *selected_node - ) { - v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec_local_var = malloc(sizeof(v1alpha2_pod_scheduling_context_spec_t)); - if (!v1alpha2_pod_scheduling_context_spec_local_var) { - return NULL; - } - v1alpha2_pod_scheduling_context_spec_local_var->potential_nodes = potential_nodes; - v1alpha2_pod_scheduling_context_spec_local_var->selected_node = selected_node; - - return v1alpha2_pod_scheduling_context_spec_local_var; -} - - -void v1alpha2_pod_scheduling_context_spec_free(v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec) { - if(NULL == v1alpha2_pod_scheduling_context_spec){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_pod_scheduling_context_spec->potential_nodes) { - list_ForEach(listEntry, v1alpha2_pod_scheduling_context_spec->potential_nodes) { - free(listEntry->data); - } - list_freeList(v1alpha2_pod_scheduling_context_spec->potential_nodes); - v1alpha2_pod_scheduling_context_spec->potential_nodes = NULL; - } - if (v1alpha2_pod_scheduling_context_spec->selected_node) { - free(v1alpha2_pod_scheduling_context_spec->selected_node); - v1alpha2_pod_scheduling_context_spec->selected_node = NULL; - } - free(v1alpha2_pod_scheduling_context_spec); -} - -cJSON *v1alpha2_pod_scheduling_context_spec_convertToJSON(v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_pod_scheduling_context_spec->potential_nodes - if(v1alpha2_pod_scheduling_context_spec->potential_nodes) { - cJSON *potential_nodes = cJSON_AddArrayToObject(item, "potentialNodes"); - if(potential_nodes == NULL) { - goto fail; //primitive container - } - - listEntry_t *potential_nodesListEntry; - list_ForEach(potential_nodesListEntry, v1alpha2_pod_scheduling_context_spec->potential_nodes) { - if(cJSON_AddStringToObject(potential_nodes, "", (char*)potential_nodesListEntry->data) == NULL) - { - goto fail; - } - } - } - - - // v1alpha2_pod_scheduling_context_spec->selected_node - if(v1alpha2_pod_scheduling_context_spec->selected_node) { - if(cJSON_AddStringToObject(item, "selectedNode", v1alpha2_pod_scheduling_context_spec->selected_node) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec_parseFromJSON(cJSON *v1alpha2_pod_scheduling_context_specJSON){ - - v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec_local_var = NULL; - - // define the local list for v1alpha2_pod_scheduling_context_spec->potential_nodes - list_t *potential_nodesList = NULL; - - // v1alpha2_pod_scheduling_context_spec->potential_nodes - cJSON *potential_nodes = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_context_specJSON, "potentialNodes"); - if (potential_nodes) { - cJSON *potential_nodes_local = NULL; - if(!cJSON_IsArray(potential_nodes)) { - goto end;//primitive container - } - potential_nodesList = list_createList(); - - cJSON_ArrayForEach(potential_nodes_local, potential_nodes) - { - if(!cJSON_IsString(potential_nodes_local)) - { - goto end; - } - list_addElement(potential_nodesList , strdup(potential_nodes_local->valuestring)); - } - } - - // v1alpha2_pod_scheduling_context_spec->selected_node - cJSON *selected_node = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_context_specJSON, "selectedNode"); - if (selected_node) { - if(!cJSON_IsString(selected_node) && !cJSON_IsNull(selected_node)) - { - goto end; //String - } - } - - - v1alpha2_pod_scheduling_context_spec_local_var = v1alpha2_pod_scheduling_context_spec_create ( - potential_nodes ? potential_nodesList : NULL, - selected_node && !cJSON_IsNull(selected_node) ? strdup(selected_node->valuestring) : NULL - ); - - return v1alpha2_pod_scheduling_context_spec_local_var; -end: - if (potential_nodesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, potential_nodesList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(potential_nodesList); - potential_nodesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context_spec.h b/kubernetes/model/v1alpha2_pod_scheduling_context_spec.h deleted file mode 100644 index cfffe970..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context_spec.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1alpha2_pod_scheduling_context_spec.h - * - * PodSchedulingContextSpec describes where resources for the Pod are needed. - */ - -#ifndef _v1alpha2_pod_scheduling_context_spec_H_ -#define _v1alpha2_pod_scheduling_context_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_pod_scheduling_context_spec_t v1alpha2_pod_scheduling_context_spec_t; - - - - -typedef struct v1alpha2_pod_scheduling_context_spec_t { - list_t *potential_nodes; //primitive container - char *selected_node; // string - -} v1alpha2_pod_scheduling_context_spec_t; - -v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec_create( - list_t *potential_nodes, - char *selected_node -); - -void v1alpha2_pod_scheduling_context_spec_free(v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec); - -v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec_parseFromJSON(cJSON *v1alpha2_pod_scheduling_context_specJSON); - -cJSON *v1alpha2_pod_scheduling_context_spec_convertToJSON(v1alpha2_pod_scheduling_context_spec_t *v1alpha2_pod_scheduling_context_spec); - -#endif /* _v1alpha2_pod_scheduling_context_spec_H_ */ - diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context_status.c b/kubernetes/model/v1alpha2_pod_scheduling_context_status.c deleted file mode 100644 index 7e9fd20f..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context_status.c +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include "v1alpha2_pod_scheduling_context_status.h" - - - -v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status_create( - list_t *resource_claims - ) { - v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status_local_var = malloc(sizeof(v1alpha2_pod_scheduling_context_status_t)); - if (!v1alpha2_pod_scheduling_context_status_local_var) { - return NULL; - } - v1alpha2_pod_scheduling_context_status_local_var->resource_claims = resource_claims; - - return v1alpha2_pod_scheduling_context_status_local_var; -} - - -void v1alpha2_pod_scheduling_context_status_free(v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status) { - if(NULL == v1alpha2_pod_scheduling_context_status){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_pod_scheduling_context_status->resource_claims) { - list_ForEach(listEntry, v1alpha2_pod_scheduling_context_status->resource_claims) { - v1alpha2_resource_claim_scheduling_status_free(listEntry->data); - } - list_freeList(v1alpha2_pod_scheduling_context_status->resource_claims); - v1alpha2_pod_scheduling_context_status->resource_claims = NULL; - } - free(v1alpha2_pod_scheduling_context_status); -} - -cJSON *v1alpha2_pod_scheduling_context_status_convertToJSON(v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_pod_scheduling_context_status->resource_claims - if(v1alpha2_pod_scheduling_context_status->resource_claims) { - cJSON *resource_claims = cJSON_AddArrayToObject(item, "resourceClaims"); - if(resource_claims == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *resource_claimsListEntry; - if (v1alpha2_pod_scheduling_context_status->resource_claims) { - list_ForEach(resource_claimsListEntry, v1alpha2_pod_scheduling_context_status->resource_claims) { - cJSON *itemLocal = v1alpha2_resource_claim_scheduling_status_convertToJSON(resource_claimsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(resource_claims, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status_parseFromJSON(cJSON *v1alpha2_pod_scheduling_context_statusJSON){ - - v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status_local_var = NULL; - - // define the local list for v1alpha2_pod_scheduling_context_status->resource_claims - list_t *resource_claimsList = NULL; - - // v1alpha2_pod_scheduling_context_status->resource_claims - cJSON *resource_claims = cJSON_GetObjectItemCaseSensitive(v1alpha2_pod_scheduling_context_statusJSON, "resourceClaims"); - if (resource_claims) { - cJSON *resource_claims_local_nonprimitive = NULL; - if(!cJSON_IsArray(resource_claims)){ - goto end; //nonprimitive container - } - - resource_claimsList = list_createList(); - - cJSON_ArrayForEach(resource_claims_local_nonprimitive,resource_claims ) - { - if(!cJSON_IsObject(resource_claims_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_claim_scheduling_status_t *resource_claimsItem = v1alpha2_resource_claim_scheduling_status_parseFromJSON(resource_claims_local_nonprimitive); - - list_addElement(resource_claimsList, resource_claimsItem); - } - } - - - v1alpha2_pod_scheduling_context_status_local_var = v1alpha2_pod_scheduling_context_status_create ( - resource_claims ? resource_claimsList : NULL - ); - - return v1alpha2_pod_scheduling_context_status_local_var; -end: - if (resource_claimsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, resource_claimsList) { - v1alpha2_resource_claim_scheduling_status_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(resource_claimsList); - resource_claimsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_pod_scheduling_context_status.h b/kubernetes/model/v1alpha2_pod_scheduling_context_status.h deleted file mode 100644 index eaa546e1..00000000 --- a/kubernetes/model/v1alpha2_pod_scheduling_context_status.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1alpha2_pod_scheduling_context_status.h - * - * PodSchedulingContextStatus describes where resources for the Pod can be allocated. - */ - -#ifndef _v1alpha2_pod_scheduling_context_status_H_ -#define _v1alpha2_pod_scheduling_context_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_pod_scheduling_context_status_t v1alpha2_pod_scheduling_context_status_t; - -#include "v1alpha2_resource_claim_scheduling_status.h" - - - -typedef struct v1alpha2_pod_scheduling_context_status_t { - list_t *resource_claims; //nonprimitive container - -} v1alpha2_pod_scheduling_context_status_t; - -v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status_create( - list_t *resource_claims -); - -void v1alpha2_pod_scheduling_context_status_free(v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status); - -v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status_parseFromJSON(cJSON *v1alpha2_pod_scheduling_context_statusJSON); - -cJSON *v1alpha2_pod_scheduling_context_status_convertToJSON(v1alpha2_pod_scheduling_context_status_t *v1alpha2_pod_scheduling_context_status); - -#endif /* _v1alpha2_pod_scheduling_context_status_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim.c b/kubernetes/model/v1alpha2_resource_claim.c deleted file mode 100644 index ad9c6994..00000000 --- a/kubernetes/model/v1alpha2_resource_claim.c +++ /dev/null @@ -1,200 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim.h" - - - -v1alpha2_resource_claim_t *v1alpha2_resource_claim_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_resource_claim_spec_t *spec, - v1alpha2_resource_claim_status_t *status - ) { - v1alpha2_resource_claim_t *v1alpha2_resource_claim_local_var = malloc(sizeof(v1alpha2_resource_claim_t)); - if (!v1alpha2_resource_claim_local_var) { - return NULL; - } - v1alpha2_resource_claim_local_var->api_version = api_version; - v1alpha2_resource_claim_local_var->kind = kind; - v1alpha2_resource_claim_local_var->metadata = metadata; - v1alpha2_resource_claim_local_var->spec = spec; - v1alpha2_resource_claim_local_var->status = status; - - return v1alpha2_resource_claim_local_var; -} - - -void v1alpha2_resource_claim_free(v1alpha2_resource_claim_t *v1alpha2_resource_claim) { - if(NULL == v1alpha2_resource_claim){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim->api_version) { - free(v1alpha2_resource_claim->api_version); - v1alpha2_resource_claim->api_version = NULL; - } - if (v1alpha2_resource_claim->kind) { - free(v1alpha2_resource_claim->kind); - v1alpha2_resource_claim->kind = NULL; - } - if (v1alpha2_resource_claim->metadata) { - v1_object_meta_free(v1alpha2_resource_claim->metadata); - v1alpha2_resource_claim->metadata = NULL; - } - if (v1alpha2_resource_claim->spec) { - v1alpha2_resource_claim_spec_free(v1alpha2_resource_claim->spec); - v1alpha2_resource_claim->spec = NULL; - } - if (v1alpha2_resource_claim->status) { - v1alpha2_resource_claim_status_free(v1alpha2_resource_claim->status); - v1alpha2_resource_claim->status = NULL; - } - free(v1alpha2_resource_claim); -} - -cJSON *v1alpha2_resource_claim_convertToJSON(v1alpha2_resource_claim_t *v1alpha2_resource_claim) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim->api_version - if(v1alpha2_resource_claim->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_claim->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim->kind - if(v1alpha2_resource_claim->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_claim->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim->metadata - if(v1alpha2_resource_claim->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_resource_claim->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_claim->spec - if (!v1alpha2_resource_claim->spec) { - goto fail; - } - cJSON *spec_local_JSON = v1alpha2_resource_claim_spec_convertToJSON(v1alpha2_resource_claim->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - - - // v1alpha2_resource_claim->status - if(v1alpha2_resource_claim->status) { - cJSON *status_local_JSON = v1alpha2_resource_claim_status_convertToJSON(v1alpha2_resource_claim->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_t *v1alpha2_resource_claim_parseFromJSON(cJSON *v1alpha2_resource_claimJSON){ - - v1alpha2_resource_claim_t *v1alpha2_resource_claim_local_var = NULL; - - // define the local variable for v1alpha2_resource_claim->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_claim->spec - v1alpha2_resource_claim_spec_t *spec_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_claim->status - v1alpha2_resource_claim_status_t *status_local_nonprim = NULL; - - // v1alpha2_resource_claim->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claimJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claimJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claimJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_resource_claim->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claimJSON, "spec"); - if (!spec) { - goto end; - } - - - spec_local_nonprim = v1alpha2_resource_claim_spec_parseFromJSON(spec); //nonprimitive - - // v1alpha2_resource_claim->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claimJSON, "status"); - if (status) { - status_local_nonprim = v1alpha2_resource_claim_status_parseFromJSON(status); //nonprimitive - } - - - v1alpha2_resource_claim_local_var = v1alpha2_resource_claim_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec_local_nonprim, - status ? status_local_nonprim : NULL - ); - - return v1alpha2_resource_claim_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha2_resource_claim_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1alpha2_resource_claim_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim.h b/kubernetes/model/v1alpha2_resource_claim.h deleted file mode 100644 index 057ff4a8..00000000 --- a/kubernetes/model/v1alpha2_resource_claim.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * v1alpha2_resource_claim.h - * - * ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. - */ - -#ifndef _v1alpha2_resource_claim_H_ -#define _v1alpha2_resource_claim_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_t v1alpha2_resource_claim_t; - -#include "v1_object_meta.h" -#include "v1alpha2_resource_claim_spec.h" -#include "v1alpha2_resource_claim_status.h" - - - -typedef struct v1alpha2_resource_claim_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha2_resource_claim_spec_t *spec; //model - struct v1alpha2_resource_claim_status_t *status; //model - -} v1alpha2_resource_claim_t; - -v1alpha2_resource_claim_t *v1alpha2_resource_claim_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_resource_claim_spec_t *spec, - v1alpha2_resource_claim_status_t *status -); - -void v1alpha2_resource_claim_free(v1alpha2_resource_claim_t *v1alpha2_resource_claim); - -v1alpha2_resource_claim_t *v1alpha2_resource_claim_parseFromJSON(cJSON *v1alpha2_resource_claimJSON); - -cJSON *v1alpha2_resource_claim_convertToJSON(v1alpha2_resource_claim_t *v1alpha2_resource_claim); - -#endif /* _v1alpha2_resource_claim_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_consumer_reference.c b/kubernetes/model/v1alpha2_resource_claim_consumer_reference.c deleted file mode 100644 index 3095c34a..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_consumer_reference.c +++ /dev/null @@ -1,157 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_consumer_reference.h" - - - -v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference_create( - char *api_group, - char *name, - char *resource, - char *uid - ) { - v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference_local_var = malloc(sizeof(v1alpha2_resource_claim_consumer_reference_t)); - if (!v1alpha2_resource_claim_consumer_reference_local_var) { - return NULL; - } - v1alpha2_resource_claim_consumer_reference_local_var->api_group = api_group; - v1alpha2_resource_claim_consumer_reference_local_var->name = name; - v1alpha2_resource_claim_consumer_reference_local_var->resource = resource; - v1alpha2_resource_claim_consumer_reference_local_var->uid = uid; - - return v1alpha2_resource_claim_consumer_reference_local_var; -} - - -void v1alpha2_resource_claim_consumer_reference_free(v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference) { - if(NULL == v1alpha2_resource_claim_consumer_reference){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_consumer_reference->api_group) { - free(v1alpha2_resource_claim_consumer_reference->api_group); - v1alpha2_resource_claim_consumer_reference->api_group = NULL; - } - if (v1alpha2_resource_claim_consumer_reference->name) { - free(v1alpha2_resource_claim_consumer_reference->name); - v1alpha2_resource_claim_consumer_reference->name = NULL; - } - if (v1alpha2_resource_claim_consumer_reference->resource) { - free(v1alpha2_resource_claim_consumer_reference->resource); - v1alpha2_resource_claim_consumer_reference->resource = NULL; - } - if (v1alpha2_resource_claim_consumer_reference->uid) { - free(v1alpha2_resource_claim_consumer_reference->uid); - v1alpha2_resource_claim_consumer_reference->uid = NULL; - } - free(v1alpha2_resource_claim_consumer_reference); -} - -cJSON *v1alpha2_resource_claim_consumer_reference_convertToJSON(v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_consumer_reference->api_group - if(v1alpha2_resource_claim_consumer_reference->api_group) { - if(cJSON_AddStringToObject(item, "apiGroup", v1alpha2_resource_claim_consumer_reference->api_group) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_consumer_reference->name - if (!v1alpha2_resource_claim_consumer_reference->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1alpha2_resource_claim_consumer_reference->name) == NULL) { - goto fail; //String - } - - - // v1alpha2_resource_claim_consumer_reference->resource - if (!v1alpha2_resource_claim_consumer_reference->resource) { - goto fail; - } - if(cJSON_AddStringToObject(item, "resource", v1alpha2_resource_claim_consumer_reference->resource) == NULL) { - goto fail; //String - } - - - // v1alpha2_resource_claim_consumer_reference->uid - if (!v1alpha2_resource_claim_consumer_reference->uid) { - goto fail; - } - if(cJSON_AddStringToObject(item, "uid", v1alpha2_resource_claim_consumer_reference->uid) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference_parseFromJSON(cJSON *v1alpha2_resource_claim_consumer_referenceJSON){ - - v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference_local_var = NULL; - - // v1alpha2_resource_claim_consumer_reference->api_group - cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_consumer_referenceJSON, "apiGroup"); - if (api_group) { - if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_consumer_reference->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_consumer_referenceJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - // v1alpha2_resource_claim_consumer_reference->resource - cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_consumer_referenceJSON, "resource"); - if (!resource) { - goto end; - } - - - if(!cJSON_IsString(resource)) - { - goto end; //String - } - - // v1alpha2_resource_claim_consumer_reference->uid - cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_consumer_referenceJSON, "uid"); - if (!uid) { - goto end; - } - - - if(!cJSON_IsString(uid)) - { - goto end; //String - } - - - v1alpha2_resource_claim_consumer_reference_local_var = v1alpha2_resource_claim_consumer_reference_create ( - api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, - strdup(name->valuestring), - strdup(resource->valuestring), - strdup(uid->valuestring) - ); - - return v1alpha2_resource_claim_consumer_reference_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_consumer_reference.h b/kubernetes/model/v1alpha2_resource_claim_consumer_reference.h deleted file mode 100644 index 5a798d55..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_consumer_reference.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1alpha2_resource_claim_consumer_reference.h - * - * ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim. - */ - -#ifndef _v1alpha2_resource_claim_consumer_reference_H_ -#define _v1alpha2_resource_claim_consumer_reference_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_consumer_reference_t v1alpha2_resource_claim_consumer_reference_t; - - - - -typedef struct v1alpha2_resource_claim_consumer_reference_t { - char *api_group; // string - char *name; // string - char *resource; // string - char *uid; // string - -} v1alpha2_resource_claim_consumer_reference_t; - -v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference_create( - char *api_group, - char *name, - char *resource, - char *uid -); - -void v1alpha2_resource_claim_consumer_reference_free(v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference); - -v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference_parseFromJSON(cJSON *v1alpha2_resource_claim_consumer_referenceJSON); - -cJSON *v1alpha2_resource_claim_consumer_reference_convertToJSON(v1alpha2_resource_claim_consumer_reference_t *v1alpha2_resource_claim_consumer_reference); - -#endif /* _v1alpha2_resource_claim_consumer_reference_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_list.c b/kubernetes/model/v1alpha2_resource_claim_list.c deleted file mode 100644 index 8d6308cd..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_list.h" - - - -v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list_local_var = malloc(sizeof(v1alpha2_resource_claim_list_t)); - if (!v1alpha2_resource_claim_list_local_var) { - return NULL; - } - v1alpha2_resource_claim_list_local_var->api_version = api_version; - v1alpha2_resource_claim_list_local_var->items = items; - v1alpha2_resource_claim_list_local_var->kind = kind; - v1alpha2_resource_claim_list_local_var->metadata = metadata; - - return v1alpha2_resource_claim_list_local_var; -} - - -void v1alpha2_resource_claim_list_free(v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list) { - if(NULL == v1alpha2_resource_claim_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_list->api_version) { - free(v1alpha2_resource_claim_list->api_version); - v1alpha2_resource_claim_list->api_version = NULL; - } - if (v1alpha2_resource_claim_list->items) { - list_ForEach(listEntry, v1alpha2_resource_claim_list->items) { - v1alpha2_resource_claim_free(listEntry->data); - } - list_freeList(v1alpha2_resource_claim_list->items); - v1alpha2_resource_claim_list->items = NULL; - } - if (v1alpha2_resource_claim_list->kind) { - free(v1alpha2_resource_claim_list->kind); - v1alpha2_resource_claim_list->kind = NULL; - } - if (v1alpha2_resource_claim_list->metadata) { - v1_list_meta_free(v1alpha2_resource_claim_list->metadata); - v1alpha2_resource_claim_list->metadata = NULL; - } - free(v1alpha2_resource_claim_list); -} - -cJSON *v1alpha2_resource_claim_list_convertToJSON(v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_list->api_version - if(v1alpha2_resource_claim_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_claim_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_list->items - if (!v1alpha2_resource_claim_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha2_resource_claim_list->items) { - list_ForEach(itemsListEntry, v1alpha2_resource_claim_list->items) { - cJSON *itemLocal = v1alpha2_resource_claim_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha2_resource_claim_list->kind - if(v1alpha2_resource_claim_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_claim_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_list->metadata - if(v1alpha2_resource_claim_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_resource_claim_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list_parseFromJSON(cJSON *v1alpha2_resource_claim_listJSON){ - - v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list_local_var = NULL; - - // define the local list for v1alpha2_resource_claim_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha2_resource_claim_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_resource_claim_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_claim_t *itemsItem = v1alpha2_resource_claim_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha2_resource_claim_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha2_resource_claim_list_local_var = v1alpha2_resource_claim_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha2_resource_claim_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha2_resource_claim_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_list.h b/kubernetes/model/v1alpha2_resource_claim_list.h deleted file mode 100644 index 9211a723..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_claim_list.h - * - * ResourceClaimList is a collection of claims. - */ - -#ifndef _v1alpha2_resource_claim_list_H_ -#define _v1alpha2_resource_claim_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_list_t v1alpha2_resource_claim_list_t; - -#include "v1_list_meta.h" -#include "v1alpha2_resource_claim.h" - - - -typedef struct v1alpha2_resource_claim_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha2_resource_claim_list_t; - -v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha2_resource_claim_list_free(v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list); - -v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list_parseFromJSON(cJSON *v1alpha2_resource_claim_listJSON); - -cJSON *v1alpha2_resource_claim_list_convertToJSON(v1alpha2_resource_claim_list_t *v1alpha2_resource_claim_list); - -#endif /* _v1alpha2_resource_claim_list_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_parameters.c b/kubernetes/model/v1alpha2_resource_claim_parameters.c deleted file mode 100644 index ef29569d..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_parameters.c +++ /dev/null @@ -1,246 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_parameters.h" - - - -v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters_create( - char *api_version, - list_t *driver_requests, - v1alpha2_resource_claim_parameters_reference_t *generated_from, - char *kind, - v1_object_meta_t *metadata, - int shareable - ) { - v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters_local_var = malloc(sizeof(v1alpha2_resource_claim_parameters_t)); - if (!v1alpha2_resource_claim_parameters_local_var) { - return NULL; - } - v1alpha2_resource_claim_parameters_local_var->api_version = api_version; - v1alpha2_resource_claim_parameters_local_var->driver_requests = driver_requests; - v1alpha2_resource_claim_parameters_local_var->generated_from = generated_from; - v1alpha2_resource_claim_parameters_local_var->kind = kind; - v1alpha2_resource_claim_parameters_local_var->metadata = metadata; - v1alpha2_resource_claim_parameters_local_var->shareable = shareable; - - return v1alpha2_resource_claim_parameters_local_var; -} - - -void v1alpha2_resource_claim_parameters_free(v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters) { - if(NULL == v1alpha2_resource_claim_parameters){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_parameters->api_version) { - free(v1alpha2_resource_claim_parameters->api_version); - v1alpha2_resource_claim_parameters->api_version = NULL; - } - if (v1alpha2_resource_claim_parameters->driver_requests) { - list_ForEach(listEntry, v1alpha2_resource_claim_parameters->driver_requests) { - v1alpha2_driver_requests_free(listEntry->data); - } - list_freeList(v1alpha2_resource_claim_parameters->driver_requests); - v1alpha2_resource_claim_parameters->driver_requests = NULL; - } - if (v1alpha2_resource_claim_parameters->generated_from) { - v1alpha2_resource_claim_parameters_reference_free(v1alpha2_resource_claim_parameters->generated_from); - v1alpha2_resource_claim_parameters->generated_from = NULL; - } - if (v1alpha2_resource_claim_parameters->kind) { - free(v1alpha2_resource_claim_parameters->kind); - v1alpha2_resource_claim_parameters->kind = NULL; - } - if (v1alpha2_resource_claim_parameters->metadata) { - v1_object_meta_free(v1alpha2_resource_claim_parameters->metadata); - v1alpha2_resource_claim_parameters->metadata = NULL; - } - free(v1alpha2_resource_claim_parameters); -} - -cJSON *v1alpha2_resource_claim_parameters_convertToJSON(v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_parameters->api_version - if(v1alpha2_resource_claim_parameters->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_claim_parameters->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_parameters->driver_requests - if(v1alpha2_resource_claim_parameters->driver_requests) { - cJSON *driver_requests = cJSON_AddArrayToObject(item, "driverRequests"); - if(driver_requests == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *driver_requestsListEntry; - if (v1alpha2_resource_claim_parameters->driver_requests) { - list_ForEach(driver_requestsListEntry, v1alpha2_resource_claim_parameters->driver_requests) { - cJSON *itemLocal = v1alpha2_driver_requests_convertToJSON(driver_requestsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(driver_requests, itemLocal); - } - } - } - - - // v1alpha2_resource_claim_parameters->generated_from - if(v1alpha2_resource_claim_parameters->generated_from) { - cJSON *generated_from_local_JSON = v1alpha2_resource_claim_parameters_reference_convertToJSON(v1alpha2_resource_claim_parameters->generated_from); - if(generated_from_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "generatedFrom", generated_from_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_claim_parameters->kind - if(v1alpha2_resource_claim_parameters->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_claim_parameters->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_parameters->metadata - if(v1alpha2_resource_claim_parameters->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_resource_claim_parameters->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_claim_parameters->shareable - if(v1alpha2_resource_claim_parameters->shareable) { - if(cJSON_AddBoolToObject(item, "shareable", v1alpha2_resource_claim_parameters->shareable) == NULL) { - goto fail; //Bool - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters_parseFromJSON(cJSON *v1alpha2_resource_claim_parametersJSON){ - - v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters_local_var = NULL; - - // define the local list for v1alpha2_resource_claim_parameters->driver_requests - list_t *driver_requestsList = NULL; - - // define the local variable for v1alpha2_resource_claim_parameters->generated_from - v1alpha2_resource_claim_parameters_reference_t *generated_from_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_claim_parameters->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_resource_claim_parameters->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parametersJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_parameters->driver_requests - cJSON *driver_requests = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parametersJSON, "driverRequests"); - if (driver_requests) { - cJSON *driver_requests_local_nonprimitive = NULL; - if(!cJSON_IsArray(driver_requests)){ - goto end; //nonprimitive container - } - - driver_requestsList = list_createList(); - - cJSON_ArrayForEach(driver_requests_local_nonprimitive,driver_requests ) - { - if(!cJSON_IsObject(driver_requests_local_nonprimitive)){ - goto end; - } - v1alpha2_driver_requests_t *driver_requestsItem = v1alpha2_driver_requests_parseFromJSON(driver_requests_local_nonprimitive); - - list_addElement(driver_requestsList, driver_requestsItem); - } - } - - // v1alpha2_resource_claim_parameters->generated_from - cJSON *generated_from = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parametersJSON, "generatedFrom"); - if (generated_from) { - generated_from_local_nonprim = v1alpha2_resource_claim_parameters_reference_parseFromJSON(generated_from); //nonprimitive - } - - // v1alpha2_resource_claim_parameters->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parametersJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_parameters->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parametersJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_resource_claim_parameters->shareable - cJSON *shareable = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parametersJSON, "shareable"); - if (shareable) { - if(!cJSON_IsBool(shareable)) - { - goto end; //Bool - } - } - - - v1alpha2_resource_claim_parameters_local_var = v1alpha2_resource_claim_parameters_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - driver_requests ? driver_requestsList : NULL, - generated_from ? generated_from_local_nonprim : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - shareable ? shareable->valueint : 0 - ); - - return v1alpha2_resource_claim_parameters_local_var; -end: - if (driver_requestsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, driver_requestsList) { - v1alpha2_driver_requests_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(driver_requestsList); - driver_requestsList = NULL; - } - if (generated_from_local_nonprim) { - v1alpha2_resource_claim_parameters_reference_free(generated_from_local_nonprim); - generated_from_local_nonprim = NULL; - } - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_parameters.h b/kubernetes/model/v1alpha2_resource_claim_parameters.h deleted file mode 100644 index a7e0754c..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_parameters.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * v1alpha2_resource_claim_parameters.h - * - * ResourceClaimParameters defines resource requests for a ResourceClaim in an in-tree format understood by Kubernetes. - */ - -#ifndef _v1alpha2_resource_claim_parameters_H_ -#define _v1alpha2_resource_claim_parameters_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_parameters_t v1alpha2_resource_claim_parameters_t; - -#include "v1_object_meta.h" -#include "v1alpha2_driver_requests.h" -#include "v1alpha2_resource_claim_parameters_reference.h" - - - -typedef struct v1alpha2_resource_claim_parameters_t { - char *api_version; // string - list_t *driver_requests; //nonprimitive container - struct v1alpha2_resource_claim_parameters_reference_t *generated_from; //model - char *kind; // string - struct v1_object_meta_t *metadata; //model - int shareable; //boolean - -} v1alpha2_resource_claim_parameters_t; - -v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters_create( - char *api_version, - list_t *driver_requests, - v1alpha2_resource_claim_parameters_reference_t *generated_from, - char *kind, - v1_object_meta_t *metadata, - int shareable -); - -void v1alpha2_resource_claim_parameters_free(v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters); - -v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters_parseFromJSON(cJSON *v1alpha2_resource_claim_parametersJSON); - -cJSON *v1alpha2_resource_claim_parameters_convertToJSON(v1alpha2_resource_claim_parameters_t *v1alpha2_resource_claim_parameters); - -#endif /* _v1alpha2_resource_claim_parameters_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_parameters_list.c b/kubernetes/model/v1alpha2_resource_claim_parameters_list.c deleted file mode 100644 index 8feff653..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_parameters_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_parameters_list.h" - - - -v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list_local_var = malloc(sizeof(v1alpha2_resource_claim_parameters_list_t)); - if (!v1alpha2_resource_claim_parameters_list_local_var) { - return NULL; - } - v1alpha2_resource_claim_parameters_list_local_var->api_version = api_version; - v1alpha2_resource_claim_parameters_list_local_var->items = items; - v1alpha2_resource_claim_parameters_list_local_var->kind = kind; - v1alpha2_resource_claim_parameters_list_local_var->metadata = metadata; - - return v1alpha2_resource_claim_parameters_list_local_var; -} - - -void v1alpha2_resource_claim_parameters_list_free(v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list) { - if(NULL == v1alpha2_resource_claim_parameters_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_parameters_list->api_version) { - free(v1alpha2_resource_claim_parameters_list->api_version); - v1alpha2_resource_claim_parameters_list->api_version = NULL; - } - if (v1alpha2_resource_claim_parameters_list->items) { - list_ForEach(listEntry, v1alpha2_resource_claim_parameters_list->items) { - v1alpha2_resource_claim_parameters_free(listEntry->data); - } - list_freeList(v1alpha2_resource_claim_parameters_list->items); - v1alpha2_resource_claim_parameters_list->items = NULL; - } - if (v1alpha2_resource_claim_parameters_list->kind) { - free(v1alpha2_resource_claim_parameters_list->kind); - v1alpha2_resource_claim_parameters_list->kind = NULL; - } - if (v1alpha2_resource_claim_parameters_list->metadata) { - v1_list_meta_free(v1alpha2_resource_claim_parameters_list->metadata); - v1alpha2_resource_claim_parameters_list->metadata = NULL; - } - free(v1alpha2_resource_claim_parameters_list); -} - -cJSON *v1alpha2_resource_claim_parameters_list_convertToJSON(v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_parameters_list->api_version - if(v1alpha2_resource_claim_parameters_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_claim_parameters_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_parameters_list->items - if (!v1alpha2_resource_claim_parameters_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha2_resource_claim_parameters_list->items) { - list_ForEach(itemsListEntry, v1alpha2_resource_claim_parameters_list->items) { - cJSON *itemLocal = v1alpha2_resource_claim_parameters_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha2_resource_claim_parameters_list->kind - if(v1alpha2_resource_claim_parameters_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_claim_parameters_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_parameters_list->metadata - if(v1alpha2_resource_claim_parameters_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_resource_claim_parameters_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list_parseFromJSON(cJSON *v1alpha2_resource_claim_parameters_listJSON){ - - v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list_local_var = NULL; - - // define the local list for v1alpha2_resource_claim_parameters_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha2_resource_claim_parameters_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_resource_claim_parameters_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parameters_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_parameters_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parameters_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_claim_parameters_t *itemsItem = v1alpha2_resource_claim_parameters_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha2_resource_claim_parameters_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parameters_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_parameters_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parameters_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha2_resource_claim_parameters_list_local_var = v1alpha2_resource_claim_parameters_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha2_resource_claim_parameters_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha2_resource_claim_parameters_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_parameters_list.h b/kubernetes/model/v1alpha2_resource_claim_parameters_list.h deleted file mode 100644 index f1407d7c..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_parameters_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_claim_parameters_list.h - * - * ResourceClaimParametersList is a collection of ResourceClaimParameters. - */ - -#ifndef _v1alpha2_resource_claim_parameters_list_H_ -#define _v1alpha2_resource_claim_parameters_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_parameters_list_t v1alpha2_resource_claim_parameters_list_t; - -#include "v1_list_meta.h" -#include "v1alpha2_resource_claim_parameters.h" - - - -typedef struct v1alpha2_resource_claim_parameters_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha2_resource_claim_parameters_list_t; - -v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha2_resource_claim_parameters_list_free(v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list); - -v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list_parseFromJSON(cJSON *v1alpha2_resource_claim_parameters_listJSON); - -cJSON *v1alpha2_resource_claim_parameters_list_convertToJSON(v1alpha2_resource_claim_parameters_list_t *v1alpha2_resource_claim_parameters_list); - -#endif /* _v1alpha2_resource_claim_parameters_list_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_parameters_reference.c b/kubernetes/model/v1alpha2_resource_claim_parameters_reference.c deleted file mode 100644 index 0acbe1e8..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_parameters_reference.c +++ /dev/null @@ -1,129 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_parameters_reference.h" - - - -v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference_create( - char *api_group, - char *kind, - char *name - ) { - v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference_local_var = malloc(sizeof(v1alpha2_resource_claim_parameters_reference_t)); - if (!v1alpha2_resource_claim_parameters_reference_local_var) { - return NULL; - } - v1alpha2_resource_claim_parameters_reference_local_var->api_group = api_group; - v1alpha2_resource_claim_parameters_reference_local_var->kind = kind; - v1alpha2_resource_claim_parameters_reference_local_var->name = name; - - return v1alpha2_resource_claim_parameters_reference_local_var; -} - - -void v1alpha2_resource_claim_parameters_reference_free(v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference) { - if(NULL == v1alpha2_resource_claim_parameters_reference){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_parameters_reference->api_group) { - free(v1alpha2_resource_claim_parameters_reference->api_group); - v1alpha2_resource_claim_parameters_reference->api_group = NULL; - } - if (v1alpha2_resource_claim_parameters_reference->kind) { - free(v1alpha2_resource_claim_parameters_reference->kind); - v1alpha2_resource_claim_parameters_reference->kind = NULL; - } - if (v1alpha2_resource_claim_parameters_reference->name) { - free(v1alpha2_resource_claim_parameters_reference->name); - v1alpha2_resource_claim_parameters_reference->name = NULL; - } - free(v1alpha2_resource_claim_parameters_reference); -} - -cJSON *v1alpha2_resource_claim_parameters_reference_convertToJSON(v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_parameters_reference->api_group - if(v1alpha2_resource_claim_parameters_reference->api_group) { - if(cJSON_AddStringToObject(item, "apiGroup", v1alpha2_resource_claim_parameters_reference->api_group) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_parameters_reference->kind - if (!v1alpha2_resource_claim_parameters_reference->kind) { - goto fail; - } - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_claim_parameters_reference->kind) == NULL) { - goto fail; //String - } - - - // v1alpha2_resource_claim_parameters_reference->name - if (!v1alpha2_resource_claim_parameters_reference->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1alpha2_resource_claim_parameters_reference->name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference_parseFromJSON(cJSON *v1alpha2_resource_claim_parameters_referenceJSON){ - - v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference_local_var = NULL; - - // v1alpha2_resource_claim_parameters_reference->api_group - cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parameters_referenceJSON, "apiGroup"); - if (api_group) { - if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_parameters_reference->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parameters_referenceJSON, "kind"); - if (!kind) { - goto end; - } - - - if(!cJSON_IsString(kind)) - { - goto end; //String - } - - // v1alpha2_resource_claim_parameters_reference->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_parameters_referenceJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - - v1alpha2_resource_claim_parameters_reference_local_var = v1alpha2_resource_claim_parameters_reference_create ( - api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, - strdup(kind->valuestring), - strdup(name->valuestring) - ); - - return v1alpha2_resource_claim_parameters_reference_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_parameters_reference.h b/kubernetes/model/v1alpha2_resource_claim_parameters_reference.h deleted file mode 100644 index 9edb6694..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_parameters_reference.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * v1alpha2_resource_claim_parameters_reference.h - * - * ResourceClaimParametersReference contains enough information to let you locate the parameters for a ResourceClaim. The object must be in the same namespace as the ResourceClaim. - */ - -#ifndef _v1alpha2_resource_claim_parameters_reference_H_ -#define _v1alpha2_resource_claim_parameters_reference_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_parameters_reference_t v1alpha2_resource_claim_parameters_reference_t; - - - - -typedef struct v1alpha2_resource_claim_parameters_reference_t { - char *api_group; // string - char *kind; // string - char *name; // string - -} v1alpha2_resource_claim_parameters_reference_t; - -v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference_create( - char *api_group, - char *kind, - char *name -); - -void v1alpha2_resource_claim_parameters_reference_free(v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference); - -v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference_parseFromJSON(cJSON *v1alpha2_resource_claim_parameters_referenceJSON); - -cJSON *v1alpha2_resource_claim_parameters_reference_convertToJSON(v1alpha2_resource_claim_parameters_reference_t *v1alpha2_resource_claim_parameters_reference); - -#endif /* _v1alpha2_resource_claim_parameters_reference_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_scheduling_status.c b/kubernetes/model/v1alpha2_resource_claim_scheduling_status.c deleted file mode 100644 index e5aeef49..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_scheduling_status.c +++ /dev/null @@ -1,131 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_scheduling_status.h" - - - -v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status_create( - char *name, - list_t *unsuitable_nodes - ) { - v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status_local_var = malloc(sizeof(v1alpha2_resource_claim_scheduling_status_t)); - if (!v1alpha2_resource_claim_scheduling_status_local_var) { - return NULL; - } - v1alpha2_resource_claim_scheduling_status_local_var->name = name; - v1alpha2_resource_claim_scheduling_status_local_var->unsuitable_nodes = unsuitable_nodes; - - return v1alpha2_resource_claim_scheduling_status_local_var; -} - - -void v1alpha2_resource_claim_scheduling_status_free(v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status) { - if(NULL == v1alpha2_resource_claim_scheduling_status){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_scheduling_status->name) { - free(v1alpha2_resource_claim_scheduling_status->name); - v1alpha2_resource_claim_scheduling_status->name = NULL; - } - if (v1alpha2_resource_claim_scheduling_status->unsuitable_nodes) { - list_ForEach(listEntry, v1alpha2_resource_claim_scheduling_status->unsuitable_nodes) { - free(listEntry->data); - } - list_freeList(v1alpha2_resource_claim_scheduling_status->unsuitable_nodes); - v1alpha2_resource_claim_scheduling_status->unsuitable_nodes = NULL; - } - free(v1alpha2_resource_claim_scheduling_status); -} - -cJSON *v1alpha2_resource_claim_scheduling_status_convertToJSON(v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_scheduling_status->name - if(v1alpha2_resource_claim_scheduling_status->name) { - if(cJSON_AddStringToObject(item, "name", v1alpha2_resource_claim_scheduling_status->name) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_scheduling_status->unsuitable_nodes - if(v1alpha2_resource_claim_scheduling_status->unsuitable_nodes) { - cJSON *unsuitable_nodes = cJSON_AddArrayToObject(item, "unsuitableNodes"); - if(unsuitable_nodes == NULL) { - goto fail; //primitive container - } - - listEntry_t *unsuitable_nodesListEntry; - list_ForEach(unsuitable_nodesListEntry, v1alpha2_resource_claim_scheduling_status->unsuitable_nodes) { - if(cJSON_AddStringToObject(unsuitable_nodes, "", (char*)unsuitable_nodesListEntry->data) == NULL) - { - goto fail; - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status_parseFromJSON(cJSON *v1alpha2_resource_claim_scheduling_statusJSON){ - - v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status_local_var = NULL; - - // define the local list for v1alpha2_resource_claim_scheduling_status->unsuitable_nodes - list_t *unsuitable_nodesList = NULL; - - // v1alpha2_resource_claim_scheduling_status->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_scheduling_statusJSON, "name"); - if (name) { - if(!cJSON_IsString(name) && !cJSON_IsNull(name)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_scheduling_status->unsuitable_nodes - cJSON *unsuitable_nodes = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_scheduling_statusJSON, "unsuitableNodes"); - if (unsuitable_nodes) { - cJSON *unsuitable_nodes_local = NULL; - if(!cJSON_IsArray(unsuitable_nodes)) { - goto end;//primitive container - } - unsuitable_nodesList = list_createList(); - - cJSON_ArrayForEach(unsuitable_nodes_local, unsuitable_nodes) - { - if(!cJSON_IsString(unsuitable_nodes_local)) - { - goto end; - } - list_addElement(unsuitable_nodesList , strdup(unsuitable_nodes_local->valuestring)); - } - } - - - v1alpha2_resource_claim_scheduling_status_local_var = v1alpha2_resource_claim_scheduling_status_create ( - name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, - unsuitable_nodes ? unsuitable_nodesList : NULL - ); - - return v1alpha2_resource_claim_scheduling_status_local_var; -end: - if (unsuitable_nodesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, unsuitable_nodesList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(unsuitable_nodesList); - unsuitable_nodesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_scheduling_status.h b/kubernetes/model/v1alpha2_resource_claim_scheduling_status.h deleted file mode 100644 index 8f84303e..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_scheduling_status.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1alpha2_resource_claim_scheduling_status.h - * - * ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode. - */ - -#ifndef _v1alpha2_resource_claim_scheduling_status_H_ -#define _v1alpha2_resource_claim_scheduling_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_scheduling_status_t v1alpha2_resource_claim_scheduling_status_t; - - - - -typedef struct v1alpha2_resource_claim_scheduling_status_t { - char *name; // string - list_t *unsuitable_nodes; //primitive container - -} v1alpha2_resource_claim_scheduling_status_t; - -v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status_create( - char *name, - list_t *unsuitable_nodes -); - -void v1alpha2_resource_claim_scheduling_status_free(v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status); - -v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status_parseFromJSON(cJSON *v1alpha2_resource_claim_scheduling_statusJSON); - -cJSON *v1alpha2_resource_claim_scheduling_status_convertToJSON(v1alpha2_resource_claim_scheduling_status_t *v1alpha2_resource_claim_scheduling_status); - -#endif /* _v1alpha2_resource_claim_scheduling_status_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_spec.c b/kubernetes/model/v1alpha2_resource_claim_spec.c deleted file mode 100644 index 13e791de..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_spec.c +++ /dev/null @@ -1,134 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_spec.h" - - - -v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec_create( - char *allocation_mode, - v1alpha2_resource_claim_parameters_reference_t *parameters_ref, - char *resource_class_name - ) { - v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec_local_var = malloc(sizeof(v1alpha2_resource_claim_spec_t)); - if (!v1alpha2_resource_claim_spec_local_var) { - return NULL; - } - v1alpha2_resource_claim_spec_local_var->allocation_mode = allocation_mode; - v1alpha2_resource_claim_spec_local_var->parameters_ref = parameters_ref; - v1alpha2_resource_claim_spec_local_var->resource_class_name = resource_class_name; - - return v1alpha2_resource_claim_spec_local_var; -} - - -void v1alpha2_resource_claim_spec_free(v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec) { - if(NULL == v1alpha2_resource_claim_spec){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_spec->allocation_mode) { - free(v1alpha2_resource_claim_spec->allocation_mode); - v1alpha2_resource_claim_spec->allocation_mode = NULL; - } - if (v1alpha2_resource_claim_spec->parameters_ref) { - v1alpha2_resource_claim_parameters_reference_free(v1alpha2_resource_claim_spec->parameters_ref); - v1alpha2_resource_claim_spec->parameters_ref = NULL; - } - if (v1alpha2_resource_claim_spec->resource_class_name) { - free(v1alpha2_resource_claim_spec->resource_class_name); - v1alpha2_resource_claim_spec->resource_class_name = NULL; - } - free(v1alpha2_resource_claim_spec); -} - -cJSON *v1alpha2_resource_claim_spec_convertToJSON(v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_spec->allocation_mode - if(v1alpha2_resource_claim_spec->allocation_mode) { - if(cJSON_AddStringToObject(item, "allocationMode", v1alpha2_resource_claim_spec->allocation_mode) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_spec->parameters_ref - if(v1alpha2_resource_claim_spec->parameters_ref) { - cJSON *parameters_ref_local_JSON = v1alpha2_resource_claim_parameters_reference_convertToJSON(v1alpha2_resource_claim_spec->parameters_ref); - if(parameters_ref_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "parametersRef", parameters_ref_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_claim_spec->resource_class_name - if (!v1alpha2_resource_claim_spec->resource_class_name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "resourceClassName", v1alpha2_resource_claim_spec->resource_class_name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec_parseFromJSON(cJSON *v1alpha2_resource_claim_specJSON){ - - v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec_local_var = NULL; - - // define the local variable for v1alpha2_resource_claim_spec->parameters_ref - v1alpha2_resource_claim_parameters_reference_t *parameters_ref_local_nonprim = NULL; - - // v1alpha2_resource_claim_spec->allocation_mode - cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_specJSON, "allocationMode"); - if (allocation_mode) { - if(!cJSON_IsString(allocation_mode) && !cJSON_IsNull(allocation_mode)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_spec->parameters_ref - cJSON *parameters_ref = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_specJSON, "parametersRef"); - if (parameters_ref) { - parameters_ref_local_nonprim = v1alpha2_resource_claim_parameters_reference_parseFromJSON(parameters_ref); //nonprimitive - } - - // v1alpha2_resource_claim_spec->resource_class_name - cJSON *resource_class_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_specJSON, "resourceClassName"); - if (!resource_class_name) { - goto end; - } - - - if(!cJSON_IsString(resource_class_name)) - { - goto end; //String - } - - - v1alpha2_resource_claim_spec_local_var = v1alpha2_resource_claim_spec_create ( - allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, - parameters_ref ? parameters_ref_local_nonprim : NULL, - strdup(resource_class_name->valuestring) - ); - - return v1alpha2_resource_claim_spec_local_var; -end: - if (parameters_ref_local_nonprim) { - v1alpha2_resource_claim_parameters_reference_free(parameters_ref_local_nonprim); - parameters_ref_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_spec.h b/kubernetes/model/v1alpha2_resource_claim_spec.h deleted file mode 100644 index 4832e393..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_spec.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * v1alpha2_resource_claim_spec.h - * - * ResourceClaimSpec defines how a resource is to be allocated. - */ - -#ifndef _v1alpha2_resource_claim_spec_H_ -#define _v1alpha2_resource_claim_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_spec_t v1alpha2_resource_claim_spec_t; - -#include "v1alpha2_resource_claim_parameters_reference.h" - - - -typedef struct v1alpha2_resource_claim_spec_t { - char *allocation_mode; // string - struct v1alpha2_resource_claim_parameters_reference_t *parameters_ref; //model - char *resource_class_name; // string - -} v1alpha2_resource_claim_spec_t; - -v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec_create( - char *allocation_mode, - v1alpha2_resource_claim_parameters_reference_t *parameters_ref, - char *resource_class_name -); - -void v1alpha2_resource_claim_spec_free(v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec); - -v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec_parseFromJSON(cJSON *v1alpha2_resource_claim_specJSON); - -cJSON *v1alpha2_resource_claim_spec_convertToJSON(v1alpha2_resource_claim_spec_t *v1alpha2_resource_claim_spec); - -#endif /* _v1alpha2_resource_claim_spec_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_status.c b/kubernetes/model/v1alpha2_resource_claim_status.c deleted file mode 100644 index f68753cd..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_status.c +++ /dev/null @@ -1,189 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_status.h" - - - -v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status_create( - v1alpha2_allocation_result_t *allocation, - int deallocation_requested, - char *driver_name, - list_t *reserved_for - ) { - v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status_local_var = malloc(sizeof(v1alpha2_resource_claim_status_t)); - if (!v1alpha2_resource_claim_status_local_var) { - return NULL; - } - v1alpha2_resource_claim_status_local_var->allocation = allocation; - v1alpha2_resource_claim_status_local_var->deallocation_requested = deallocation_requested; - v1alpha2_resource_claim_status_local_var->driver_name = driver_name; - v1alpha2_resource_claim_status_local_var->reserved_for = reserved_for; - - return v1alpha2_resource_claim_status_local_var; -} - - -void v1alpha2_resource_claim_status_free(v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status) { - if(NULL == v1alpha2_resource_claim_status){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_status->allocation) { - v1alpha2_allocation_result_free(v1alpha2_resource_claim_status->allocation); - v1alpha2_resource_claim_status->allocation = NULL; - } - if (v1alpha2_resource_claim_status->driver_name) { - free(v1alpha2_resource_claim_status->driver_name); - v1alpha2_resource_claim_status->driver_name = NULL; - } - if (v1alpha2_resource_claim_status->reserved_for) { - list_ForEach(listEntry, v1alpha2_resource_claim_status->reserved_for) { - v1alpha2_resource_claim_consumer_reference_free(listEntry->data); - } - list_freeList(v1alpha2_resource_claim_status->reserved_for); - v1alpha2_resource_claim_status->reserved_for = NULL; - } - free(v1alpha2_resource_claim_status); -} - -cJSON *v1alpha2_resource_claim_status_convertToJSON(v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_status->allocation - if(v1alpha2_resource_claim_status->allocation) { - cJSON *allocation_local_JSON = v1alpha2_allocation_result_convertToJSON(v1alpha2_resource_claim_status->allocation); - if(allocation_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "allocation", allocation_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_claim_status->deallocation_requested - if(v1alpha2_resource_claim_status->deallocation_requested) { - if(cJSON_AddBoolToObject(item, "deallocationRequested", v1alpha2_resource_claim_status->deallocation_requested) == NULL) { - goto fail; //Bool - } - } - - - // v1alpha2_resource_claim_status->driver_name - if(v1alpha2_resource_claim_status->driver_name) { - if(cJSON_AddStringToObject(item, "driverName", v1alpha2_resource_claim_status->driver_name) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_status->reserved_for - if(v1alpha2_resource_claim_status->reserved_for) { - cJSON *reserved_for = cJSON_AddArrayToObject(item, "reservedFor"); - if(reserved_for == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *reserved_forListEntry; - if (v1alpha2_resource_claim_status->reserved_for) { - list_ForEach(reserved_forListEntry, v1alpha2_resource_claim_status->reserved_for) { - cJSON *itemLocal = v1alpha2_resource_claim_consumer_reference_convertToJSON(reserved_forListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(reserved_for, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status_parseFromJSON(cJSON *v1alpha2_resource_claim_statusJSON){ - - v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status_local_var = NULL; - - // define the local variable for v1alpha2_resource_claim_status->allocation - v1alpha2_allocation_result_t *allocation_local_nonprim = NULL; - - // define the local list for v1alpha2_resource_claim_status->reserved_for - list_t *reserved_forList = NULL; - - // v1alpha2_resource_claim_status->allocation - cJSON *allocation = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_statusJSON, "allocation"); - if (allocation) { - allocation_local_nonprim = v1alpha2_allocation_result_parseFromJSON(allocation); //nonprimitive - } - - // v1alpha2_resource_claim_status->deallocation_requested - cJSON *deallocation_requested = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_statusJSON, "deallocationRequested"); - if (deallocation_requested) { - if(!cJSON_IsBool(deallocation_requested)) - { - goto end; //Bool - } - } - - // v1alpha2_resource_claim_status->driver_name - cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_statusJSON, "driverName"); - if (driver_name) { - if(!cJSON_IsString(driver_name) && !cJSON_IsNull(driver_name)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_status->reserved_for - cJSON *reserved_for = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_statusJSON, "reservedFor"); - if (reserved_for) { - cJSON *reserved_for_local_nonprimitive = NULL; - if(!cJSON_IsArray(reserved_for)){ - goto end; //nonprimitive container - } - - reserved_forList = list_createList(); - - cJSON_ArrayForEach(reserved_for_local_nonprimitive,reserved_for ) - { - if(!cJSON_IsObject(reserved_for_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_claim_consumer_reference_t *reserved_forItem = v1alpha2_resource_claim_consumer_reference_parseFromJSON(reserved_for_local_nonprimitive); - - list_addElement(reserved_forList, reserved_forItem); - } - } - - - v1alpha2_resource_claim_status_local_var = v1alpha2_resource_claim_status_create ( - allocation ? allocation_local_nonprim : NULL, - deallocation_requested ? deallocation_requested->valueint : 0, - driver_name && !cJSON_IsNull(driver_name) ? strdup(driver_name->valuestring) : NULL, - reserved_for ? reserved_forList : NULL - ); - - return v1alpha2_resource_claim_status_local_var; -end: - if (allocation_local_nonprim) { - v1alpha2_allocation_result_free(allocation_local_nonprim); - allocation_local_nonprim = NULL; - } - if (reserved_forList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, reserved_forList) { - v1alpha2_resource_claim_consumer_reference_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(reserved_forList); - reserved_forList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_status.h b/kubernetes/model/v1alpha2_resource_claim_status.h deleted file mode 100644 index ba768234..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_status.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_claim_status.h - * - * ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are. - */ - -#ifndef _v1alpha2_resource_claim_status_H_ -#define _v1alpha2_resource_claim_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_status_t v1alpha2_resource_claim_status_t; - -#include "v1alpha2_allocation_result.h" -#include "v1alpha2_resource_claim_consumer_reference.h" - - - -typedef struct v1alpha2_resource_claim_status_t { - struct v1alpha2_allocation_result_t *allocation; //model - int deallocation_requested; //boolean - char *driver_name; // string - list_t *reserved_for; //nonprimitive container - -} v1alpha2_resource_claim_status_t; - -v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status_create( - v1alpha2_allocation_result_t *allocation, - int deallocation_requested, - char *driver_name, - list_t *reserved_for -); - -void v1alpha2_resource_claim_status_free(v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status); - -v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status_parseFromJSON(cJSON *v1alpha2_resource_claim_statusJSON); - -cJSON *v1alpha2_resource_claim_status_convertToJSON(v1alpha2_resource_claim_status_t *v1alpha2_resource_claim_status); - -#endif /* _v1alpha2_resource_claim_status_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_template.c b/kubernetes/model/v1alpha2_resource_claim_template.c deleted file mode 100644 index 2ea29a8d..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_template.c +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_template.h" - - - -v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_resource_claim_template_spec_t *spec - ) { - v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template_local_var = malloc(sizeof(v1alpha2_resource_claim_template_t)); - if (!v1alpha2_resource_claim_template_local_var) { - return NULL; - } - v1alpha2_resource_claim_template_local_var->api_version = api_version; - v1alpha2_resource_claim_template_local_var->kind = kind; - v1alpha2_resource_claim_template_local_var->metadata = metadata; - v1alpha2_resource_claim_template_local_var->spec = spec; - - return v1alpha2_resource_claim_template_local_var; -} - - -void v1alpha2_resource_claim_template_free(v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template) { - if(NULL == v1alpha2_resource_claim_template){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_template->api_version) { - free(v1alpha2_resource_claim_template->api_version); - v1alpha2_resource_claim_template->api_version = NULL; - } - if (v1alpha2_resource_claim_template->kind) { - free(v1alpha2_resource_claim_template->kind); - v1alpha2_resource_claim_template->kind = NULL; - } - if (v1alpha2_resource_claim_template->metadata) { - v1_object_meta_free(v1alpha2_resource_claim_template->metadata); - v1alpha2_resource_claim_template->metadata = NULL; - } - if (v1alpha2_resource_claim_template->spec) { - v1alpha2_resource_claim_template_spec_free(v1alpha2_resource_claim_template->spec); - v1alpha2_resource_claim_template->spec = NULL; - } - free(v1alpha2_resource_claim_template); -} - -cJSON *v1alpha2_resource_claim_template_convertToJSON(v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_template->api_version - if(v1alpha2_resource_claim_template->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_claim_template->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_template->kind - if(v1alpha2_resource_claim_template->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_claim_template->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_template->metadata - if(v1alpha2_resource_claim_template->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_resource_claim_template->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_claim_template->spec - if (!v1alpha2_resource_claim_template->spec) { - goto fail; - } - cJSON *spec_local_JSON = v1alpha2_resource_claim_template_spec_convertToJSON(v1alpha2_resource_claim_template->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template_parseFromJSON(cJSON *v1alpha2_resource_claim_templateJSON){ - - v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template_local_var = NULL; - - // define the local variable for v1alpha2_resource_claim_template->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_claim_template->spec - v1alpha2_resource_claim_template_spec_t *spec_local_nonprim = NULL; - - // v1alpha2_resource_claim_template->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_templateJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_template->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_templateJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_template->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_templateJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_resource_claim_template->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_templateJSON, "spec"); - if (!spec) { - goto end; - } - - - spec_local_nonprim = v1alpha2_resource_claim_template_spec_parseFromJSON(spec); //nonprimitive - - - v1alpha2_resource_claim_template_local_var = v1alpha2_resource_claim_template_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec_local_nonprim - ); - - return v1alpha2_resource_claim_template_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha2_resource_claim_template_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_template.h b/kubernetes/model/v1alpha2_resource_claim_template.h deleted file mode 100644 index 91786a69..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_template.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_claim_template.h - * - * ResourceClaimTemplate is used to produce ResourceClaim objects. - */ - -#ifndef _v1alpha2_resource_claim_template_H_ -#define _v1alpha2_resource_claim_template_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_template_t v1alpha2_resource_claim_template_t; - -#include "v1_object_meta.h" -#include "v1alpha2_resource_claim_template_spec.h" - - - -typedef struct v1alpha2_resource_claim_template_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha2_resource_claim_template_spec_t *spec; //model - -} v1alpha2_resource_claim_template_t; - -v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_resource_claim_template_spec_t *spec -); - -void v1alpha2_resource_claim_template_free(v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template); - -v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template_parseFromJSON(cJSON *v1alpha2_resource_claim_templateJSON); - -cJSON *v1alpha2_resource_claim_template_convertToJSON(v1alpha2_resource_claim_template_t *v1alpha2_resource_claim_template); - -#endif /* _v1alpha2_resource_claim_template_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_template_list.c b/kubernetes/model/v1alpha2_resource_claim_template_list.c deleted file mode 100644 index 9eeda178..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_template_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_template_list.h" - - - -v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list_local_var = malloc(sizeof(v1alpha2_resource_claim_template_list_t)); - if (!v1alpha2_resource_claim_template_list_local_var) { - return NULL; - } - v1alpha2_resource_claim_template_list_local_var->api_version = api_version; - v1alpha2_resource_claim_template_list_local_var->items = items; - v1alpha2_resource_claim_template_list_local_var->kind = kind; - v1alpha2_resource_claim_template_list_local_var->metadata = metadata; - - return v1alpha2_resource_claim_template_list_local_var; -} - - -void v1alpha2_resource_claim_template_list_free(v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list) { - if(NULL == v1alpha2_resource_claim_template_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_template_list->api_version) { - free(v1alpha2_resource_claim_template_list->api_version); - v1alpha2_resource_claim_template_list->api_version = NULL; - } - if (v1alpha2_resource_claim_template_list->items) { - list_ForEach(listEntry, v1alpha2_resource_claim_template_list->items) { - v1alpha2_resource_claim_template_free(listEntry->data); - } - list_freeList(v1alpha2_resource_claim_template_list->items); - v1alpha2_resource_claim_template_list->items = NULL; - } - if (v1alpha2_resource_claim_template_list->kind) { - free(v1alpha2_resource_claim_template_list->kind); - v1alpha2_resource_claim_template_list->kind = NULL; - } - if (v1alpha2_resource_claim_template_list->metadata) { - v1_list_meta_free(v1alpha2_resource_claim_template_list->metadata); - v1alpha2_resource_claim_template_list->metadata = NULL; - } - free(v1alpha2_resource_claim_template_list); -} - -cJSON *v1alpha2_resource_claim_template_list_convertToJSON(v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_template_list->api_version - if(v1alpha2_resource_claim_template_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_claim_template_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_template_list->items - if (!v1alpha2_resource_claim_template_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha2_resource_claim_template_list->items) { - list_ForEach(itemsListEntry, v1alpha2_resource_claim_template_list->items) { - cJSON *itemLocal = v1alpha2_resource_claim_template_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha2_resource_claim_template_list->kind - if(v1alpha2_resource_claim_template_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_claim_template_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_claim_template_list->metadata - if(v1alpha2_resource_claim_template_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_resource_claim_template_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list_parseFromJSON(cJSON *v1alpha2_resource_claim_template_listJSON){ - - v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list_local_var = NULL; - - // define the local list for v1alpha2_resource_claim_template_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha2_resource_claim_template_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_resource_claim_template_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_template_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_template_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_template_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_claim_template_t *itemsItem = v1alpha2_resource_claim_template_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha2_resource_claim_template_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_template_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_claim_template_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_template_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha2_resource_claim_template_list_local_var = v1alpha2_resource_claim_template_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha2_resource_claim_template_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha2_resource_claim_template_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_template_list.h b/kubernetes/model/v1alpha2_resource_claim_template_list.h deleted file mode 100644 index edce7913..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_template_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_claim_template_list.h - * - * ResourceClaimTemplateList is a collection of claim templates. - */ - -#ifndef _v1alpha2_resource_claim_template_list_H_ -#define _v1alpha2_resource_claim_template_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_template_list_t v1alpha2_resource_claim_template_list_t; - -#include "v1_list_meta.h" -#include "v1alpha2_resource_claim_template.h" - - - -typedef struct v1alpha2_resource_claim_template_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha2_resource_claim_template_list_t; - -v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha2_resource_claim_template_list_free(v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list); - -v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list_parseFromJSON(cJSON *v1alpha2_resource_claim_template_listJSON); - -cJSON *v1alpha2_resource_claim_template_list_convertToJSON(v1alpha2_resource_claim_template_list_t *v1alpha2_resource_claim_template_list); - -#endif /* _v1alpha2_resource_claim_template_list_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_claim_template_spec.c b/kubernetes/model/v1alpha2_resource_claim_template_spec.c deleted file mode 100644 index cd38c7ad..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_template_spec.c +++ /dev/null @@ -1,119 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_claim_template_spec.h" - - - -v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec_create( - v1_object_meta_t *metadata, - v1alpha2_resource_claim_spec_t *spec - ) { - v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec_local_var = malloc(sizeof(v1alpha2_resource_claim_template_spec_t)); - if (!v1alpha2_resource_claim_template_spec_local_var) { - return NULL; - } - v1alpha2_resource_claim_template_spec_local_var->metadata = metadata; - v1alpha2_resource_claim_template_spec_local_var->spec = spec; - - return v1alpha2_resource_claim_template_spec_local_var; -} - - -void v1alpha2_resource_claim_template_spec_free(v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec) { - if(NULL == v1alpha2_resource_claim_template_spec){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_claim_template_spec->metadata) { - v1_object_meta_free(v1alpha2_resource_claim_template_spec->metadata); - v1alpha2_resource_claim_template_spec->metadata = NULL; - } - if (v1alpha2_resource_claim_template_spec->spec) { - v1alpha2_resource_claim_spec_free(v1alpha2_resource_claim_template_spec->spec); - v1alpha2_resource_claim_template_spec->spec = NULL; - } - free(v1alpha2_resource_claim_template_spec); -} - -cJSON *v1alpha2_resource_claim_template_spec_convertToJSON(v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_claim_template_spec->metadata - if(v1alpha2_resource_claim_template_spec->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_resource_claim_template_spec->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_claim_template_spec->spec - if (!v1alpha2_resource_claim_template_spec->spec) { - goto fail; - } - cJSON *spec_local_JSON = v1alpha2_resource_claim_spec_convertToJSON(v1alpha2_resource_claim_template_spec->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec_parseFromJSON(cJSON *v1alpha2_resource_claim_template_specJSON){ - - v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec_local_var = NULL; - - // define the local variable for v1alpha2_resource_claim_template_spec->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_claim_template_spec->spec - v1alpha2_resource_claim_spec_t *spec_local_nonprim = NULL; - - // v1alpha2_resource_claim_template_spec->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_template_specJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_resource_claim_template_spec->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_claim_template_specJSON, "spec"); - if (!spec) { - goto end; - } - - - spec_local_nonprim = v1alpha2_resource_claim_spec_parseFromJSON(spec); //nonprimitive - - - v1alpha2_resource_claim_template_spec_local_var = v1alpha2_resource_claim_template_spec_create ( - metadata ? metadata_local_nonprim : NULL, - spec_local_nonprim - ); - - return v1alpha2_resource_claim_template_spec_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1alpha2_resource_claim_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_claim_template_spec.h b/kubernetes/model/v1alpha2_resource_claim_template_spec.h deleted file mode 100644 index 40aa25af..00000000 --- a/kubernetes/model/v1alpha2_resource_claim_template_spec.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * v1alpha2_resource_claim_template_spec.h - * - * ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. - */ - -#ifndef _v1alpha2_resource_claim_template_spec_H_ -#define _v1alpha2_resource_claim_template_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_claim_template_spec_t v1alpha2_resource_claim_template_spec_t; - -#include "v1_object_meta.h" -#include "v1alpha2_resource_claim_spec.h" - - - -typedef struct v1alpha2_resource_claim_template_spec_t { - struct v1_object_meta_t *metadata; //model - struct v1alpha2_resource_claim_spec_t *spec; //model - -} v1alpha2_resource_claim_template_spec_t; - -v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec_create( - v1_object_meta_t *metadata, - v1alpha2_resource_claim_spec_t *spec -); - -void v1alpha2_resource_claim_template_spec_free(v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec); - -v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec_parseFromJSON(cJSON *v1alpha2_resource_claim_template_specJSON); - -cJSON *v1alpha2_resource_claim_template_spec_convertToJSON(v1alpha2_resource_claim_template_spec_t *v1alpha2_resource_claim_template_spec); - -#endif /* _v1alpha2_resource_claim_template_spec_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_class.c b/kubernetes/model/v1alpha2_resource_class.c deleted file mode 100644 index 09b59bf1..00000000 --- a/kubernetes/model/v1alpha2_resource_class.c +++ /dev/null @@ -1,244 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_class.h" - - - -v1alpha2_resource_class_t *v1alpha2_resource_class_create( - char *api_version, - char *driver_name, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_resource_class_parameters_reference_t *parameters_ref, - int structured_parameters, - v1_node_selector_t *suitable_nodes - ) { - v1alpha2_resource_class_t *v1alpha2_resource_class_local_var = malloc(sizeof(v1alpha2_resource_class_t)); - if (!v1alpha2_resource_class_local_var) { - return NULL; - } - v1alpha2_resource_class_local_var->api_version = api_version; - v1alpha2_resource_class_local_var->driver_name = driver_name; - v1alpha2_resource_class_local_var->kind = kind; - v1alpha2_resource_class_local_var->metadata = metadata; - v1alpha2_resource_class_local_var->parameters_ref = parameters_ref; - v1alpha2_resource_class_local_var->structured_parameters = structured_parameters; - v1alpha2_resource_class_local_var->suitable_nodes = suitable_nodes; - - return v1alpha2_resource_class_local_var; -} - - -void v1alpha2_resource_class_free(v1alpha2_resource_class_t *v1alpha2_resource_class) { - if(NULL == v1alpha2_resource_class){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_class->api_version) { - free(v1alpha2_resource_class->api_version); - v1alpha2_resource_class->api_version = NULL; - } - if (v1alpha2_resource_class->driver_name) { - free(v1alpha2_resource_class->driver_name); - v1alpha2_resource_class->driver_name = NULL; - } - if (v1alpha2_resource_class->kind) { - free(v1alpha2_resource_class->kind); - v1alpha2_resource_class->kind = NULL; - } - if (v1alpha2_resource_class->metadata) { - v1_object_meta_free(v1alpha2_resource_class->metadata); - v1alpha2_resource_class->metadata = NULL; - } - if (v1alpha2_resource_class->parameters_ref) { - v1alpha2_resource_class_parameters_reference_free(v1alpha2_resource_class->parameters_ref); - v1alpha2_resource_class->parameters_ref = NULL; - } - if (v1alpha2_resource_class->suitable_nodes) { - v1_node_selector_free(v1alpha2_resource_class->suitable_nodes); - v1alpha2_resource_class->suitable_nodes = NULL; - } - free(v1alpha2_resource_class); -} - -cJSON *v1alpha2_resource_class_convertToJSON(v1alpha2_resource_class_t *v1alpha2_resource_class) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_class->api_version - if(v1alpha2_resource_class->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_class->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class->driver_name - if (!v1alpha2_resource_class->driver_name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "driverName", v1alpha2_resource_class->driver_name) == NULL) { - goto fail; //String - } - - - // v1alpha2_resource_class->kind - if(v1alpha2_resource_class->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_class->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class->metadata - if(v1alpha2_resource_class->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_resource_class->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_class->parameters_ref - if(v1alpha2_resource_class->parameters_ref) { - cJSON *parameters_ref_local_JSON = v1alpha2_resource_class_parameters_reference_convertToJSON(v1alpha2_resource_class->parameters_ref); - if(parameters_ref_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "parametersRef", parameters_ref_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_class->structured_parameters - if(v1alpha2_resource_class->structured_parameters) { - if(cJSON_AddBoolToObject(item, "structuredParameters", v1alpha2_resource_class->structured_parameters) == NULL) { - goto fail; //Bool - } - } - - - // v1alpha2_resource_class->suitable_nodes - if(v1alpha2_resource_class->suitable_nodes) { - cJSON *suitable_nodes_local_JSON = v1_node_selector_convertToJSON(v1alpha2_resource_class->suitable_nodes); - if(suitable_nodes_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "suitableNodes", suitable_nodes_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_class_t *v1alpha2_resource_class_parseFromJSON(cJSON *v1alpha2_resource_classJSON){ - - v1alpha2_resource_class_t *v1alpha2_resource_class_local_var = NULL; - - // define the local variable for v1alpha2_resource_class->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_class->parameters_ref - v1alpha2_resource_class_parameters_reference_t *parameters_ref_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_class->suitable_nodes - v1_node_selector_t *suitable_nodes_local_nonprim = NULL; - - // v1alpha2_resource_class->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_classJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_class->driver_name - cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_classJSON, "driverName"); - if (!driver_name) { - goto end; - } - - - if(!cJSON_IsString(driver_name)) - { - goto end; //String - } - - // v1alpha2_resource_class->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_classJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_class->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_classJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_resource_class->parameters_ref - cJSON *parameters_ref = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_classJSON, "parametersRef"); - if (parameters_ref) { - parameters_ref_local_nonprim = v1alpha2_resource_class_parameters_reference_parseFromJSON(parameters_ref); //nonprimitive - } - - // v1alpha2_resource_class->structured_parameters - cJSON *structured_parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_classJSON, "structuredParameters"); - if (structured_parameters) { - if(!cJSON_IsBool(structured_parameters)) - { - goto end; //Bool - } - } - - // v1alpha2_resource_class->suitable_nodes - cJSON *suitable_nodes = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_classJSON, "suitableNodes"); - if (suitable_nodes) { - suitable_nodes_local_nonprim = v1_node_selector_parseFromJSON(suitable_nodes); //nonprimitive - } - - - v1alpha2_resource_class_local_var = v1alpha2_resource_class_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - strdup(driver_name->valuestring), - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - parameters_ref ? parameters_ref_local_nonprim : NULL, - structured_parameters ? structured_parameters->valueint : 0, - suitable_nodes ? suitable_nodes_local_nonprim : NULL - ); - - return v1alpha2_resource_class_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (parameters_ref_local_nonprim) { - v1alpha2_resource_class_parameters_reference_free(parameters_ref_local_nonprim); - parameters_ref_local_nonprim = NULL; - } - if (suitable_nodes_local_nonprim) { - v1_node_selector_free(suitable_nodes_local_nonprim); - suitable_nodes_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_class.h b/kubernetes/model/v1alpha2_resource_class.h deleted file mode 100644 index 9e20e4d1..00000000 --- a/kubernetes/model/v1alpha2_resource_class.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * v1alpha2_resource_class.h - * - * ResourceClass is used by administrators to influence how resources are allocated. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. - */ - -#ifndef _v1alpha2_resource_class_H_ -#define _v1alpha2_resource_class_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_class_t v1alpha2_resource_class_t; - -#include "v1_node_selector.h" -#include "v1_object_meta.h" -#include "v1alpha2_resource_class_parameters_reference.h" - - - -typedef struct v1alpha2_resource_class_t { - char *api_version; // string - char *driver_name; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha2_resource_class_parameters_reference_t *parameters_ref; //model - int structured_parameters; //boolean - struct v1_node_selector_t *suitable_nodes; //model - -} v1alpha2_resource_class_t; - -v1alpha2_resource_class_t *v1alpha2_resource_class_create( - char *api_version, - char *driver_name, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_resource_class_parameters_reference_t *parameters_ref, - int structured_parameters, - v1_node_selector_t *suitable_nodes -); - -void v1alpha2_resource_class_free(v1alpha2_resource_class_t *v1alpha2_resource_class); - -v1alpha2_resource_class_t *v1alpha2_resource_class_parseFromJSON(cJSON *v1alpha2_resource_classJSON); - -cJSON *v1alpha2_resource_class_convertToJSON(v1alpha2_resource_class_t *v1alpha2_resource_class); - -#endif /* _v1alpha2_resource_class_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_class_list.c b/kubernetes/model/v1alpha2_resource_class_list.c deleted file mode 100644 index 859a304c..00000000 --- a/kubernetes/model/v1alpha2_resource_class_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_class_list.h" - - - -v1alpha2_resource_class_list_t *v1alpha2_resource_class_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha2_resource_class_list_t *v1alpha2_resource_class_list_local_var = malloc(sizeof(v1alpha2_resource_class_list_t)); - if (!v1alpha2_resource_class_list_local_var) { - return NULL; - } - v1alpha2_resource_class_list_local_var->api_version = api_version; - v1alpha2_resource_class_list_local_var->items = items; - v1alpha2_resource_class_list_local_var->kind = kind; - v1alpha2_resource_class_list_local_var->metadata = metadata; - - return v1alpha2_resource_class_list_local_var; -} - - -void v1alpha2_resource_class_list_free(v1alpha2_resource_class_list_t *v1alpha2_resource_class_list) { - if(NULL == v1alpha2_resource_class_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_class_list->api_version) { - free(v1alpha2_resource_class_list->api_version); - v1alpha2_resource_class_list->api_version = NULL; - } - if (v1alpha2_resource_class_list->items) { - list_ForEach(listEntry, v1alpha2_resource_class_list->items) { - v1alpha2_resource_class_free(listEntry->data); - } - list_freeList(v1alpha2_resource_class_list->items); - v1alpha2_resource_class_list->items = NULL; - } - if (v1alpha2_resource_class_list->kind) { - free(v1alpha2_resource_class_list->kind); - v1alpha2_resource_class_list->kind = NULL; - } - if (v1alpha2_resource_class_list->metadata) { - v1_list_meta_free(v1alpha2_resource_class_list->metadata); - v1alpha2_resource_class_list->metadata = NULL; - } - free(v1alpha2_resource_class_list); -} - -cJSON *v1alpha2_resource_class_list_convertToJSON(v1alpha2_resource_class_list_t *v1alpha2_resource_class_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_class_list->api_version - if(v1alpha2_resource_class_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_class_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class_list->items - if (!v1alpha2_resource_class_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha2_resource_class_list->items) { - list_ForEach(itemsListEntry, v1alpha2_resource_class_list->items) { - cJSON *itemLocal = v1alpha2_resource_class_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha2_resource_class_list->kind - if(v1alpha2_resource_class_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_class_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class_list->metadata - if(v1alpha2_resource_class_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_resource_class_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_class_list_t *v1alpha2_resource_class_list_parseFromJSON(cJSON *v1alpha2_resource_class_listJSON){ - - v1alpha2_resource_class_list_t *v1alpha2_resource_class_list_local_var = NULL; - - // define the local list for v1alpha2_resource_class_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha2_resource_class_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_resource_class_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_class_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_class_t *itemsItem = v1alpha2_resource_class_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha2_resource_class_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_class_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha2_resource_class_list_local_var = v1alpha2_resource_class_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha2_resource_class_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha2_resource_class_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_class_list.h b/kubernetes/model/v1alpha2_resource_class_list.h deleted file mode 100644 index 0272b5d2..00000000 --- a/kubernetes/model/v1alpha2_resource_class_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_class_list.h - * - * ResourceClassList is a collection of classes. - */ - -#ifndef _v1alpha2_resource_class_list_H_ -#define _v1alpha2_resource_class_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_class_list_t v1alpha2_resource_class_list_t; - -#include "v1_list_meta.h" -#include "v1alpha2_resource_class.h" - - - -typedef struct v1alpha2_resource_class_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha2_resource_class_list_t; - -v1alpha2_resource_class_list_t *v1alpha2_resource_class_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha2_resource_class_list_free(v1alpha2_resource_class_list_t *v1alpha2_resource_class_list); - -v1alpha2_resource_class_list_t *v1alpha2_resource_class_list_parseFromJSON(cJSON *v1alpha2_resource_class_listJSON); - -cJSON *v1alpha2_resource_class_list_convertToJSON(v1alpha2_resource_class_list_t *v1alpha2_resource_class_list); - -#endif /* _v1alpha2_resource_class_list_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_class_parameters.c b/kubernetes/model/v1alpha2_resource_class_parameters.c deleted file mode 100644 index aaed344a..00000000 --- a/kubernetes/model/v1alpha2_resource_class_parameters.c +++ /dev/null @@ -1,289 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_class_parameters.h" - - - -v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters_create( - char *api_version, - list_t *filters, - v1alpha2_resource_class_parameters_reference_t *generated_from, - char *kind, - v1_object_meta_t *metadata, - list_t *vendor_parameters - ) { - v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters_local_var = malloc(sizeof(v1alpha2_resource_class_parameters_t)); - if (!v1alpha2_resource_class_parameters_local_var) { - return NULL; - } - v1alpha2_resource_class_parameters_local_var->api_version = api_version; - v1alpha2_resource_class_parameters_local_var->filters = filters; - v1alpha2_resource_class_parameters_local_var->generated_from = generated_from; - v1alpha2_resource_class_parameters_local_var->kind = kind; - v1alpha2_resource_class_parameters_local_var->metadata = metadata; - v1alpha2_resource_class_parameters_local_var->vendor_parameters = vendor_parameters; - - return v1alpha2_resource_class_parameters_local_var; -} - - -void v1alpha2_resource_class_parameters_free(v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters) { - if(NULL == v1alpha2_resource_class_parameters){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_class_parameters->api_version) { - free(v1alpha2_resource_class_parameters->api_version); - v1alpha2_resource_class_parameters->api_version = NULL; - } - if (v1alpha2_resource_class_parameters->filters) { - list_ForEach(listEntry, v1alpha2_resource_class_parameters->filters) { - v1alpha2_resource_filter_free(listEntry->data); - } - list_freeList(v1alpha2_resource_class_parameters->filters); - v1alpha2_resource_class_parameters->filters = NULL; - } - if (v1alpha2_resource_class_parameters->generated_from) { - v1alpha2_resource_class_parameters_reference_free(v1alpha2_resource_class_parameters->generated_from); - v1alpha2_resource_class_parameters->generated_from = NULL; - } - if (v1alpha2_resource_class_parameters->kind) { - free(v1alpha2_resource_class_parameters->kind); - v1alpha2_resource_class_parameters->kind = NULL; - } - if (v1alpha2_resource_class_parameters->metadata) { - v1_object_meta_free(v1alpha2_resource_class_parameters->metadata); - v1alpha2_resource_class_parameters->metadata = NULL; - } - if (v1alpha2_resource_class_parameters->vendor_parameters) { - list_ForEach(listEntry, v1alpha2_resource_class_parameters->vendor_parameters) { - v1alpha2_vendor_parameters_free(listEntry->data); - } - list_freeList(v1alpha2_resource_class_parameters->vendor_parameters); - v1alpha2_resource_class_parameters->vendor_parameters = NULL; - } - free(v1alpha2_resource_class_parameters); -} - -cJSON *v1alpha2_resource_class_parameters_convertToJSON(v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_class_parameters->api_version - if(v1alpha2_resource_class_parameters->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_class_parameters->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class_parameters->filters - if(v1alpha2_resource_class_parameters->filters) { - cJSON *filters = cJSON_AddArrayToObject(item, "filters"); - if(filters == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *filtersListEntry; - if (v1alpha2_resource_class_parameters->filters) { - list_ForEach(filtersListEntry, v1alpha2_resource_class_parameters->filters) { - cJSON *itemLocal = v1alpha2_resource_filter_convertToJSON(filtersListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(filters, itemLocal); - } - } - } - - - // v1alpha2_resource_class_parameters->generated_from - if(v1alpha2_resource_class_parameters->generated_from) { - cJSON *generated_from_local_JSON = v1alpha2_resource_class_parameters_reference_convertToJSON(v1alpha2_resource_class_parameters->generated_from); - if(generated_from_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "generatedFrom", generated_from_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_class_parameters->kind - if(v1alpha2_resource_class_parameters->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_class_parameters->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class_parameters->metadata - if(v1alpha2_resource_class_parameters->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_resource_class_parameters->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_class_parameters->vendor_parameters - if(v1alpha2_resource_class_parameters->vendor_parameters) { - cJSON *vendor_parameters = cJSON_AddArrayToObject(item, "vendorParameters"); - if(vendor_parameters == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *vendor_parametersListEntry; - if (v1alpha2_resource_class_parameters->vendor_parameters) { - list_ForEach(vendor_parametersListEntry, v1alpha2_resource_class_parameters->vendor_parameters) { - cJSON *itemLocal = v1alpha2_vendor_parameters_convertToJSON(vendor_parametersListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(vendor_parameters, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters_parseFromJSON(cJSON *v1alpha2_resource_class_parametersJSON){ - - v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters_local_var = NULL; - - // define the local list for v1alpha2_resource_class_parameters->filters - list_t *filtersList = NULL; - - // define the local variable for v1alpha2_resource_class_parameters->generated_from - v1alpha2_resource_class_parameters_reference_t *generated_from_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_class_parameters->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local list for v1alpha2_resource_class_parameters->vendor_parameters - list_t *vendor_parametersList = NULL; - - // v1alpha2_resource_class_parameters->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parametersJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_class_parameters->filters - cJSON *filters = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parametersJSON, "filters"); - if (filters) { - cJSON *filters_local_nonprimitive = NULL; - if(!cJSON_IsArray(filters)){ - goto end; //nonprimitive container - } - - filtersList = list_createList(); - - cJSON_ArrayForEach(filters_local_nonprimitive,filters ) - { - if(!cJSON_IsObject(filters_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_filter_t *filtersItem = v1alpha2_resource_filter_parseFromJSON(filters_local_nonprimitive); - - list_addElement(filtersList, filtersItem); - } - } - - // v1alpha2_resource_class_parameters->generated_from - cJSON *generated_from = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parametersJSON, "generatedFrom"); - if (generated_from) { - generated_from_local_nonprim = v1alpha2_resource_class_parameters_reference_parseFromJSON(generated_from); //nonprimitive - } - - // v1alpha2_resource_class_parameters->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parametersJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_class_parameters->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parametersJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_resource_class_parameters->vendor_parameters - cJSON *vendor_parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parametersJSON, "vendorParameters"); - if (vendor_parameters) { - cJSON *vendor_parameters_local_nonprimitive = NULL; - if(!cJSON_IsArray(vendor_parameters)){ - goto end; //nonprimitive container - } - - vendor_parametersList = list_createList(); - - cJSON_ArrayForEach(vendor_parameters_local_nonprimitive,vendor_parameters ) - { - if(!cJSON_IsObject(vendor_parameters_local_nonprimitive)){ - goto end; - } - v1alpha2_vendor_parameters_t *vendor_parametersItem = v1alpha2_vendor_parameters_parseFromJSON(vendor_parameters_local_nonprimitive); - - list_addElement(vendor_parametersList, vendor_parametersItem); - } - } - - - v1alpha2_resource_class_parameters_local_var = v1alpha2_resource_class_parameters_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - filters ? filtersList : NULL, - generated_from ? generated_from_local_nonprim : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - vendor_parameters ? vendor_parametersList : NULL - ); - - return v1alpha2_resource_class_parameters_local_var; -end: - if (filtersList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, filtersList) { - v1alpha2_resource_filter_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(filtersList); - filtersList = NULL; - } - if (generated_from_local_nonprim) { - v1alpha2_resource_class_parameters_reference_free(generated_from_local_nonprim); - generated_from_local_nonprim = NULL; - } - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (vendor_parametersList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, vendor_parametersList) { - v1alpha2_vendor_parameters_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(vendor_parametersList); - vendor_parametersList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_class_parameters.h b/kubernetes/model/v1alpha2_resource_class_parameters.h deleted file mode 100644 index bff7afd4..00000000 --- a/kubernetes/model/v1alpha2_resource_class_parameters.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * v1alpha2_resource_class_parameters.h - * - * ResourceClassParameters defines resource requests for a ResourceClass in an in-tree format understood by Kubernetes. - */ - -#ifndef _v1alpha2_resource_class_parameters_H_ -#define _v1alpha2_resource_class_parameters_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_class_parameters_t v1alpha2_resource_class_parameters_t; - -#include "v1_object_meta.h" -#include "v1alpha2_resource_class_parameters_reference.h" -#include "v1alpha2_resource_filter.h" -#include "v1alpha2_vendor_parameters.h" - - - -typedef struct v1alpha2_resource_class_parameters_t { - char *api_version; // string - list_t *filters; //nonprimitive container - struct v1alpha2_resource_class_parameters_reference_t *generated_from; //model - char *kind; // string - struct v1_object_meta_t *metadata; //model - list_t *vendor_parameters; //nonprimitive container - -} v1alpha2_resource_class_parameters_t; - -v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters_create( - char *api_version, - list_t *filters, - v1alpha2_resource_class_parameters_reference_t *generated_from, - char *kind, - v1_object_meta_t *metadata, - list_t *vendor_parameters -); - -void v1alpha2_resource_class_parameters_free(v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters); - -v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters_parseFromJSON(cJSON *v1alpha2_resource_class_parametersJSON); - -cJSON *v1alpha2_resource_class_parameters_convertToJSON(v1alpha2_resource_class_parameters_t *v1alpha2_resource_class_parameters); - -#endif /* _v1alpha2_resource_class_parameters_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_class_parameters_list.c b/kubernetes/model/v1alpha2_resource_class_parameters_list.c deleted file mode 100644 index 3eb18cb3..00000000 --- a/kubernetes/model/v1alpha2_resource_class_parameters_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_class_parameters_list.h" - - - -v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list_local_var = malloc(sizeof(v1alpha2_resource_class_parameters_list_t)); - if (!v1alpha2_resource_class_parameters_list_local_var) { - return NULL; - } - v1alpha2_resource_class_parameters_list_local_var->api_version = api_version; - v1alpha2_resource_class_parameters_list_local_var->items = items; - v1alpha2_resource_class_parameters_list_local_var->kind = kind; - v1alpha2_resource_class_parameters_list_local_var->metadata = metadata; - - return v1alpha2_resource_class_parameters_list_local_var; -} - - -void v1alpha2_resource_class_parameters_list_free(v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list) { - if(NULL == v1alpha2_resource_class_parameters_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_class_parameters_list->api_version) { - free(v1alpha2_resource_class_parameters_list->api_version); - v1alpha2_resource_class_parameters_list->api_version = NULL; - } - if (v1alpha2_resource_class_parameters_list->items) { - list_ForEach(listEntry, v1alpha2_resource_class_parameters_list->items) { - v1alpha2_resource_class_parameters_free(listEntry->data); - } - list_freeList(v1alpha2_resource_class_parameters_list->items); - v1alpha2_resource_class_parameters_list->items = NULL; - } - if (v1alpha2_resource_class_parameters_list->kind) { - free(v1alpha2_resource_class_parameters_list->kind); - v1alpha2_resource_class_parameters_list->kind = NULL; - } - if (v1alpha2_resource_class_parameters_list->metadata) { - v1_list_meta_free(v1alpha2_resource_class_parameters_list->metadata); - v1alpha2_resource_class_parameters_list->metadata = NULL; - } - free(v1alpha2_resource_class_parameters_list); -} - -cJSON *v1alpha2_resource_class_parameters_list_convertToJSON(v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_class_parameters_list->api_version - if(v1alpha2_resource_class_parameters_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_class_parameters_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class_parameters_list->items - if (!v1alpha2_resource_class_parameters_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha2_resource_class_parameters_list->items) { - list_ForEach(itemsListEntry, v1alpha2_resource_class_parameters_list->items) { - cJSON *itemLocal = v1alpha2_resource_class_parameters_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha2_resource_class_parameters_list->kind - if(v1alpha2_resource_class_parameters_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_class_parameters_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class_parameters_list->metadata - if(v1alpha2_resource_class_parameters_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_resource_class_parameters_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list_parseFromJSON(cJSON *v1alpha2_resource_class_parameters_listJSON){ - - v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list_local_var = NULL; - - // define the local list for v1alpha2_resource_class_parameters_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha2_resource_class_parameters_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_resource_class_parameters_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_class_parameters_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_class_parameters_t *itemsItem = v1alpha2_resource_class_parameters_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha2_resource_class_parameters_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_class_parameters_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha2_resource_class_parameters_list_local_var = v1alpha2_resource_class_parameters_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha2_resource_class_parameters_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha2_resource_class_parameters_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_class_parameters_list.h b/kubernetes/model/v1alpha2_resource_class_parameters_list.h deleted file mode 100644 index 525c0759..00000000 --- a/kubernetes/model/v1alpha2_resource_class_parameters_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_class_parameters_list.h - * - * ResourceClassParametersList is a collection of ResourceClassParameters. - */ - -#ifndef _v1alpha2_resource_class_parameters_list_H_ -#define _v1alpha2_resource_class_parameters_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_class_parameters_list_t v1alpha2_resource_class_parameters_list_t; - -#include "v1_list_meta.h" -#include "v1alpha2_resource_class_parameters.h" - - - -typedef struct v1alpha2_resource_class_parameters_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha2_resource_class_parameters_list_t; - -v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha2_resource_class_parameters_list_free(v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list); - -v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list_parseFromJSON(cJSON *v1alpha2_resource_class_parameters_listJSON); - -cJSON *v1alpha2_resource_class_parameters_list_convertToJSON(v1alpha2_resource_class_parameters_list_t *v1alpha2_resource_class_parameters_list); - -#endif /* _v1alpha2_resource_class_parameters_list_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_class_parameters_reference.c b/kubernetes/model/v1alpha2_resource_class_parameters_reference.c deleted file mode 100644 index 659d357e..00000000 --- a/kubernetes/model/v1alpha2_resource_class_parameters_reference.c +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_class_parameters_reference.h" - - - -v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference_create( - char *api_group, - char *kind, - char *name, - char *_namespace - ) { - v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference_local_var = malloc(sizeof(v1alpha2_resource_class_parameters_reference_t)); - if (!v1alpha2_resource_class_parameters_reference_local_var) { - return NULL; - } - v1alpha2_resource_class_parameters_reference_local_var->api_group = api_group; - v1alpha2_resource_class_parameters_reference_local_var->kind = kind; - v1alpha2_resource_class_parameters_reference_local_var->name = name; - v1alpha2_resource_class_parameters_reference_local_var->_namespace = _namespace; - - return v1alpha2_resource_class_parameters_reference_local_var; -} - - -void v1alpha2_resource_class_parameters_reference_free(v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference) { - if(NULL == v1alpha2_resource_class_parameters_reference){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_class_parameters_reference->api_group) { - free(v1alpha2_resource_class_parameters_reference->api_group); - v1alpha2_resource_class_parameters_reference->api_group = NULL; - } - if (v1alpha2_resource_class_parameters_reference->kind) { - free(v1alpha2_resource_class_parameters_reference->kind); - v1alpha2_resource_class_parameters_reference->kind = NULL; - } - if (v1alpha2_resource_class_parameters_reference->name) { - free(v1alpha2_resource_class_parameters_reference->name); - v1alpha2_resource_class_parameters_reference->name = NULL; - } - if (v1alpha2_resource_class_parameters_reference->_namespace) { - free(v1alpha2_resource_class_parameters_reference->_namespace); - v1alpha2_resource_class_parameters_reference->_namespace = NULL; - } - free(v1alpha2_resource_class_parameters_reference); -} - -cJSON *v1alpha2_resource_class_parameters_reference_convertToJSON(v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_class_parameters_reference->api_group - if(v1alpha2_resource_class_parameters_reference->api_group) { - if(cJSON_AddStringToObject(item, "apiGroup", v1alpha2_resource_class_parameters_reference->api_group) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_class_parameters_reference->kind - if (!v1alpha2_resource_class_parameters_reference->kind) { - goto fail; - } - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_class_parameters_reference->kind) == NULL) { - goto fail; //String - } - - - // v1alpha2_resource_class_parameters_reference->name - if (!v1alpha2_resource_class_parameters_reference->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1alpha2_resource_class_parameters_reference->name) == NULL) { - goto fail; //String - } - - - // v1alpha2_resource_class_parameters_reference->_namespace - if(v1alpha2_resource_class_parameters_reference->_namespace) { - if(cJSON_AddStringToObject(item, "namespace", v1alpha2_resource_class_parameters_reference->_namespace) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference_parseFromJSON(cJSON *v1alpha2_resource_class_parameters_referenceJSON){ - - v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference_local_var = NULL; - - // v1alpha2_resource_class_parameters_reference->api_group - cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_referenceJSON, "apiGroup"); - if (api_group) { - if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) - { - goto end; //String - } - } - - // v1alpha2_resource_class_parameters_reference->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_referenceJSON, "kind"); - if (!kind) { - goto end; - } - - - if(!cJSON_IsString(kind)) - { - goto end; //String - } - - // v1alpha2_resource_class_parameters_reference->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_referenceJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - // v1alpha2_resource_class_parameters_reference->_namespace - cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_class_parameters_referenceJSON, "namespace"); - if (_namespace) { - if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) - { - goto end; //String - } - } - - - v1alpha2_resource_class_parameters_reference_local_var = v1alpha2_resource_class_parameters_reference_create ( - api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, - strdup(kind->valuestring), - strdup(name->valuestring), - _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL - ); - - return v1alpha2_resource_class_parameters_reference_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_class_parameters_reference.h b/kubernetes/model/v1alpha2_resource_class_parameters_reference.h deleted file mode 100644 index 4286dc2d..00000000 --- a/kubernetes/model/v1alpha2_resource_class_parameters_reference.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1alpha2_resource_class_parameters_reference.h - * - * ResourceClassParametersReference contains enough information to let you locate the parameters for a ResourceClass. - */ - -#ifndef _v1alpha2_resource_class_parameters_reference_H_ -#define _v1alpha2_resource_class_parameters_reference_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_class_parameters_reference_t v1alpha2_resource_class_parameters_reference_t; - - - - -typedef struct v1alpha2_resource_class_parameters_reference_t { - char *api_group; // string - char *kind; // string - char *name; // string - char *_namespace; // string - -} v1alpha2_resource_class_parameters_reference_t; - -v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference_create( - char *api_group, - char *kind, - char *name, - char *_namespace -); - -void v1alpha2_resource_class_parameters_reference_free(v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference); - -v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference_parseFromJSON(cJSON *v1alpha2_resource_class_parameters_referenceJSON); - -cJSON *v1alpha2_resource_class_parameters_reference_convertToJSON(v1alpha2_resource_class_parameters_reference_t *v1alpha2_resource_class_parameters_reference); - -#endif /* _v1alpha2_resource_class_parameters_reference_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_filter.c b/kubernetes/model/v1alpha2_resource_filter.c deleted file mode 100644 index a707e17b..00000000 --- a/kubernetes/model/v1alpha2_resource_filter.c +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_filter.h" - - - -v1alpha2_resource_filter_t *v1alpha2_resource_filter_create( - char *driver_name, - v1alpha2_named_resources_filter_t *named_resources - ) { - v1alpha2_resource_filter_t *v1alpha2_resource_filter_local_var = malloc(sizeof(v1alpha2_resource_filter_t)); - if (!v1alpha2_resource_filter_local_var) { - return NULL; - } - v1alpha2_resource_filter_local_var->driver_name = driver_name; - v1alpha2_resource_filter_local_var->named_resources = named_resources; - - return v1alpha2_resource_filter_local_var; -} - - -void v1alpha2_resource_filter_free(v1alpha2_resource_filter_t *v1alpha2_resource_filter) { - if(NULL == v1alpha2_resource_filter){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_filter->driver_name) { - free(v1alpha2_resource_filter->driver_name); - v1alpha2_resource_filter->driver_name = NULL; - } - if (v1alpha2_resource_filter->named_resources) { - v1alpha2_named_resources_filter_free(v1alpha2_resource_filter->named_resources); - v1alpha2_resource_filter->named_resources = NULL; - } - free(v1alpha2_resource_filter); -} - -cJSON *v1alpha2_resource_filter_convertToJSON(v1alpha2_resource_filter_t *v1alpha2_resource_filter) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_filter->driver_name - if(v1alpha2_resource_filter->driver_name) { - if(cJSON_AddStringToObject(item, "driverName", v1alpha2_resource_filter->driver_name) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_filter->named_resources - if(v1alpha2_resource_filter->named_resources) { - cJSON *named_resources_local_JSON = v1alpha2_named_resources_filter_convertToJSON(v1alpha2_resource_filter->named_resources); - if(named_resources_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "namedResources", named_resources_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_filter_t *v1alpha2_resource_filter_parseFromJSON(cJSON *v1alpha2_resource_filterJSON){ - - v1alpha2_resource_filter_t *v1alpha2_resource_filter_local_var = NULL; - - // define the local variable for v1alpha2_resource_filter->named_resources - v1alpha2_named_resources_filter_t *named_resources_local_nonprim = NULL; - - // v1alpha2_resource_filter->driver_name - cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_filterJSON, "driverName"); - if (driver_name) { - if(!cJSON_IsString(driver_name) && !cJSON_IsNull(driver_name)) - { - goto end; //String - } - } - - // v1alpha2_resource_filter->named_resources - cJSON *named_resources = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_filterJSON, "namedResources"); - if (named_resources) { - named_resources_local_nonprim = v1alpha2_named_resources_filter_parseFromJSON(named_resources); //nonprimitive - } - - - v1alpha2_resource_filter_local_var = v1alpha2_resource_filter_create ( - driver_name && !cJSON_IsNull(driver_name) ? strdup(driver_name->valuestring) : NULL, - named_resources ? named_resources_local_nonprim : NULL - ); - - return v1alpha2_resource_filter_local_var; -end: - if (named_resources_local_nonprim) { - v1alpha2_named_resources_filter_free(named_resources_local_nonprim); - named_resources_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_filter.h b/kubernetes/model/v1alpha2_resource_filter.h deleted file mode 100644 index b7423fa5..00000000 --- a/kubernetes/model/v1alpha2_resource_filter.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * v1alpha2_resource_filter.h - * - * ResourceFilter is a filter for resources from one particular driver. - */ - -#ifndef _v1alpha2_resource_filter_H_ -#define _v1alpha2_resource_filter_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_filter_t v1alpha2_resource_filter_t; - -#include "v1alpha2_named_resources_filter.h" - - - -typedef struct v1alpha2_resource_filter_t { - char *driver_name; // string - struct v1alpha2_named_resources_filter_t *named_resources; //model - -} v1alpha2_resource_filter_t; - -v1alpha2_resource_filter_t *v1alpha2_resource_filter_create( - char *driver_name, - v1alpha2_named_resources_filter_t *named_resources -); - -void v1alpha2_resource_filter_free(v1alpha2_resource_filter_t *v1alpha2_resource_filter); - -v1alpha2_resource_filter_t *v1alpha2_resource_filter_parseFromJSON(cJSON *v1alpha2_resource_filterJSON); - -cJSON *v1alpha2_resource_filter_convertToJSON(v1alpha2_resource_filter_t *v1alpha2_resource_filter); - -#endif /* _v1alpha2_resource_filter_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_handle.c b/kubernetes/model/v1alpha2_resource_handle.c deleted file mode 100644 index c35df0d8..00000000 --- a/kubernetes/model/v1alpha2_resource_handle.c +++ /dev/null @@ -1,130 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_handle.h" - - - -v1alpha2_resource_handle_t *v1alpha2_resource_handle_create( - char *data, - char *driver_name, - v1alpha2_structured_resource_handle_t *structured_data - ) { - v1alpha2_resource_handle_t *v1alpha2_resource_handle_local_var = malloc(sizeof(v1alpha2_resource_handle_t)); - if (!v1alpha2_resource_handle_local_var) { - return NULL; - } - v1alpha2_resource_handle_local_var->data = data; - v1alpha2_resource_handle_local_var->driver_name = driver_name; - v1alpha2_resource_handle_local_var->structured_data = structured_data; - - return v1alpha2_resource_handle_local_var; -} - - -void v1alpha2_resource_handle_free(v1alpha2_resource_handle_t *v1alpha2_resource_handle) { - if(NULL == v1alpha2_resource_handle){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_handle->data) { - free(v1alpha2_resource_handle->data); - v1alpha2_resource_handle->data = NULL; - } - if (v1alpha2_resource_handle->driver_name) { - free(v1alpha2_resource_handle->driver_name); - v1alpha2_resource_handle->driver_name = NULL; - } - if (v1alpha2_resource_handle->structured_data) { - v1alpha2_structured_resource_handle_free(v1alpha2_resource_handle->structured_data); - v1alpha2_resource_handle->structured_data = NULL; - } - free(v1alpha2_resource_handle); -} - -cJSON *v1alpha2_resource_handle_convertToJSON(v1alpha2_resource_handle_t *v1alpha2_resource_handle) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_handle->data - if(v1alpha2_resource_handle->data) { - if(cJSON_AddStringToObject(item, "data", v1alpha2_resource_handle->data) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_handle->driver_name - if(v1alpha2_resource_handle->driver_name) { - if(cJSON_AddStringToObject(item, "driverName", v1alpha2_resource_handle->driver_name) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_handle->structured_data - if(v1alpha2_resource_handle->structured_data) { - cJSON *structured_data_local_JSON = v1alpha2_structured_resource_handle_convertToJSON(v1alpha2_resource_handle->structured_data); - if(structured_data_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "structuredData", structured_data_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_handle_t *v1alpha2_resource_handle_parseFromJSON(cJSON *v1alpha2_resource_handleJSON){ - - v1alpha2_resource_handle_t *v1alpha2_resource_handle_local_var = NULL; - - // define the local variable for v1alpha2_resource_handle->structured_data - v1alpha2_structured_resource_handle_t *structured_data_local_nonprim = NULL; - - // v1alpha2_resource_handle->data - cJSON *data = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_handleJSON, "data"); - if (data) { - if(!cJSON_IsString(data) && !cJSON_IsNull(data)) - { - goto end; //String - } - } - - // v1alpha2_resource_handle->driver_name - cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_handleJSON, "driverName"); - if (driver_name) { - if(!cJSON_IsString(driver_name) && !cJSON_IsNull(driver_name)) - { - goto end; //String - } - } - - // v1alpha2_resource_handle->structured_data - cJSON *structured_data = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_handleJSON, "structuredData"); - if (structured_data) { - structured_data_local_nonprim = v1alpha2_structured_resource_handle_parseFromJSON(structured_data); //nonprimitive - } - - - v1alpha2_resource_handle_local_var = v1alpha2_resource_handle_create ( - data && !cJSON_IsNull(data) ? strdup(data->valuestring) : NULL, - driver_name && !cJSON_IsNull(driver_name) ? strdup(driver_name->valuestring) : NULL, - structured_data ? structured_data_local_nonprim : NULL - ); - - return v1alpha2_resource_handle_local_var; -end: - if (structured_data_local_nonprim) { - v1alpha2_structured_resource_handle_free(structured_data_local_nonprim); - structured_data_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_handle.h b/kubernetes/model/v1alpha2_resource_handle.h deleted file mode 100644 index 132b75b4..00000000 --- a/kubernetes/model/v1alpha2_resource_handle.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * v1alpha2_resource_handle.h - * - * ResourceHandle holds opaque resource data for processing by a specific kubelet plugin. - */ - -#ifndef _v1alpha2_resource_handle_H_ -#define _v1alpha2_resource_handle_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_handle_t v1alpha2_resource_handle_t; - -#include "v1alpha2_structured_resource_handle.h" - - - -typedef struct v1alpha2_resource_handle_t { - char *data; // string - char *driver_name; // string - struct v1alpha2_structured_resource_handle_t *structured_data; //model - -} v1alpha2_resource_handle_t; - -v1alpha2_resource_handle_t *v1alpha2_resource_handle_create( - char *data, - char *driver_name, - v1alpha2_structured_resource_handle_t *structured_data -); - -void v1alpha2_resource_handle_free(v1alpha2_resource_handle_t *v1alpha2_resource_handle); - -v1alpha2_resource_handle_t *v1alpha2_resource_handle_parseFromJSON(cJSON *v1alpha2_resource_handleJSON); - -cJSON *v1alpha2_resource_handle_convertToJSON(v1alpha2_resource_handle_t *v1alpha2_resource_handle); - -#endif /* _v1alpha2_resource_handle_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_request.c b/kubernetes/model/v1alpha2_resource_request.c deleted file mode 100644 index e8deb99f..00000000 --- a/kubernetes/model/v1alpha2_resource_request.c +++ /dev/null @@ -1,109 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_request.h" - - - -v1alpha2_resource_request_t *v1alpha2_resource_request_create( - v1alpha2_named_resources_request_t *named_resources, - object_t *vendor_parameters - ) { - v1alpha2_resource_request_t *v1alpha2_resource_request_local_var = malloc(sizeof(v1alpha2_resource_request_t)); - if (!v1alpha2_resource_request_local_var) { - return NULL; - } - v1alpha2_resource_request_local_var->named_resources = named_resources; - v1alpha2_resource_request_local_var->vendor_parameters = vendor_parameters; - - return v1alpha2_resource_request_local_var; -} - - -void v1alpha2_resource_request_free(v1alpha2_resource_request_t *v1alpha2_resource_request) { - if(NULL == v1alpha2_resource_request){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_request->named_resources) { - v1alpha2_named_resources_request_free(v1alpha2_resource_request->named_resources); - v1alpha2_resource_request->named_resources = NULL; - } - if (v1alpha2_resource_request->vendor_parameters) { - object_free(v1alpha2_resource_request->vendor_parameters); - v1alpha2_resource_request->vendor_parameters = NULL; - } - free(v1alpha2_resource_request); -} - -cJSON *v1alpha2_resource_request_convertToJSON(v1alpha2_resource_request_t *v1alpha2_resource_request) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_request->named_resources - if(v1alpha2_resource_request->named_resources) { - cJSON *named_resources_local_JSON = v1alpha2_named_resources_request_convertToJSON(v1alpha2_resource_request->named_resources); - if(named_resources_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "namedResources", named_resources_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_request->vendor_parameters - if(v1alpha2_resource_request->vendor_parameters) { - cJSON *vendor_parameters_object = object_convertToJSON(v1alpha2_resource_request->vendor_parameters); - if(vendor_parameters_object == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "vendorParameters", vendor_parameters_object); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_request_t *v1alpha2_resource_request_parseFromJSON(cJSON *v1alpha2_resource_requestJSON){ - - v1alpha2_resource_request_t *v1alpha2_resource_request_local_var = NULL; - - // define the local variable for v1alpha2_resource_request->named_resources - v1alpha2_named_resources_request_t *named_resources_local_nonprim = NULL; - - // v1alpha2_resource_request->named_resources - cJSON *named_resources = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_requestJSON, "namedResources"); - if (named_resources) { - named_resources_local_nonprim = v1alpha2_named_resources_request_parseFromJSON(named_resources); //nonprimitive - } - - // v1alpha2_resource_request->vendor_parameters - cJSON *vendor_parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_requestJSON, "vendorParameters"); - object_t *vendor_parameters_local_object = NULL; - if (vendor_parameters) { - vendor_parameters_local_object = object_parseFromJSON(vendor_parameters); //object - } - - - v1alpha2_resource_request_local_var = v1alpha2_resource_request_create ( - named_resources ? named_resources_local_nonprim : NULL, - vendor_parameters ? vendor_parameters_local_object : NULL - ); - - return v1alpha2_resource_request_local_var; -end: - if (named_resources_local_nonprim) { - v1alpha2_named_resources_request_free(named_resources_local_nonprim); - named_resources_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_request.h b/kubernetes/model/v1alpha2_resource_request.h deleted file mode 100644 index 589e5ed2..00000000 --- a/kubernetes/model/v1alpha2_resource_request.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * v1alpha2_resource_request.h - * - * ResourceRequest is a request for resources from one particular driver. - */ - -#ifndef _v1alpha2_resource_request_H_ -#define _v1alpha2_resource_request_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_request_t v1alpha2_resource_request_t; - -#include "object.h" -#include "v1alpha2_named_resources_request.h" - - - -typedef struct v1alpha2_resource_request_t { - struct v1alpha2_named_resources_request_t *named_resources; //model - object_t *vendor_parameters; //object - -} v1alpha2_resource_request_t; - -v1alpha2_resource_request_t *v1alpha2_resource_request_create( - v1alpha2_named_resources_request_t *named_resources, - object_t *vendor_parameters -); - -void v1alpha2_resource_request_free(v1alpha2_resource_request_t *v1alpha2_resource_request); - -v1alpha2_resource_request_t *v1alpha2_resource_request_parseFromJSON(cJSON *v1alpha2_resource_requestJSON); - -cJSON *v1alpha2_resource_request_convertToJSON(v1alpha2_resource_request_t *v1alpha2_resource_request); - -#endif /* _v1alpha2_resource_request_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_slice.c b/kubernetes/model/v1alpha2_resource_slice.c deleted file mode 100644 index 0984bb01..00000000 --- a/kubernetes/model/v1alpha2_resource_slice.c +++ /dev/null @@ -1,215 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_slice.h" - - - -v1alpha2_resource_slice_t *v1alpha2_resource_slice_create( - char *api_version, - char *driver_name, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_named_resources_resources_t *named_resources, - char *node_name - ) { - v1alpha2_resource_slice_t *v1alpha2_resource_slice_local_var = malloc(sizeof(v1alpha2_resource_slice_t)); - if (!v1alpha2_resource_slice_local_var) { - return NULL; - } - v1alpha2_resource_slice_local_var->api_version = api_version; - v1alpha2_resource_slice_local_var->driver_name = driver_name; - v1alpha2_resource_slice_local_var->kind = kind; - v1alpha2_resource_slice_local_var->metadata = metadata; - v1alpha2_resource_slice_local_var->named_resources = named_resources; - v1alpha2_resource_slice_local_var->node_name = node_name; - - return v1alpha2_resource_slice_local_var; -} - - -void v1alpha2_resource_slice_free(v1alpha2_resource_slice_t *v1alpha2_resource_slice) { - if(NULL == v1alpha2_resource_slice){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_slice->api_version) { - free(v1alpha2_resource_slice->api_version); - v1alpha2_resource_slice->api_version = NULL; - } - if (v1alpha2_resource_slice->driver_name) { - free(v1alpha2_resource_slice->driver_name); - v1alpha2_resource_slice->driver_name = NULL; - } - if (v1alpha2_resource_slice->kind) { - free(v1alpha2_resource_slice->kind); - v1alpha2_resource_slice->kind = NULL; - } - if (v1alpha2_resource_slice->metadata) { - v1_object_meta_free(v1alpha2_resource_slice->metadata); - v1alpha2_resource_slice->metadata = NULL; - } - if (v1alpha2_resource_slice->named_resources) { - v1alpha2_named_resources_resources_free(v1alpha2_resource_slice->named_resources); - v1alpha2_resource_slice->named_resources = NULL; - } - if (v1alpha2_resource_slice->node_name) { - free(v1alpha2_resource_slice->node_name); - v1alpha2_resource_slice->node_name = NULL; - } - free(v1alpha2_resource_slice); -} - -cJSON *v1alpha2_resource_slice_convertToJSON(v1alpha2_resource_slice_t *v1alpha2_resource_slice) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_slice->api_version - if(v1alpha2_resource_slice->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_slice->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_slice->driver_name - if (!v1alpha2_resource_slice->driver_name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "driverName", v1alpha2_resource_slice->driver_name) == NULL) { - goto fail; //String - } - - - // v1alpha2_resource_slice->kind - if(v1alpha2_resource_slice->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_slice->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_slice->metadata - if(v1alpha2_resource_slice->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha2_resource_slice->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_slice->named_resources - if(v1alpha2_resource_slice->named_resources) { - cJSON *named_resources_local_JSON = v1alpha2_named_resources_resources_convertToJSON(v1alpha2_resource_slice->named_resources); - if(named_resources_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "namedResources", named_resources_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_resource_slice->node_name - if(v1alpha2_resource_slice->node_name) { - if(cJSON_AddStringToObject(item, "nodeName", v1alpha2_resource_slice->node_name) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_slice_t *v1alpha2_resource_slice_parseFromJSON(cJSON *v1alpha2_resource_sliceJSON){ - - v1alpha2_resource_slice_t *v1alpha2_resource_slice_local_var = NULL; - - // define the local variable for v1alpha2_resource_slice->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1alpha2_resource_slice->named_resources - v1alpha2_named_resources_resources_t *named_resources_local_nonprim = NULL; - - // v1alpha2_resource_slice->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_sliceJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_slice->driver_name - cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_sliceJSON, "driverName"); - if (!driver_name) { - goto end; - } - - - if(!cJSON_IsString(driver_name)) - { - goto end; //String - } - - // v1alpha2_resource_slice->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_sliceJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_slice->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_sliceJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1alpha2_resource_slice->named_resources - cJSON *named_resources = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_sliceJSON, "namedResources"); - if (named_resources) { - named_resources_local_nonprim = v1alpha2_named_resources_resources_parseFromJSON(named_resources); //nonprimitive - } - - // v1alpha2_resource_slice->node_name - cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_sliceJSON, "nodeName"); - if (node_name) { - if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) - { - goto end; //String - } - } - - - v1alpha2_resource_slice_local_var = v1alpha2_resource_slice_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - strdup(driver_name->valuestring), - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - named_resources ? named_resources_local_nonprim : NULL, - node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL - ); - - return v1alpha2_resource_slice_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (named_resources_local_nonprim) { - v1alpha2_named_resources_resources_free(named_resources_local_nonprim); - named_resources_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_slice.h b/kubernetes/model/v1alpha2_resource_slice.h deleted file mode 100644 index a8313b16..00000000 --- a/kubernetes/model/v1alpha2_resource_slice.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * v1alpha2_resource_slice.h - * - * ResourceSlice provides information about available resources on individual nodes. - */ - -#ifndef _v1alpha2_resource_slice_H_ -#define _v1alpha2_resource_slice_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_slice_t v1alpha2_resource_slice_t; - -#include "v1_object_meta.h" -#include "v1alpha2_named_resources_resources.h" - - - -typedef struct v1alpha2_resource_slice_t { - char *api_version; // string - char *driver_name; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1alpha2_named_resources_resources_t *named_resources; //model - char *node_name; // string - -} v1alpha2_resource_slice_t; - -v1alpha2_resource_slice_t *v1alpha2_resource_slice_create( - char *api_version, - char *driver_name, - char *kind, - v1_object_meta_t *metadata, - v1alpha2_named_resources_resources_t *named_resources, - char *node_name -); - -void v1alpha2_resource_slice_free(v1alpha2_resource_slice_t *v1alpha2_resource_slice); - -v1alpha2_resource_slice_t *v1alpha2_resource_slice_parseFromJSON(cJSON *v1alpha2_resource_sliceJSON); - -cJSON *v1alpha2_resource_slice_convertToJSON(v1alpha2_resource_slice_t *v1alpha2_resource_slice); - -#endif /* _v1alpha2_resource_slice_H_ */ - diff --git a/kubernetes/model/v1alpha2_resource_slice_list.c b/kubernetes/model/v1alpha2_resource_slice_list.c deleted file mode 100644 index a003e003..00000000 --- a/kubernetes/model/v1alpha2_resource_slice_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1alpha2_resource_slice_list.h" - - - -v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list_local_var = malloc(sizeof(v1alpha2_resource_slice_list_t)); - if (!v1alpha2_resource_slice_list_local_var) { - return NULL; - } - v1alpha2_resource_slice_list_local_var->api_version = api_version; - v1alpha2_resource_slice_list_local_var->items = items; - v1alpha2_resource_slice_list_local_var->kind = kind; - v1alpha2_resource_slice_list_local_var->metadata = metadata; - - return v1alpha2_resource_slice_list_local_var; -} - - -void v1alpha2_resource_slice_list_free(v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list) { - if(NULL == v1alpha2_resource_slice_list){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_resource_slice_list->api_version) { - free(v1alpha2_resource_slice_list->api_version); - v1alpha2_resource_slice_list->api_version = NULL; - } - if (v1alpha2_resource_slice_list->items) { - list_ForEach(listEntry, v1alpha2_resource_slice_list->items) { - v1alpha2_resource_slice_free(listEntry->data); - } - list_freeList(v1alpha2_resource_slice_list->items); - v1alpha2_resource_slice_list->items = NULL; - } - if (v1alpha2_resource_slice_list->kind) { - free(v1alpha2_resource_slice_list->kind); - v1alpha2_resource_slice_list->kind = NULL; - } - if (v1alpha2_resource_slice_list->metadata) { - v1_list_meta_free(v1alpha2_resource_slice_list->metadata); - v1alpha2_resource_slice_list->metadata = NULL; - } - free(v1alpha2_resource_slice_list); -} - -cJSON *v1alpha2_resource_slice_list_convertToJSON(v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_resource_slice_list->api_version - if(v1alpha2_resource_slice_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1alpha2_resource_slice_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_slice_list->items - if (!v1alpha2_resource_slice_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1alpha2_resource_slice_list->items) { - list_ForEach(itemsListEntry, v1alpha2_resource_slice_list->items) { - cJSON *itemLocal = v1alpha2_resource_slice_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1alpha2_resource_slice_list->kind - if(v1alpha2_resource_slice_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1alpha2_resource_slice_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_resource_slice_list->metadata - if(v1alpha2_resource_slice_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha2_resource_slice_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list_parseFromJSON(cJSON *v1alpha2_resource_slice_listJSON){ - - v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list_local_var = NULL; - - // define the local list for v1alpha2_resource_slice_list->items - list_t *itemsList = NULL; - - // define the local variable for v1alpha2_resource_slice_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1alpha2_resource_slice_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_slice_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1alpha2_resource_slice_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_slice_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1alpha2_resource_slice_t *itemsItem = v1alpha2_resource_slice_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1alpha2_resource_slice_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_slice_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1alpha2_resource_slice_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha2_resource_slice_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1alpha2_resource_slice_list_local_var = v1alpha2_resource_slice_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1alpha2_resource_slice_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1alpha2_resource_slice_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_resource_slice_list.h b/kubernetes/model/v1alpha2_resource_slice_list.h deleted file mode 100644 index 20a98acc..00000000 --- a/kubernetes/model/v1alpha2_resource_slice_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_resource_slice_list.h - * - * ResourceSliceList is a collection of ResourceSlices. - */ - -#ifndef _v1alpha2_resource_slice_list_H_ -#define _v1alpha2_resource_slice_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_resource_slice_list_t v1alpha2_resource_slice_list_t; - -#include "v1_list_meta.h" -#include "v1alpha2_resource_slice.h" - - - -typedef struct v1alpha2_resource_slice_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1alpha2_resource_slice_list_t; - -v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1alpha2_resource_slice_list_free(v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list); - -v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list_parseFromJSON(cJSON *v1alpha2_resource_slice_listJSON); - -cJSON *v1alpha2_resource_slice_list_convertToJSON(v1alpha2_resource_slice_list_t *v1alpha2_resource_slice_list); - -#endif /* _v1alpha2_resource_slice_list_H_ */ - diff --git a/kubernetes/model/v1alpha2_structured_resource_handle.c b/kubernetes/model/v1alpha2_structured_resource_handle.c deleted file mode 100644 index ef7a43fd..00000000 --- a/kubernetes/model/v1alpha2_structured_resource_handle.c +++ /dev/null @@ -1,194 +0,0 @@ -#include -#include -#include -#include "v1alpha2_structured_resource_handle.h" - - - -v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle_create( - char *node_name, - list_t *results, - object_t *vendor_claim_parameters, - object_t *vendor_class_parameters - ) { - v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle_local_var = malloc(sizeof(v1alpha2_structured_resource_handle_t)); - if (!v1alpha2_structured_resource_handle_local_var) { - return NULL; - } - v1alpha2_structured_resource_handle_local_var->node_name = node_name; - v1alpha2_structured_resource_handle_local_var->results = results; - v1alpha2_structured_resource_handle_local_var->vendor_claim_parameters = vendor_claim_parameters; - v1alpha2_structured_resource_handle_local_var->vendor_class_parameters = vendor_class_parameters; - - return v1alpha2_structured_resource_handle_local_var; -} - - -void v1alpha2_structured_resource_handle_free(v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle) { - if(NULL == v1alpha2_structured_resource_handle){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_structured_resource_handle->node_name) { - free(v1alpha2_structured_resource_handle->node_name); - v1alpha2_structured_resource_handle->node_name = NULL; - } - if (v1alpha2_structured_resource_handle->results) { - list_ForEach(listEntry, v1alpha2_structured_resource_handle->results) { - v1alpha2_driver_allocation_result_free(listEntry->data); - } - list_freeList(v1alpha2_structured_resource_handle->results); - v1alpha2_structured_resource_handle->results = NULL; - } - if (v1alpha2_structured_resource_handle->vendor_claim_parameters) { - object_free(v1alpha2_structured_resource_handle->vendor_claim_parameters); - v1alpha2_structured_resource_handle->vendor_claim_parameters = NULL; - } - if (v1alpha2_structured_resource_handle->vendor_class_parameters) { - object_free(v1alpha2_structured_resource_handle->vendor_class_parameters); - v1alpha2_structured_resource_handle->vendor_class_parameters = NULL; - } - free(v1alpha2_structured_resource_handle); -} - -cJSON *v1alpha2_structured_resource_handle_convertToJSON(v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_structured_resource_handle->node_name - if(v1alpha2_structured_resource_handle->node_name) { - if(cJSON_AddStringToObject(item, "nodeName", v1alpha2_structured_resource_handle->node_name) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_structured_resource_handle->results - if (!v1alpha2_structured_resource_handle->results) { - goto fail; - } - cJSON *results = cJSON_AddArrayToObject(item, "results"); - if(results == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *resultsListEntry; - if (v1alpha2_structured_resource_handle->results) { - list_ForEach(resultsListEntry, v1alpha2_structured_resource_handle->results) { - cJSON *itemLocal = v1alpha2_driver_allocation_result_convertToJSON(resultsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(results, itemLocal); - } - } - - - // v1alpha2_structured_resource_handle->vendor_claim_parameters - if(v1alpha2_structured_resource_handle->vendor_claim_parameters) { - cJSON *vendor_claim_parameters_object = object_convertToJSON(v1alpha2_structured_resource_handle->vendor_claim_parameters); - if(vendor_claim_parameters_object == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "vendorClaimParameters", vendor_claim_parameters_object); - if(item->child == NULL) { - goto fail; - } - } - - - // v1alpha2_structured_resource_handle->vendor_class_parameters - if(v1alpha2_structured_resource_handle->vendor_class_parameters) { - cJSON *vendor_class_parameters_object = object_convertToJSON(v1alpha2_structured_resource_handle->vendor_class_parameters); - if(vendor_class_parameters_object == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "vendorClassParameters", vendor_class_parameters_object); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle_parseFromJSON(cJSON *v1alpha2_structured_resource_handleJSON){ - - v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle_local_var = NULL; - - // define the local list for v1alpha2_structured_resource_handle->results - list_t *resultsList = NULL; - - // v1alpha2_structured_resource_handle->node_name - cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_structured_resource_handleJSON, "nodeName"); - if (node_name) { - if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) - { - goto end; //String - } - } - - // v1alpha2_structured_resource_handle->results - cJSON *results = cJSON_GetObjectItemCaseSensitive(v1alpha2_structured_resource_handleJSON, "results"); - if (!results) { - goto end; - } - - - cJSON *results_local_nonprimitive = NULL; - if(!cJSON_IsArray(results)){ - goto end; //nonprimitive container - } - - resultsList = list_createList(); - - cJSON_ArrayForEach(results_local_nonprimitive,results ) - { - if(!cJSON_IsObject(results_local_nonprimitive)){ - goto end; - } - v1alpha2_driver_allocation_result_t *resultsItem = v1alpha2_driver_allocation_result_parseFromJSON(results_local_nonprimitive); - - list_addElement(resultsList, resultsItem); - } - - // v1alpha2_structured_resource_handle->vendor_claim_parameters - cJSON *vendor_claim_parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_structured_resource_handleJSON, "vendorClaimParameters"); - object_t *vendor_claim_parameters_local_object = NULL; - if (vendor_claim_parameters) { - vendor_claim_parameters_local_object = object_parseFromJSON(vendor_claim_parameters); //object - } - - // v1alpha2_structured_resource_handle->vendor_class_parameters - cJSON *vendor_class_parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_structured_resource_handleJSON, "vendorClassParameters"); - object_t *vendor_class_parameters_local_object = NULL; - if (vendor_class_parameters) { - vendor_class_parameters_local_object = object_parseFromJSON(vendor_class_parameters); //object - } - - - v1alpha2_structured_resource_handle_local_var = v1alpha2_structured_resource_handle_create ( - node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, - resultsList, - vendor_claim_parameters ? vendor_claim_parameters_local_object : NULL, - vendor_class_parameters ? vendor_class_parameters_local_object : NULL - ); - - return v1alpha2_structured_resource_handle_local_var; -end: - if (resultsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, resultsList) { - v1alpha2_driver_allocation_result_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(resultsList); - resultsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_structured_resource_handle.h b/kubernetes/model/v1alpha2_structured_resource_handle.h deleted file mode 100644 index dc8e483b..00000000 --- a/kubernetes/model/v1alpha2_structured_resource_handle.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1alpha2_structured_resource_handle.h - * - * StructuredResourceHandle is the in-tree representation of the allocation result. - */ - -#ifndef _v1alpha2_structured_resource_handle_H_ -#define _v1alpha2_structured_resource_handle_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_structured_resource_handle_t v1alpha2_structured_resource_handle_t; - -#include "object.h" -#include "v1alpha2_driver_allocation_result.h" - - - -typedef struct v1alpha2_structured_resource_handle_t { - char *node_name; // string - list_t *results; //nonprimitive container - object_t *vendor_claim_parameters; //object - object_t *vendor_class_parameters; //object - -} v1alpha2_structured_resource_handle_t; - -v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle_create( - char *node_name, - list_t *results, - object_t *vendor_claim_parameters, - object_t *vendor_class_parameters -); - -void v1alpha2_structured_resource_handle_free(v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle); - -v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle_parseFromJSON(cJSON *v1alpha2_structured_resource_handleJSON); - -cJSON *v1alpha2_structured_resource_handle_convertToJSON(v1alpha2_structured_resource_handle_t *v1alpha2_structured_resource_handle); - -#endif /* _v1alpha2_structured_resource_handle_H_ */ - diff --git a/kubernetes/model/v1alpha2_vendor_parameters.c b/kubernetes/model/v1alpha2_vendor_parameters.c deleted file mode 100644 index 5d6351dd..00000000 --- a/kubernetes/model/v1alpha2_vendor_parameters.c +++ /dev/null @@ -1,100 +0,0 @@ -#include -#include -#include -#include "v1alpha2_vendor_parameters.h" - - - -v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters_create( - char *driver_name, - object_t *parameters - ) { - v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters_local_var = malloc(sizeof(v1alpha2_vendor_parameters_t)); - if (!v1alpha2_vendor_parameters_local_var) { - return NULL; - } - v1alpha2_vendor_parameters_local_var->driver_name = driver_name; - v1alpha2_vendor_parameters_local_var->parameters = parameters; - - return v1alpha2_vendor_parameters_local_var; -} - - -void v1alpha2_vendor_parameters_free(v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters) { - if(NULL == v1alpha2_vendor_parameters){ - return ; - } - listEntry_t *listEntry; - if (v1alpha2_vendor_parameters->driver_name) { - free(v1alpha2_vendor_parameters->driver_name); - v1alpha2_vendor_parameters->driver_name = NULL; - } - if (v1alpha2_vendor_parameters->parameters) { - object_free(v1alpha2_vendor_parameters->parameters); - v1alpha2_vendor_parameters->parameters = NULL; - } - free(v1alpha2_vendor_parameters); -} - -cJSON *v1alpha2_vendor_parameters_convertToJSON(v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters) { - cJSON *item = cJSON_CreateObject(); - - // v1alpha2_vendor_parameters->driver_name - if(v1alpha2_vendor_parameters->driver_name) { - if(cJSON_AddStringToObject(item, "driverName", v1alpha2_vendor_parameters->driver_name) == NULL) { - goto fail; //String - } - } - - - // v1alpha2_vendor_parameters->parameters - if(v1alpha2_vendor_parameters->parameters) { - cJSON *parameters_object = object_convertToJSON(v1alpha2_vendor_parameters->parameters); - if(parameters_object == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "parameters", parameters_object); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters_parseFromJSON(cJSON *v1alpha2_vendor_parametersJSON){ - - v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters_local_var = NULL; - - // v1alpha2_vendor_parameters->driver_name - cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1alpha2_vendor_parametersJSON, "driverName"); - if (driver_name) { - if(!cJSON_IsString(driver_name) && !cJSON_IsNull(driver_name)) - { - goto end; //String - } - } - - // v1alpha2_vendor_parameters->parameters - cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1alpha2_vendor_parametersJSON, "parameters"); - object_t *parameters_local_object = NULL; - if (parameters) { - parameters_local_object = object_parseFromJSON(parameters); //object - } - - - v1alpha2_vendor_parameters_local_var = v1alpha2_vendor_parameters_create ( - driver_name && !cJSON_IsNull(driver_name) ? strdup(driver_name->valuestring) : NULL, - parameters ? parameters_local_object : NULL - ); - - return v1alpha2_vendor_parameters_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1alpha2_vendor_parameters.h b/kubernetes/model/v1alpha2_vendor_parameters.h deleted file mode 100644 index 27866713..00000000 --- a/kubernetes/model/v1alpha2_vendor_parameters.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * v1alpha2_vendor_parameters.h - * - * VendorParameters are opaque parameters for one particular driver. - */ - -#ifndef _v1alpha2_vendor_parameters_H_ -#define _v1alpha2_vendor_parameters_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1alpha2_vendor_parameters_t v1alpha2_vendor_parameters_t; - -#include "object.h" - - - -typedef struct v1alpha2_vendor_parameters_t { - char *driver_name; // string - object_t *parameters; //object - -} v1alpha2_vendor_parameters_t; - -v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters_create( - char *driver_name, - object_t *parameters -); - -void v1alpha2_vendor_parameters_free(v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters); - -v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters_parseFromJSON(cJSON *v1alpha2_vendor_parametersJSON); - -cJSON *v1alpha2_vendor_parameters_convertToJSON(v1alpha2_vendor_parameters_t *v1alpha2_vendor_parameters); - -#endif /* _v1alpha2_vendor_parameters_H_ */ - diff --git a/kubernetes/model/v1alpha3_cel_device_selector.c b/kubernetes/model/v1alpha3_cel_device_selector.c new file mode 100644 index 00000000..4b1e0c92 --- /dev/null +++ b/kubernetes/model/v1alpha3_cel_device_selector.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1alpha3_cel_device_selector.h" + + + +static v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector_create_internal( + char *expression + ) { + v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector_local_var = malloc(sizeof(v1alpha3_cel_device_selector_t)); + if (!v1alpha3_cel_device_selector_local_var) { + return NULL; + } + v1alpha3_cel_device_selector_local_var->expression = expression; + + v1alpha3_cel_device_selector_local_var->_library_owned = 1; + return v1alpha3_cel_device_selector_local_var; +} + +__attribute__((deprecated)) v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector_create( + char *expression + ) { + return v1alpha3_cel_device_selector_create_internal ( + expression + ); +} + +void v1alpha3_cel_device_selector_free(v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector) { + if(NULL == v1alpha3_cel_device_selector){ + return ; + } + if(v1alpha3_cel_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_cel_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_cel_device_selector->expression) { + free(v1alpha3_cel_device_selector->expression); + v1alpha3_cel_device_selector->expression = NULL; + } + free(v1alpha3_cel_device_selector); +} + +cJSON *v1alpha3_cel_device_selector_convertToJSON(v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_cel_device_selector->expression + if (!v1alpha3_cel_device_selector->expression) { + goto fail; + } + if(cJSON_AddStringToObject(item, "expression", v1alpha3_cel_device_selector->expression) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector_parseFromJSON(cJSON *v1alpha3_cel_device_selectorJSON){ + + v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector_local_var = NULL; + + // v1alpha3_cel_device_selector->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1alpha3_cel_device_selectorJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (!expression) { + goto end; + } + + + if(!cJSON_IsString(expression)) + { + goto end; //String + } + + + v1alpha3_cel_device_selector_local_var = v1alpha3_cel_device_selector_create_internal ( + strdup(expression->valuestring) + ); + + return v1alpha3_cel_device_selector_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_cel_device_selector.h b/kubernetes/model/v1alpha3_cel_device_selector.h new file mode 100644 index 00000000..87744bb0 --- /dev/null +++ b/kubernetes/model/v1alpha3_cel_device_selector.h @@ -0,0 +1,38 @@ +/* + * v1alpha3_cel_device_selector.h + * + * CELDeviceSelector contains a CEL expression for selecting a device. + */ + +#ifndef _v1alpha3_cel_device_selector_H_ +#define _v1alpha3_cel_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_cel_device_selector_t v1alpha3_cel_device_selector_t; + + + + +typedef struct v1alpha3_cel_device_selector_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_cel_device_selector_t; + +__attribute__((deprecated)) v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector_create( + char *expression +); + +void v1alpha3_cel_device_selector_free(v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector); + +v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector_parseFromJSON(cJSON *v1alpha3_cel_device_selectorJSON); + +cJSON *v1alpha3_cel_device_selector_convertToJSON(v1alpha3_cel_device_selector_t *v1alpha3_cel_device_selector); + +#endif /* _v1alpha3_cel_device_selector_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_selector.c b/kubernetes/model/v1alpha3_device_selector.c new file mode 100644 index 00000000..9500d473 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_selector.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1alpha3_device_selector.h" + + + +static v1alpha3_device_selector_t *v1alpha3_device_selector_create_internal( + v1alpha3_cel_device_selector_t *cel + ) { + v1alpha3_device_selector_t *v1alpha3_device_selector_local_var = malloc(sizeof(v1alpha3_device_selector_t)); + if (!v1alpha3_device_selector_local_var) { + return NULL; + } + v1alpha3_device_selector_local_var->cel = cel; + + v1alpha3_device_selector_local_var->_library_owned = 1; + return v1alpha3_device_selector_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_selector_t *v1alpha3_device_selector_create( + v1alpha3_cel_device_selector_t *cel + ) { + return v1alpha3_device_selector_create_internal ( + cel + ); +} + +void v1alpha3_device_selector_free(v1alpha3_device_selector_t *v1alpha3_device_selector) { + if(NULL == v1alpha3_device_selector){ + return ; + } + if(v1alpha3_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_selector->cel) { + v1alpha3_cel_device_selector_free(v1alpha3_device_selector->cel); + v1alpha3_device_selector->cel = NULL; + } + free(v1alpha3_device_selector); +} + +cJSON *v1alpha3_device_selector_convertToJSON(v1alpha3_device_selector_t *v1alpha3_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_selector->cel + if(v1alpha3_device_selector->cel) { + cJSON *cel_local_JSON = v1alpha3_cel_device_selector_convertToJSON(v1alpha3_device_selector->cel); + if(cel_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "cel", cel_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_selector_t *v1alpha3_device_selector_parseFromJSON(cJSON *v1alpha3_device_selectorJSON){ + + v1alpha3_device_selector_t *v1alpha3_device_selector_local_var = NULL; + + // define the local variable for v1alpha3_device_selector->cel + v1alpha3_cel_device_selector_t *cel_local_nonprim = NULL; + + // v1alpha3_device_selector->cel + cJSON *cel = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_selectorJSON, "cel"); + if (cJSON_IsNull(cel)) { + cel = NULL; + } + if (cel) { + cel_local_nonprim = v1alpha3_cel_device_selector_parseFromJSON(cel); //nonprimitive + } + + + v1alpha3_device_selector_local_var = v1alpha3_device_selector_create_internal ( + cel ? cel_local_nonprim : NULL + ); + + return v1alpha3_device_selector_local_var; +end: + if (cel_local_nonprim) { + v1alpha3_cel_device_selector_free(cel_local_nonprim); + cel_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_selector.h b/kubernetes/model/v1alpha3_device_selector.h new file mode 100644 index 00000000..b4541514 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_selector.h @@ -0,0 +1,39 @@ +/* + * v1alpha3_device_selector.h + * + * DeviceSelector must have exactly one field set. + */ + +#ifndef _v1alpha3_device_selector_H_ +#define _v1alpha3_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_selector_t v1alpha3_device_selector_t; + +#include "v1alpha3_cel_device_selector.h" + + + +typedef struct v1alpha3_device_selector_t { + struct v1alpha3_cel_device_selector_t *cel; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_device_selector_t; + +__attribute__((deprecated)) v1alpha3_device_selector_t *v1alpha3_device_selector_create( + v1alpha3_cel_device_selector_t *cel +); + +void v1alpha3_device_selector_free(v1alpha3_device_selector_t *v1alpha3_device_selector); + +v1alpha3_device_selector_t *v1alpha3_device_selector_parseFromJSON(cJSON *v1alpha3_device_selectorJSON); + +cJSON *v1alpha3_device_selector_convertToJSON(v1alpha3_device_selector_t *v1alpha3_device_selector); + +#endif /* _v1alpha3_device_selector_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_taint.c b/kubernetes/model/v1alpha3_device_taint.c new file mode 100644 index 00000000..1a1132b3 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include "v1alpha3_device_taint.h" + + + +static v1alpha3_device_taint_t *v1alpha3_device_taint_create_internal( + char *effect, + char *key, + char *time_added, + char *value + ) { + v1alpha3_device_taint_t *v1alpha3_device_taint_local_var = malloc(sizeof(v1alpha3_device_taint_t)); + if (!v1alpha3_device_taint_local_var) { + return NULL; + } + v1alpha3_device_taint_local_var->effect = effect; + v1alpha3_device_taint_local_var->key = key; + v1alpha3_device_taint_local_var->time_added = time_added; + v1alpha3_device_taint_local_var->value = value; + + v1alpha3_device_taint_local_var->_library_owned = 1; + return v1alpha3_device_taint_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_taint_t *v1alpha3_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value + ) { + return v1alpha3_device_taint_create_internal ( + effect, + key, + time_added, + value + ); +} + +void v1alpha3_device_taint_free(v1alpha3_device_taint_t *v1alpha3_device_taint) { + if(NULL == v1alpha3_device_taint){ + return ; + } + if(v1alpha3_device_taint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_taint_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_taint->effect) { + free(v1alpha3_device_taint->effect); + v1alpha3_device_taint->effect = NULL; + } + if (v1alpha3_device_taint->key) { + free(v1alpha3_device_taint->key); + v1alpha3_device_taint->key = NULL; + } + if (v1alpha3_device_taint->time_added) { + free(v1alpha3_device_taint->time_added); + v1alpha3_device_taint->time_added = NULL; + } + if (v1alpha3_device_taint->value) { + free(v1alpha3_device_taint->value); + v1alpha3_device_taint->value = NULL; + } + free(v1alpha3_device_taint); +} + +cJSON *v1alpha3_device_taint_convertToJSON(v1alpha3_device_taint_t *v1alpha3_device_taint) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_taint->effect + if (!v1alpha3_device_taint->effect) { + goto fail; + } + if(cJSON_AddStringToObject(item, "effect", v1alpha3_device_taint->effect) == NULL) { + goto fail; //String + } + + + // v1alpha3_device_taint->key + if (!v1alpha3_device_taint->key) { + goto fail; + } + if(cJSON_AddStringToObject(item, "key", v1alpha3_device_taint->key) == NULL) { + goto fail; //String + } + + + // v1alpha3_device_taint->time_added + if(v1alpha3_device_taint->time_added) { + if(cJSON_AddStringToObject(item, "timeAdded", v1alpha3_device_taint->time_added) == NULL) { + goto fail; //Date-Time + } + } + + + // v1alpha3_device_taint->value + if(v1alpha3_device_taint->value) { + if(cJSON_AddStringToObject(item, "value", v1alpha3_device_taint->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_taint_t *v1alpha3_device_taint_parseFromJSON(cJSON *v1alpha3_device_taintJSON){ + + v1alpha3_device_taint_t *v1alpha3_device_taint_local_var = NULL; + + // v1alpha3_device_taint->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taintJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (!effect) { + goto end; + } + + + if(!cJSON_IsString(effect)) + { + goto end; //String + } + + // v1alpha3_device_taint->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taintJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (!key) { + goto end; + } + + + if(!cJSON_IsString(key)) + { + goto end; //String + } + + // v1alpha3_device_taint->time_added + cJSON *time_added = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taintJSON, "timeAdded"); + if (cJSON_IsNull(time_added)) { + time_added = NULL; + } + if (time_added) { + if(!cJSON_IsString(time_added) && !cJSON_IsNull(time_added)) + { + goto end; //DateTime + } + } + + // v1alpha3_device_taint->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taintJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1alpha3_device_taint_local_var = v1alpha3_device_taint_create_internal ( + strdup(effect->valuestring), + strdup(key->valuestring), + time_added && !cJSON_IsNull(time_added) ? strdup(time_added->valuestring) : NULL, + value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL + ); + + return v1alpha3_device_taint_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_taint.h b/kubernetes/model/v1alpha3_device_taint.h new file mode 100644 index 00000000..c67ebdd9 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint.h @@ -0,0 +1,44 @@ +/* + * v1alpha3_device_taint.h + * + * The device this taint is attached to has the \"effect\" on any claim which does not tolerate the taint and, through the claim, to pods using the claim. + */ + +#ifndef _v1alpha3_device_taint_H_ +#define _v1alpha3_device_taint_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_taint_t v1alpha3_device_taint_t; + + + + +typedef struct v1alpha3_device_taint_t { + char *effect; // string + char *key; // string + char *time_added; //date time + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_device_taint_t; + +__attribute__((deprecated)) v1alpha3_device_taint_t *v1alpha3_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value +); + +void v1alpha3_device_taint_free(v1alpha3_device_taint_t *v1alpha3_device_taint); + +v1alpha3_device_taint_t *v1alpha3_device_taint_parseFromJSON(cJSON *v1alpha3_device_taintJSON); + +cJSON *v1alpha3_device_taint_convertToJSON(v1alpha3_device_taint_t *v1alpha3_device_taint); + +#endif /* _v1alpha3_device_taint_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_taint_rule.c b/kubernetes/model/v1alpha3_device_taint_rule.c new file mode 100644 index 00000000..aea7022b --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_rule.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1alpha3_device_taint_rule.h" + + + +static v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha3_device_taint_rule_spec_t *spec + ) { + v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule_local_var = malloc(sizeof(v1alpha3_device_taint_rule_t)); + if (!v1alpha3_device_taint_rule_local_var) { + return NULL; + } + v1alpha3_device_taint_rule_local_var->api_version = api_version; + v1alpha3_device_taint_rule_local_var->kind = kind; + v1alpha3_device_taint_rule_local_var->metadata = metadata; + v1alpha3_device_taint_rule_local_var->spec = spec; + + v1alpha3_device_taint_rule_local_var->_library_owned = 1; + return v1alpha3_device_taint_rule_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha3_device_taint_rule_spec_t *spec + ) { + return v1alpha3_device_taint_rule_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1alpha3_device_taint_rule_free(v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule) { + if(NULL == v1alpha3_device_taint_rule){ + return ; + } + if(v1alpha3_device_taint_rule->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_taint_rule_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_taint_rule->api_version) { + free(v1alpha3_device_taint_rule->api_version); + v1alpha3_device_taint_rule->api_version = NULL; + } + if (v1alpha3_device_taint_rule->kind) { + free(v1alpha3_device_taint_rule->kind); + v1alpha3_device_taint_rule->kind = NULL; + } + if (v1alpha3_device_taint_rule->metadata) { + v1_object_meta_free(v1alpha3_device_taint_rule->metadata); + v1alpha3_device_taint_rule->metadata = NULL; + } + if (v1alpha3_device_taint_rule->spec) { + v1alpha3_device_taint_rule_spec_free(v1alpha3_device_taint_rule->spec); + v1alpha3_device_taint_rule->spec = NULL; + } + free(v1alpha3_device_taint_rule); +} + +cJSON *v1alpha3_device_taint_rule_convertToJSON(v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_taint_rule->api_version + if(v1alpha3_device_taint_rule->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha3_device_taint_rule->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_rule->kind + if(v1alpha3_device_taint_rule->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha3_device_taint_rule->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_rule->metadata + if(v1alpha3_device_taint_rule->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1alpha3_device_taint_rule->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha3_device_taint_rule->spec + if (!v1alpha3_device_taint_rule->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1alpha3_device_taint_rule_spec_convertToJSON(v1alpha3_device_taint_rule->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule_parseFromJSON(cJSON *v1alpha3_device_taint_ruleJSON){ + + v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule_local_var = NULL; + + // define the local variable for v1alpha3_device_taint_rule->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1alpha3_device_taint_rule->spec + v1alpha3_device_taint_rule_spec_t *spec_local_nonprim = NULL; + + // v1alpha3_device_taint_rule->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_ruleJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_rule->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_ruleJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_rule->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_ruleJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1alpha3_device_taint_rule->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_ruleJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1alpha3_device_taint_rule_spec_parseFromJSON(spec); //nonprimitive + + + v1alpha3_device_taint_rule_local_var = v1alpha3_device_taint_rule_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1alpha3_device_taint_rule_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1alpha3_device_taint_rule_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_taint_rule.h b/kubernetes/model/v1alpha3_device_taint_rule.h new file mode 100644 index 00000000..a9f51b2f --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_rule.h @@ -0,0 +1,46 @@ +/* + * v1alpha3_device_taint_rule.h + * + * DeviceTaintRule adds one taint to all devices which match the selector. This has the same effect as if the taint was specified directly in the ResourceSlice by the DRA driver. + */ + +#ifndef _v1alpha3_device_taint_rule_H_ +#define _v1alpha3_device_taint_rule_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_taint_rule_t v1alpha3_device_taint_rule_t; + +#include "v1_object_meta.h" +#include "v1alpha3_device_taint_rule_spec.h" + + + +typedef struct v1alpha3_device_taint_rule_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1alpha3_device_taint_rule_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_device_taint_rule_t; + +__attribute__((deprecated)) v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1alpha3_device_taint_rule_spec_t *spec +); + +void v1alpha3_device_taint_rule_free(v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule); + +v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule_parseFromJSON(cJSON *v1alpha3_device_taint_ruleJSON); + +cJSON *v1alpha3_device_taint_rule_convertToJSON(v1alpha3_device_taint_rule_t *v1alpha3_device_taint_rule); + +#endif /* _v1alpha3_device_taint_rule_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_taint_rule_list.c b/kubernetes/model/v1alpha3_device_taint_rule_list.c new file mode 100644 index 00000000..7d3ccff7 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_rule_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1alpha3_device_taint_rule_list.h" + + + +static v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list_local_var = malloc(sizeof(v1alpha3_device_taint_rule_list_t)); + if (!v1alpha3_device_taint_rule_list_local_var) { + return NULL; + } + v1alpha3_device_taint_rule_list_local_var->api_version = api_version; + v1alpha3_device_taint_rule_list_local_var->items = items; + v1alpha3_device_taint_rule_list_local_var->kind = kind; + v1alpha3_device_taint_rule_list_local_var->metadata = metadata; + + v1alpha3_device_taint_rule_list_local_var->_library_owned = 1; + return v1alpha3_device_taint_rule_list_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1alpha3_device_taint_rule_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1alpha3_device_taint_rule_list_free(v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list) { + if(NULL == v1alpha3_device_taint_rule_list){ + return ; + } + if(v1alpha3_device_taint_rule_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_taint_rule_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_taint_rule_list->api_version) { + free(v1alpha3_device_taint_rule_list->api_version); + v1alpha3_device_taint_rule_list->api_version = NULL; + } + if (v1alpha3_device_taint_rule_list->items) { + list_ForEach(listEntry, v1alpha3_device_taint_rule_list->items) { + v1alpha3_device_taint_rule_free(listEntry->data); + } + list_freeList(v1alpha3_device_taint_rule_list->items); + v1alpha3_device_taint_rule_list->items = NULL; + } + if (v1alpha3_device_taint_rule_list->kind) { + free(v1alpha3_device_taint_rule_list->kind); + v1alpha3_device_taint_rule_list->kind = NULL; + } + if (v1alpha3_device_taint_rule_list->metadata) { + v1_list_meta_free(v1alpha3_device_taint_rule_list->metadata); + v1alpha3_device_taint_rule_list->metadata = NULL; + } + free(v1alpha3_device_taint_rule_list); +} + +cJSON *v1alpha3_device_taint_rule_list_convertToJSON(v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_taint_rule_list->api_version + if(v1alpha3_device_taint_rule_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1alpha3_device_taint_rule_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_rule_list->items + if (!v1alpha3_device_taint_rule_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1alpha3_device_taint_rule_list->items) { + list_ForEach(itemsListEntry, v1alpha3_device_taint_rule_list->items) { + cJSON *itemLocal = v1alpha3_device_taint_rule_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1alpha3_device_taint_rule_list->kind + if(v1alpha3_device_taint_rule_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1alpha3_device_taint_rule_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_rule_list->metadata + if(v1alpha3_device_taint_rule_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1alpha3_device_taint_rule_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list_parseFromJSON(cJSON *v1alpha3_device_taint_rule_listJSON){ + + v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list_local_var = NULL; + + // define the local list for v1alpha3_device_taint_rule_list->items + list_t *itemsList = NULL; + + // define the local variable for v1alpha3_device_taint_rule_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1alpha3_device_taint_rule_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_rule_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_rule_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_rule_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1alpha3_device_taint_rule_t *itemsItem = v1alpha3_device_taint_rule_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1alpha3_device_taint_rule_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_rule_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_rule_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_rule_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1alpha3_device_taint_rule_list_local_var = v1alpha3_device_taint_rule_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1alpha3_device_taint_rule_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha3_device_taint_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_taint_rule_list.h b/kubernetes/model/v1alpha3_device_taint_rule_list.h new file mode 100644 index 00000000..4831afc8 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_rule_list.h @@ -0,0 +1,46 @@ +/* + * v1alpha3_device_taint_rule_list.h + * + * DeviceTaintRuleList is a collection of DeviceTaintRules. + */ + +#ifndef _v1alpha3_device_taint_rule_list_H_ +#define _v1alpha3_device_taint_rule_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_taint_rule_list_t v1alpha3_device_taint_rule_list_t; + +#include "v1_list_meta.h" +#include "v1alpha3_device_taint_rule.h" + + + +typedef struct v1alpha3_device_taint_rule_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_device_taint_rule_list_t; + +__attribute__((deprecated)) v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1alpha3_device_taint_rule_list_free(v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list); + +v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list_parseFromJSON(cJSON *v1alpha3_device_taint_rule_listJSON); + +cJSON *v1alpha3_device_taint_rule_list_convertToJSON(v1alpha3_device_taint_rule_list_t *v1alpha3_device_taint_rule_list); + +#endif /* _v1alpha3_device_taint_rule_list_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_taint_rule_spec.c b/kubernetes/model/v1alpha3_device_taint_rule_spec.c new file mode 100644 index 00000000..0de2aee0 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_rule_spec.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include "v1alpha3_device_taint_rule_spec.h" + + + +static v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec_create_internal( + v1alpha3_device_taint_selector_t *device_selector, + v1alpha3_device_taint_t *taint + ) { + v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec_local_var = malloc(sizeof(v1alpha3_device_taint_rule_spec_t)); + if (!v1alpha3_device_taint_rule_spec_local_var) { + return NULL; + } + v1alpha3_device_taint_rule_spec_local_var->device_selector = device_selector; + v1alpha3_device_taint_rule_spec_local_var->taint = taint; + + v1alpha3_device_taint_rule_spec_local_var->_library_owned = 1; + return v1alpha3_device_taint_rule_spec_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec_create( + v1alpha3_device_taint_selector_t *device_selector, + v1alpha3_device_taint_t *taint + ) { + return v1alpha3_device_taint_rule_spec_create_internal ( + device_selector, + taint + ); +} + +void v1alpha3_device_taint_rule_spec_free(v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec) { + if(NULL == v1alpha3_device_taint_rule_spec){ + return ; + } + if(v1alpha3_device_taint_rule_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_taint_rule_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_taint_rule_spec->device_selector) { + v1alpha3_device_taint_selector_free(v1alpha3_device_taint_rule_spec->device_selector); + v1alpha3_device_taint_rule_spec->device_selector = NULL; + } + if (v1alpha3_device_taint_rule_spec->taint) { + v1alpha3_device_taint_free(v1alpha3_device_taint_rule_spec->taint); + v1alpha3_device_taint_rule_spec->taint = NULL; + } + free(v1alpha3_device_taint_rule_spec); +} + +cJSON *v1alpha3_device_taint_rule_spec_convertToJSON(v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_taint_rule_spec->device_selector + if(v1alpha3_device_taint_rule_spec->device_selector) { + cJSON *device_selector_local_JSON = v1alpha3_device_taint_selector_convertToJSON(v1alpha3_device_taint_rule_spec->device_selector); + if(device_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "deviceSelector", device_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1alpha3_device_taint_rule_spec->taint + if (!v1alpha3_device_taint_rule_spec->taint) { + goto fail; + } + cJSON *taint_local_JSON = v1alpha3_device_taint_convertToJSON(v1alpha3_device_taint_rule_spec->taint); + if(taint_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "taint", taint_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec_parseFromJSON(cJSON *v1alpha3_device_taint_rule_specJSON){ + + v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec_local_var = NULL; + + // define the local variable for v1alpha3_device_taint_rule_spec->device_selector + v1alpha3_device_taint_selector_t *device_selector_local_nonprim = NULL; + + // define the local variable for v1alpha3_device_taint_rule_spec->taint + v1alpha3_device_taint_t *taint_local_nonprim = NULL; + + // v1alpha3_device_taint_rule_spec->device_selector + cJSON *device_selector = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_rule_specJSON, "deviceSelector"); + if (cJSON_IsNull(device_selector)) { + device_selector = NULL; + } + if (device_selector) { + device_selector_local_nonprim = v1alpha3_device_taint_selector_parseFromJSON(device_selector); //nonprimitive + } + + // v1alpha3_device_taint_rule_spec->taint + cJSON *taint = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_rule_specJSON, "taint"); + if (cJSON_IsNull(taint)) { + taint = NULL; + } + if (!taint) { + goto end; + } + + + taint_local_nonprim = v1alpha3_device_taint_parseFromJSON(taint); //nonprimitive + + + v1alpha3_device_taint_rule_spec_local_var = v1alpha3_device_taint_rule_spec_create_internal ( + device_selector ? device_selector_local_nonprim : NULL, + taint_local_nonprim + ); + + return v1alpha3_device_taint_rule_spec_local_var; +end: + if (device_selector_local_nonprim) { + v1alpha3_device_taint_selector_free(device_selector_local_nonprim); + device_selector_local_nonprim = NULL; + } + if (taint_local_nonprim) { + v1alpha3_device_taint_free(taint_local_nonprim); + taint_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_taint_rule_spec.h b/kubernetes/model/v1alpha3_device_taint_rule_spec.h new file mode 100644 index 00000000..b502b225 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_rule_spec.h @@ -0,0 +1,42 @@ +/* + * v1alpha3_device_taint_rule_spec.h + * + * DeviceTaintRuleSpec specifies the selector and one taint. + */ + +#ifndef _v1alpha3_device_taint_rule_spec_H_ +#define _v1alpha3_device_taint_rule_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_taint_rule_spec_t v1alpha3_device_taint_rule_spec_t; + +#include "v1alpha3_device_taint.h" +#include "v1alpha3_device_taint_selector.h" + + + +typedef struct v1alpha3_device_taint_rule_spec_t { + struct v1alpha3_device_taint_selector_t *device_selector; //model + struct v1alpha3_device_taint_t *taint; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_device_taint_rule_spec_t; + +__attribute__((deprecated)) v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec_create( + v1alpha3_device_taint_selector_t *device_selector, + v1alpha3_device_taint_t *taint +); + +void v1alpha3_device_taint_rule_spec_free(v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec); + +v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec_parseFromJSON(cJSON *v1alpha3_device_taint_rule_specJSON); + +cJSON *v1alpha3_device_taint_rule_spec_convertToJSON(v1alpha3_device_taint_rule_spec_t *v1alpha3_device_taint_rule_spec); + +#endif /* _v1alpha3_device_taint_rule_spec_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_taint_selector.c b/kubernetes/model/v1alpha3_device_taint_selector.c new file mode 100644 index 00000000..4b757f08 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_selector.c @@ -0,0 +1,243 @@ +#include +#include +#include +#include "v1alpha3_device_taint_selector.h" + + + +static v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector_create_internal( + char *device, + char *device_class_name, + char *driver, + char *pool, + list_t *selectors + ) { + v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector_local_var = malloc(sizeof(v1alpha3_device_taint_selector_t)); + if (!v1alpha3_device_taint_selector_local_var) { + return NULL; + } + v1alpha3_device_taint_selector_local_var->device = device; + v1alpha3_device_taint_selector_local_var->device_class_name = device_class_name; + v1alpha3_device_taint_selector_local_var->driver = driver; + v1alpha3_device_taint_selector_local_var->pool = pool; + v1alpha3_device_taint_selector_local_var->selectors = selectors; + + v1alpha3_device_taint_selector_local_var->_library_owned = 1; + return v1alpha3_device_taint_selector_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector_create( + char *device, + char *device_class_name, + char *driver, + char *pool, + list_t *selectors + ) { + return v1alpha3_device_taint_selector_create_internal ( + device, + device_class_name, + driver, + pool, + selectors + ); +} + +void v1alpha3_device_taint_selector_free(v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector) { + if(NULL == v1alpha3_device_taint_selector){ + return ; + } + if(v1alpha3_device_taint_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_taint_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_taint_selector->device) { + free(v1alpha3_device_taint_selector->device); + v1alpha3_device_taint_selector->device = NULL; + } + if (v1alpha3_device_taint_selector->device_class_name) { + free(v1alpha3_device_taint_selector->device_class_name); + v1alpha3_device_taint_selector->device_class_name = NULL; + } + if (v1alpha3_device_taint_selector->driver) { + free(v1alpha3_device_taint_selector->driver); + v1alpha3_device_taint_selector->driver = NULL; + } + if (v1alpha3_device_taint_selector->pool) { + free(v1alpha3_device_taint_selector->pool); + v1alpha3_device_taint_selector->pool = NULL; + } + if (v1alpha3_device_taint_selector->selectors) { + list_ForEach(listEntry, v1alpha3_device_taint_selector->selectors) { + v1alpha3_device_selector_free(listEntry->data); + } + list_freeList(v1alpha3_device_taint_selector->selectors); + v1alpha3_device_taint_selector->selectors = NULL; + } + free(v1alpha3_device_taint_selector); +} + +cJSON *v1alpha3_device_taint_selector_convertToJSON(v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_taint_selector->device + if(v1alpha3_device_taint_selector->device) { + if(cJSON_AddStringToObject(item, "device", v1alpha3_device_taint_selector->device) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_selector->device_class_name + if(v1alpha3_device_taint_selector->device_class_name) { + if(cJSON_AddStringToObject(item, "deviceClassName", v1alpha3_device_taint_selector->device_class_name) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_selector->driver + if(v1alpha3_device_taint_selector->driver) { + if(cJSON_AddStringToObject(item, "driver", v1alpha3_device_taint_selector->driver) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_selector->pool + if(v1alpha3_device_taint_selector->pool) { + if(cJSON_AddStringToObject(item, "pool", v1alpha3_device_taint_selector->pool) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_taint_selector->selectors + if(v1alpha3_device_taint_selector->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1alpha3_device_taint_selector->selectors) { + list_ForEach(selectorsListEntry, v1alpha3_device_taint_selector->selectors) { + cJSON *itemLocal = v1alpha3_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector_parseFromJSON(cJSON *v1alpha3_device_taint_selectorJSON){ + + v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector_local_var = NULL; + + // define the local list for v1alpha3_device_taint_selector->selectors + list_t *selectorsList = NULL; + + // v1alpha3_device_taint_selector->device + cJSON *device = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_selectorJSON, "device"); + if (cJSON_IsNull(device)) { + device = NULL; + } + if (device) { + if(!cJSON_IsString(device) && !cJSON_IsNull(device)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_selector->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_selectorJSON, "deviceClassName"); + if (cJSON_IsNull(device_class_name)) { + device_class_name = NULL; + } + if (device_class_name) { + if(!cJSON_IsString(device_class_name) && !cJSON_IsNull(device_class_name)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_selector->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_selectorJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (driver) { + if(!cJSON_IsString(driver) && !cJSON_IsNull(driver)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_selector->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_selectorJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (pool) { + if(!cJSON_IsString(pool) && !cJSON_IsNull(pool)) + { + goto end; //String + } + } + + // v1alpha3_device_taint_selector->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_taint_selectorJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1alpha3_device_selector_t *selectorsItem = v1alpha3_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + + v1alpha3_device_taint_selector_local_var = v1alpha3_device_taint_selector_create_internal ( + device && !cJSON_IsNull(device) ? strdup(device->valuestring) : NULL, + device_class_name && !cJSON_IsNull(device_class_name) ? strdup(device_class_name->valuestring) : NULL, + driver && !cJSON_IsNull(driver) ? strdup(driver->valuestring) : NULL, + pool && !cJSON_IsNull(pool) ? strdup(pool->valuestring) : NULL, + selectors ? selectorsList : NULL + ); + + return v1alpha3_device_taint_selector_local_var; +end: + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1alpha3_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_taint_selector.h b/kubernetes/model/v1alpha3_device_taint_selector.h new file mode 100644 index 00000000..39fc041e --- /dev/null +++ b/kubernetes/model/v1alpha3_device_taint_selector.h @@ -0,0 +1,47 @@ +/* + * v1alpha3_device_taint_selector.h + * + * DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. The empty selector matches all devices. Without a selector, no devices are matched. + */ + +#ifndef _v1alpha3_device_taint_selector_H_ +#define _v1alpha3_device_taint_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_taint_selector_t v1alpha3_device_taint_selector_t; + +#include "v1alpha3_device_selector.h" + + + +typedef struct v1alpha3_device_taint_selector_t { + char *device; // string + char *device_class_name; // string + char *driver; // string + char *pool; // string + list_t *selectors; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_device_taint_selector_t; + +__attribute__((deprecated)) v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector_create( + char *device, + char *device_class_name, + char *driver, + char *pool, + list_t *selectors +); + +void v1alpha3_device_taint_selector_free(v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector); + +v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector_parseFromJSON(cJSON *v1alpha3_device_taint_selectorJSON); + +cJSON *v1alpha3_device_taint_selector_convertToJSON(v1alpha3_device_taint_selector_t *v1alpha3_device_taint_selector); + +#endif /* _v1alpha3_device_taint_selector_H_ */ + diff --git a/kubernetes/model/v1beta1_allocated_device_status.c b/kubernetes/model/v1beta1_allocated_device_status.c new file mode 100644 index 00000000..735a925c --- /dev/null +++ b/kubernetes/model/v1beta1_allocated_device_status.c @@ -0,0 +1,325 @@ +#include +#include +#include +#include "v1beta1_allocated_device_status.h" + + + +static v1beta1_allocated_device_status_t *v1beta1_allocated_device_status_create_internal( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1beta1_network_device_data_t *network_data, + char *pool, + char *share_id + ) { + v1beta1_allocated_device_status_t *v1beta1_allocated_device_status_local_var = malloc(sizeof(v1beta1_allocated_device_status_t)); + if (!v1beta1_allocated_device_status_local_var) { + return NULL; + } + v1beta1_allocated_device_status_local_var->conditions = conditions; + v1beta1_allocated_device_status_local_var->data = data; + v1beta1_allocated_device_status_local_var->device = device; + v1beta1_allocated_device_status_local_var->driver = driver; + v1beta1_allocated_device_status_local_var->network_data = network_data; + v1beta1_allocated_device_status_local_var->pool = pool; + v1beta1_allocated_device_status_local_var->share_id = share_id; + + v1beta1_allocated_device_status_local_var->_library_owned = 1; + return v1beta1_allocated_device_status_local_var; +} + +__attribute__((deprecated)) v1beta1_allocated_device_status_t *v1beta1_allocated_device_status_create( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1beta1_network_device_data_t *network_data, + char *pool, + char *share_id + ) { + return v1beta1_allocated_device_status_create_internal ( + conditions, + data, + device, + driver, + network_data, + pool, + share_id + ); +} + +void v1beta1_allocated_device_status_free(v1beta1_allocated_device_status_t *v1beta1_allocated_device_status) { + if(NULL == v1beta1_allocated_device_status){ + return ; + } + if(v1beta1_allocated_device_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_allocated_device_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_allocated_device_status->conditions) { + list_ForEach(listEntry, v1beta1_allocated_device_status->conditions) { + v1_condition_free(listEntry->data); + } + list_freeList(v1beta1_allocated_device_status->conditions); + v1beta1_allocated_device_status->conditions = NULL; + } + if (v1beta1_allocated_device_status->data) { + object_free(v1beta1_allocated_device_status->data); + v1beta1_allocated_device_status->data = NULL; + } + if (v1beta1_allocated_device_status->device) { + free(v1beta1_allocated_device_status->device); + v1beta1_allocated_device_status->device = NULL; + } + if (v1beta1_allocated_device_status->driver) { + free(v1beta1_allocated_device_status->driver); + v1beta1_allocated_device_status->driver = NULL; + } + if (v1beta1_allocated_device_status->network_data) { + v1beta1_network_device_data_free(v1beta1_allocated_device_status->network_data); + v1beta1_allocated_device_status->network_data = NULL; + } + if (v1beta1_allocated_device_status->pool) { + free(v1beta1_allocated_device_status->pool); + v1beta1_allocated_device_status->pool = NULL; + } + if (v1beta1_allocated_device_status->share_id) { + free(v1beta1_allocated_device_status->share_id); + v1beta1_allocated_device_status->share_id = NULL; + } + free(v1beta1_allocated_device_status); +} + +cJSON *v1beta1_allocated_device_status_convertToJSON(v1beta1_allocated_device_status_t *v1beta1_allocated_device_status) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_allocated_device_status->conditions + if(v1beta1_allocated_device_status->conditions) { + cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); + if(conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *conditionsListEntry; + if (v1beta1_allocated_device_status->conditions) { + list_ForEach(conditionsListEntry, v1beta1_allocated_device_status->conditions) { + cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(conditions, itemLocal); + } + } + } + + + // v1beta1_allocated_device_status->data + if(v1beta1_allocated_device_status->data) { + cJSON *data_object = object_convertToJSON(v1beta1_allocated_device_status->data); + if(data_object == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "data", data_object); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_allocated_device_status->device + if (!v1beta1_allocated_device_status->device) { + goto fail; + } + if(cJSON_AddStringToObject(item, "device", v1beta1_allocated_device_status->device) == NULL) { + goto fail; //String + } + + + // v1beta1_allocated_device_status->driver + if (!v1beta1_allocated_device_status->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta1_allocated_device_status->driver) == NULL) { + goto fail; //String + } + + + // v1beta1_allocated_device_status->network_data + if(v1beta1_allocated_device_status->network_data) { + cJSON *network_data_local_JSON = v1beta1_network_device_data_convertToJSON(v1beta1_allocated_device_status->network_data); + if(network_data_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "networkData", network_data_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_allocated_device_status->pool + if (!v1beta1_allocated_device_status->pool) { + goto fail; + } + if(cJSON_AddStringToObject(item, "pool", v1beta1_allocated_device_status->pool) == NULL) { + goto fail; //String + } + + + // v1beta1_allocated_device_status->share_id + if(v1beta1_allocated_device_status->share_id) { + if(cJSON_AddStringToObject(item, "shareID", v1beta1_allocated_device_status->share_id) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_allocated_device_status_t *v1beta1_allocated_device_status_parseFromJSON(cJSON *v1beta1_allocated_device_statusJSON){ + + v1beta1_allocated_device_status_t *v1beta1_allocated_device_status_local_var = NULL; + + // define the local list for v1beta1_allocated_device_status->conditions + list_t *conditionsList = NULL; + + // define the local variable for v1beta1_allocated_device_status->network_data + v1beta1_network_device_data_t *network_data_local_nonprim = NULL; + + // v1beta1_allocated_device_status->conditions + cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_allocated_device_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } + if (conditions) { + cJSON *conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(conditions)){ + goto end; //nonprimitive container + } + + conditionsList = list_createList(); + + cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) + { + if(!cJSON_IsObject(conditions_local_nonprimitive)){ + goto end; + } + v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); + + list_addElement(conditionsList, conditionsItem); + } + } + + // v1beta1_allocated_device_status->data + cJSON *data = cJSON_GetObjectItemCaseSensitive(v1beta1_allocated_device_statusJSON, "data"); + if (cJSON_IsNull(data)) { + data = NULL; + } + object_t *data_local_object = NULL; + if (data) { + data_local_object = object_parseFromJSON(data); //object + } + + // v1beta1_allocated_device_status->device + cJSON *device = cJSON_GetObjectItemCaseSensitive(v1beta1_allocated_device_statusJSON, "device"); + if (cJSON_IsNull(device)) { + device = NULL; + } + if (!device) { + goto end; + } + + + if(!cJSON_IsString(device)) + { + goto end; //String + } + + // v1beta1_allocated_device_status->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta1_allocated_device_statusJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta1_allocated_device_status->network_data + cJSON *network_data = cJSON_GetObjectItemCaseSensitive(v1beta1_allocated_device_statusJSON, "networkData"); + if (cJSON_IsNull(network_data)) { + network_data = NULL; + } + if (network_data) { + network_data_local_nonprim = v1beta1_network_device_data_parseFromJSON(network_data); //nonprimitive + } + + // v1beta1_allocated_device_status->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1beta1_allocated_device_statusJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + if(!cJSON_IsString(pool)) + { + goto end; //String + } + + // v1beta1_allocated_device_status->share_id + cJSON *share_id = cJSON_GetObjectItemCaseSensitive(v1beta1_allocated_device_statusJSON, "shareID"); + if (cJSON_IsNull(share_id)) { + share_id = NULL; + } + if (share_id) { + if(!cJSON_IsString(share_id) && !cJSON_IsNull(share_id)) + { + goto end; //String + } + } + + + v1beta1_allocated_device_status_local_var = v1beta1_allocated_device_status_create_internal ( + conditions ? conditionsList : NULL, + data ? data_local_object : NULL, + strdup(device->valuestring), + strdup(driver->valuestring), + network_data ? network_data_local_nonprim : NULL, + strdup(pool->valuestring), + share_id && !cJSON_IsNull(share_id) ? strdup(share_id->valuestring) : NULL + ); + + return v1beta1_allocated_device_status_local_var; +end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (network_data_local_nonprim) { + v1beta1_network_device_data_free(network_data_local_nonprim); + network_data_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_allocated_device_status.h b/kubernetes/model/v1beta1_allocated_device_status.h new file mode 100644 index 00000000..725de19f --- /dev/null +++ b/kubernetes/model/v1beta1_allocated_device_status.h @@ -0,0 +1,53 @@ +/* + * v1beta1_allocated_device_status.h + * + * AllocatedDeviceStatus contains the status of an allocated device, if the driver chooses to report it. This may include driver-specific information. The combination of Driver, Pool, Device, and ShareID must match the corresponding key in Status.Allocation.Devices. + */ + +#ifndef _v1beta1_allocated_device_status_H_ +#define _v1beta1_allocated_device_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_allocated_device_status_t v1beta1_allocated_device_status_t; + +#include "object.h" +#include "v1_condition.h" +#include "v1beta1_network_device_data.h" + + + +typedef struct v1beta1_allocated_device_status_t { + list_t *conditions; //nonprimitive container + object_t *data; //object + char *device; // string + char *driver; // string + struct v1beta1_network_device_data_t *network_data; //model + char *pool; // string + char *share_id; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_allocated_device_status_t; + +__attribute__((deprecated)) v1beta1_allocated_device_status_t *v1beta1_allocated_device_status_create( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1beta1_network_device_data_t *network_data, + char *pool, + char *share_id +); + +void v1beta1_allocated_device_status_free(v1beta1_allocated_device_status_t *v1beta1_allocated_device_status); + +v1beta1_allocated_device_status_t *v1beta1_allocated_device_status_parseFromJSON(cJSON *v1beta1_allocated_device_statusJSON); + +cJSON *v1beta1_allocated_device_status_convertToJSON(v1beta1_allocated_device_status_t *v1beta1_allocated_device_status); + +#endif /* _v1beta1_allocated_device_status_H_ */ + diff --git a/kubernetes/model/v1beta1_allocation_result.c b/kubernetes/model/v1beta1_allocation_result.c new file mode 100644 index 00000000..c820691e --- /dev/null +++ b/kubernetes/model/v1beta1_allocation_result.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include "v1beta1_allocation_result.h" + + + +static v1beta1_allocation_result_t *v1beta1_allocation_result_create_internal( + char *allocation_timestamp, + v1beta1_device_allocation_result_t *devices, + v1_node_selector_t *node_selector + ) { + v1beta1_allocation_result_t *v1beta1_allocation_result_local_var = malloc(sizeof(v1beta1_allocation_result_t)); + if (!v1beta1_allocation_result_local_var) { + return NULL; + } + v1beta1_allocation_result_local_var->allocation_timestamp = allocation_timestamp; + v1beta1_allocation_result_local_var->devices = devices; + v1beta1_allocation_result_local_var->node_selector = node_selector; + + v1beta1_allocation_result_local_var->_library_owned = 1; + return v1beta1_allocation_result_local_var; +} + +__attribute__((deprecated)) v1beta1_allocation_result_t *v1beta1_allocation_result_create( + char *allocation_timestamp, + v1beta1_device_allocation_result_t *devices, + v1_node_selector_t *node_selector + ) { + return v1beta1_allocation_result_create_internal ( + allocation_timestamp, + devices, + node_selector + ); +} + +void v1beta1_allocation_result_free(v1beta1_allocation_result_t *v1beta1_allocation_result) { + if(NULL == v1beta1_allocation_result){ + return ; + } + if(v1beta1_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_allocation_result->allocation_timestamp) { + free(v1beta1_allocation_result->allocation_timestamp); + v1beta1_allocation_result->allocation_timestamp = NULL; + } + if (v1beta1_allocation_result->devices) { + v1beta1_device_allocation_result_free(v1beta1_allocation_result->devices); + v1beta1_allocation_result->devices = NULL; + } + if (v1beta1_allocation_result->node_selector) { + v1_node_selector_free(v1beta1_allocation_result->node_selector); + v1beta1_allocation_result->node_selector = NULL; + } + free(v1beta1_allocation_result); +} + +cJSON *v1beta1_allocation_result_convertToJSON(v1beta1_allocation_result_t *v1beta1_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_allocation_result->allocation_timestamp + if(v1beta1_allocation_result->allocation_timestamp) { + if(cJSON_AddStringToObject(item, "allocationTimestamp", v1beta1_allocation_result->allocation_timestamp) == NULL) { + goto fail; //Date-Time + } + } + + + // v1beta1_allocation_result->devices + if(v1beta1_allocation_result->devices) { + cJSON *devices_local_JSON = v1beta1_device_allocation_result_convertToJSON(v1beta1_allocation_result->devices); + if(devices_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "devices", devices_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_allocation_result->node_selector + if(v1beta1_allocation_result->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1beta1_allocation_result->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_allocation_result_t *v1beta1_allocation_result_parseFromJSON(cJSON *v1beta1_allocation_resultJSON){ + + v1beta1_allocation_result_t *v1beta1_allocation_result_local_var = NULL; + + // define the local variable for v1beta1_allocation_result->devices + v1beta1_device_allocation_result_t *devices_local_nonprim = NULL; + + // define the local variable for v1beta1_allocation_result->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // v1beta1_allocation_result->allocation_timestamp + cJSON *allocation_timestamp = cJSON_GetObjectItemCaseSensitive(v1beta1_allocation_resultJSON, "allocationTimestamp"); + if (cJSON_IsNull(allocation_timestamp)) { + allocation_timestamp = NULL; + } + if (allocation_timestamp) { + if(!cJSON_IsString(allocation_timestamp) && !cJSON_IsNull(allocation_timestamp)) + { + goto end; //DateTime + } + } + + // v1beta1_allocation_result->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta1_allocation_resultJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + devices_local_nonprim = v1beta1_device_allocation_result_parseFromJSON(devices); //nonprimitive + } + + // v1beta1_allocation_result->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta1_allocation_resultJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + + v1beta1_allocation_result_local_var = v1beta1_allocation_result_create_internal ( + allocation_timestamp && !cJSON_IsNull(allocation_timestamp) ? strdup(allocation_timestamp->valuestring) : NULL, + devices ? devices_local_nonprim : NULL, + node_selector ? node_selector_local_nonprim : NULL + ); + + return v1beta1_allocation_result_local_var; +end: + if (devices_local_nonprim) { + v1beta1_device_allocation_result_free(devices_local_nonprim); + devices_local_nonprim = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_allocation_result.h b/kubernetes/model/v1beta1_allocation_result.h new file mode 100644 index 00000000..45d7fd85 --- /dev/null +++ b/kubernetes/model/v1beta1_allocation_result.h @@ -0,0 +1,44 @@ +/* + * v1beta1_allocation_result.h + * + * AllocationResult contains attributes of an allocated resource. + */ + +#ifndef _v1beta1_allocation_result_H_ +#define _v1beta1_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_allocation_result_t v1beta1_allocation_result_t; + +#include "v1_node_selector.h" +#include "v1beta1_device_allocation_result.h" + + + +typedef struct v1beta1_allocation_result_t { + char *allocation_timestamp; //date time + struct v1beta1_device_allocation_result_t *devices; //model + struct v1_node_selector_t *node_selector; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_allocation_result_t; + +__attribute__((deprecated)) v1beta1_allocation_result_t *v1beta1_allocation_result_create( + char *allocation_timestamp, + v1beta1_device_allocation_result_t *devices, + v1_node_selector_t *node_selector +); + +void v1beta1_allocation_result_free(v1beta1_allocation_result_t *v1beta1_allocation_result); + +v1beta1_allocation_result_t *v1beta1_allocation_result_parseFromJSON(cJSON *v1beta1_allocation_resultJSON); + +cJSON *v1beta1_allocation_result_convertToJSON(v1beta1_allocation_result_t *v1beta1_allocation_result); + +#endif /* _v1beta1_allocation_result_H_ */ + diff --git a/kubernetes/model/v1beta1_apply_configuration.c b/kubernetes/model/v1beta1_apply_configuration.c new file mode 100644 index 00000000..25d7e8be --- /dev/null +++ b/kubernetes/model/v1beta1_apply_configuration.c @@ -0,0 +1,88 @@ +#include +#include +#include +#include "v1beta1_apply_configuration.h" + + + +static v1beta1_apply_configuration_t *v1beta1_apply_configuration_create_internal( + char *expression + ) { + v1beta1_apply_configuration_t *v1beta1_apply_configuration_local_var = malloc(sizeof(v1beta1_apply_configuration_t)); + if (!v1beta1_apply_configuration_local_var) { + return NULL; + } + v1beta1_apply_configuration_local_var->expression = expression; + + v1beta1_apply_configuration_local_var->_library_owned = 1; + return v1beta1_apply_configuration_local_var; +} + +__attribute__((deprecated)) v1beta1_apply_configuration_t *v1beta1_apply_configuration_create( + char *expression + ) { + return v1beta1_apply_configuration_create_internal ( + expression + ); +} + +void v1beta1_apply_configuration_free(v1beta1_apply_configuration_t *v1beta1_apply_configuration) { + if(NULL == v1beta1_apply_configuration){ + return ; + } + if(v1beta1_apply_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_apply_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_apply_configuration->expression) { + free(v1beta1_apply_configuration->expression); + v1beta1_apply_configuration->expression = NULL; + } + free(v1beta1_apply_configuration); +} + +cJSON *v1beta1_apply_configuration_convertToJSON(v1beta1_apply_configuration_t *v1beta1_apply_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_apply_configuration->expression + if(v1beta1_apply_configuration->expression) { + if(cJSON_AddStringToObject(item, "expression", v1beta1_apply_configuration->expression) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_apply_configuration_t *v1beta1_apply_configuration_parseFromJSON(cJSON *v1beta1_apply_configurationJSON){ + + v1beta1_apply_configuration_t *v1beta1_apply_configuration_local_var = NULL; + + // v1beta1_apply_configuration->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1beta1_apply_configurationJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (expression) { + if(!cJSON_IsString(expression) && !cJSON_IsNull(expression)) + { + goto end; //String + } + } + + + v1beta1_apply_configuration_local_var = v1beta1_apply_configuration_create_internal ( + expression && !cJSON_IsNull(expression) ? strdup(expression->valuestring) : NULL + ); + + return v1beta1_apply_configuration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_apply_configuration.h b/kubernetes/model/v1beta1_apply_configuration.h new file mode 100644 index 00000000..fb2e6898 --- /dev/null +++ b/kubernetes/model/v1beta1_apply_configuration.h @@ -0,0 +1,38 @@ +/* + * v1beta1_apply_configuration.h + * + * ApplyConfiguration defines the desired configuration values of an object. + */ + +#ifndef _v1beta1_apply_configuration_H_ +#define _v1beta1_apply_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_apply_configuration_t v1beta1_apply_configuration_t; + + + + +typedef struct v1beta1_apply_configuration_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_apply_configuration_t; + +__attribute__((deprecated)) v1beta1_apply_configuration_t *v1beta1_apply_configuration_create( + char *expression +); + +void v1beta1_apply_configuration_free(v1beta1_apply_configuration_t *v1beta1_apply_configuration); + +v1beta1_apply_configuration_t *v1beta1_apply_configuration_parseFromJSON(cJSON *v1beta1_apply_configurationJSON); + +cJSON *v1beta1_apply_configuration_convertToJSON(v1beta1_apply_configuration_t *v1beta1_apply_configuration); + +#endif /* _v1beta1_apply_configuration_H_ */ + diff --git a/kubernetes/model/v1beta1_audit_annotation.c b/kubernetes/model/v1beta1_audit_annotation.c deleted file mode 100644 index 1710de65..00000000 --- a/kubernetes/model/v1beta1_audit_annotation.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include "v1beta1_audit_annotation.h" - - - -v1beta1_audit_annotation_t *v1beta1_audit_annotation_create( - char *key, - char *value_expression - ) { - v1beta1_audit_annotation_t *v1beta1_audit_annotation_local_var = malloc(sizeof(v1beta1_audit_annotation_t)); - if (!v1beta1_audit_annotation_local_var) { - return NULL; - } - v1beta1_audit_annotation_local_var->key = key; - v1beta1_audit_annotation_local_var->value_expression = value_expression; - - return v1beta1_audit_annotation_local_var; -} - - -void v1beta1_audit_annotation_free(v1beta1_audit_annotation_t *v1beta1_audit_annotation) { - if(NULL == v1beta1_audit_annotation){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_audit_annotation->key) { - free(v1beta1_audit_annotation->key); - v1beta1_audit_annotation->key = NULL; - } - if (v1beta1_audit_annotation->value_expression) { - free(v1beta1_audit_annotation->value_expression); - v1beta1_audit_annotation->value_expression = NULL; - } - free(v1beta1_audit_annotation); -} - -cJSON *v1beta1_audit_annotation_convertToJSON(v1beta1_audit_annotation_t *v1beta1_audit_annotation) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_audit_annotation->key - if (!v1beta1_audit_annotation->key) { - goto fail; - } - if(cJSON_AddStringToObject(item, "key", v1beta1_audit_annotation->key) == NULL) { - goto fail; //String - } - - - // v1beta1_audit_annotation->value_expression - if (!v1beta1_audit_annotation->value_expression) { - goto fail; - } - if(cJSON_AddStringToObject(item, "valueExpression", v1beta1_audit_annotation->value_expression) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_audit_annotation_t *v1beta1_audit_annotation_parseFromJSON(cJSON *v1beta1_audit_annotationJSON){ - - v1beta1_audit_annotation_t *v1beta1_audit_annotation_local_var = NULL; - - // v1beta1_audit_annotation->key - cJSON *key = cJSON_GetObjectItemCaseSensitive(v1beta1_audit_annotationJSON, "key"); - if (!key) { - goto end; - } - - - if(!cJSON_IsString(key)) - { - goto end; //String - } - - // v1beta1_audit_annotation->value_expression - cJSON *value_expression = cJSON_GetObjectItemCaseSensitive(v1beta1_audit_annotationJSON, "valueExpression"); - if (!value_expression) { - goto end; - } - - - if(!cJSON_IsString(value_expression)) - { - goto end; //String - } - - - v1beta1_audit_annotation_local_var = v1beta1_audit_annotation_create ( - strdup(key->valuestring), - strdup(value_expression->valuestring) - ); - - return v1beta1_audit_annotation_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta1_audit_annotation.h b/kubernetes/model/v1beta1_audit_annotation.h deleted file mode 100644 index 2ee39a8b..00000000 --- a/kubernetes/model/v1beta1_audit_annotation.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1beta1_audit_annotation.h - * - * AuditAnnotation describes how to produce an audit annotation for an API request. - */ - -#ifndef _v1beta1_audit_annotation_H_ -#define _v1beta1_audit_annotation_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_audit_annotation_t v1beta1_audit_annotation_t; - - - - -typedef struct v1beta1_audit_annotation_t { - char *key; // string - char *value_expression; // string - -} v1beta1_audit_annotation_t; - -v1beta1_audit_annotation_t *v1beta1_audit_annotation_create( - char *key, - char *value_expression -); - -void v1beta1_audit_annotation_free(v1beta1_audit_annotation_t *v1beta1_audit_annotation); - -v1beta1_audit_annotation_t *v1beta1_audit_annotation_parseFromJSON(cJSON *v1beta1_audit_annotationJSON); - -cJSON *v1beta1_audit_annotation_convertToJSON(v1beta1_audit_annotation_t *v1beta1_audit_annotation); - -#endif /* _v1beta1_audit_annotation_H_ */ - diff --git a/kubernetes/model/v1beta1_basic_device.c b/kubernetes/model/v1beta1_basic_device.c new file mode 100644 index 00000000..8ca20797 --- /dev/null +++ b/kubernetes/model/v1beta1_basic_device.c @@ -0,0 +1,559 @@ +#include +#include +#include +#include "v1beta1_basic_device.h" + + + +static v1beta1_basic_device_t *v1beta1_basic_device_create_internal( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints + ) { + v1beta1_basic_device_t *v1beta1_basic_device_local_var = malloc(sizeof(v1beta1_basic_device_t)); + if (!v1beta1_basic_device_local_var) { + return NULL; + } + v1beta1_basic_device_local_var->all_nodes = all_nodes; + v1beta1_basic_device_local_var->allow_multiple_allocations = allow_multiple_allocations; + v1beta1_basic_device_local_var->attributes = attributes; + v1beta1_basic_device_local_var->binding_conditions = binding_conditions; + v1beta1_basic_device_local_var->binding_failure_conditions = binding_failure_conditions; + v1beta1_basic_device_local_var->binds_to_node = binds_to_node; + v1beta1_basic_device_local_var->capacity = capacity; + v1beta1_basic_device_local_var->consumes_counters = consumes_counters; + v1beta1_basic_device_local_var->node_name = node_name; + v1beta1_basic_device_local_var->node_selector = node_selector; + v1beta1_basic_device_local_var->taints = taints; + + v1beta1_basic_device_local_var->_library_owned = 1; + return v1beta1_basic_device_local_var; +} + +__attribute__((deprecated)) v1beta1_basic_device_t *v1beta1_basic_device_create( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints + ) { + return v1beta1_basic_device_create_internal ( + all_nodes, + allow_multiple_allocations, + attributes, + binding_conditions, + binding_failure_conditions, + binds_to_node, + capacity, + consumes_counters, + node_name, + node_selector, + taints + ); +} + +void v1beta1_basic_device_free(v1beta1_basic_device_t *v1beta1_basic_device) { + if(NULL == v1beta1_basic_device){ + return ; + } + if(v1beta1_basic_device->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_basic_device_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_basic_device->attributes) { + list_ForEach(listEntry, v1beta1_basic_device->attributes) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta1_basic_device->attributes); + v1beta1_basic_device->attributes = NULL; + } + if (v1beta1_basic_device->binding_conditions) { + list_ForEach(listEntry, v1beta1_basic_device->binding_conditions) { + free(listEntry->data); + } + list_freeList(v1beta1_basic_device->binding_conditions); + v1beta1_basic_device->binding_conditions = NULL; + } + if (v1beta1_basic_device->binding_failure_conditions) { + list_ForEach(listEntry, v1beta1_basic_device->binding_failure_conditions) { + free(listEntry->data); + } + list_freeList(v1beta1_basic_device->binding_failure_conditions); + v1beta1_basic_device->binding_failure_conditions = NULL; + } + if (v1beta1_basic_device->capacity) { + list_ForEach(listEntry, v1beta1_basic_device->capacity) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta1_basic_device->capacity); + v1beta1_basic_device->capacity = NULL; + } + if (v1beta1_basic_device->consumes_counters) { + list_ForEach(listEntry, v1beta1_basic_device->consumes_counters) { + v1beta1_device_counter_consumption_free(listEntry->data); + } + list_freeList(v1beta1_basic_device->consumes_counters); + v1beta1_basic_device->consumes_counters = NULL; + } + if (v1beta1_basic_device->node_name) { + free(v1beta1_basic_device->node_name); + v1beta1_basic_device->node_name = NULL; + } + if (v1beta1_basic_device->node_selector) { + v1_node_selector_free(v1beta1_basic_device->node_selector); + v1beta1_basic_device->node_selector = NULL; + } + if (v1beta1_basic_device->taints) { + list_ForEach(listEntry, v1beta1_basic_device->taints) { + v1beta1_device_taint_free(listEntry->data); + } + list_freeList(v1beta1_basic_device->taints); + v1beta1_basic_device->taints = NULL; + } + free(v1beta1_basic_device); +} + +cJSON *v1beta1_basic_device_convertToJSON(v1beta1_basic_device_t *v1beta1_basic_device) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_basic_device->all_nodes + if(v1beta1_basic_device->all_nodes) { + if(cJSON_AddBoolToObject(item, "allNodes", v1beta1_basic_device->all_nodes) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_basic_device->allow_multiple_allocations + if(v1beta1_basic_device->allow_multiple_allocations) { + if(cJSON_AddBoolToObject(item, "allowMultipleAllocations", v1beta1_basic_device->allow_multiple_allocations) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_basic_device->attributes + if(v1beta1_basic_device->attributes) { + cJSON *attributes = cJSON_AddObjectToObject(item, "attributes"); + if(attributes == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = attributes; + listEntry_t *attributesListEntry; + if (v1beta1_basic_device->attributes) { + list_ForEach(attributesListEntry, v1beta1_basic_device->attributes) { + keyValuePair_t *localKeyValue = attributesListEntry->data; + } + } + } + + + // v1beta1_basic_device->binding_conditions + if(v1beta1_basic_device->binding_conditions) { + cJSON *binding_conditions = cJSON_AddArrayToObject(item, "bindingConditions"); + if(binding_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_conditionsListEntry; + list_ForEach(binding_conditionsListEntry, v1beta1_basic_device->binding_conditions) { + if(cJSON_AddStringToObject(binding_conditions, "", binding_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta1_basic_device->binding_failure_conditions + if(v1beta1_basic_device->binding_failure_conditions) { + cJSON *binding_failure_conditions = cJSON_AddArrayToObject(item, "bindingFailureConditions"); + if(binding_failure_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_failure_conditionsListEntry; + list_ForEach(binding_failure_conditionsListEntry, v1beta1_basic_device->binding_failure_conditions) { + if(cJSON_AddStringToObject(binding_failure_conditions, "", binding_failure_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta1_basic_device->binds_to_node + if(v1beta1_basic_device->binds_to_node) { + if(cJSON_AddBoolToObject(item, "bindsToNode", v1beta1_basic_device->binds_to_node) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_basic_device->capacity + if(v1beta1_basic_device->capacity) { + cJSON *capacity = cJSON_AddObjectToObject(item, "capacity"); + if(capacity == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = capacity; + listEntry_t *capacityListEntry; + if (v1beta1_basic_device->capacity) { + list_ForEach(capacityListEntry, v1beta1_basic_device->capacity) { + keyValuePair_t *localKeyValue = capacityListEntry->data; + } + } + } + + + // v1beta1_basic_device->consumes_counters + if(v1beta1_basic_device->consumes_counters) { + cJSON *consumes_counters = cJSON_AddArrayToObject(item, "consumesCounters"); + if(consumes_counters == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *consumes_countersListEntry; + if (v1beta1_basic_device->consumes_counters) { + list_ForEach(consumes_countersListEntry, v1beta1_basic_device->consumes_counters) { + cJSON *itemLocal = v1beta1_device_counter_consumption_convertToJSON(consumes_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(consumes_counters, itemLocal); + } + } + } + + + // v1beta1_basic_device->node_name + if(v1beta1_basic_device->node_name) { + if(cJSON_AddStringToObject(item, "nodeName", v1beta1_basic_device->node_name) == NULL) { + goto fail; //String + } + } + + + // v1beta1_basic_device->node_selector + if(v1beta1_basic_device->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1beta1_basic_device->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_basic_device->taints + if(v1beta1_basic_device->taints) { + cJSON *taints = cJSON_AddArrayToObject(item, "taints"); + if(taints == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *taintsListEntry; + if (v1beta1_basic_device->taints) { + list_ForEach(taintsListEntry, v1beta1_basic_device->taints) { + cJSON *itemLocal = v1beta1_device_taint_convertToJSON(taintsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(taints, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_basic_device_t *v1beta1_basic_device_parseFromJSON(cJSON *v1beta1_basic_deviceJSON){ + + v1beta1_basic_device_t *v1beta1_basic_device_local_var = NULL; + + // define the local map for v1beta1_basic_device->attributes + list_t *attributesList = NULL; + + // define the local list for v1beta1_basic_device->binding_conditions + list_t *binding_conditionsList = NULL; + + // define the local list for v1beta1_basic_device->binding_failure_conditions + list_t *binding_failure_conditionsList = NULL; + + // define the local map for v1beta1_basic_device->capacity + list_t *capacityList = NULL; + + // define the local list for v1beta1_basic_device->consumes_counters + list_t *consumes_countersList = NULL; + + // define the local variable for v1beta1_basic_device->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // define the local list for v1beta1_basic_device->taints + list_t *taintsList = NULL; + + // v1beta1_basic_device->all_nodes + cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "allNodes"); + if (cJSON_IsNull(all_nodes)) { + all_nodes = NULL; + } + if (all_nodes) { + if(!cJSON_IsBool(all_nodes)) + { + goto end; //Bool + } + } + + // v1beta1_basic_device->allow_multiple_allocations + cJSON *allow_multiple_allocations = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "allowMultipleAllocations"); + if (cJSON_IsNull(allow_multiple_allocations)) { + allow_multiple_allocations = NULL; + } + if (allow_multiple_allocations) { + if(!cJSON_IsBool(allow_multiple_allocations)) + { + goto end; //Bool + } + } + + // v1beta1_basic_device->attributes + cJSON *attributes = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "attributes"); + if (cJSON_IsNull(attributes)) { + attributes = NULL; + } + if (attributes) { + + // The data type of the elements in v1beta1_basic_device->attributes is currently not supported. + + } + + // v1beta1_basic_device->binding_conditions + cJSON *binding_conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "bindingConditions"); + if (cJSON_IsNull(binding_conditions)) { + binding_conditions = NULL; + } + if (binding_conditions) { + cJSON *binding_conditions_local = NULL; + if(!cJSON_IsArray(binding_conditions)) { + goto end;//primitive container + } + binding_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_conditions_local, binding_conditions) + { + if(!cJSON_IsString(binding_conditions_local)) + { + goto end; + } + list_addElement(binding_conditionsList , strdup(binding_conditions_local->valuestring)); + } + } + + // v1beta1_basic_device->binding_failure_conditions + cJSON *binding_failure_conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "bindingFailureConditions"); + if (cJSON_IsNull(binding_failure_conditions)) { + binding_failure_conditions = NULL; + } + if (binding_failure_conditions) { + cJSON *binding_failure_conditions_local = NULL; + if(!cJSON_IsArray(binding_failure_conditions)) { + goto end;//primitive container + } + binding_failure_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_failure_conditions_local, binding_failure_conditions) + { + if(!cJSON_IsString(binding_failure_conditions_local)) + { + goto end; + } + list_addElement(binding_failure_conditionsList , strdup(binding_failure_conditions_local->valuestring)); + } + } + + // v1beta1_basic_device->binds_to_node + cJSON *binds_to_node = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "bindsToNode"); + if (cJSON_IsNull(binds_to_node)) { + binds_to_node = NULL; + } + if (binds_to_node) { + if(!cJSON_IsBool(binds_to_node)) + { + goto end; //Bool + } + } + + // v1beta1_basic_device->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + + // The data type of the elements in v1beta1_basic_device->capacity is currently not supported. + + } + + // v1beta1_basic_device->consumes_counters + cJSON *consumes_counters = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "consumesCounters"); + if (cJSON_IsNull(consumes_counters)) { + consumes_counters = NULL; + } + if (consumes_counters) { + cJSON *consumes_counters_local_nonprimitive = NULL; + if(!cJSON_IsArray(consumes_counters)){ + goto end; //nonprimitive container + } + + consumes_countersList = list_createList(); + + cJSON_ArrayForEach(consumes_counters_local_nonprimitive,consumes_counters ) + { + if(!cJSON_IsObject(consumes_counters_local_nonprimitive)){ + goto end; + } + v1beta1_device_counter_consumption_t *consumes_countersItem = v1beta1_device_counter_consumption_parseFromJSON(consumes_counters_local_nonprimitive); + + list_addElement(consumes_countersList, consumes_countersItem); + } + } + + // v1beta1_basic_device->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } + if (node_name) { + if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) + { + goto end; //String + } + } + + // v1beta1_basic_device->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + // v1beta1_basic_device->taints + cJSON *taints = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "taints"); + if (cJSON_IsNull(taints)) { + taints = NULL; + } + if (taints) { + cJSON *taints_local_nonprimitive = NULL; + if(!cJSON_IsArray(taints)){ + goto end; //nonprimitive container + } + + taintsList = list_createList(); + + cJSON_ArrayForEach(taints_local_nonprimitive,taints ) + { + if(!cJSON_IsObject(taints_local_nonprimitive)){ + goto end; + } + v1beta1_device_taint_t *taintsItem = v1beta1_device_taint_parseFromJSON(taints_local_nonprimitive); + + list_addElement(taintsList, taintsItem); + } + } + + + v1beta1_basic_device_local_var = v1beta1_basic_device_create_internal ( + all_nodes ? all_nodes->valueint : 0, + allow_multiple_allocations ? allow_multiple_allocations->valueint : 0, + attributes ? attributesList : NULL, + binding_conditions ? binding_conditionsList : NULL, + binding_failure_conditions ? binding_failure_conditionsList : NULL, + binds_to_node ? binds_to_node->valueint : 0, + capacity ? capacityList : NULL, + consumes_counters ? consumes_countersList : NULL, + node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, + node_selector ? node_selector_local_nonprim : NULL, + taints ? taintsList : NULL + ); + + return v1beta1_basic_device_local_var; +end: + + // The data type of the elements in v1beta1_basic_device->attributes is currently not supported. + + if (binding_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_conditionsList); + binding_conditionsList = NULL; + } + if (binding_failure_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_failure_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_failure_conditionsList); + binding_failure_conditionsList = NULL; + } + + // The data type of the elements in v1beta1_basic_device->capacity is currently not supported. + + if (consumes_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, consumes_countersList) { + v1beta1_device_counter_consumption_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(consumes_countersList); + consumes_countersList = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + if (taintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, taintsList) { + v1beta1_device_taint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(taintsList); + taintsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_basic_device.h b/kubernetes/model/v1beta1_basic_device.h new file mode 100644 index 00000000..0f2f3ae6 --- /dev/null +++ b/kubernetes/model/v1beta1_basic_device.h @@ -0,0 +1,63 @@ +/* + * v1beta1_basic_device.h + * + * BasicDevice defines one device instance. + */ + +#ifndef _v1beta1_basic_device_H_ +#define _v1beta1_basic_device_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_basic_device_t v1beta1_basic_device_t; + +#include "v1_node_selector.h" +#include "v1beta1_device_attribute.h" +#include "v1beta1_device_capacity.h" +#include "v1beta1_device_counter_consumption.h" +#include "v1beta1_device_taint.h" + + + +typedef struct v1beta1_basic_device_t { + int all_nodes; //boolean + int allow_multiple_allocations; //boolean + list_t* attributes; //map + list_t *binding_conditions; //primitive container + list_t *binding_failure_conditions; //primitive container + int binds_to_node; //boolean + list_t* capacity; //map + list_t *consumes_counters; //nonprimitive container + char *node_name; // string + struct v1_node_selector_t *node_selector; //model + list_t *taints; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_basic_device_t; + +__attribute__((deprecated)) v1beta1_basic_device_t *v1beta1_basic_device_create( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints +); + +void v1beta1_basic_device_free(v1beta1_basic_device_t *v1beta1_basic_device); + +v1beta1_basic_device_t *v1beta1_basic_device_parseFromJSON(cJSON *v1beta1_basic_deviceJSON); + +cJSON *v1beta1_basic_device_convertToJSON(v1beta1_basic_device_t *v1beta1_basic_device); + +#endif /* _v1beta1_basic_device_H_ */ + diff --git a/kubernetes/model/v1beta1_capacity_request_policy.c b/kubernetes/model/v1beta1_capacity_request_policy.c new file mode 100644 index 00000000..02cd75d2 --- /dev/null +++ b/kubernetes/model/v1beta1_capacity_request_policy.c @@ -0,0 +1,189 @@ +#include +#include +#include +#include "v1beta1_capacity_request_policy.h" + + + +static v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy_create_internal( + char *_default, + v1beta1_capacity_request_policy_range_t *valid_range, + list_t *valid_values + ) { + v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy_local_var = malloc(sizeof(v1beta1_capacity_request_policy_t)); + if (!v1beta1_capacity_request_policy_local_var) { + return NULL; + } + v1beta1_capacity_request_policy_local_var->_default = _default; + v1beta1_capacity_request_policy_local_var->valid_range = valid_range; + v1beta1_capacity_request_policy_local_var->valid_values = valid_values; + + v1beta1_capacity_request_policy_local_var->_library_owned = 1; + return v1beta1_capacity_request_policy_local_var; +} + +__attribute__((deprecated)) v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy_create( + char *_default, + v1beta1_capacity_request_policy_range_t *valid_range, + list_t *valid_values + ) { + return v1beta1_capacity_request_policy_create_internal ( + _default, + valid_range, + valid_values + ); +} + +void v1beta1_capacity_request_policy_free(v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy) { + if(NULL == v1beta1_capacity_request_policy){ + return ; + } + if(v1beta1_capacity_request_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_capacity_request_policy_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_capacity_request_policy->_default) { + free(v1beta1_capacity_request_policy->_default); + v1beta1_capacity_request_policy->_default = NULL; + } + if (v1beta1_capacity_request_policy->valid_range) { + v1beta1_capacity_request_policy_range_free(v1beta1_capacity_request_policy->valid_range); + v1beta1_capacity_request_policy->valid_range = NULL; + } + if (v1beta1_capacity_request_policy->valid_values) { + list_ForEach(listEntry, v1beta1_capacity_request_policy->valid_values) { + free(listEntry->data); + } + list_freeList(v1beta1_capacity_request_policy->valid_values); + v1beta1_capacity_request_policy->valid_values = NULL; + } + free(v1beta1_capacity_request_policy); +} + +cJSON *v1beta1_capacity_request_policy_convertToJSON(v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_capacity_request_policy->_default + if(v1beta1_capacity_request_policy->_default) { + if(cJSON_AddStringToObject(item, "default", v1beta1_capacity_request_policy->_default) == NULL) { + goto fail; //String + } + } + + + // v1beta1_capacity_request_policy->valid_range + if(v1beta1_capacity_request_policy->valid_range) { + cJSON *valid_range_local_JSON = v1beta1_capacity_request_policy_range_convertToJSON(v1beta1_capacity_request_policy->valid_range); + if(valid_range_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "validRange", valid_range_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_capacity_request_policy->valid_values + if(v1beta1_capacity_request_policy->valid_values) { + cJSON *valid_values = cJSON_AddArrayToObject(item, "validValues"); + if(valid_values == NULL) { + goto fail; //primitive container + } + + listEntry_t *valid_valuesListEntry; + list_ForEach(valid_valuesListEntry, v1beta1_capacity_request_policy->valid_values) { + if(cJSON_AddStringToObject(valid_values, "", valid_valuesListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy_parseFromJSON(cJSON *v1beta1_capacity_request_policyJSON){ + + v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy_local_var = NULL; + + // define the local variable for v1beta1_capacity_request_policy->valid_range + v1beta1_capacity_request_policy_range_t *valid_range_local_nonprim = NULL; + + // define the local list for v1beta1_capacity_request_policy->valid_values + list_t *valid_valuesList = NULL; + + // v1beta1_capacity_request_policy->_default + cJSON *_default = cJSON_GetObjectItemCaseSensitive(v1beta1_capacity_request_policyJSON, "default"); + if (cJSON_IsNull(_default)) { + _default = NULL; + } + if (_default) { + if(!cJSON_IsString(_default) && !cJSON_IsNull(_default)) + { + goto end; //String + } + } + + // v1beta1_capacity_request_policy->valid_range + cJSON *valid_range = cJSON_GetObjectItemCaseSensitive(v1beta1_capacity_request_policyJSON, "validRange"); + if (cJSON_IsNull(valid_range)) { + valid_range = NULL; + } + if (valid_range) { + valid_range_local_nonprim = v1beta1_capacity_request_policy_range_parseFromJSON(valid_range); //nonprimitive + } + + // v1beta1_capacity_request_policy->valid_values + cJSON *valid_values = cJSON_GetObjectItemCaseSensitive(v1beta1_capacity_request_policyJSON, "validValues"); + if (cJSON_IsNull(valid_values)) { + valid_values = NULL; + } + if (valid_values) { + cJSON *valid_values_local = NULL; + if(!cJSON_IsArray(valid_values)) { + goto end;//primitive container + } + valid_valuesList = list_createList(); + + cJSON_ArrayForEach(valid_values_local, valid_values) + { + if(!cJSON_IsString(valid_values_local)) + { + goto end; + } + list_addElement(valid_valuesList , strdup(valid_values_local->valuestring)); + } + } + + + v1beta1_capacity_request_policy_local_var = v1beta1_capacity_request_policy_create_internal ( + _default && !cJSON_IsNull(_default) ? strdup(_default->valuestring) : NULL, + valid_range ? valid_range_local_nonprim : NULL, + valid_values ? valid_valuesList : NULL + ); + + return v1beta1_capacity_request_policy_local_var; +end: + if (valid_range_local_nonprim) { + v1beta1_capacity_request_policy_range_free(valid_range_local_nonprim); + valid_range_local_nonprim = NULL; + } + if (valid_valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valid_valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valid_valuesList); + valid_valuesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_capacity_request_policy.h b/kubernetes/model/v1beta1_capacity_request_policy.h new file mode 100644 index 00000000..ace98aa3 --- /dev/null +++ b/kubernetes/model/v1beta1_capacity_request_policy.h @@ -0,0 +1,43 @@ +/* + * v1beta1_capacity_request_policy.h + * + * CapacityRequestPolicy defines how requests consume device capacity. Must not set more than one ValidRequestValues. + */ + +#ifndef _v1beta1_capacity_request_policy_H_ +#define _v1beta1_capacity_request_policy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_capacity_request_policy_t v1beta1_capacity_request_policy_t; + +#include "v1beta1_capacity_request_policy_range.h" + + + +typedef struct v1beta1_capacity_request_policy_t { + char *_default; // string + struct v1beta1_capacity_request_policy_range_t *valid_range; //model + list_t *valid_values; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_capacity_request_policy_t; + +__attribute__((deprecated)) v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy_create( + char *_default, + v1beta1_capacity_request_policy_range_t *valid_range, + list_t *valid_values +); + +void v1beta1_capacity_request_policy_free(v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy); + +v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy_parseFromJSON(cJSON *v1beta1_capacity_request_policyJSON); + +cJSON *v1beta1_capacity_request_policy_convertToJSON(v1beta1_capacity_request_policy_t *v1beta1_capacity_request_policy); + +#endif /* _v1beta1_capacity_request_policy_H_ */ + diff --git a/kubernetes/model/v1beta1_capacity_request_policy_range.c b/kubernetes/model/v1beta1_capacity_request_policy_range.c new file mode 100644 index 00000000..d377a892 --- /dev/null +++ b/kubernetes/model/v1beta1_capacity_request_policy_range.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include "v1beta1_capacity_request_policy_range.h" + + + +static v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range_create_internal( + char *max, + char *min, + char *step + ) { + v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range_local_var = malloc(sizeof(v1beta1_capacity_request_policy_range_t)); + if (!v1beta1_capacity_request_policy_range_local_var) { + return NULL; + } + v1beta1_capacity_request_policy_range_local_var->max = max; + v1beta1_capacity_request_policy_range_local_var->min = min; + v1beta1_capacity_request_policy_range_local_var->step = step; + + v1beta1_capacity_request_policy_range_local_var->_library_owned = 1; + return v1beta1_capacity_request_policy_range_local_var; +} + +__attribute__((deprecated)) v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range_create( + char *max, + char *min, + char *step + ) { + return v1beta1_capacity_request_policy_range_create_internal ( + max, + min, + step + ); +} + +void v1beta1_capacity_request_policy_range_free(v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range) { + if(NULL == v1beta1_capacity_request_policy_range){ + return ; + } + if(v1beta1_capacity_request_policy_range->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_capacity_request_policy_range_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_capacity_request_policy_range->max) { + free(v1beta1_capacity_request_policy_range->max); + v1beta1_capacity_request_policy_range->max = NULL; + } + if (v1beta1_capacity_request_policy_range->min) { + free(v1beta1_capacity_request_policy_range->min); + v1beta1_capacity_request_policy_range->min = NULL; + } + if (v1beta1_capacity_request_policy_range->step) { + free(v1beta1_capacity_request_policy_range->step); + v1beta1_capacity_request_policy_range->step = NULL; + } + free(v1beta1_capacity_request_policy_range); +} + +cJSON *v1beta1_capacity_request_policy_range_convertToJSON(v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_capacity_request_policy_range->max + if(v1beta1_capacity_request_policy_range->max) { + if(cJSON_AddStringToObject(item, "max", v1beta1_capacity_request_policy_range->max) == NULL) { + goto fail; //String + } + } + + + // v1beta1_capacity_request_policy_range->min + if (!v1beta1_capacity_request_policy_range->min) { + goto fail; + } + if(cJSON_AddStringToObject(item, "min", v1beta1_capacity_request_policy_range->min) == NULL) { + goto fail; //String + } + + + // v1beta1_capacity_request_policy_range->step + if(v1beta1_capacity_request_policy_range->step) { + if(cJSON_AddStringToObject(item, "step", v1beta1_capacity_request_policy_range->step) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range_parseFromJSON(cJSON *v1beta1_capacity_request_policy_rangeJSON){ + + v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range_local_var = NULL; + + // v1beta1_capacity_request_policy_range->max + cJSON *max = cJSON_GetObjectItemCaseSensitive(v1beta1_capacity_request_policy_rangeJSON, "max"); + if (cJSON_IsNull(max)) { + max = NULL; + } + if (max) { + if(!cJSON_IsString(max) && !cJSON_IsNull(max)) + { + goto end; //String + } + } + + // v1beta1_capacity_request_policy_range->min + cJSON *min = cJSON_GetObjectItemCaseSensitive(v1beta1_capacity_request_policy_rangeJSON, "min"); + if (cJSON_IsNull(min)) { + min = NULL; + } + if (!min) { + goto end; + } + + + if(!cJSON_IsString(min)) + { + goto end; //String + } + + // v1beta1_capacity_request_policy_range->step + cJSON *step = cJSON_GetObjectItemCaseSensitive(v1beta1_capacity_request_policy_rangeJSON, "step"); + if (cJSON_IsNull(step)) { + step = NULL; + } + if (step) { + if(!cJSON_IsString(step) && !cJSON_IsNull(step)) + { + goto end; //String + } + } + + + v1beta1_capacity_request_policy_range_local_var = v1beta1_capacity_request_policy_range_create_internal ( + max && !cJSON_IsNull(max) ? strdup(max->valuestring) : NULL, + strdup(min->valuestring), + step && !cJSON_IsNull(step) ? strdup(step->valuestring) : NULL + ); + + return v1beta1_capacity_request_policy_range_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_capacity_request_policy_range.h b/kubernetes/model/v1beta1_capacity_request_policy_range.h new file mode 100644 index 00000000..31e2e36f --- /dev/null +++ b/kubernetes/model/v1beta1_capacity_request_policy_range.h @@ -0,0 +1,42 @@ +/* + * v1beta1_capacity_request_policy_range.h + * + * CapacityRequestPolicyRange defines a valid range for consumable capacity values. - If the requested amount is less than Min, it is rounded up to the Min value. - If Step is set and the requested amount is between Min and Max but not aligned with Step, it will be rounded up to the next value equal to Min + (n * Step). - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set). - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy, and the device cannot be allocated. + */ + +#ifndef _v1beta1_capacity_request_policy_range_H_ +#define _v1beta1_capacity_request_policy_range_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_capacity_request_policy_range_t v1beta1_capacity_request_policy_range_t; + + + + +typedef struct v1beta1_capacity_request_policy_range_t { + char *max; // string + char *min; // string + char *step; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_capacity_request_policy_range_t; + +__attribute__((deprecated)) v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range_create( + char *max, + char *min, + char *step +); + +void v1beta1_capacity_request_policy_range_free(v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range); + +v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range_parseFromJSON(cJSON *v1beta1_capacity_request_policy_rangeJSON); + +cJSON *v1beta1_capacity_request_policy_range_convertToJSON(v1beta1_capacity_request_policy_range_t *v1beta1_capacity_request_policy_range); + +#endif /* _v1beta1_capacity_request_policy_range_H_ */ + diff --git a/kubernetes/model/v1beta1_capacity_requirements.c b/kubernetes/model/v1beta1_capacity_requirements.c new file mode 100644 index 00000000..69be268a --- /dev/null +++ b/kubernetes/model/v1beta1_capacity_requirements.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include "v1beta1_capacity_requirements.h" + + + +static v1beta1_capacity_requirements_t *v1beta1_capacity_requirements_create_internal( + list_t* requests + ) { + v1beta1_capacity_requirements_t *v1beta1_capacity_requirements_local_var = malloc(sizeof(v1beta1_capacity_requirements_t)); + if (!v1beta1_capacity_requirements_local_var) { + return NULL; + } + v1beta1_capacity_requirements_local_var->requests = requests; + + v1beta1_capacity_requirements_local_var->_library_owned = 1; + return v1beta1_capacity_requirements_local_var; +} + +__attribute__((deprecated)) v1beta1_capacity_requirements_t *v1beta1_capacity_requirements_create( + list_t* requests + ) { + return v1beta1_capacity_requirements_create_internal ( + requests + ); +} + +void v1beta1_capacity_requirements_free(v1beta1_capacity_requirements_t *v1beta1_capacity_requirements) { + if(NULL == v1beta1_capacity_requirements){ + return ; + } + if(v1beta1_capacity_requirements->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_capacity_requirements_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_capacity_requirements->requests) { + list_ForEach(listEntry, v1beta1_capacity_requirements->requests) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta1_capacity_requirements->requests); + v1beta1_capacity_requirements->requests = NULL; + } + free(v1beta1_capacity_requirements); +} + +cJSON *v1beta1_capacity_requirements_convertToJSON(v1beta1_capacity_requirements_t *v1beta1_capacity_requirements) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_capacity_requirements->requests + if(v1beta1_capacity_requirements->requests) { + cJSON *requests = cJSON_AddObjectToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = requests; + listEntry_t *requestsListEntry; + if (v1beta1_capacity_requirements->requests) { + list_ForEach(requestsListEntry, v1beta1_capacity_requirements->requests) { + keyValuePair_t *localKeyValue = requestsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_capacity_requirements_t *v1beta1_capacity_requirements_parseFromJSON(cJSON *v1beta1_capacity_requirementsJSON){ + + v1beta1_capacity_requirements_t *v1beta1_capacity_requirements_local_var = NULL; + + // define the local map for v1beta1_capacity_requirements->requests + list_t *requestsList = NULL; + + // v1beta1_capacity_requirements->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta1_capacity_requirementsJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local_map = NULL; + if(!cJSON_IsObject(requests) && !cJSON_IsNull(requests)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(requests)) + { + requestsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(requests_local_map, requests) + { + cJSON *localMapObject = requests_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(requestsList , localMapKeyPair); + } + } + } + + + v1beta1_capacity_requirements_local_var = v1beta1_capacity_requirements_create_internal ( + requests ? requestsList : NULL + ); + + return v1beta1_capacity_requirements_local_var; +end: + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_capacity_requirements.h b/kubernetes/model/v1beta1_capacity_requirements.h new file mode 100644 index 00000000..69de870e --- /dev/null +++ b/kubernetes/model/v1beta1_capacity_requirements.h @@ -0,0 +1,38 @@ +/* + * v1beta1_capacity_requirements.h + * + * CapacityRequirements defines the capacity requirements for a specific device request. + */ + +#ifndef _v1beta1_capacity_requirements_H_ +#define _v1beta1_capacity_requirements_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_capacity_requirements_t v1beta1_capacity_requirements_t; + + + + +typedef struct v1beta1_capacity_requirements_t { + list_t* requests; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_capacity_requirements_t; + +__attribute__((deprecated)) v1beta1_capacity_requirements_t *v1beta1_capacity_requirements_create( + list_t* requests +); + +void v1beta1_capacity_requirements_free(v1beta1_capacity_requirements_t *v1beta1_capacity_requirements); + +v1beta1_capacity_requirements_t *v1beta1_capacity_requirements_parseFromJSON(cJSON *v1beta1_capacity_requirementsJSON); + +cJSON *v1beta1_capacity_requirements_convertToJSON(v1beta1_capacity_requirements_t *v1beta1_capacity_requirements); + +#endif /* _v1beta1_capacity_requirements_H_ */ + diff --git a/kubernetes/model/v1beta1_cel_device_selector.c b/kubernetes/model/v1beta1_cel_device_selector.c new file mode 100644 index 00000000..8a967d7f --- /dev/null +++ b/kubernetes/model/v1beta1_cel_device_selector.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1beta1_cel_device_selector.h" + + + +static v1beta1_cel_device_selector_t *v1beta1_cel_device_selector_create_internal( + char *expression + ) { + v1beta1_cel_device_selector_t *v1beta1_cel_device_selector_local_var = malloc(sizeof(v1beta1_cel_device_selector_t)); + if (!v1beta1_cel_device_selector_local_var) { + return NULL; + } + v1beta1_cel_device_selector_local_var->expression = expression; + + v1beta1_cel_device_selector_local_var->_library_owned = 1; + return v1beta1_cel_device_selector_local_var; +} + +__attribute__((deprecated)) v1beta1_cel_device_selector_t *v1beta1_cel_device_selector_create( + char *expression + ) { + return v1beta1_cel_device_selector_create_internal ( + expression + ); +} + +void v1beta1_cel_device_selector_free(v1beta1_cel_device_selector_t *v1beta1_cel_device_selector) { + if(NULL == v1beta1_cel_device_selector){ + return ; + } + if(v1beta1_cel_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_cel_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_cel_device_selector->expression) { + free(v1beta1_cel_device_selector->expression); + v1beta1_cel_device_selector->expression = NULL; + } + free(v1beta1_cel_device_selector); +} + +cJSON *v1beta1_cel_device_selector_convertToJSON(v1beta1_cel_device_selector_t *v1beta1_cel_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_cel_device_selector->expression + if (!v1beta1_cel_device_selector->expression) { + goto fail; + } + if(cJSON_AddStringToObject(item, "expression", v1beta1_cel_device_selector->expression) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_cel_device_selector_t *v1beta1_cel_device_selector_parseFromJSON(cJSON *v1beta1_cel_device_selectorJSON){ + + v1beta1_cel_device_selector_t *v1beta1_cel_device_selector_local_var = NULL; + + // v1beta1_cel_device_selector->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1beta1_cel_device_selectorJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (!expression) { + goto end; + } + + + if(!cJSON_IsString(expression)) + { + goto end; //String + } + + + v1beta1_cel_device_selector_local_var = v1beta1_cel_device_selector_create_internal ( + strdup(expression->valuestring) + ); + + return v1beta1_cel_device_selector_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_cel_device_selector.h b/kubernetes/model/v1beta1_cel_device_selector.h new file mode 100644 index 00000000..851b43a2 --- /dev/null +++ b/kubernetes/model/v1beta1_cel_device_selector.h @@ -0,0 +1,38 @@ +/* + * v1beta1_cel_device_selector.h + * + * CELDeviceSelector contains a CEL expression for selecting a device. + */ + +#ifndef _v1beta1_cel_device_selector_H_ +#define _v1beta1_cel_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_cel_device_selector_t v1beta1_cel_device_selector_t; + + + + +typedef struct v1beta1_cel_device_selector_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_cel_device_selector_t; + +__attribute__((deprecated)) v1beta1_cel_device_selector_t *v1beta1_cel_device_selector_create( + char *expression +); + +void v1beta1_cel_device_selector_free(v1beta1_cel_device_selector_t *v1beta1_cel_device_selector); + +v1beta1_cel_device_selector_t *v1beta1_cel_device_selector_parseFromJSON(cJSON *v1beta1_cel_device_selectorJSON); + +cJSON *v1beta1_cel_device_selector_convertToJSON(v1beta1_cel_device_selector_t *v1beta1_cel_device_selector); + +#endif /* _v1beta1_cel_device_selector_H_ */ + diff --git a/kubernetes/model/v1beta1_cluster_trust_bundle.c b/kubernetes/model/v1beta1_cluster_trust_bundle.c new file mode 100644 index 00000000..d4fbb74e --- /dev/null +++ b/kubernetes/model/v1beta1_cluster_trust_bundle.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1beta1_cluster_trust_bundle.h" + + + +static v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_cluster_trust_bundle_spec_t *spec + ) { + v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle_local_var = malloc(sizeof(v1beta1_cluster_trust_bundle_t)); + if (!v1beta1_cluster_trust_bundle_local_var) { + return NULL; + } + v1beta1_cluster_trust_bundle_local_var->api_version = api_version; + v1beta1_cluster_trust_bundle_local_var->kind = kind; + v1beta1_cluster_trust_bundle_local_var->metadata = metadata; + v1beta1_cluster_trust_bundle_local_var->spec = spec; + + v1beta1_cluster_trust_bundle_local_var->_library_owned = 1; + return v1beta1_cluster_trust_bundle_local_var; +} + +__attribute__((deprecated)) v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_cluster_trust_bundle_spec_t *spec + ) { + return v1beta1_cluster_trust_bundle_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_cluster_trust_bundle_free(v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle) { + if(NULL == v1beta1_cluster_trust_bundle){ + return ; + } + if(v1beta1_cluster_trust_bundle->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_cluster_trust_bundle_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_cluster_trust_bundle->api_version) { + free(v1beta1_cluster_trust_bundle->api_version); + v1beta1_cluster_trust_bundle->api_version = NULL; + } + if (v1beta1_cluster_trust_bundle->kind) { + free(v1beta1_cluster_trust_bundle->kind); + v1beta1_cluster_trust_bundle->kind = NULL; + } + if (v1beta1_cluster_trust_bundle->metadata) { + v1_object_meta_free(v1beta1_cluster_trust_bundle->metadata); + v1beta1_cluster_trust_bundle->metadata = NULL; + } + if (v1beta1_cluster_trust_bundle->spec) { + v1beta1_cluster_trust_bundle_spec_free(v1beta1_cluster_trust_bundle->spec); + v1beta1_cluster_trust_bundle->spec = NULL; + } + free(v1beta1_cluster_trust_bundle); +} + +cJSON *v1beta1_cluster_trust_bundle_convertToJSON(v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_cluster_trust_bundle->api_version + if(v1beta1_cluster_trust_bundle->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_cluster_trust_bundle->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_cluster_trust_bundle->kind + if(v1beta1_cluster_trust_bundle->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_cluster_trust_bundle->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_cluster_trust_bundle->metadata + if(v1beta1_cluster_trust_bundle->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_cluster_trust_bundle->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_cluster_trust_bundle->spec + if (!v1beta1_cluster_trust_bundle->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta1_cluster_trust_bundle_spec_convertToJSON(v1beta1_cluster_trust_bundle->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle_parseFromJSON(cJSON *v1beta1_cluster_trust_bundleJSON){ + + v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle_local_var = NULL; + + // define the local variable for v1beta1_cluster_trust_bundle->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_cluster_trust_bundle->spec + v1beta1_cluster_trust_bundle_spec_t *spec_local_nonprim = NULL; + + // v1beta1_cluster_trust_bundle->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundleJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_cluster_trust_bundle->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundleJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_cluster_trust_bundle->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundleJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_cluster_trust_bundle->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundleJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta1_cluster_trust_bundle_spec_parseFromJSON(spec); //nonprimitive + + + v1beta1_cluster_trust_bundle_local_var = v1beta1_cluster_trust_bundle_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta1_cluster_trust_bundle_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_cluster_trust_bundle_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_cluster_trust_bundle.h b/kubernetes/model/v1beta1_cluster_trust_bundle.h new file mode 100644 index 00000000..0dadbd02 --- /dev/null +++ b/kubernetes/model/v1beta1_cluster_trust_bundle.h @@ -0,0 +1,46 @@ +/* + * v1beta1_cluster_trust_bundle.h + * + * ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates). ClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to. It can be optionally associated with a particular assigner, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle. + */ + +#ifndef _v1beta1_cluster_trust_bundle_H_ +#define _v1beta1_cluster_trust_bundle_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_cluster_trust_bundle_t v1beta1_cluster_trust_bundle_t; + +#include "v1_object_meta.h" +#include "v1beta1_cluster_trust_bundle_spec.h" + + + +typedef struct v1beta1_cluster_trust_bundle_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_cluster_trust_bundle_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_cluster_trust_bundle_t; + +__attribute__((deprecated)) v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_cluster_trust_bundle_spec_t *spec +); + +void v1beta1_cluster_trust_bundle_free(v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle); + +v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle_parseFromJSON(cJSON *v1beta1_cluster_trust_bundleJSON); + +cJSON *v1beta1_cluster_trust_bundle_convertToJSON(v1beta1_cluster_trust_bundle_t *v1beta1_cluster_trust_bundle); + +#endif /* _v1beta1_cluster_trust_bundle_H_ */ + diff --git a/kubernetes/model/v1beta1_cluster_trust_bundle_list.c b/kubernetes/model/v1beta1_cluster_trust_bundle_list.c new file mode 100644 index 00000000..aa7f17ee --- /dev/null +++ b/kubernetes/model/v1beta1_cluster_trust_bundle_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_cluster_trust_bundle_list.h" + + + +static v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list_local_var = malloc(sizeof(v1beta1_cluster_trust_bundle_list_t)); + if (!v1beta1_cluster_trust_bundle_list_local_var) { + return NULL; + } + v1beta1_cluster_trust_bundle_list_local_var->api_version = api_version; + v1beta1_cluster_trust_bundle_list_local_var->items = items; + v1beta1_cluster_trust_bundle_list_local_var->kind = kind; + v1beta1_cluster_trust_bundle_list_local_var->metadata = metadata; + + v1beta1_cluster_trust_bundle_list_local_var->_library_owned = 1; + return v1beta1_cluster_trust_bundle_list_local_var; +} + +__attribute__((deprecated)) v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_cluster_trust_bundle_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_cluster_trust_bundle_list_free(v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list) { + if(NULL == v1beta1_cluster_trust_bundle_list){ + return ; + } + if(v1beta1_cluster_trust_bundle_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_cluster_trust_bundle_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_cluster_trust_bundle_list->api_version) { + free(v1beta1_cluster_trust_bundle_list->api_version); + v1beta1_cluster_trust_bundle_list->api_version = NULL; + } + if (v1beta1_cluster_trust_bundle_list->items) { + list_ForEach(listEntry, v1beta1_cluster_trust_bundle_list->items) { + v1beta1_cluster_trust_bundle_free(listEntry->data); + } + list_freeList(v1beta1_cluster_trust_bundle_list->items); + v1beta1_cluster_trust_bundle_list->items = NULL; + } + if (v1beta1_cluster_trust_bundle_list->kind) { + free(v1beta1_cluster_trust_bundle_list->kind); + v1beta1_cluster_trust_bundle_list->kind = NULL; + } + if (v1beta1_cluster_trust_bundle_list->metadata) { + v1_list_meta_free(v1beta1_cluster_trust_bundle_list->metadata); + v1beta1_cluster_trust_bundle_list->metadata = NULL; + } + free(v1beta1_cluster_trust_bundle_list); +} + +cJSON *v1beta1_cluster_trust_bundle_list_convertToJSON(v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_cluster_trust_bundle_list->api_version + if(v1beta1_cluster_trust_bundle_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_cluster_trust_bundle_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_cluster_trust_bundle_list->items + if (!v1beta1_cluster_trust_bundle_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_cluster_trust_bundle_list->items) { + list_ForEach(itemsListEntry, v1beta1_cluster_trust_bundle_list->items) { + cJSON *itemLocal = v1beta1_cluster_trust_bundle_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_cluster_trust_bundle_list->kind + if(v1beta1_cluster_trust_bundle_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_cluster_trust_bundle_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_cluster_trust_bundle_list->metadata + if(v1beta1_cluster_trust_bundle_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_cluster_trust_bundle_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list_parseFromJSON(cJSON *v1beta1_cluster_trust_bundle_listJSON){ + + v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list_local_var = NULL; + + // define the local list for v1beta1_cluster_trust_bundle_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_cluster_trust_bundle_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_cluster_trust_bundle_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundle_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_cluster_trust_bundle_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundle_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_cluster_trust_bundle_t *itemsItem = v1beta1_cluster_trust_bundle_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_cluster_trust_bundle_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundle_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_cluster_trust_bundle_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundle_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_cluster_trust_bundle_list_local_var = v1beta1_cluster_trust_bundle_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_cluster_trust_bundle_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_cluster_trust_bundle_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_cluster_trust_bundle_list.h b/kubernetes/model/v1beta1_cluster_trust_bundle_list.h new file mode 100644 index 00000000..851f732f --- /dev/null +++ b/kubernetes/model/v1beta1_cluster_trust_bundle_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_cluster_trust_bundle_list.h + * + * ClusterTrustBundleList is a collection of ClusterTrustBundle objects + */ + +#ifndef _v1beta1_cluster_trust_bundle_list_H_ +#define _v1beta1_cluster_trust_bundle_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_cluster_trust_bundle_list_t v1beta1_cluster_trust_bundle_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_cluster_trust_bundle.h" + + + +typedef struct v1beta1_cluster_trust_bundle_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_cluster_trust_bundle_list_t; + +__attribute__((deprecated)) v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_cluster_trust_bundle_list_free(v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list); + +v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list_parseFromJSON(cJSON *v1beta1_cluster_trust_bundle_listJSON); + +cJSON *v1beta1_cluster_trust_bundle_list_convertToJSON(v1beta1_cluster_trust_bundle_list_t *v1beta1_cluster_trust_bundle_list); + +#endif /* _v1beta1_cluster_trust_bundle_list_H_ */ + diff --git a/kubernetes/model/v1beta1_cluster_trust_bundle_spec.c b/kubernetes/model/v1beta1_cluster_trust_bundle_spec.c new file mode 100644 index 00000000..b756473b --- /dev/null +++ b/kubernetes/model/v1beta1_cluster_trust_bundle_spec.c @@ -0,0 +1,121 @@ +#include +#include +#include +#include "v1beta1_cluster_trust_bundle_spec.h" + + + +static v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec_create_internal( + char *signer_name, + char *trust_bundle + ) { + v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec_local_var = malloc(sizeof(v1beta1_cluster_trust_bundle_spec_t)); + if (!v1beta1_cluster_trust_bundle_spec_local_var) { + return NULL; + } + v1beta1_cluster_trust_bundle_spec_local_var->signer_name = signer_name; + v1beta1_cluster_trust_bundle_spec_local_var->trust_bundle = trust_bundle; + + v1beta1_cluster_trust_bundle_spec_local_var->_library_owned = 1; + return v1beta1_cluster_trust_bundle_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec_create( + char *signer_name, + char *trust_bundle + ) { + return v1beta1_cluster_trust_bundle_spec_create_internal ( + signer_name, + trust_bundle + ); +} + +void v1beta1_cluster_trust_bundle_spec_free(v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec) { + if(NULL == v1beta1_cluster_trust_bundle_spec){ + return ; + } + if(v1beta1_cluster_trust_bundle_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_cluster_trust_bundle_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_cluster_trust_bundle_spec->signer_name) { + free(v1beta1_cluster_trust_bundle_spec->signer_name); + v1beta1_cluster_trust_bundle_spec->signer_name = NULL; + } + if (v1beta1_cluster_trust_bundle_spec->trust_bundle) { + free(v1beta1_cluster_trust_bundle_spec->trust_bundle); + v1beta1_cluster_trust_bundle_spec->trust_bundle = NULL; + } + free(v1beta1_cluster_trust_bundle_spec); +} + +cJSON *v1beta1_cluster_trust_bundle_spec_convertToJSON(v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_cluster_trust_bundle_spec->signer_name + if(v1beta1_cluster_trust_bundle_spec->signer_name) { + if(cJSON_AddStringToObject(item, "signerName", v1beta1_cluster_trust_bundle_spec->signer_name) == NULL) { + goto fail; //String + } + } + + + // v1beta1_cluster_trust_bundle_spec->trust_bundle + if (!v1beta1_cluster_trust_bundle_spec->trust_bundle) { + goto fail; + } + if(cJSON_AddStringToObject(item, "trustBundle", v1beta1_cluster_trust_bundle_spec->trust_bundle) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec_parseFromJSON(cJSON *v1beta1_cluster_trust_bundle_specJSON){ + + v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec_local_var = NULL; + + // v1beta1_cluster_trust_bundle_spec->signer_name + cJSON *signer_name = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundle_specJSON, "signerName"); + if (cJSON_IsNull(signer_name)) { + signer_name = NULL; + } + if (signer_name) { + if(!cJSON_IsString(signer_name) && !cJSON_IsNull(signer_name)) + { + goto end; //String + } + } + + // v1beta1_cluster_trust_bundle_spec->trust_bundle + cJSON *trust_bundle = cJSON_GetObjectItemCaseSensitive(v1beta1_cluster_trust_bundle_specJSON, "trustBundle"); + if (cJSON_IsNull(trust_bundle)) { + trust_bundle = NULL; + } + if (!trust_bundle) { + goto end; + } + + + if(!cJSON_IsString(trust_bundle)) + { + goto end; //String + } + + + v1beta1_cluster_trust_bundle_spec_local_var = v1beta1_cluster_trust_bundle_spec_create_internal ( + signer_name && !cJSON_IsNull(signer_name) ? strdup(signer_name->valuestring) : NULL, + strdup(trust_bundle->valuestring) + ); + + return v1beta1_cluster_trust_bundle_spec_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_cluster_trust_bundle_spec.h b/kubernetes/model/v1beta1_cluster_trust_bundle_spec.h new file mode 100644 index 00000000..f9fe0ac7 --- /dev/null +++ b/kubernetes/model/v1beta1_cluster_trust_bundle_spec.h @@ -0,0 +1,40 @@ +/* + * v1beta1_cluster_trust_bundle_spec.h + * + * ClusterTrustBundleSpec contains the signer and trust anchors. + */ + +#ifndef _v1beta1_cluster_trust_bundle_spec_H_ +#define _v1beta1_cluster_trust_bundle_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_cluster_trust_bundle_spec_t v1beta1_cluster_trust_bundle_spec_t; + + + + +typedef struct v1beta1_cluster_trust_bundle_spec_t { + char *signer_name; // string + char *trust_bundle; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_cluster_trust_bundle_spec_t; + +__attribute__((deprecated)) v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec_create( + char *signer_name, + char *trust_bundle +); + +void v1beta1_cluster_trust_bundle_spec_free(v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec); + +v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec_parseFromJSON(cJSON *v1beta1_cluster_trust_bundle_specJSON); + +cJSON *v1beta1_cluster_trust_bundle_spec_convertToJSON(v1beta1_cluster_trust_bundle_spec_t *v1beta1_cluster_trust_bundle_spec); + +#endif /* _v1beta1_cluster_trust_bundle_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_counter.c b/kubernetes/model/v1beta1_counter.c new file mode 100644 index 00000000..7c90998f --- /dev/null +++ b/kubernetes/model/v1beta1_counter.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1beta1_counter.h" + + + +static v1beta1_counter_t *v1beta1_counter_create_internal( + char *value + ) { + v1beta1_counter_t *v1beta1_counter_local_var = malloc(sizeof(v1beta1_counter_t)); + if (!v1beta1_counter_local_var) { + return NULL; + } + v1beta1_counter_local_var->value = value; + + v1beta1_counter_local_var->_library_owned = 1; + return v1beta1_counter_local_var; +} + +__attribute__((deprecated)) v1beta1_counter_t *v1beta1_counter_create( + char *value + ) { + return v1beta1_counter_create_internal ( + value + ); +} + +void v1beta1_counter_free(v1beta1_counter_t *v1beta1_counter) { + if(NULL == v1beta1_counter){ + return ; + } + if(v1beta1_counter->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_counter_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_counter->value) { + free(v1beta1_counter->value); + v1beta1_counter->value = NULL; + } + free(v1beta1_counter); +} + +cJSON *v1beta1_counter_convertToJSON(v1beta1_counter_t *v1beta1_counter) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_counter->value + if (!v1beta1_counter->value) { + goto fail; + } + if(cJSON_AddStringToObject(item, "value", v1beta1_counter->value) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_counter_t *v1beta1_counter_parseFromJSON(cJSON *v1beta1_counterJSON){ + + v1beta1_counter_t *v1beta1_counter_local_var = NULL; + + // v1beta1_counter->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta1_counterJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (!value) { + goto end; + } + + + if(!cJSON_IsString(value)) + { + goto end; //String + } + + + v1beta1_counter_local_var = v1beta1_counter_create_internal ( + strdup(value->valuestring) + ); + + return v1beta1_counter_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_counter.h b/kubernetes/model/v1beta1_counter.h new file mode 100644 index 00000000..4f8ae1fd --- /dev/null +++ b/kubernetes/model/v1beta1_counter.h @@ -0,0 +1,38 @@ +/* + * v1beta1_counter.h + * + * Counter describes a quantity associated with a device. + */ + +#ifndef _v1beta1_counter_H_ +#define _v1beta1_counter_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_counter_t v1beta1_counter_t; + + + + +typedef struct v1beta1_counter_t { + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_counter_t; + +__attribute__((deprecated)) v1beta1_counter_t *v1beta1_counter_create( + char *value +); + +void v1beta1_counter_free(v1beta1_counter_t *v1beta1_counter); + +v1beta1_counter_t *v1beta1_counter_parseFromJSON(cJSON *v1beta1_counterJSON); + +cJSON *v1beta1_counter_convertToJSON(v1beta1_counter_t *v1beta1_counter); + +#endif /* _v1beta1_counter_H_ */ + diff --git a/kubernetes/model/v1beta1_counter_set.c b/kubernetes/model/v1beta1_counter_set.c new file mode 100644 index 00000000..9de48a59 --- /dev/null +++ b/kubernetes/model/v1beta1_counter_set.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1beta1_counter_set.h" + + + +static v1beta1_counter_set_t *v1beta1_counter_set_create_internal( + list_t* counters, + char *name + ) { + v1beta1_counter_set_t *v1beta1_counter_set_local_var = malloc(sizeof(v1beta1_counter_set_t)); + if (!v1beta1_counter_set_local_var) { + return NULL; + } + v1beta1_counter_set_local_var->counters = counters; + v1beta1_counter_set_local_var->name = name; + + v1beta1_counter_set_local_var->_library_owned = 1; + return v1beta1_counter_set_local_var; +} + +__attribute__((deprecated)) v1beta1_counter_set_t *v1beta1_counter_set_create( + list_t* counters, + char *name + ) { + return v1beta1_counter_set_create_internal ( + counters, + name + ); +} + +void v1beta1_counter_set_free(v1beta1_counter_set_t *v1beta1_counter_set) { + if(NULL == v1beta1_counter_set){ + return ; + } + if(v1beta1_counter_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_counter_set_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_counter_set->counters) { + list_ForEach(listEntry, v1beta1_counter_set->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta1_counter_set->counters); + v1beta1_counter_set->counters = NULL; + } + if (v1beta1_counter_set->name) { + free(v1beta1_counter_set->name); + v1beta1_counter_set->name = NULL; + } + free(v1beta1_counter_set); +} + +cJSON *v1beta1_counter_set_convertToJSON(v1beta1_counter_set_t *v1beta1_counter_set) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_counter_set->counters + if (!v1beta1_counter_set->counters) { + goto fail; + } + cJSON *counters = cJSON_AddObjectToObject(item, "counters"); + if(counters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = counters; + listEntry_t *countersListEntry; + if (v1beta1_counter_set->counters) { + list_ForEach(countersListEntry, v1beta1_counter_set->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + + // v1beta1_counter_set->name + if (!v1beta1_counter_set->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta1_counter_set->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_counter_set_t *v1beta1_counter_set_parseFromJSON(cJSON *v1beta1_counter_setJSON){ + + v1beta1_counter_set_t *v1beta1_counter_set_local_var = NULL; + + // define the local map for v1beta1_counter_set->counters + list_t *countersList = NULL; + + // v1beta1_counter_set->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1beta1_counter_setJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1beta1_counter_set->counters is currently not supported. + + + // v1beta1_counter_set->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_counter_setJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1beta1_counter_set_local_var = v1beta1_counter_set_create_internal ( + countersList, + strdup(name->valuestring) + ); + + return v1beta1_counter_set_local_var; +end: + + // The data type of the elements in v1beta1_counter_set->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1beta1_counter_set.h b/kubernetes/model/v1beta1_counter_set.h new file mode 100644 index 00000000..93a4ff7b --- /dev/null +++ b/kubernetes/model/v1beta1_counter_set.h @@ -0,0 +1,41 @@ +/* + * v1beta1_counter_set.h + * + * CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice. The counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices. + */ + +#ifndef _v1beta1_counter_set_H_ +#define _v1beta1_counter_set_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_counter_set_t v1beta1_counter_set_t; + +#include "v1beta1_counter.h" + + + +typedef struct v1beta1_counter_set_t { + list_t* counters; //map + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_counter_set_t; + +__attribute__((deprecated)) v1beta1_counter_set_t *v1beta1_counter_set_create( + list_t* counters, + char *name +); + +void v1beta1_counter_set_free(v1beta1_counter_set_t *v1beta1_counter_set); + +v1beta1_counter_set_t *v1beta1_counter_set_parseFromJSON(cJSON *v1beta1_counter_setJSON); + +cJSON *v1beta1_counter_set_convertToJSON(v1beta1_counter_set_t *v1beta1_counter_set); + +#endif /* _v1beta1_counter_set_H_ */ + diff --git a/kubernetes/model/v1beta1_device.c b/kubernetes/model/v1beta1_device.c new file mode 100644 index 00000000..38efcd4d --- /dev/null +++ b/kubernetes/model/v1beta1_device.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include "v1beta1_device.h" + + + +static v1beta1_device_t *v1beta1_device_create_internal( + v1beta1_basic_device_t *basic, + char *name + ) { + v1beta1_device_t *v1beta1_device_local_var = malloc(sizeof(v1beta1_device_t)); + if (!v1beta1_device_local_var) { + return NULL; + } + v1beta1_device_local_var->basic = basic; + v1beta1_device_local_var->name = name; + + v1beta1_device_local_var->_library_owned = 1; + return v1beta1_device_local_var; +} + +__attribute__((deprecated)) v1beta1_device_t *v1beta1_device_create( + v1beta1_basic_device_t *basic, + char *name + ) { + return v1beta1_device_create_internal ( + basic, + name + ); +} + +void v1beta1_device_free(v1beta1_device_t *v1beta1_device) { + if(NULL == v1beta1_device){ + return ; + } + if(v1beta1_device->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device->basic) { + v1beta1_basic_device_free(v1beta1_device->basic); + v1beta1_device->basic = NULL; + } + if (v1beta1_device->name) { + free(v1beta1_device->name); + v1beta1_device->name = NULL; + } + free(v1beta1_device); +} + +cJSON *v1beta1_device_convertToJSON(v1beta1_device_t *v1beta1_device) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device->basic + if(v1beta1_device->basic) { + cJSON *basic_local_JSON = v1beta1_basic_device_convertToJSON(v1beta1_device->basic); + if(basic_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "basic", basic_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_device->name + if (!v1beta1_device->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta1_device->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_t *v1beta1_device_parseFromJSON(cJSON *v1beta1_deviceJSON){ + + v1beta1_device_t *v1beta1_device_local_var = NULL; + + // define the local variable for v1beta1_device->basic + v1beta1_basic_device_t *basic_local_nonprim = NULL; + + // v1beta1_device->basic + cJSON *basic = cJSON_GetObjectItemCaseSensitive(v1beta1_deviceJSON, "basic"); + if (cJSON_IsNull(basic)) { + basic = NULL; + } + if (basic) { + basic_local_nonprim = v1beta1_basic_device_parseFromJSON(basic); //nonprimitive + } + + // v1beta1_device->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_deviceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1beta1_device_local_var = v1beta1_device_create_internal ( + basic ? basic_local_nonprim : NULL, + strdup(name->valuestring) + ); + + return v1beta1_device_local_var; +end: + if (basic_local_nonprim) { + v1beta1_basic_device_free(basic_local_nonprim); + basic_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device.h b/kubernetes/model/v1beta1_device.h new file mode 100644 index 00000000..c3ad6061 --- /dev/null +++ b/kubernetes/model/v1beta1_device.h @@ -0,0 +1,41 @@ +/* + * v1beta1_device.h + * + * Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set. + */ + +#ifndef _v1beta1_device_H_ +#define _v1beta1_device_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_t v1beta1_device_t; + +#include "v1beta1_basic_device.h" + + + +typedef struct v1beta1_device_t { + struct v1beta1_basic_device_t *basic; //model + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_t; + +__attribute__((deprecated)) v1beta1_device_t *v1beta1_device_create( + v1beta1_basic_device_t *basic, + char *name +); + +void v1beta1_device_free(v1beta1_device_t *v1beta1_device); + +v1beta1_device_t *v1beta1_device_parseFromJSON(cJSON *v1beta1_deviceJSON); + +cJSON *v1beta1_device_convertToJSON(v1beta1_device_t *v1beta1_device); + +#endif /* _v1beta1_device_H_ */ + diff --git a/kubernetes/model/v1beta1_device_allocation_configuration.c b/kubernetes/model/v1beta1_device_allocation_configuration.c new file mode 100644 index 00000000..b482eac5 --- /dev/null +++ b/kubernetes/model/v1beta1_device_allocation_configuration.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1beta1_device_allocation_configuration.h" + + + +static v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration_create_internal( + v1beta1_opaque_device_configuration_t *opaque, + list_t *requests, + char *source + ) { + v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration_local_var = malloc(sizeof(v1beta1_device_allocation_configuration_t)); + if (!v1beta1_device_allocation_configuration_local_var) { + return NULL; + } + v1beta1_device_allocation_configuration_local_var->opaque = opaque; + v1beta1_device_allocation_configuration_local_var->requests = requests; + v1beta1_device_allocation_configuration_local_var->source = source; + + v1beta1_device_allocation_configuration_local_var->_library_owned = 1; + return v1beta1_device_allocation_configuration_local_var; +} + +__attribute__((deprecated)) v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration_create( + v1beta1_opaque_device_configuration_t *opaque, + list_t *requests, + char *source + ) { + return v1beta1_device_allocation_configuration_create_internal ( + opaque, + requests, + source + ); +} + +void v1beta1_device_allocation_configuration_free(v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration) { + if(NULL == v1beta1_device_allocation_configuration){ + return ; + } + if(v1beta1_device_allocation_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_allocation_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_allocation_configuration->opaque) { + v1beta1_opaque_device_configuration_free(v1beta1_device_allocation_configuration->opaque); + v1beta1_device_allocation_configuration->opaque = NULL; + } + if (v1beta1_device_allocation_configuration->requests) { + list_ForEach(listEntry, v1beta1_device_allocation_configuration->requests) { + free(listEntry->data); + } + list_freeList(v1beta1_device_allocation_configuration->requests); + v1beta1_device_allocation_configuration->requests = NULL; + } + if (v1beta1_device_allocation_configuration->source) { + free(v1beta1_device_allocation_configuration->source); + v1beta1_device_allocation_configuration->source = NULL; + } + free(v1beta1_device_allocation_configuration); +} + +cJSON *v1beta1_device_allocation_configuration_convertToJSON(v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_allocation_configuration->opaque + if(v1beta1_device_allocation_configuration->opaque) { + cJSON *opaque_local_JSON = v1beta1_opaque_device_configuration_convertToJSON(v1beta1_device_allocation_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_device_allocation_configuration->requests + if(v1beta1_device_allocation_configuration->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1beta1_device_allocation_configuration->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta1_device_allocation_configuration->source + if (!v1beta1_device_allocation_configuration->source) { + goto fail; + } + if(cJSON_AddStringToObject(item, "source", v1beta1_device_allocation_configuration->source) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration_parseFromJSON(cJSON *v1beta1_device_allocation_configurationJSON){ + + v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration_local_var = NULL; + + // define the local variable for v1beta1_device_allocation_configuration->opaque + v1beta1_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // define the local list for v1beta1_device_allocation_configuration->requests + list_t *requestsList = NULL; + + // v1beta1_device_allocation_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1beta1_device_allocation_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1beta1_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + // v1beta1_device_allocation_configuration->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta1_device_allocation_configurationJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + // v1beta1_device_allocation_configuration->source + cJSON *source = cJSON_GetObjectItemCaseSensitive(v1beta1_device_allocation_configurationJSON, "source"); + if (cJSON_IsNull(source)) { + source = NULL; + } + if (!source) { + goto end; + } + + + if(!cJSON_IsString(source)) + { + goto end; //String + } + + + v1beta1_device_allocation_configuration_local_var = v1beta1_device_allocation_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL, + requests ? requestsList : NULL, + strdup(source->valuestring) + ); + + return v1beta1_device_allocation_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1beta1_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_allocation_configuration.h b/kubernetes/model/v1beta1_device_allocation_configuration.h new file mode 100644 index 00000000..04ef7260 --- /dev/null +++ b/kubernetes/model/v1beta1_device_allocation_configuration.h @@ -0,0 +1,43 @@ +/* + * v1beta1_device_allocation_configuration.h + * + * DeviceAllocationConfiguration gets embedded in an AllocationResult. + */ + +#ifndef _v1beta1_device_allocation_configuration_H_ +#define _v1beta1_device_allocation_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_allocation_configuration_t v1beta1_device_allocation_configuration_t; + +#include "v1beta1_opaque_device_configuration.h" + + + +typedef struct v1beta1_device_allocation_configuration_t { + struct v1beta1_opaque_device_configuration_t *opaque; //model + list_t *requests; //primitive container + char *source; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_allocation_configuration_t; + +__attribute__((deprecated)) v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration_create( + v1beta1_opaque_device_configuration_t *opaque, + list_t *requests, + char *source +); + +void v1beta1_device_allocation_configuration_free(v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration); + +v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration_parseFromJSON(cJSON *v1beta1_device_allocation_configurationJSON); + +cJSON *v1beta1_device_allocation_configuration_convertToJSON(v1beta1_device_allocation_configuration_t *v1beta1_device_allocation_configuration); + +#endif /* _v1beta1_device_allocation_configuration_H_ */ + diff --git a/kubernetes/model/v1beta1_device_allocation_result.c b/kubernetes/model/v1beta1_device_allocation_result.c new file mode 100644 index 00000000..06ad9829 --- /dev/null +++ b/kubernetes/model/v1beta1_device_allocation_result.c @@ -0,0 +1,195 @@ +#include +#include +#include +#include "v1beta1_device_allocation_result.h" + + + +static v1beta1_device_allocation_result_t *v1beta1_device_allocation_result_create_internal( + list_t *config, + list_t *results + ) { + v1beta1_device_allocation_result_t *v1beta1_device_allocation_result_local_var = malloc(sizeof(v1beta1_device_allocation_result_t)); + if (!v1beta1_device_allocation_result_local_var) { + return NULL; + } + v1beta1_device_allocation_result_local_var->config = config; + v1beta1_device_allocation_result_local_var->results = results; + + v1beta1_device_allocation_result_local_var->_library_owned = 1; + return v1beta1_device_allocation_result_local_var; +} + +__attribute__((deprecated)) v1beta1_device_allocation_result_t *v1beta1_device_allocation_result_create( + list_t *config, + list_t *results + ) { + return v1beta1_device_allocation_result_create_internal ( + config, + results + ); +} + +void v1beta1_device_allocation_result_free(v1beta1_device_allocation_result_t *v1beta1_device_allocation_result) { + if(NULL == v1beta1_device_allocation_result){ + return ; + } + if(v1beta1_device_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_allocation_result->config) { + list_ForEach(listEntry, v1beta1_device_allocation_result->config) { + v1beta1_device_allocation_configuration_free(listEntry->data); + } + list_freeList(v1beta1_device_allocation_result->config); + v1beta1_device_allocation_result->config = NULL; + } + if (v1beta1_device_allocation_result->results) { + list_ForEach(listEntry, v1beta1_device_allocation_result->results) { + v1beta1_device_request_allocation_result_free(listEntry->data); + } + list_freeList(v1beta1_device_allocation_result->results); + v1beta1_device_allocation_result->results = NULL; + } + free(v1beta1_device_allocation_result); +} + +cJSON *v1beta1_device_allocation_result_convertToJSON(v1beta1_device_allocation_result_t *v1beta1_device_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_allocation_result->config + if(v1beta1_device_allocation_result->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1beta1_device_allocation_result->config) { + list_ForEach(configListEntry, v1beta1_device_allocation_result->config) { + cJSON *itemLocal = v1beta1_device_allocation_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1beta1_device_allocation_result->results + if(v1beta1_device_allocation_result->results) { + cJSON *results = cJSON_AddArrayToObject(item, "results"); + if(results == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *resultsListEntry; + if (v1beta1_device_allocation_result->results) { + list_ForEach(resultsListEntry, v1beta1_device_allocation_result->results) { + cJSON *itemLocal = v1beta1_device_request_allocation_result_convertToJSON(resultsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(results, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_allocation_result_t *v1beta1_device_allocation_result_parseFromJSON(cJSON *v1beta1_device_allocation_resultJSON){ + + v1beta1_device_allocation_result_t *v1beta1_device_allocation_result_local_var = NULL; + + // define the local list for v1beta1_device_allocation_result->config + list_t *configList = NULL; + + // define the local list for v1beta1_device_allocation_result->results + list_t *resultsList = NULL; + + // v1beta1_device_allocation_result->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1beta1_device_allocation_resultJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1beta1_device_allocation_configuration_t *configItem = v1beta1_device_allocation_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1beta1_device_allocation_result->results + cJSON *results = cJSON_GetObjectItemCaseSensitive(v1beta1_device_allocation_resultJSON, "results"); + if (cJSON_IsNull(results)) { + results = NULL; + } + if (results) { + cJSON *results_local_nonprimitive = NULL; + if(!cJSON_IsArray(results)){ + goto end; //nonprimitive container + } + + resultsList = list_createList(); + + cJSON_ArrayForEach(results_local_nonprimitive,results ) + { + if(!cJSON_IsObject(results_local_nonprimitive)){ + goto end; + } + v1beta1_device_request_allocation_result_t *resultsItem = v1beta1_device_request_allocation_result_parseFromJSON(results_local_nonprimitive); + + list_addElement(resultsList, resultsItem); + } + } + + + v1beta1_device_allocation_result_local_var = v1beta1_device_allocation_result_create_internal ( + config ? configList : NULL, + results ? resultsList : NULL + ); + + return v1beta1_device_allocation_result_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1beta1_device_allocation_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (resultsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resultsList) { + v1beta1_device_request_allocation_result_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resultsList); + resultsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_allocation_result.h b/kubernetes/model/v1beta1_device_allocation_result.h new file mode 100644 index 00000000..113d7179 --- /dev/null +++ b/kubernetes/model/v1beta1_device_allocation_result.h @@ -0,0 +1,42 @@ +/* + * v1beta1_device_allocation_result.h + * + * DeviceAllocationResult is the result of allocating devices. + */ + +#ifndef _v1beta1_device_allocation_result_H_ +#define _v1beta1_device_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_allocation_result_t v1beta1_device_allocation_result_t; + +#include "v1beta1_device_allocation_configuration.h" +#include "v1beta1_device_request_allocation_result.h" + + + +typedef struct v1beta1_device_allocation_result_t { + list_t *config; //nonprimitive container + list_t *results; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_allocation_result_t; + +__attribute__((deprecated)) v1beta1_device_allocation_result_t *v1beta1_device_allocation_result_create( + list_t *config, + list_t *results +); + +void v1beta1_device_allocation_result_free(v1beta1_device_allocation_result_t *v1beta1_device_allocation_result); + +v1beta1_device_allocation_result_t *v1beta1_device_allocation_result_parseFromJSON(cJSON *v1beta1_device_allocation_resultJSON); + +cJSON *v1beta1_device_allocation_result_convertToJSON(v1beta1_device_allocation_result_t *v1beta1_device_allocation_result); + +#endif /* _v1beta1_device_allocation_result_H_ */ + diff --git a/kubernetes/model/v1beta1_device_attribute.c b/kubernetes/model/v1beta1_device_attribute.c new file mode 100644 index 00000000..81e908bd --- /dev/null +++ b/kubernetes/model/v1beta1_device_attribute.c @@ -0,0 +1,167 @@ +#include +#include +#include +#include "v1beta1_device_attribute.h" + + + +static v1beta1_device_attribute_t *v1beta1_device_attribute_create_internal( + int _bool, + long _int, + char *string, + char *version + ) { + v1beta1_device_attribute_t *v1beta1_device_attribute_local_var = malloc(sizeof(v1beta1_device_attribute_t)); + if (!v1beta1_device_attribute_local_var) { + return NULL; + } + v1beta1_device_attribute_local_var->_bool = _bool; + v1beta1_device_attribute_local_var->_int = _int; + v1beta1_device_attribute_local_var->string = string; + v1beta1_device_attribute_local_var->version = version; + + v1beta1_device_attribute_local_var->_library_owned = 1; + return v1beta1_device_attribute_local_var; +} + +__attribute__((deprecated)) v1beta1_device_attribute_t *v1beta1_device_attribute_create( + int _bool, + long _int, + char *string, + char *version + ) { + return v1beta1_device_attribute_create_internal ( + _bool, + _int, + string, + version + ); +} + +void v1beta1_device_attribute_free(v1beta1_device_attribute_t *v1beta1_device_attribute) { + if(NULL == v1beta1_device_attribute){ + return ; + } + if(v1beta1_device_attribute->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_attribute_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_attribute->string) { + free(v1beta1_device_attribute->string); + v1beta1_device_attribute->string = NULL; + } + if (v1beta1_device_attribute->version) { + free(v1beta1_device_attribute->version); + v1beta1_device_attribute->version = NULL; + } + free(v1beta1_device_attribute); +} + +cJSON *v1beta1_device_attribute_convertToJSON(v1beta1_device_attribute_t *v1beta1_device_attribute) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_attribute->_bool + if(v1beta1_device_attribute->_bool) { + if(cJSON_AddBoolToObject(item, "bool", v1beta1_device_attribute->_bool) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_device_attribute->_int + if(v1beta1_device_attribute->_int) { + if(cJSON_AddNumberToObject(item, "int", v1beta1_device_attribute->_int) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta1_device_attribute->string + if(v1beta1_device_attribute->string) { + if(cJSON_AddStringToObject(item, "string", v1beta1_device_attribute->string) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_attribute->version + if(v1beta1_device_attribute->version) { + if(cJSON_AddStringToObject(item, "version", v1beta1_device_attribute->version) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_attribute_t *v1beta1_device_attribute_parseFromJSON(cJSON *v1beta1_device_attributeJSON){ + + v1beta1_device_attribute_t *v1beta1_device_attribute_local_var = NULL; + + // v1beta1_device_attribute->_bool + cJSON *_bool = cJSON_GetObjectItemCaseSensitive(v1beta1_device_attributeJSON, "bool"); + if (cJSON_IsNull(_bool)) { + _bool = NULL; + } + if (_bool) { + if(!cJSON_IsBool(_bool)) + { + goto end; //Bool + } + } + + // v1beta1_device_attribute->_int + cJSON *_int = cJSON_GetObjectItemCaseSensitive(v1beta1_device_attributeJSON, "int"); + if (cJSON_IsNull(_int)) { + _int = NULL; + } + if (_int) { + if(!cJSON_IsNumber(_int)) + { + goto end; //Numeric + } + } + + // v1beta1_device_attribute->string + cJSON *string = cJSON_GetObjectItemCaseSensitive(v1beta1_device_attributeJSON, "string"); + if (cJSON_IsNull(string)) { + string = NULL; + } + if (string) { + if(!cJSON_IsString(string) && !cJSON_IsNull(string)) + { + goto end; //String + } + } + + // v1beta1_device_attribute->version + cJSON *version = cJSON_GetObjectItemCaseSensitive(v1beta1_device_attributeJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } + if (version) { + if(!cJSON_IsString(version) && !cJSON_IsNull(version)) + { + goto end; //String + } + } + + + v1beta1_device_attribute_local_var = v1beta1_device_attribute_create_internal ( + _bool ? _bool->valueint : 0, + _int ? _int->valuedouble : 0, + string && !cJSON_IsNull(string) ? strdup(string->valuestring) : NULL, + version && !cJSON_IsNull(version) ? strdup(version->valuestring) : NULL + ); + + return v1beta1_device_attribute_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_attribute.h b/kubernetes/model/v1beta1_device_attribute.h new file mode 100644 index 00000000..20397c36 --- /dev/null +++ b/kubernetes/model/v1beta1_device_attribute.h @@ -0,0 +1,44 @@ +/* + * v1beta1_device_attribute.h + * + * DeviceAttribute must have exactly one field set. + */ + +#ifndef _v1beta1_device_attribute_H_ +#define _v1beta1_device_attribute_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_attribute_t v1beta1_device_attribute_t; + + + + +typedef struct v1beta1_device_attribute_t { + int _bool; //boolean + long _int; //numeric + char *string; // string + char *version; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_attribute_t; + +__attribute__((deprecated)) v1beta1_device_attribute_t *v1beta1_device_attribute_create( + int _bool, + long _int, + char *string, + char *version +); + +void v1beta1_device_attribute_free(v1beta1_device_attribute_t *v1beta1_device_attribute); + +v1beta1_device_attribute_t *v1beta1_device_attribute_parseFromJSON(cJSON *v1beta1_device_attributeJSON); + +cJSON *v1beta1_device_attribute_convertToJSON(v1beta1_device_attribute_t *v1beta1_device_attribute); + +#endif /* _v1beta1_device_attribute_H_ */ + diff --git a/kubernetes/model/v1beta1_device_capacity.c b/kubernetes/model/v1beta1_device_capacity.c new file mode 100644 index 00000000..537d46fb --- /dev/null +++ b/kubernetes/model/v1beta1_device_capacity.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include "v1beta1_device_capacity.h" + + + +static v1beta1_device_capacity_t *v1beta1_device_capacity_create_internal( + v1beta1_capacity_request_policy_t *request_policy, + char *value + ) { + v1beta1_device_capacity_t *v1beta1_device_capacity_local_var = malloc(sizeof(v1beta1_device_capacity_t)); + if (!v1beta1_device_capacity_local_var) { + return NULL; + } + v1beta1_device_capacity_local_var->request_policy = request_policy; + v1beta1_device_capacity_local_var->value = value; + + v1beta1_device_capacity_local_var->_library_owned = 1; + return v1beta1_device_capacity_local_var; +} + +__attribute__((deprecated)) v1beta1_device_capacity_t *v1beta1_device_capacity_create( + v1beta1_capacity_request_policy_t *request_policy, + char *value + ) { + return v1beta1_device_capacity_create_internal ( + request_policy, + value + ); +} + +void v1beta1_device_capacity_free(v1beta1_device_capacity_t *v1beta1_device_capacity) { + if(NULL == v1beta1_device_capacity){ + return ; + } + if(v1beta1_device_capacity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_capacity_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_capacity->request_policy) { + v1beta1_capacity_request_policy_free(v1beta1_device_capacity->request_policy); + v1beta1_device_capacity->request_policy = NULL; + } + if (v1beta1_device_capacity->value) { + free(v1beta1_device_capacity->value); + v1beta1_device_capacity->value = NULL; + } + free(v1beta1_device_capacity); +} + +cJSON *v1beta1_device_capacity_convertToJSON(v1beta1_device_capacity_t *v1beta1_device_capacity) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_capacity->request_policy + if(v1beta1_device_capacity->request_policy) { + cJSON *request_policy_local_JSON = v1beta1_capacity_request_policy_convertToJSON(v1beta1_device_capacity->request_policy); + if(request_policy_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "requestPolicy", request_policy_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_device_capacity->value + if (!v1beta1_device_capacity->value) { + goto fail; + } + if(cJSON_AddStringToObject(item, "value", v1beta1_device_capacity->value) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_capacity_t *v1beta1_device_capacity_parseFromJSON(cJSON *v1beta1_device_capacityJSON){ + + v1beta1_device_capacity_t *v1beta1_device_capacity_local_var = NULL; + + // define the local variable for v1beta1_device_capacity->request_policy + v1beta1_capacity_request_policy_t *request_policy_local_nonprim = NULL; + + // v1beta1_device_capacity->request_policy + cJSON *request_policy = cJSON_GetObjectItemCaseSensitive(v1beta1_device_capacityJSON, "requestPolicy"); + if (cJSON_IsNull(request_policy)) { + request_policy = NULL; + } + if (request_policy) { + request_policy_local_nonprim = v1beta1_capacity_request_policy_parseFromJSON(request_policy); //nonprimitive + } + + // v1beta1_device_capacity->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta1_device_capacityJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (!value) { + goto end; + } + + + if(!cJSON_IsString(value)) + { + goto end; //String + } + + + v1beta1_device_capacity_local_var = v1beta1_device_capacity_create_internal ( + request_policy ? request_policy_local_nonprim : NULL, + strdup(value->valuestring) + ); + + return v1beta1_device_capacity_local_var; +end: + if (request_policy_local_nonprim) { + v1beta1_capacity_request_policy_free(request_policy_local_nonprim); + request_policy_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_capacity.h b/kubernetes/model/v1beta1_device_capacity.h new file mode 100644 index 00000000..db1ac201 --- /dev/null +++ b/kubernetes/model/v1beta1_device_capacity.h @@ -0,0 +1,41 @@ +/* + * v1beta1_device_capacity.h + * + * DeviceCapacity describes a quantity associated with a device. + */ + +#ifndef _v1beta1_device_capacity_H_ +#define _v1beta1_device_capacity_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_capacity_t v1beta1_device_capacity_t; + +#include "v1beta1_capacity_request_policy.h" + + + +typedef struct v1beta1_device_capacity_t { + struct v1beta1_capacity_request_policy_t *request_policy; //model + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_capacity_t; + +__attribute__((deprecated)) v1beta1_device_capacity_t *v1beta1_device_capacity_create( + v1beta1_capacity_request_policy_t *request_policy, + char *value +); + +void v1beta1_device_capacity_free(v1beta1_device_capacity_t *v1beta1_device_capacity); + +v1beta1_device_capacity_t *v1beta1_device_capacity_parseFromJSON(cJSON *v1beta1_device_capacityJSON); + +cJSON *v1beta1_device_capacity_convertToJSON(v1beta1_device_capacity_t *v1beta1_device_capacity); + +#endif /* _v1beta1_device_capacity_H_ */ + diff --git a/kubernetes/model/v1beta1_device_claim.c b/kubernetes/model/v1beta1_device_claim.c new file mode 100644 index 00000000..758af914 --- /dev/null +++ b/kubernetes/model/v1beta1_device_claim.c @@ -0,0 +1,263 @@ +#include +#include +#include +#include "v1beta1_device_claim.h" + + + +static v1beta1_device_claim_t *v1beta1_device_claim_create_internal( + list_t *config, + list_t *constraints, + list_t *requests + ) { + v1beta1_device_claim_t *v1beta1_device_claim_local_var = malloc(sizeof(v1beta1_device_claim_t)); + if (!v1beta1_device_claim_local_var) { + return NULL; + } + v1beta1_device_claim_local_var->config = config; + v1beta1_device_claim_local_var->constraints = constraints; + v1beta1_device_claim_local_var->requests = requests; + + v1beta1_device_claim_local_var->_library_owned = 1; + return v1beta1_device_claim_local_var; +} + +__attribute__((deprecated)) v1beta1_device_claim_t *v1beta1_device_claim_create( + list_t *config, + list_t *constraints, + list_t *requests + ) { + return v1beta1_device_claim_create_internal ( + config, + constraints, + requests + ); +} + +void v1beta1_device_claim_free(v1beta1_device_claim_t *v1beta1_device_claim) { + if(NULL == v1beta1_device_claim){ + return ; + } + if(v1beta1_device_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_claim_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_claim->config) { + list_ForEach(listEntry, v1beta1_device_claim->config) { + v1beta1_device_claim_configuration_free(listEntry->data); + } + list_freeList(v1beta1_device_claim->config); + v1beta1_device_claim->config = NULL; + } + if (v1beta1_device_claim->constraints) { + list_ForEach(listEntry, v1beta1_device_claim->constraints) { + v1beta1_device_constraint_free(listEntry->data); + } + list_freeList(v1beta1_device_claim->constraints); + v1beta1_device_claim->constraints = NULL; + } + if (v1beta1_device_claim->requests) { + list_ForEach(listEntry, v1beta1_device_claim->requests) { + v1beta1_device_request_free(listEntry->data); + } + list_freeList(v1beta1_device_claim->requests); + v1beta1_device_claim->requests = NULL; + } + free(v1beta1_device_claim); +} + +cJSON *v1beta1_device_claim_convertToJSON(v1beta1_device_claim_t *v1beta1_device_claim) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_claim->config + if(v1beta1_device_claim->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1beta1_device_claim->config) { + list_ForEach(configListEntry, v1beta1_device_claim->config) { + cJSON *itemLocal = v1beta1_device_claim_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1beta1_device_claim->constraints + if(v1beta1_device_claim->constraints) { + cJSON *constraints = cJSON_AddArrayToObject(item, "constraints"); + if(constraints == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *constraintsListEntry; + if (v1beta1_device_claim->constraints) { + list_ForEach(constraintsListEntry, v1beta1_device_claim->constraints) { + cJSON *itemLocal = v1beta1_device_constraint_convertToJSON(constraintsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(constraints, itemLocal); + } + } + } + + + // v1beta1_device_claim->requests + if(v1beta1_device_claim->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *requestsListEntry; + if (v1beta1_device_claim->requests) { + list_ForEach(requestsListEntry, v1beta1_device_claim->requests) { + cJSON *itemLocal = v1beta1_device_request_convertToJSON(requestsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(requests, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_claim_t *v1beta1_device_claim_parseFromJSON(cJSON *v1beta1_device_claimJSON){ + + v1beta1_device_claim_t *v1beta1_device_claim_local_var = NULL; + + // define the local list for v1beta1_device_claim->config + list_t *configList = NULL; + + // define the local list for v1beta1_device_claim->constraints + list_t *constraintsList = NULL; + + // define the local list for v1beta1_device_claim->requests + list_t *requestsList = NULL; + + // v1beta1_device_claim->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1beta1_device_claimJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1beta1_device_claim_configuration_t *configItem = v1beta1_device_claim_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1beta1_device_claim->constraints + cJSON *constraints = cJSON_GetObjectItemCaseSensitive(v1beta1_device_claimJSON, "constraints"); + if (cJSON_IsNull(constraints)) { + constraints = NULL; + } + if (constraints) { + cJSON *constraints_local_nonprimitive = NULL; + if(!cJSON_IsArray(constraints)){ + goto end; //nonprimitive container + } + + constraintsList = list_createList(); + + cJSON_ArrayForEach(constraints_local_nonprimitive,constraints ) + { + if(!cJSON_IsObject(constraints_local_nonprimitive)){ + goto end; + } + v1beta1_device_constraint_t *constraintsItem = v1beta1_device_constraint_parseFromJSON(constraints_local_nonprimitive); + + list_addElement(constraintsList, constraintsItem); + } + } + + // v1beta1_device_claim->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta1_device_claimJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local_nonprimitive = NULL; + if(!cJSON_IsArray(requests)){ + goto end; //nonprimitive container + } + + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local_nonprimitive,requests ) + { + if(!cJSON_IsObject(requests_local_nonprimitive)){ + goto end; + } + v1beta1_device_request_t *requestsItem = v1beta1_device_request_parseFromJSON(requests_local_nonprimitive); + + list_addElement(requestsList, requestsItem); + } + } + + + v1beta1_device_claim_local_var = v1beta1_device_claim_create_internal ( + config ? configList : NULL, + constraints ? constraintsList : NULL, + requests ? requestsList : NULL + ); + + return v1beta1_device_claim_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1beta1_device_claim_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (constraintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, constraintsList) { + v1beta1_device_constraint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(constraintsList); + constraintsList = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + v1beta1_device_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_claim.h b/kubernetes/model/v1beta1_device_claim.h new file mode 100644 index 00000000..965a05e8 --- /dev/null +++ b/kubernetes/model/v1beta1_device_claim.h @@ -0,0 +1,45 @@ +/* + * v1beta1_device_claim.h + * + * DeviceClaim defines how to request devices with a ResourceClaim. + */ + +#ifndef _v1beta1_device_claim_H_ +#define _v1beta1_device_claim_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_claim_t v1beta1_device_claim_t; + +#include "v1beta1_device_claim_configuration.h" +#include "v1beta1_device_constraint.h" +#include "v1beta1_device_request.h" + + + +typedef struct v1beta1_device_claim_t { + list_t *config; //nonprimitive container + list_t *constraints; //nonprimitive container + list_t *requests; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_claim_t; + +__attribute__((deprecated)) v1beta1_device_claim_t *v1beta1_device_claim_create( + list_t *config, + list_t *constraints, + list_t *requests +); + +void v1beta1_device_claim_free(v1beta1_device_claim_t *v1beta1_device_claim); + +v1beta1_device_claim_t *v1beta1_device_claim_parseFromJSON(cJSON *v1beta1_device_claimJSON); + +cJSON *v1beta1_device_claim_convertToJSON(v1beta1_device_claim_t *v1beta1_device_claim); + +#endif /* _v1beta1_device_claim_H_ */ + diff --git a/kubernetes/model/v1beta1_device_claim_configuration.c b/kubernetes/model/v1beta1_device_claim_configuration.c new file mode 100644 index 00000000..d149e57f --- /dev/null +++ b/kubernetes/model/v1beta1_device_claim_configuration.c @@ -0,0 +1,160 @@ +#include +#include +#include +#include "v1beta1_device_claim_configuration.h" + + + +static v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration_create_internal( + v1beta1_opaque_device_configuration_t *opaque, + list_t *requests + ) { + v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration_local_var = malloc(sizeof(v1beta1_device_claim_configuration_t)); + if (!v1beta1_device_claim_configuration_local_var) { + return NULL; + } + v1beta1_device_claim_configuration_local_var->opaque = opaque; + v1beta1_device_claim_configuration_local_var->requests = requests; + + v1beta1_device_claim_configuration_local_var->_library_owned = 1; + return v1beta1_device_claim_configuration_local_var; +} + +__attribute__((deprecated)) v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration_create( + v1beta1_opaque_device_configuration_t *opaque, + list_t *requests + ) { + return v1beta1_device_claim_configuration_create_internal ( + opaque, + requests + ); +} + +void v1beta1_device_claim_configuration_free(v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration) { + if(NULL == v1beta1_device_claim_configuration){ + return ; + } + if(v1beta1_device_claim_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_claim_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_claim_configuration->opaque) { + v1beta1_opaque_device_configuration_free(v1beta1_device_claim_configuration->opaque); + v1beta1_device_claim_configuration->opaque = NULL; + } + if (v1beta1_device_claim_configuration->requests) { + list_ForEach(listEntry, v1beta1_device_claim_configuration->requests) { + free(listEntry->data); + } + list_freeList(v1beta1_device_claim_configuration->requests); + v1beta1_device_claim_configuration->requests = NULL; + } + free(v1beta1_device_claim_configuration); +} + +cJSON *v1beta1_device_claim_configuration_convertToJSON(v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_claim_configuration->opaque + if(v1beta1_device_claim_configuration->opaque) { + cJSON *opaque_local_JSON = v1beta1_opaque_device_configuration_convertToJSON(v1beta1_device_claim_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_device_claim_configuration->requests + if(v1beta1_device_claim_configuration->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1beta1_device_claim_configuration->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration_parseFromJSON(cJSON *v1beta1_device_claim_configurationJSON){ + + v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration_local_var = NULL; + + // define the local variable for v1beta1_device_claim_configuration->opaque + v1beta1_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // define the local list for v1beta1_device_claim_configuration->requests + list_t *requestsList = NULL; + + // v1beta1_device_claim_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1beta1_device_claim_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1beta1_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + // v1beta1_device_claim_configuration->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta1_device_claim_configurationJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + + v1beta1_device_claim_configuration_local_var = v1beta1_device_claim_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL, + requests ? requestsList : NULL + ); + + return v1beta1_device_claim_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1beta1_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_claim_configuration.h b/kubernetes/model/v1beta1_device_claim_configuration.h new file mode 100644 index 00000000..3d8911ce --- /dev/null +++ b/kubernetes/model/v1beta1_device_claim_configuration.h @@ -0,0 +1,41 @@ +/* + * v1beta1_device_claim_configuration.h + * + * DeviceClaimConfiguration is used for configuration parameters in DeviceClaim. + */ + +#ifndef _v1beta1_device_claim_configuration_H_ +#define _v1beta1_device_claim_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_claim_configuration_t v1beta1_device_claim_configuration_t; + +#include "v1beta1_opaque_device_configuration.h" + + + +typedef struct v1beta1_device_claim_configuration_t { + struct v1beta1_opaque_device_configuration_t *opaque; //model + list_t *requests; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_claim_configuration_t; + +__attribute__((deprecated)) v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration_create( + v1beta1_opaque_device_configuration_t *opaque, + list_t *requests +); + +void v1beta1_device_claim_configuration_free(v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration); + +v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration_parseFromJSON(cJSON *v1beta1_device_claim_configurationJSON); + +cJSON *v1beta1_device_claim_configuration_convertToJSON(v1beta1_device_claim_configuration_t *v1beta1_device_claim_configuration); + +#endif /* _v1beta1_device_claim_configuration_H_ */ + diff --git a/kubernetes/model/v1beta1_device_class.c b/kubernetes/model/v1beta1_device_class.c new file mode 100644 index 00000000..f569a3ce --- /dev/null +++ b/kubernetes/model/v1beta1_device_class.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1beta1_device_class.h" + + + +static v1beta1_device_class_t *v1beta1_device_class_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_device_class_spec_t *spec + ) { + v1beta1_device_class_t *v1beta1_device_class_local_var = malloc(sizeof(v1beta1_device_class_t)); + if (!v1beta1_device_class_local_var) { + return NULL; + } + v1beta1_device_class_local_var->api_version = api_version; + v1beta1_device_class_local_var->kind = kind; + v1beta1_device_class_local_var->metadata = metadata; + v1beta1_device_class_local_var->spec = spec; + + v1beta1_device_class_local_var->_library_owned = 1; + return v1beta1_device_class_local_var; +} + +__attribute__((deprecated)) v1beta1_device_class_t *v1beta1_device_class_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_device_class_spec_t *spec + ) { + return v1beta1_device_class_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_device_class_free(v1beta1_device_class_t *v1beta1_device_class) { + if(NULL == v1beta1_device_class){ + return ; + } + if(v1beta1_device_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_class_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_class->api_version) { + free(v1beta1_device_class->api_version); + v1beta1_device_class->api_version = NULL; + } + if (v1beta1_device_class->kind) { + free(v1beta1_device_class->kind); + v1beta1_device_class->kind = NULL; + } + if (v1beta1_device_class->metadata) { + v1_object_meta_free(v1beta1_device_class->metadata); + v1beta1_device_class->metadata = NULL; + } + if (v1beta1_device_class->spec) { + v1beta1_device_class_spec_free(v1beta1_device_class->spec); + v1beta1_device_class->spec = NULL; + } + free(v1beta1_device_class); +} + +cJSON *v1beta1_device_class_convertToJSON(v1beta1_device_class_t *v1beta1_device_class) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_class->api_version + if(v1beta1_device_class->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_device_class->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_class->kind + if(v1beta1_device_class->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_device_class->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_class->metadata + if(v1beta1_device_class->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_device_class->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_device_class->spec + if (!v1beta1_device_class->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta1_device_class_spec_convertToJSON(v1beta1_device_class->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_class_t *v1beta1_device_class_parseFromJSON(cJSON *v1beta1_device_classJSON){ + + v1beta1_device_class_t *v1beta1_device_class_local_var = NULL; + + // define the local variable for v1beta1_device_class->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_device_class->spec + v1beta1_device_class_spec_t *spec_local_nonprim = NULL; + + // v1beta1_device_class->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_device_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_device_class->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_device_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_device_class->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_device_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_device_class->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_device_classJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta1_device_class_spec_parseFromJSON(spec); //nonprimitive + + + v1beta1_device_class_local_var = v1beta1_device_class_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta1_device_class_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_device_class_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_class.h b/kubernetes/model/v1beta1_device_class.h new file mode 100644 index 00000000..53f5e745 --- /dev/null +++ b/kubernetes/model/v1beta1_device_class.h @@ -0,0 +1,46 @@ +/* + * v1beta1_device_class.h + * + * DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta1_device_class_H_ +#define _v1beta1_device_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_class_t v1beta1_device_class_t; + +#include "v1_object_meta.h" +#include "v1beta1_device_class_spec.h" + + + +typedef struct v1beta1_device_class_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_device_class_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_class_t; + +__attribute__((deprecated)) v1beta1_device_class_t *v1beta1_device_class_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_device_class_spec_t *spec +); + +void v1beta1_device_class_free(v1beta1_device_class_t *v1beta1_device_class); + +v1beta1_device_class_t *v1beta1_device_class_parseFromJSON(cJSON *v1beta1_device_classJSON); + +cJSON *v1beta1_device_class_convertToJSON(v1beta1_device_class_t *v1beta1_device_class); + +#endif /* _v1beta1_device_class_H_ */ + diff --git a/kubernetes/model/v1beta1_device_class_configuration.c b/kubernetes/model/v1beta1_device_class_configuration.c new file mode 100644 index 00000000..2f424e53 --- /dev/null +++ b/kubernetes/model/v1beta1_device_class_configuration.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1beta1_device_class_configuration.h" + + + +static v1beta1_device_class_configuration_t *v1beta1_device_class_configuration_create_internal( + v1beta1_opaque_device_configuration_t *opaque + ) { + v1beta1_device_class_configuration_t *v1beta1_device_class_configuration_local_var = malloc(sizeof(v1beta1_device_class_configuration_t)); + if (!v1beta1_device_class_configuration_local_var) { + return NULL; + } + v1beta1_device_class_configuration_local_var->opaque = opaque; + + v1beta1_device_class_configuration_local_var->_library_owned = 1; + return v1beta1_device_class_configuration_local_var; +} + +__attribute__((deprecated)) v1beta1_device_class_configuration_t *v1beta1_device_class_configuration_create( + v1beta1_opaque_device_configuration_t *opaque + ) { + return v1beta1_device_class_configuration_create_internal ( + opaque + ); +} + +void v1beta1_device_class_configuration_free(v1beta1_device_class_configuration_t *v1beta1_device_class_configuration) { + if(NULL == v1beta1_device_class_configuration){ + return ; + } + if(v1beta1_device_class_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_class_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_class_configuration->opaque) { + v1beta1_opaque_device_configuration_free(v1beta1_device_class_configuration->opaque); + v1beta1_device_class_configuration->opaque = NULL; + } + free(v1beta1_device_class_configuration); +} + +cJSON *v1beta1_device_class_configuration_convertToJSON(v1beta1_device_class_configuration_t *v1beta1_device_class_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_class_configuration->opaque + if(v1beta1_device_class_configuration->opaque) { + cJSON *opaque_local_JSON = v1beta1_opaque_device_configuration_convertToJSON(v1beta1_device_class_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_class_configuration_t *v1beta1_device_class_configuration_parseFromJSON(cJSON *v1beta1_device_class_configurationJSON){ + + v1beta1_device_class_configuration_t *v1beta1_device_class_configuration_local_var = NULL; + + // define the local variable for v1beta1_device_class_configuration->opaque + v1beta1_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // v1beta1_device_class_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1beta1_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + + v1beta1_device_class_configuration_local_var = v1beta1_device_class_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL + ); + + return v1beta1_device_class_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1beta1_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_class_configuration.h b/kubernetes/model/v1beta1_device_class_configuration.h new file mode 100644 index 00000000..89837f5d --- /dev/null +++ b/kubernetes/model/v1beta1_device_class_configuration.h @@ -0,0 +1,39 @@ +/* + * v1beta1_device_class_configuration.h + * + * DeviceClassConfiguration is used in DeviceClass. + */ + +#ifndef _v1beta1_device_class_configuration_H_ +#define _v1beta1_device_class_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_class_configuration_t v1beta1_device_class_configuration_t; + +#include "v1beta1_opaque_device_configuration.h" + + + +typedef struct v1beta1_device_class_configuration_t { + struct v1beta1_opaque_device_configuration_t *opaque; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_class_configuration_t; + +__attribute__((deprecated)) v1beta1_device_class_configuration_t *v1beta1_device_class_configuration_create( + v1beta1_opaque_device_configuration_t *opaque +); + +void v1beta1_device_class_configuration_free(v1beta1_device_class_configuration_t *v1beta1_device_class_configuration); + +v1beta1_device_class_configuration_t *v1beta1_device_class_configuration_parseFromJSON(cJSON *v1beta1_device_class_configurationJSON); + +cJSON *v1beta1_device_class_configuration_convertToJSON(v1beta1_device_class_configuration_t *v1beta1_device_class_configuration); + +#endif /* _v1beta1_device_class_configuration_H_ */ + diff --git a/kubernetes/model/v1beta1_device_class_list.c b/kubernetes/model/v1beta1_device_class_list.c new file mode 100644 index 00000000..5b3e32ad --- /dev/null +++ b/kubernetes/model/v1beta1_device_class_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_device_class_list.h" + + + +static v1beta1_device_class_list_t *v1beta1_device_class_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_device_class_list_t *v1beta1_device_class_list_local_var = malloc(sizeof(v1beta1_device_class_list_t)); + if (!v1beta1_device_class_list_local_var) { + return NULL; + } + v1beta1_device_class_list_local_var->api_version = api_version; + v1beta1_device_class_list_local_var->items = items; + v1beta1_device_class_list_local_var->kind = kind; + v1beta1_device_class_list_local_var->metadata = metadata; + + v1beta1_device_class_list_local_var->_library_owned = 1; + return v1beta1_device_class_list_local_var; +} + +__attribute__((deprecated)) v1beta1_device_class_list_t *v1beta1_device_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_device_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_device_class_list_free(v1beta1_device_class_list_t *v1beta1_device_class_list) { + if(NULL == v1beta1_device_class_list){ + return ; + } + if(v1beta1_device_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_class_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_class_list->api_version) { + free(v1beta1_device_class_list->api_version); + v1beta1_device_class_list->api_version = NULL; + } + if (v1beta1_device_class_list->items) { + list_ForEach(listEntry, v1beta1_device_class_list->items) { + v1beta1_device_class_free(listEntry->data); + } + list_freeList(v1beta1_device_class_list->items); + v1beta1_device_class_list->items = NULL; + } + if (v1beta1_device_class_list->kind) { + free(v1beta1_device_class_list->kind); + v1beta1_device_class_list->kind = NULL; + } + if (v1beta1_device_class_list->metadata) { + v1_list_meta_free(v1beta1_device_class_list->metadata); + v1beta1_device_class_list->metadata = NULL; + } + free(v1beta1_device_class_list); +} + +cJSON *v1beta1_device_class_list_convertToJSON(v1beta1_device_class_list_t *v1beta1_device_class_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_class_list->api_version + if(v1beta1_device_class_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_device_class_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_class_list->items + if (!v1beta1_device_class_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_device_class_list->items) { + list_ForEach(itemsListEntry, v1beta1_device_class_list->items) { + cJSON *itemLocal = v1beta1_device_class_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_device_class_list->kind + if(v1beta1_device_class_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_device_class_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_class_list->metadata + if(v1beta1_device_class_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_device_class_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_class_list_t *v1beta1_device_class_list_parseFromJSON(cJSON *v1beta1_device_class_listJSON){ + + v1beta1_device_class_list_t *v1beta1_device_class_list_local_var = NULL; + + // define the local list for v1beta1_device_class_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_device_class_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_device_class_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_device_class_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_device_class_t *itemsItem = v1beta1_device_class_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_device_class_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_device_class_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_device_class_list_local_var = v1beta1_device_class_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_device_class_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_device_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_class_list.h b/kubernetes/model/v1beta1_device_class_list.h new file mode 100644 index 00000000..621cafd3 --- /dev/null +++ b/kubernetes/model/v1beta1_device_class_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_device_class_list.h + * + * DeviceClassList is a collection of classes. + */ + +#ifndef _v1beta1_device_class_list_H_ +#define _v1beta1_device_class_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_class_list_t v1beta1_device_class_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_device_class.h" + + + +typedef struct v1beta1_device_class_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_class_list_t; + +__attribute__((deprecated)) v1beta1_device_class_list_t *v1beta1_device_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_device_class_list_free(v1beta1_device_class_list_t *v1beta1_device_class_list); + +v1beta1_device_class_list_t *v1beta1_device_class_list_parseFromJSON(cJSON *v1beta1_device_class_listJSON); + +cJSON *v1beta1_device_class_list_convertToJSON(v1beta1_device_class_list_t *v1beta1_device_class_list); + +#endif /* _v1beta1_device_class_list_H_ */ + diff --git a/kubernetes/model/v1beta1_device_class_spec.c b/kubernetes/model/v1beta1_device_class_spec.c new file mode 100644 index 00000000..882dc6d8 --- /dev/null +++ b/kubernetes/model/v1beta1_device_class_spec.c @@ -0,0 +1,224 @@ +#include +#include +#include +#include "v1beta1_device_class_spec.h" + + + +static v1beta1_device_class_spec_t *v1beta1_device_class_spec_create_internal( + list_t *config, + char *extended_resource_name, + list_t *selectors + ) { + v1beta1_device_class_spec_t *v1beta1_device_class_spec_local_var = malloc(sizeof(v1beta1_device_class_spec_t)); + if (!v1beta1_device_class_spec_local_var) { + return NULL; + } + v1beta1_device_class_spec_local_var->config = config; + v1beta1_device_class_spec_local_var->extended_resource_name = extended_resource_name; + v1beta1_device_class_spec_local_var->selectors = selectors; + + v1beta1_device_class_spec_local_var->_library_owned = 1; + return v1beta1_device_class_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_device_class_spec_t *v1beta1_device_class_spec_create( + list_t *config, + char *extended_resource_name, + list_t *selectors + ) { + return v1beta1_device_class_spec_create_internal ( + config, + extended_resource_name, + selectors + ); +} + +void v1beta1_device_class_spec_free(v1beta1_device_class_spec_t *v1beta1_device_class_spec) { + if(NULL == v1beta1_device_class_spec){ + return ; + } + if(v1beta1_device_class_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_class_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_class_spec->config) { + list_ForEach(listEntry, v1beta1_device_class_spec->config) { + v1beta1_device_class_configuration_free(listEntry->data); + } + list_freeList(v1beta1_device_class_spec->config); + v1beta1_device_class_spec->config = NULL; + } + if (v1beta1_device_class_spec->extended_resource_name) { + free(v1beta1_device_class_spec->extended_resource_name); + v1beta1_device_class_spec->extended_resource_name = NULL; + } + if (v1beta1_device_class_spec->selectors) { + list_ForEach(listEntry, v1beta1_device_class_spec->selectors) { + v1beta1_device_selector_free(listEntry->data); + } + list_freeList(v1beta1_device_class_spec->selectors); + v1beta1_device_class_spec->selectors = NULL; + } + free(v1beta1_device_class_spec); +} + +cJSON *v1beta1_device_class_spec_convertToJSON(v1beta1_device_class_spec_t *v1beta1_device_class_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_class_spec->config + if(v1beta1_device_class_spec->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1beta1_device_class_spec->config) { + list_ForEach(configListEntry, v1beta1_device_class_spec->config) { + cJSON *itemLocal = v1beta1_device_class_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1beta1_device_class_spec->extended_resource_name + if(v1beta1_device_class_spec->extended_resource_name) { + if(cJSON_AddStringToObject(item, "extendedResourceName", v1beta1_device_class_spec->extended_resource_name) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_class_spec->selectors + if(v1beta1_device_class_spec->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1beta1_device_class_spec->selectors) { + list_ForEach(selectorsListEntry, v1beta1_device_class_spec->selectors) { + cJSON *itemLocal = v1beta1_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_class_spec_t *v1beta1_device_class_spec_parseFromJSON(cJSON *v1beta1_device_class_specJSON){ + + v1beta1_device_class_spec_t *v1beta1_device_class_spec_local_var = NULL; + + // define the local list for v1beta1_device_class_spec->config + list_t *configList = NULL; + + // define the local list for v1beta1_device_class_spec->selectors + list_t *selectorsList = NULL; + + // v1beta1_device_class_spec->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_specJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1beta1_device_class_configuration_t *configItem = v1beta1_device_class_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1beta1_device_class_spec->extended_resource_name + cJSON *extended_resource_name = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_specJSON, "extendedResourceName"); + if (cJSON_IsNull(extended_resource_name)) { + extended_resource_name = NULL; + } + if (extended_resource_name) { + if(!cJSON_IsString(extended_resource_name) && !cJSON_IsNull(extended_resource_name)) + { + goto end; //String + } + } + + // v1beta1_device_class_spec->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1beta1_device_class_specJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1beta1_device_selector_t *selectorsItem = v1beta1_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + + v1beta1_device_class_spec_local_var = v1beta1_device_class_spec_create_internal ( + config ? configList : NULL, + extended_resource_name && !cJSON_IsNull(extended_resource_name) ? strdup(extended_resource_name->valuestring) : NULL, + selectors ? selectorsList : NULL + ); + + return v1beta1_device_class_spec_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1beta1_device_class_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1beta1_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_class_spec.h b/kubernetes/model/v1beta1_device_class_spec.h new file mode 100644 index 00000000..eb35c324 --- /dev/null +++ b/kubernetes/model/v1beta1_device_class_spec.h @@ -0,0 +1,44 @@ +/* + * v1beta1_device_class_spec.h + * + * DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it. + */ + +#ifndef _v1beta1_device_class_spec_H_ +#define _v1beta1_device_class_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_class_spec_t v1beta1_device_class_spec_t; + +#include "v1beta1_device_class_configuration.h" +#include "v1beta1_device_selector.h" + + + +typedef struct v1beta1_device_class_spec_t { + list_t *config; //nonprimitive container + char *extended_resource_name; // string + list_t *selectors; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_class_spec_t; + +__attribute__((deprecated)) v1beta1_device_class_spec_t *v1beta1_device_class_spec_create( + list_t *config, + char *extended_resource_name, + list_t *selectors +); + +void v1beta1_device_class_spec_free(v1beta1_device_class_spec_t *v1beta1_device_class_spec); + +v1beta1_device_class_spec_t *v1beta1_device_class_spec_parseFromJSON(cJSON *v1beta1_device_class_specJSON); + +cJSON *v1beta1_device_class_spec_convertToJSON(v1beta1_device_class_spec_t *v1beta1_device_class_spec); + +#endif /* _v1beta1_device_class_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_device_constraint.c b/kubernetes/model/v1beta1_device_constraint.c new file mode 100644 index 00000000..945ced18 --- /dev/null +++ b/kubernetes/model/v1beta1_device_constraint.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include "v1beta1_device_constraint.h" + + + +static v1beta1_device_constraint_t *v1beta1_device_constraint_create_internal( + char *distinct_attribute, + char *match_attribute, + list_t *requests + ) { + v1beta1_device_constraint_t *v1beta1_device_constraint_local_var = malloc(sizeof(v1beta1_device_constraint_t)); + if (!v1beta1_device_constraint_local_var) { + return NULL; + } + v1beta1_device_constraint_local_var->distinct_attribute = distinct_attribute; + v1beta1_device_constraint_local_var->match_attribute = match_attribute; + v1beta1_device_constraint_local_var->requests = requests; + + v1beta1_device_constraint_local_var->_library_owned = 1; + return v1beta1_device_constraint_local_var; +} + +__attribute__((deprecated)) v1beta1_device_constraint_t *v1beta1_device_constraint_create( + char *distinct_attribute, + char *match_attribute, + list_t *requests + ) { + return v1beta1_device_constraint_create_internal ( + distinct_attribute, + match_attribute, + requests + ); +} + +void v1beta1_device_constraint_free(v1beta1_device_constraint_t *v1beta1_device_constraint) { + if(NULL == v1beta1_device_constraint){ + return ; + } + if(v1beta1_device_constraint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_constraint_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_constraint->distinct_attribute) { + free(v1beta1_device_constraint->distinct_attribute); + v1beta1_device_constraint->distinct_attribute = NULL; + } + if (v1beta1_device_constraint->match_attribute) { + free(v1beta1_device_constraint->match_attribute); + v1beta1_device_constraint->match_attribute = NULL; + } + if (v1beta1_device_constraint->requests) { + list_ForEach(listEntry, v1beta1_device_constraint->requests) { + free(listEntry->data); + } + list_freeList(v1beta1_device_constraint->requests); + v1beta1_device_constraint->requests = NULL; + } + free(v1beta1_device_constraint); +} + +cJSON *v1beta1_device_constraint_convertToJSON(v1beta1_device_constraint_t *v1beta1_device_constraint) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_constraint->distinct_attribute + if(v1beta1_device_constraint->distinct_attribute) { + if(cJSON_AddStringToObject(item, "distinctAttribute", v1beta1_device_constraint->distinct_attribute) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_constraint->match_attribute + if(v1beta1_device_constraint->match_attribute) { + if(cJSON_AddStringToObject(item, "matchAttribute", v1beta1_device_constraint->match_attribute) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_constraint->requests + if(v1beta1_device_constraint->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1beta1_device_constraint->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_constraint_t *v1beta1_device_constraint_parseFromJSON(cJSON *v1beta1_device_constraintJSON){ + + v1beta1_device_constraint_t *v1beta1_device_constraint_local_var = NULL; + + // define the local list for v1beta1_device_constraint->requests + list_t *requestsList = NULL; + + // v1beta1_device_constraint->distinct_attribute + cJSON *distinct_attribute = cJSON_GetObjectItemCaseSensitive(v1beta1_device_constraintJSON, "distinctAttribute"); + if (cJSON_IsNull(distinct_attribute)) { + distinct_attribute = NULL; + } + if (distinct_attribute) { + if(!cJSON_IsString(distinct_attribute) && !cJSON_IsNull(distinct_attribute)) + { + goto end; //String + } + } + + // v1beta1_device_constraint->match_attribute + cJSON *match_attribute = cJSON_GetObjectItemCaseSensitive(v1beta1_device_constraintJSON, "matchAttribute"); + if (cJSON_IsNull(match_attribute)) { + match_attribute = NULL; + } + if (match_attribute) { + if(!cJSON_IsString(match_attribute) && !cJSON_IsNull(match_attribute)) + { + goto end; //String + } + } + + // v1beta1_device_constraint->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta1_device_constraintJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + + v1beta1_device_constraint_local_var = v1beta1_device_constraint_create_internal ( + distinct_attribute && !cJSON_IsNull(distinct_attribute) ? strdup(distinct_attribute->valuestring) : NULL, + match_attribute && !cJSON_IsNull(match_attribute) ? strdup(match_attribute->valuestring) : NULL, + requests ? requestsList : NULL + ); + + return v1beta1_device_constraint_local_var; +end: + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_constraint.h b/kubernetes/model/v1beta1_device_constraint.h new file mode 100644 index 00000000..34335f1d --- /dev/null +++ b/kubernetes/model/v1beta1_device_constraint.h @@ -0,0 +1,42 @@ +/* + * v1beta1_device_constraint.h + * + * DeviceConstraint must have exactly one field set besides Requests. + */ + +#ifndef _v1beta1_device_constraint_H_ +#define _v1beta1_device_constraint_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_constraint_t v1beta1_device_constraint_t; + + + + +typedef struct v1beta1_device_constraint_t { + char *distinct_attribute; // string + char *match_attribute; // string + list_t *requests; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_constraint_t; + +__attribute__((deprecated)) v1beta1_device_constraint_t *v1beta1_device_constraint_create( + char *distinct_attribute, + char *match_attribute, + list_t *requests +); + +void v1beta1_device_constraint_free(v1beta1_device_constraint_t *v1beta1_device_constraint); + +v1beta1_device_constraint_t *v1beta1_device_constraint_parseFromJSON(cJSON *v1beta1_device_constraintJSON); + +cJSON *v1beta1_device_constraint_convertToJSON(v1beta1_device_constraint_t *v1beta1_device_constraint); + +#endif /* _v1beta1_device_constraint_H_ */ + diff --git a/kubernetes/model/v1beta1_device_counter_consumption.c b/kubernetes/model/v1beta1_device_counter_consumption.c new file mode 100644 index 00000000..613457d0 --- /dev/null +++ b/kubernetes/model/v1beta1_device_counter_consumption.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1beta1_device_counter_consumption.h" + + + +static v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption_create_internal( + char *counter_set, + list_t* counters + ) { + v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption_local_var = malloc(sizeof(v1beta1_device_counter_consumption_t)); + if (!v1beta1_device_counter_consumption_local_var) { + return NULL; + } + v1beta1_device_counter_consumption_local_var->counter_set = counter_set; + v1beta1_device_counter_consumption_local_var->counters = counters; + + v1beta1_device_counter_consumption_local_var->_library_owned = 1; + return v1beta1_device_counter_consumption_local_var; +} + +__attribute__((deprecated)) v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption_create( + char *counter_set, + list_t* counters + ) { + return v1beta1_device_counter_consumption_create_internal ( + counter_set, + counters + ); +} + +void v1beta1_device_counter_consumption_free(v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption) { + if(NULL == v1beta1_device_counter_consumption){ + return ; + } + if(v1beta1_device_counter_consumption->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_counter_consumption_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_counter_consumption->counter_set) { + free(v1beta1_device_counter_consumption->counter_set); + v1beta1_device_counter_consumption->counter_set = NULL; + } + if (v1beta1_device_counter_consumption->counters) { + list_ForEach(listEntry, v1beta1_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta1_device_counter_consumption->counters); + v1beta1_device_counter_consumption->counters = NULL; + } + free(v1beta1_device_counter_consumption); +} + +cJSON *v1beta1_device_counter_consumption_convertToJSON(v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_counter_consumption->counter_set + if (!v1beta1_device_counter_consumption->counter_set) { + goto fail; + } + if(cJSON_AddStringToObject(item, "counterSet", v1beta1_device_counter_consumption->counter_set) == NULL) { + goto fail; //String + } + + + // v1beta1_device_counter_consumption->counters + if (!v1beta1_device_counter_consumption->counters) { + goto fail; + } + cJSON *counters = cJSON_AddObjectToObject(item, "counters"); + if(counters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = counters; + listEntry_t *countersListEntry; + if (v1beta1_device_counter_consumption->counters) { + list_ForEach(countersListEntry, v1beta1_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption_parseFromJSON(cJSON *v1beta1_device_counter_consumptionJSON){ + + v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption_local_var = NULL; + + // define the local map for v1beta1_device_counter_consumption->counters + list_t *countersList = NULL; + + // v1beta1_device_counter_consumption->counter_set + cJSON *counter_set = cJSON_GetObjectItemCaseSensitive(v1beta1_device_counter_consumptionJSON, "counterSet"); + if (cJSON_IsNull(counter_set)) { + counter_set = NULL; + } + if (!counter_set) { + goto end; + } + + + if(!cJSON_IsString(counter_set)) + { + goto end; //String + } + + // v1beta1_device_counter_consumption->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1beta1_device_counter_consumptionJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1beta1_device_counter_consumption->counters is currently not supported. + + + + v1beta1_device_counter_consumption_local_var = v1beta1_device_counter_consumption_create_internal ( + strdup(counter_set->valuestring), + countersList + ); + + return v1beta1_device_counter_consumption_local_var; +end: + + // The data type of the elements in v1beta1_device_counter_consumption->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_counter_consumption.h b/kubernetes/model/v1beta1_device_counter_consumption.h new file mode 100644 index 00000000..b81d80c4 --- /dev/null +++ b/kubernetes/model/v1beta1_device_counter_consumption.h @@ -0,0 +1,41 @@ +/* + * v1beta1_device_counter_consumption.h + * + * DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet. + */ + +#ifndef _v1beta1_device_counter_consumption_H_ +#define _v1beta1_device_counter_consumption_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_counter_consumption_t v1beta1_device_counter_consumption_t; + +#include "v1beta1_counter.h" + + + +typedef struct v1beta1_device_counter_consumption_t { + char *counter_set; // string + list_t* counters; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_counter_consumption_t; + +__attribute__((deprecated)) v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption_create( + char *counter_set, + list_t* counters +); + +void v1beta1_device_counter_consumption_free(v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption); + +v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption_parseFromJSON(cJSON *v1beta1_device_counter_consumptionJSON); + +cJSON *v1beta1_device_counter_consumption_convertToJSON(v1beta1_device_counter_consumption_t *v1beta1_device_counter_consumption); + +#endif /* _v1beta1_device_counter_consumption_H_ */ + diff --git a/kubernetes/model/v1beta1_device_request.c b/kubernetes/model/v1beta1_device_request.c new file mode 100644 index 00000000..527ac3d6 --- /dev/null +++ b/kubernetes/model/v1beta1_device_request.c @@ -0,0 +1,442 @@ +#include +#include +#include +#include "v1beta1_device_request.h" + + + +static v1beta1_device_request_t *v1beta1_device_request_create_internal( + int admin_access, + char *allocation_mode, + v1beta1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *first_available, + char *name, + list_t *selectors, + list_t *tolerations + ) { + v1beta1_device_request_t *v1beta1_device_request_local_var = malloc(sizeof(v1beta1_device_request_t)); + if (!v1beta1_device_request_local_var) { + return NULL; + } + v1beta1_device_request_local_var->admin_access = admin_access; + v1beta1_device_request_local_var->allocation_mode = allocation_mode; + v1beta1_device_request_local_var->capacity = capacity; + v1beta1_device_request_local_var->count = count; + v1beta1_device_request_local_var->device_class_name = device_class_name; + v1beta1_device_request_local_var->first_available = first_available; + v1beta1_device_request_local_var->name = name; + v1beta1_device_request_local_var->selectors = selectors; + v1beta1_device_request_local_var->tolerations = tolerations; + + v1beta1_device_request_local_var->_library_owned = 1; + return v1beta1_device_request_local_var; +} + +__attribute__((deprecated)) v1beta1_device_request_t *v1beta1_device_request_create( + int admin_access, + char *allocation_mode, + v1beta1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *first_available, + char *name, + list_t *selectors, + list_t *tolerations + ) { + return v1beta1_device_request_create_internal ( + admin_access, + allocation_mode, + capacity, + count, + device_class_name, + first_available, + name, + selectors, + tolerations + ); +} + +void v1beta1_device_request_free(v1beta1_device_request_t *v1beta1_device_request) { + if(NULL == v1beta1_device_request){ + return ; + } + if(v1beta1_device_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_request->allocation_mode) { + free(v1beta1_device_request->allocation_mode); + v1beta1_device_request->allocation_mode = NULL; + } + if (v1beta1_device_request->capacity) { + v1beta1_capacity_requirements_free(v1beta1_device_request->capacity); + v1beta1_device_request->capacity = NULL; + } + if (v1beta1_device_request->device_class_name) { + free(v1beta1_device_request->device_class_name); + v1beta1_device_request->device_class_name = NULL; + } + if (v1beta1_device_request->first_available) { + list_ForEach(listEntry, v1beta1_device_request->first_available) { + v1beta1_device_sub_request_free(listEntry->data); + } + list_freeList(v1beta1_device_request->first_available); + v1beta1_device_request->first_available = NULL; + } + if (v1beta1_device_request->name) { + free(v1beta1_device_request->name); + v1beta1_device_request->name = NULL; + } + if (v1beta1_device_request->selectors) { + list_ForEach(listEntry, v1beta1_device_request->selectors) { + v1beta1_device_selector_free(listEntry->data); + } + list_freeList(v1beta1_device_request->selectors); + v1beta1_device_request->selectors = NULL; + } + if (v1beta1_device_request->tolerations) { + list_ForEach(listEntry, v1beta1_device_request->tolerations) { + v1beta1_device_toleration_free(listEntry->data); + } + list_freeList(v1beta1_device_request->tolerations); + v1beta1_device_request->tolerations = NULL; + } + free(v1beta1_device_request); +} + +cJSON *v1beta1_device_request_convertToJSON(v1beta1_device_request_t *v1beta1_device_request) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_request->admin_access + if(v1beta1_device_request->admin_access) { + if(cJSON_AddBoolToObject(item, "adminAccess", v1beta1_device_request->admin_access) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_device_request->allocation_mode + if(v1beta1_device_request->allocation_mode) { + if(cJSON_AddStringToObject(item, "allocationMode", v1beta1_device_request->allocation_mode) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_request->capacity + if(v1beta1_device_request->capacity) { + cJSON *capacity_local_JSON = v1beta1_capacity_requirements_convertToJSON(v1beta1_device_request->capacity); + if(capacity_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "capacity", capacity_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_device_request->count + if(v1beta1_device_request->count) { + if(cJSON_AddNumberToObject(item, "count", v1beta1_device_request->count) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta1_device_request->device_class_name + if(v1beta1_device_request->device_class_name) { + if(cJSON_AddStringToObject(item, "deviceClassName", v1beta1_device_request->device_class_name) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_request->first_available + if(v1beta1_device_request->first_available) { + cJSON *first_available = cJSON_AddArrayToObject(item, "firstAvailable"); + if(first_available == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *first_availableListEntry; + if (v1beta1_device_request->first_available) { + list_ForEach(first_availableListEntry, v1beta1_device_request->first_available) { + cJSON *itemLocal = v1beta1_device_sub_request_convertToJSON(first_availableListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(first_available, itemLocal); + } + } + } + + + // v1beta1_device_request->name + if (!v1beta1_device_request->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta1_device_request->name) == NULL) { + goto fail; //String + } + + + // v1beta1_device_request->selectors + if(v1beta1_device_request->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1beta1_device_request->selectors) { + list_ForEach(selectorsListEntry, v1beta1_device_request->selectors) { + cJSON *itemLocal = v1beta1_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + + // v1beta1_device_request->tolerations + if(v1beta1_device_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1beta1_device_request->tolerations) { + list_ForEach(tolerationsListEntry, v1beta1_device_request->tolerations) { + cJSON *itemLocal = v1beta1_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_request_t *v1beta1_device_request_parseFromJSON(cJSON *v1beta1_device_requestJSON){ + + v1beta1_device_request_t *v1beta1_device_request_local_var = NULL; + + // define the local variable for v1beta1_device_request->capacity + v1beta1_capacity_requirements_t *capacity_local_nonprim = NULL; + + // define the local list for v1beta1_device_request->first_available + list_t *first_availableList = NULL; + + // define the local list for v1beta1_device_request->selectors + list_t *selectorsList = NULL; + + // define the local list for v1beta1_device_request->tolerations + list_t *tolerationsList = NULL; + + // v1beta1_device_request->admin_access + cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "adminAccess"); + if (cJSON_IsNull(admin_access)) { + admin_access = NULL; + } + if (admin_access) { + if(!cJSON_IsBool(admin_access)) + { + goto end; //Bool + } + } + + // v1beta1_device_request->allocation_mode + cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "allocationMode"); + if (cJSON_IsNull(allocation_mode)) { + allocation_mode = NULL; + } + if (allocation_mode) { + if(!cJSON_IsString(allocation_mode) && !cJSON_IsNull(allocation_mode)) + { + goto end; //String + } + } + + // v1beta1_device_request->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + capacity_local_nonprim = v1beta1_capacity_requirements_parseFromJSON(capacity); //nonprimitive + } + + // v1beta1_device_request->count + cJSON *count = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } + if (count) { + if(!cJSON_IsNumber(count)) + { + goto end; //Numeric + } + } + + // v1beta1_device_request->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "deviceClassName"); + if (cJSON_IsNull(device_class_name)) { + device_class_name = NULL; + } + if (device_class_name) { + if(!cJSON_IsString(device_class_name) && !cJSON_IsNull(device_class_name)) + { + goto end; //String + } + } + + // v1beta1_device_request->first_available + cJSON *first_available = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "firstAvailable"); + if (cJSON_IsNull(first_available)) { + first_available = NULL; + } + if (first_available) { + cJSON *first_available_local_nonprimitive = NULL; + if(!cJSON_IsArray(first_available)){ + goto end; //nonprimitive container + } + + first_availableList = list_createList(); + + cJSON_ArrayForEach(first_available_local_nonprimitive,first_available ) + { + if(!cJSON_IsObject(first_available_local_nonprimitive)){ + goto end; + } + v1beta1_device_sub_request_t *first_availableItem = v1beta1_device_sub_request_parseFromJSON(first_available_local_nonprimitive); + + list_addElement(first_availableList, first_availableItem); + } + } + + // v1beta1_device_request->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta1_device_request->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1beta1_device_selector_t *selectorsItem = v1beta1_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + // v1beta1_device_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1beta1_device_requestJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1beta1_device_toleration_t *tolerationsItem = v1beta1_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1beta1_device_request_local_var = v1beta1_device_request_create_internal ( + admin_access ? admin_access->valueint : 0, + allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, + capacity ? capacity_local_nonprim : NULL, + count ? count->valuedouble : 0, + device_class_name && !cJSON_IsNull(device_class_name) ? strdup(device_class_name->valuestring) : NULL, + first_available ? first_availableList : NULL, + strdup(name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1beta1_device_request_local_var; +end: + if (capacity_local_nonprim) { + v1beta1_capacity_requirements_free(capacity_local_nonprim); + capacity_local_nonprim = NULL; + } + if (first_availableList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, first_availableList) { + v1beta1_device_sub_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(first_availableList); + first_availableList = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1beta1_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1beta1_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_request.h b/kubernetes/model/v1beta1_device_request.h new file mode 100644 index 00000000..85d9bb23 --- /dev/null +++ b/kubernetes/model/v1beta1_device_request.h @@ -0,0 +1,58 @@ +/* + * v1beta1_device_request.h + * + * DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices. + */ + +#ifndef _v1beta1_device_request_H_ +#define _v1beta1_device_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_request_t v1beta1_device_request_t; + +#include "v1beta1_capacity_requirements.h" +#include "v1beta1_device_selector.h" +#include "v1beta1_device_sub_request.h" +#include "v1beta1_device_toleration.h" + + + +typedef struct v1beta1_device_request_t { + int admin_access; //boolean + char *allocation_mode; // string + struct v1beta1_capacity_requirements_t *capacity; //model + long count; //numeric + char *device_class_name; // string + list_t *first_available; //nonprimitive container + char *name; // string + list_t *selectors; //nonprimitive container + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_request_t; + +__attribute__((deprecated)) v1beta1_device_request_t *v1beta1_device_request_create( + int admin_access, + char *allocation_mode, + v1beta1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *first_available, + char *name, + list_t *selectors, + list_t *tolerations +); + +void v1beta1_device_request_free(v1beta1_device_request_t *v1beta1_device_request); + +v1beta1_device_request_t *v1beta1_device_request_parseFromJSON(cJSON *v1beta1_device_requestJSON); + +cJSON *v1beta1_device_request_convertToJSON(v1beta1_device_request_t *v1beta1_device_request); + +#endif /* _v1beta1_device_request_H_ */ + diff --git a/kubernetes/model/v1beta1_device_request_allocation_result.c b/kubernetes/model/v1beta1_device_request_allocation_result.c new file mode 100644 index 00000000..4956a75c --- /dev/null +++ b/kubernetes/model/v1beta1_device_request_allocation_result.c @@ -0,0 +1,519 @@ +#include +#include +#include +#include "v1beta1_device_request_allocation_result.h" + + + +static v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_create_internal( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations + ) { + v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_local_var = malloc(sizeof(v1beta1_device_request_allocation_result_t)); + if (!v1beta1_device_request_allocation_result_local_var) { + return NULL; + } + v1beta1_device_request_allocation_result_local_var->admin_access = admin_access; + v1beta1_device_request_allocation_result_local_var->binding_conditions = binding_conditions; + v1beta1_device_request_allocation_result_local_var->binding_failure_conditions = binding_failure_conditions; + v1beta1_device_request_allocation_result_local_var->consumed_capacity = consumed_capacity; + v1beta1_device_request_allocation_result_local_var->device = device; + v1beta1_device_request_allocation_result_local_var->driver = driver; + v1beta1_device_request_allocation_result_local_var->pool = pool; + v1beta1_device_request_allocation_result_local_var->request = request; + v1beta1_device_request_allocation_result_local_var->share_id = share_id; + v1beta1_device_request_allocation_result_local_var->tolerations = tolerations; + + v1beta1_device_request_allocation_result_local_var->_library_owned = 1; + return v1beta1_device_request_allocation_result_local_var; +} + +__attribute__((deprecated)) v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_create( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations + ) { + return v1beta1_device_request_allocation_result_create_internal ( + admin_access, + binding_conditions, + binding_failure_conditions, + consumed_capacity, + device, + driver, + pool, + request, + share_id, + tolerations + ); +} + +void v1beta1_device_request_allocation_result_free(v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result) { + if(NULL == v1beta1_device_request_allocation_result){ + return ; + } + if(v1beta1_device_request_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_request_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_request_allocation_result->binding_conditions) { + list_ForEach(listEntry, v1beta1_device_request_allocation_result->binding_conditions) { + free(listEntry->data); + } + list_freeList(v1beta1_device_request_allocation_result->binding_conditions); + v1beta1_device_request_allocation_result->binding_conditions = NULL; + } + if (v1beta1_device_request_allocation_result->binding_failure_conditions) { + list_ForEach(listEntry, v1beta1_device_request_allocation_result->binding_failure_conditions) { + free(listEntry->data); + } + list_freeList(v1beta1_device_request_allocation_result->binding_failure_conditions); + v1beta1_device_request_allocation_result->binding_failure_conditions = NULL; + } + if (v1beta1_device_request_allocation_result->consumed_capacity) { + list_ForEach(listEntry, v1beta1_device_request_allocation_result->consumed_capacity) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta1_device_request_allocation_result->consumed_capacity); + v1beta1_device_request_allocation_result->consumed_capacity = NULL; + } + if (v1beta1_device_request_allocation_result->device) { + free(v1beta1_device_request_allocation_result->device); + v1beta1_device_request_allocation_result->device = NULL; + } + if (v1beta1_device_request_allocation_result->driver) { + free(v1beta1_device_request_allocation_result->driver); + v1beta1_device_request_allocation_result->driver = NULL; + } + if (v1beta1_device_request_allocation_result->pool) { + free(v1beta1_device_request_allocation_result->pool); + v1beta1_device_request_allocation_result->pool = NULL; + } + if (v1beta1_device_request_allocation_result->request) { + free(v1beta1_device_request_allocation_result->request); + v1beta1_device_request_allocation_result->request = NULL; + } + if (v1beta1_device_request_allocation_result->share_id) { + free(v1beta1_device_request_allocation_result->share_id); + v1beta1_device_request_allocation_result->share_id = NULL; + } + if (v1beta1_device_request_allocation_result->tolerations) { + list_ForEach(listEntry, v1beta1_device_request_allocation_result->tolerations) { + v1beta1_device_toleration_free(listEntry->data); + } + list_freeList(v1beta1_device_request_allocation_result->tolerations); + v1beta1_device_request_allocation_result->tolerations = NULL; + } + free(v1beta1_device_request_allocation_result); +} + +cJSON *v1beta1_device_request_allocation_result_convertToJSON(v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_request_allocation_result->admin_access + if(v1beta1_device_request_allocation_result->admin_access) { + if(cJSON_AddBoolToObject(item, "adminAccess", v1beta1_device_request_allocation_result->admin_access) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_device_request_allocation_result->binding_conditions + if(v1beta1_device_request_allocation_result->binding_conditions) { + cJSON *binding_conditions = cJSON_AddArrayToObject(item, "bindingConditions"); + if(binding_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_conditionsListEntry; + list_ForEach(binding_conditionsListEntry, v1beta1_device_request_allocation_result->binding_conditions) { + if(cJSON_AddStringToObject(binding_conditions, "", binding_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta1_device_request_allocation_result->binding_failure_conditions + if(v1beta1_device_request_allocation_result->binding_failure_conditions) { + cJSON *binding_failure_conditions = cJSON_AddArrayToObject(item, "bindingFailureConditions"); + if(binding_failure_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_failure_conditionsListEntry; + list_ForEach(binding_failure_conditionsListEntry, v1beta1_device_request_allocation_result->binding_failure_conditions) { + if(cJSON_AddStringToObject(binding_failure_conditions, "", binding_failure_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta1_device_request_allocation_result->consumed_capacity + if(v1beta1_device_request_allocation_result->consumed_capacity) { + cJSON *consumed_capacity = cJSON_AddObjectToObject(item, "consumedCapacity"); + if(consumed_capacity == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = consumed_capacity; + listEntry_t *consumed_capacityListEntry; + if (v1beta1_device_request_allocation_result->consumed_capacity) { + list_ForEach(consumed_capacityListEntry, v1beta1_device_request_allocation_result->consumed_capacity) { + keyValuePair_t *localKeyValue = consumed_capacityListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + + // v1beta1_device_request_allocation_result->device + if (!v1beta1_device_request_allocation_result->device) { + goto fail; + } + if(cJSON_AddStringToObject(item, "device", v1beta1_device_request_allocation_result->device) == NULL) { + goto fail; //String + } + + + // v1beta1_device_request_allocation_result->driver + if (!v1beta1_device_request_allocation_result->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta1_device_request_allocation_result->driver) == NULL) { + goto fail; //String + } + + + // v1beta1_device_request_allocation_result->pool + if (!v1beta1_device_request_allocation_result->pool) { + goto fail; + } + if(cJSON_AddStringToObject(item, "pool", v1beta1_device_request_allocation_result->pool) == NULL) { + goto fail; //String + } + + + // v1beta1_device_request_allocation_result->request + if (!v1beta1_device_request_allocation_result->request) { + goto fail; + } + if(cJSON_AddStringToObject(item, "request", v1beta1_device_request_allocation_result->request) == NULL) { + goto fail; //String + } + + + // v1beta1_device_request_allocation_result->share_id + if(v1beta1_device_request_allocation_result->share_id) { + if(cJSON_AddStringToObject(item, "shareID", v1beta1_device_request_allocation_result->share_id) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_request_allocation_result->tolerations + if(v1beta1_device_request_allocation_result->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1beta1_device_request_allocation_result->tolerations) { + list_ForEach(tolerationsListEntry, v1beta1_device_request_allocation_result->tolerations) { + cJSON *itemLocal = v1beta1_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_parseFromJSON(cJSON *v1beta1_device_request_allocation_resultJSON){ + + v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_local_var = NULL; + + // define the local list for v1beta1_device_request_allocation_result->binding_conditions + list_t *binding_conditionsList = NULL; + + // define the local list for v1beta1_device_request_allocation_result->binding_failure_conditions + list_t *binding_failure_conditionsList = NULL; + + // define the local map for v1beta1_device_request_allocation_result->consumed_capacity + list_t *consumed_capacityList = NULL; + + // define the local list for v1beta1_device_request_allocation_result->tolerations + list_t *tolerationsList = NULL; + + // v1beta1_device_request_allocation_result->admin_access + cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "adminAccess"); + if (cJSON_IsNull(admin_access)) { + admin_access = NULL; + } + if (admin_access) { + if(!cJSON_IsBool(admin_access)) + { + goto end; //Bool + } + } + + // v1beta1_device_request_allocation_result->binding_conditions + cJSON *binding_conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "bindingConditions"); + if (cJSON_IsNull(binding_conditions)) { + binding_conditions = NULL; + } + if (binding_conditions) { + cJSON *binding_conditions_local = NULL; + if(!cJSON_IsArray(binding_conditions)) { + goto end;//primitive container + } + binding_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_conditions_local, binding_conditions) + { + if(!cJSON_IsString(binding_conditions_local)) + { + goto end; + } + list_addElement(binding_conditionsList , strdup(binding_conditions_local->valuestring)); + } + } + + // v1beta1_device_request_allocation_result->binding_failure_conditions + cJSON *binding_failure_conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "bindingFailureConditions"); + if (cJSON_IsNull(binding_failure_conditions)) { + binding_failure_conditions = NULL; + } + if (binding_failure_conditions) { + cJSON *binding_failure_conditions_local = NULL; + if(!cJSON_IsArray(binding_failure_conditions)) { + goto end;//primitive container + } + binding_failure_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_failure_conditions_local, binding_failure_conditions) + { + if(!cJSON_IsString(binding_failure_conditions_local)) + { + goto end; + } + list_addElement(binding_failure_conditionsList , strdup(binding_failure_conditions_local->valuestring)); + } + } + + // v1beta1_device_request_allocation_result->consumed_capacity + cJSON *consumed_capacity = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "consumedCapacity"); + if (cJSON_IsNull(consumed_capacity)) { + consumed_capacity = NULL; + } + if (consumed_capacity) { + cJSON *consumed_capacity_local_map = NULL; + if(!cJSON_IsObject(consumed_capacity) && !cJSON_IsNull(consumed_capacity)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(consumed_capacity)) + { + consumed_capacityList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(consumed_capacity_local_map, consumed_capacity) + { + cJSON *localMapObject = consumed_capacity_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(consumed_capacityList , localMapKeyPair); + } + } + } + + // v1beta1_device_request_allocation_result->device + cJSON *device = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "device"); + if (cJSON_IsNull(device)) { + device = NULL; + } + if (!device) { + goto end; + } + + + if(!cJSON_IsString(device)) + { + goto end; //String + } + + // v1beta1_device_request_allocation_result->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta1_device_request_allocation_result->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + if(!cJSON_IsString(pool)) + { + goto end; //String + } + + // v1beta1_device_request_allocation_result->request + cJSON *request = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "request"); + if (cJSON_IsNull(request)) { + request = NULL; + } + if (!request) { + goto end; + } + + + if(!cJSON_IsString(request)) + { + goto end; //String + } + + // v1beta1_device_request_allocation_result->share_id + cJSON *share_id = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "shareID"); + if (cJSON_IsNull(share_id)) { + share_id = NULL; + } + if (share_id) { + if(!cJSON_IsString(share_id) && !cJSON_IsNull(share_id)) + { + goto end; //String + } + } + + // v1beta1_device_request_allocation_result->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1beta1_device_request_allocation_resultJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1beta1_device_toleration_t *tolerationsItem = v1beta1_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1beta1_device_request_allocation_result_local_var = v1beta1_device_request_allocation_result_create_internal ( + admin_access ? admin_access->valueint : 0, + binding_conditions ? binding_conditionsList : NULL, + binding_failure_conditions ? binding_failure_conditionsList : NULL, + consumed_capacity ? consumed_capacityList : NULL, + strdup(device->valuestring), + strdup(driver->valuestring), + strdup(pool->valuestring), + strdup(request->valuestring), + share_id && !cJSON_IsNull(share_id) ? strdup(share_id->valuestring) : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1beta1_device_request_allocation_result_local_var; +end: + if (binding_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_conditionsList); + binding_conditionsList = NULL; + } + if (binding_failure_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_failure_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_failure_conditionsList); + binding_failure_conditionsList = NULL; + } + if (consumed_capacityList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, consumed_capacityList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(consumed_capacityList); + consumed_capacityList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1beta1_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_request_allocation_result.h b/kubernetes/model/v1beta1_device_request_allocation_result.h new file mode 100644 index 00000000..0f55f6aa --- /dev/null +++ b/kubernetes/model/v1beta1_device_request_allocation_result.h @@ -0,0 +1,57 @@ +/* + * v1beta1_device_request_allocation_result.h + * + * DeviceRequestAllocationResult contains the allocation result for one request. + */ + +#ifndef _v1beta1_device_request_allocation_result_H_ +#define _v1beta1_device_request_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_request_allocation_result_t v1beta1_device_request_allocation_result_t; + +#include "v1beta1_device_toleration.h" + + + +typedef struct v1beta1_device_request_allocation_result_t { + int admin_access; //boolean + list_t *binding_conditions; //primitive container + list_t *binding_failure_conditions; //primitive container + list_t* consumed_capacity; //map + char *device; // string + char *driver; // string + char *pool; // string + char *request; // string + char *share_id; // string + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_request_allocation_result_t; + +__attribute__((deprecated)) v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_create( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations +); + +void v1beta1_device_request_allocation_result_free(v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result); + +v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_parseFromJSON(cJSON *v1beta1_device_request_allocation_resultJSON); + +cJSON *v1beta1_device_request_allocation_result_convertToJSON(v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result); + +#endif /* _v1beta1_device_request_allocation_result_H_ */ + diff --git a/kubernetes/model/v1beta1_device_selector.c b/kubernetes/model/v1beta1_device_selector.c new file mode 100644 index 00000000..74e4f860 --- /dev/null +++ b/kubernetes/model/v1beta1_device_selector.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1beta1_device_selector.h" + + + +static v1beta1_device_selector_t *v1beta1_device_selector_create_internal( + v1beta1_cel_device_selector_t *cel + ) { + v1beta1_device_selector_t *v1beta1_device_selector_local_var = malloc(sizeof(v1beta1_device_selector_t)); + if (!v1beta1_device_selector_local_var) { + return NULL; + } + v1beta1_device_selector_local_var->cel = cel; + + v1beta1_device_selector_local_var->_library_owned = 1; + return v1beta1_device_selector_local_var; +} + +__attribute__((deprecated)) v1beta1_device_selector_t *v1beta1_device_selector_create( + v1beta1_cel_device_selector_t *cel + ) { + return v1beta1_device_selector_create_internal ( + cel + ); +} + +void v1beta1_device_selector_free(v1beta1_device_selector_t *v1beta1_device_selector) { + if(NULL == v1beta1_device_selector){ + return ; + } + if(v1beta1_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_selector->cel) { + v1beta1_cel_device_selector_free(v1beta1_device_selector->cel); + v1beta1_device_selector->cel = NULL; + } + free(v1beta1_device_selector); +} + +cJSON *v1beta1_device_selector_convertToJSON(v1beta1_device_selector_t *v1beta1_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_selector->cel + if(v1beta1_device_selector->cel) { + cJSON *cel_local_JSON = v1beta1_cel_device_selector_convertToJSON(v1beta1_device_selector->cel); + if(cel_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "cel", cel_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_selector_t *v1beta1_device_selector_parseFromJSON(cJSON *v1beta1_device_selectorJSON){ + + v1beta1_device_selector_t *v1beta1_device_selector_local_var = NULL; + + // define the local variable for v1beta1_device_selector->cel + v1beta1_cel_device_selector_t *cel_local_nonprim = NULL; + + // v1beta1_device_selector->cel + cJSON *cel = cJSON_GetObjectItemCaseSensitive(v1beta1_device_selectorJSON, "cel"); + if (cJSON_IsNull(cel)) { + cel = NULL; + } + if (cel) { + cel_local_nonprim = v1beta1_cel_device_selector_parseFromJSON(cel); //nonprimitive + } + + + v1beta1_device_selector_local_var = v1beta1_device_selector_create_internal ( + cel ? cel_local_nonprim : NULL + ); + + return v1beta1_device_selector_local_var; +end: + if (cel_local_nonprim) { + v1beta1_cel_device_selector_free(cel_local_nonprim); + cel_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_selector.h b/kubernetes/model/v1beta1_device_selector.h new file mode 100644 index 00000000..873b32fa --- /dev/null +++ b/kubernetes/model/v1beta1_device_selector.h @@ -0,0 +1,39 @@ +/* + * v1beta1_device_selector.h + * + * DeviceSelector must have exactly one field set. + */ + +#ifndef _v1beta1_device_selector_H_ +#define _v1beta1_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_selector_t v1beta1_device_selector_t; + +#include "v1beta1_cel_device_selector.h" + + + +typedef struct v1beta1_device_selector_t { + struct v1beta1_cel_device_selector_t *cel; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_selector_t; + +__attribute__((deprecated)) v1beta1_device_selector_t *v1beta1_device_selector_create( + v1beta1_cel_device_selector_t *cel +); + +void v1beta1_device_selector_free(v1beta1_device_selector_t *v1beta1_device_selector); + +v1beta1_device_selector_t *v1beta1_device_selector_parseFromJSON(cJSON *v1beta1_device_selectorJSON); + +cJSON *v1beta1_device_selector_convertToJSON(v1beta1_device_selector_t *v1beta1_device_selector); + +#endif /* _v1beta1_device_selector_H_ */ + diff --git a/kubernetes/model/v1beta1_device_sub_request.c b/kubernetes/model/v1beta1_device_sub_request.c new file mode 100644 index 00000000..b3db0408 --- /dev/null +++ b/kubernetes/model/v1beta1_device_sub_request.c @@ -0,0 +1,353 @@ +#include +#include +#include +#include "v1beta1_device_sub_request.h" + + + +static v1beta1_device_sub_request_t *v1beta1_device_sub_request_create_internal( + char *allocation_mode, + v1beta1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + v1beta1_device_sub_request_t *v1beta1_device_sub_request_local_var = malloc(sizeof(v1beta1_device_sub_request_t)); + if (!v1beta1_device_sub_request_local_var) { + return NULL; + } + v1beta1_device_sub_request_local_var->allocation_mode = allocation_mode; + v1beta1_device_sub_request_local_var->capacity = capacity; + v1beta1_device_sub_request_local_var->count = count; + v1beta1_device_sub_request_local_var->device_class_name = device_class_name; + v1beta1_device_sub_request_local_var->name = name; + v1beta1_device_sub_request_local_var->selectors = selectors; + v1beta1_device_sub_request_local_var->tolerations = tolerations; + + v1beta1_device_sub_request_local_var->_library_owned = 1; + return v1beta1_device_sub_request_local_var; +} + +__attribute__((deprecated)) v1beta1_device_sub_request_t *v1beta1_device_sub_request_create( + char *allocation_mode, + v1beta1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + return v1beta1_device_sub_request_create_internal ( + allocation_mode, + capacity, + count, + device_class_name, + name, + selectors, + tolerations + ); +} + +void v1beta1_device_sub_request_free(v1beta1_device_sub_request_t *v1beta1_device_sub_request) { + if(NULL == v1beta1_device_sub_request){ + return ; + } + if(v1beta1_device_sub_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_sub_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_sub_request->allocation_mode) { + free(v1beta1_device_sub_request->allocation_mode); + v1beta1_device_sub_request->allocation_mode = NULL; + } + if (v1beta1_device_sub_request->capacity) { + v1beta1_capacity_requirements_free(v1beta1_device_sub_request->capacity); + v1beta1_device_sub_request->capacity = NULL; + } + if (v1beta1_device_sub_request->device_class_name) { + free(v1beta1_device_sub_request->device_class_name); + v1beta1_device_sub_request->device_class_name = NULL; + } + if (v1beta1_device_sub_request->name) { + free(v1beta1_device_sub_request->name); + v1beta1_device_sub_request->name = NULL; + } + if (v1beta1_device_sub_request->selectors) { + list_ForEach(listEntry, v1beta1_device_sub_request->selectors) { + v1beta1_device_selector_free(listEntry->data); + } + list_freeList(v1beta1_device_sub_request->selectors); + v1beta1_device_sub_request->selectors = NULL; + } + if (v1beta1_device_sub_request->tolerations) { + list_ForEach(listEntry, v1beta1_device_sub_request->tolerations) { + v1beta1_device_toleration_free(listEntry->data); + } + list_freeList(v1beta1_device_sub_request->tolerations); + v1beta1_device_sub_request->tolerations = NULL; + } + free(v1beta1_device_sub_request); +} + +cJSON *v1beta1_device_sub_request_convertToJSON(v1beta1_device_sub_request_t *v1beta1_device_sub_request) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_sub_request->allocation_mode + if(v1beta1_device_sub_request->allocation_mode) { + if(cJSON_AddStringToObject(item, "allocationMode", v1beta1_device_sub_request->allocation_mode) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_sub_request->capacity + if(v1beta1_device_sub_request->capacity) { + cJSON *capacity_local_JSON = v1beta1_capacity_requirements_convertToJSON(v1beta1_device_sub_request->capacity); + if(capacity_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "capacity", capacity_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_device_sub_request->count + if(v1beta1_device_sub_request->count) { + if(cJSON_AddNumberToObject(item, "count", v1beta1_device_sub_request->count) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta1_device_sub_request->device_class_name + if (!v1beta1_device_sub_request->device_class_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "deviceClassName", v1beta1_device_sub_request->device_class_name) == NULL) { + goto fail; //String + } + + + // v1beta1_device_sub_request->name + if (!v1beta1_device_sub_request->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta1_device_sub_request->name) == NULL) { + goto fail; //String + } + + + // v1beta1_device_sub_request->selectors + if(v1beta1_device_sub_request->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1beta1_device_sub_request->selectors) { + list_ForEach(selectorsListEntry, v1beta1_device_sub_request->selectors) { + cJSON *itemLocal = v1beta1_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + + // v1beta1_device_sub_request->tolerations + if(v1beta1_device_sub_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1beta1_device_sub_request->tolerations) { + list_ForEach(tolerationsListEntry, v1beta1_device_sub_request->tolerations) { + cJSON *itemLocal = v1beta1_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_sub_request_t *v1beta1_device_sub_request_parseFromJSON(cJSON *v1beta1_device_sub_requestJSON){ + + v1beta1_device_sub_request_t *v1beta1_device_sub_request_local_var = NULL; + + // define the local variable for v1beta1_device_sub_request->capacity + v1beta1_capacity_requirements_t *capacity_local_nonprim = NULL; + + // define the local list for v1beta1_device_sub_request->selectors + list_t *selectorsList = NULL; + + // define the local list for v1beta1_device_sub_request->tolerations + list_t *tolerationsList = NULL; + + // v1beta1_device_sub_request->allocation_mode + cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1beta1_device_sub_requestJSON, "allocationMode"); + if (cJSON_IsNull(allocation_mode)) { + allocation_mode = NULL; + } + if (allocation_mode) { + if(!cJSON_IsString(allocation_mode) && !cJSON_IsNull(allocation_mode)) + { + goto end; //String + } + } + + // v1beta1_device_sub_request->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1beta1_device_sub_requestJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + capacity_local_nonprim = v1beta1_capacity_requirements_parseFromJSON(capacity); //nonprimitive + } + + // v1beta1_device_sub_request->count + cJSON *count = cJSON_GetObjectItemCaseSensitive(v1beta1_device_sub_requestJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } + if (count) { + if(!cJSON_IsNumber(count)) + { + goto end; //Numeric + } + } + + // v1beta1_device_sub_request->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1beta1_device_sub_requestJSON, "deviceClassName"); + if (cJSON_IsNull(device_class_name)) { + device_class_name = NULL; + } + if (!device_class_name) { + goto end; + } + + + if(!cJSON_IsString(device_class_name)) + { + goto end; //String + } + + // v1beta1_device_sub_request->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_device_sub_requestJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta1_device_sub_request->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1beta1_device_sub_requestJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1beta1_device_selector_t *selectorsItem = v1beta1_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + // v1beta1_device_sub_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1beta1_device_sub_requestJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1beta1_device_toleration_t *tolerationsItem = v1beta1_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1beta1_device_sub_request_local_var = v1beta1_device_sub_request_create_internal ( + allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, + capacity ? capacity_local_nonprim : NULL, + count ? count->valuedouble : 0, + strdup(device_class_name->valuestring), + strdup(name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1beta1_device_sub_request_local_var; +end: + if (capacity_local_nonprim) { + v1beta1_capacity_requirements_free(capacity_local_nonprim); + capacity_local_nonprim = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1beta1_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1beta1_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_sub_request.h b/kubernetes/model/v1beta1_device_sub_request.h new file mode 100644 index 00000000..07bfc5ef --- /dev/null +++ b/kubernetes/model/v1beta1_device_sub_request.h @@ -0,0 +1,53 @@ +/* + * v1beta1_device_sub_request.h + * + * DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices. DeviceSubRequest is similar to Request, but doesn't expose the AdminAccess or FirstAvailable fields, as those can only be set on the top-level request. AdminAccess is not supported for requests with a prioritized list, and recursive FirstAvailable fields are not supported. + */ + +#ifndef _v1beta1_device_sub_request_H_ +#define _v1beta1_device_sub_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_sub_request_t v1beta1_device_sub_request_t; + +#include "v1beta1_capacity_requirements.h" +#include "v1beta1_device_selector.h" +#include "v1beta1_device_toleration.h" + + + +typedef struct v1beta1_device_sub_request_t { + char *allocation_mode; // string + struct v1beta1_capacity_requirements_t *capacity; //model + long count; //numeric + char *device_class_name; // string + char *name; // string + list_t *selectors; //nonprimitive container + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_sub_request_t; + +__attribute__((deprecated)) v1beta1_device_sub_request_t *v1beta1_device_sub_request_create( + char *allocation_mode, + v1beta1_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations +); + +void v1beta1_device_sub_request_free(v1beta1_device_sub_request_t *v1beta1_device_sub_request); + +v1beta1_device_sub_request_t *v1beta1_device_sub_request_parseFromJSON(cJSON *v1beta1_device_sub_requestJSON); + +cJSON *v1beta1_device_sub_request_convertToJSON(v1beta1_device_sub_request_t *v1beta1_device_sub_request); + +#endif /* _v1beta1_device_sub_request_H_ */ + diff --git a/kubernetes/model/v1beta1_device_taint.c b/kubernetes/model/v1beta1_device_taint.c new file mode 100644 index 00000000..9278e956 --- /dev/null +++ b/kubernetes/model/v1beta1_device_taint.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include "v1beta1_device_taint.h" + + + +static v1beta1_device_taint_t *v1beta1_device_taint_create_internal( + char *effect, + char *key, + char *time_added, + char *value + ) { + v1beta1_device_taint_t *v1beta1_device_taint_local_var = malloc(sizeof(v1beta1_device_taint_t)); + if (!v1beta1_device_taint_local_var) { + return NULL; + } + v1beta1_device_taint_local_var->effect = effect; + v1beta1_device_taint_local_var->key = key; + v1beta1_device_taint_local_var->time_added = time_added; + v1beta1_device_taint_local_var->value = value; + + v1beta1_device_taint_local_var->_library_owned = 1; + return v1beta1_device_taint_local_var; +} + +__attribute__((deprecated)) v1beta1_device_taint_t *v1beta1_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value + ) { + return v1beta1_device_taint_create_internal ( + effect, + key, + time_added, + value + ); +} + +void v1beta1_device_taint_free(v1beta1_device_taint_t *v1beta1_device_taint) { + if(NULL == v1beta1_device_taint){ + return ; + } + if(v1beta1_device_taint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_taint_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_taint->effect) { + free(v1beta1_device_taint->effect); + v1beta1_device_taint->effect = NULL; + } + if (v1beta1_device_taint->key) { + free(v1beta1_device_taint->key); + v1beta1_device_taint->key = NULL; + } + if (v1beta1_device_taint->time_added) { + free(v1beta1_device_taint->time_added); + v1beta1_device_taint->time_added = NULL; + } + if (v1beta1_device_taint->value) { + free(v1beta1_device_taint->value); + v1beta1_device_taint->value = NULL; + } + free(v1beta1_device_taint); +} + +cJSON *v1beta1_device_taint_convertToJSON(v1beta1_device_taint_t *v1beta1_device_taint) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_taint->effect + if (!v1beta1_device_taint->effect) { + goto fail; + } + if(cJSON_AddStringToObject(item, "effect", v1beta1_device_taint->effect) == NULL) { + goto fail; //String + } + + + // v1beta1_device_taint->key + if (!v1beta1_device_taint->key) { + goto fail; + } + if(cJSON_AddStringToObject(item, "key", v1beta1_device_taint->key) == NULL) { + goto fail; //String + } + + + // v1beta1_device_taint->time_added + if(v1beta1_device_taint->time_added) { + if(cJSON_AddStringToObject(item, "timeAdded", v1beta1_device_taint->time_added) == NULL) { + goto fail; //Date-Time + } + } + + + // v1beta1_device_taint->value + if(v1beta1_device_taint->value) { + if(cJSON_AddStringToObject(item, "value", v1beta1_device_taint->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_taint_t *v1beta1_device_taint_parseFromJSON(cJSON *v1beta1_device_taintJSON){ + + v1beta1_device_taint_t *v1beta1_device_taint_local_var = NULL; + + // v1beta1_device_taint->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1beta1_device_taintJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (!effect) { + goto end; + } + + + if(!cJSON_IsString(effect)) + { + goto end; //String + } + + // v1beta1_device_taint->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1beta1_device_taintJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (!key) { + goto end; + } + + + if(!cJSON_IsString(key)) + { + goto end; //String + } + + // v1beta1_device_taint->time_added + cJSON *time_added = cJSON_GetObjectItemCaseSensitive(v1beta1_device_taintJSON, "timeAdded"); + if (cJSON_IsNull(time_added)) { + time_added = NULL; + } + if (time_added) { + if(!cJSON_IsString(time_added) && !cJSON_IsNull(time_added)) + { + goto end; //DateTime + } + } + + // v1beta1_device_taint->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta1_device_taintJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1beta1_device_taint_local_var = v1beta1_device_taint_create_internal ( + strdup(effect->valuestring), + strdup(key->valuestring), + time_added && !cJSON_IsNull(time_added) ? strdup(time_added->valuestring) : NULL, + value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL + ); + + return v1beta1_device_taint_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_taint.h b/kubernetes/model/v1beta1_device_taint.h new file mode 100644 index 00000000..c12c6694 --- /dev/null +++ b/kubernetes/model/v1beta1_device_taint.h @@ -0,0 +1,44 @@ +/* + * v1beta1_device_taint.h + * + * The device this taint is attached to has the \"effect\" on any claim which does not tolerate the taint and, through the claim, to pods using the claim. + */ + +#ifndef _v1beta1_device_taint_H_ +#define _v1beta1_device_taint_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_taint_t v1beta1_device_taint_t; + + + + +typedef struct v1beta1_device_taint_t { + char *effect; // string + char *key; // string + char *time_added; //date time + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_taint_t; + +__attribute__((deprecated)) v1beta1_device_taint_t *v1beta1_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value +); + +void v1beta1_device_taint_free(v1beta1_device_taint_t *v1beta1_device_taint); + +v1beta1_device_taint_t *v1beta1_device_taint_parseFromJSON(cJSON *v1beta1_device_taintJSON); + +cJSON *v1beta1_device_taint_convertToJSON(v1beta1_device_taint_t *v1beta1_device_taint); + +#endif /* _v1beta1_device_taint_H_ */ + diff --git a/kubernetes/model/v1beta1_device_toleration.c b/kubernetes/model/v1beta1_device_toleration.c new file mode 100644 index 00000000..f99a3188 --- /dev/null +++ b/kubernetes/model/v1beta1_device_toleration.c @@ -0,0 +1,200 @@ +#include +#include +#include +#include "v1beta1_device_toleration.h" + + + +static v1beta1_device_toleration_t *v1beta1_device_toleration_create_internal( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + v1beta1_device_toleration_t *v1beta1_device_toleration_local_var = malloc(sizeof(v1beta1_device_toleration_t)); + if (!v1beta1_device_toleration_local_var) { + return NULL; + } + v1beta1_device_toleration_local_var->effect = effect; + v1beta1_device_toleration_local_var->key = key; + v1beta1_device_toleration_local_var->_operator = _operator; + v1beta1_device_toleration_local_var->toleration_seconds = toleration_seconds; + v1beta1_device_toleration_local_var->value = value; + + v1beta1_device_toleration_local_var->_library_owned = 1; + return v1beta1_device_toleration_local_var; +} + +__attribute__((deprecated)) v1beta1_device_toleration_t *v1beta1_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + return v1beta1_device_toleration_create_internal ( + effect, + key, + _operator, + toleration_seconds, + value + ); +} + +void v1beta1_device_toleration_free(v1beta1_device_toleration_t *v1beta1_device_toleration) { + if(NULL == v1beta1_device_toleration){ + return ; + } + if(v1beta1_device_toleration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_device_toleration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_device_toleration->effect) { + free(v1beta1_device_toleration->effect); + v1beta1_device_toleration->effect = NULL; + } + if (v1beta1_device_toleration->key) { + free(v1beta1_device_toleration->key); + v1beta1_device_toleration->key = NULL; + } + if (v1beta1_device_toleration->_operator) { + free(v1beta1_device_toleration->_operator); + v1beta1_device_toleration->_operator = NULL; + } + if (v1beta1_device_toleration->value) { + free(v1beta1_device_toleration->value); + v1beta1_device_toleration->value = NULL; + } + free(v1beta1_device_toleration); +} + +cJSON *v1beta1_device_toleration_convertToJSON(v1beta1_device_toleration_t *v1beta1_device_toleration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_device_toleration->effect + if(v1beta1_device_toleration->effect) { + if(cJSON_AddStringToObject(item, "effect", v1beta1_device_toleration->effect) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_toleration->key + if(v1beta1_device_toleration->key) { + if(cJSON_AddStringToObject(item, "key", v1beta1_device_toleration->key) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_toleration->_operator + if(v1beta1_device_toleration->_operator) { + if(cJSON_AddStringToObject(item, "operator", v1beta1_device_toleration->_operator) == NULL) { + goto fail; //String + } + } + + + // v1beta1_device_toleration->toleration_seconds + if(v1beta1_device_toleration->toleration_seconds) { + if(cJSON_AddNumberToObject(item, "tolerationSeconds", v1beta1_device_toleration->toleration_seconds) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta1_device_toleration->value + if(v1beta1_device_toleration->value) { + if(cJSON_AddStringToObject(item, "value", v1beta1_device_toleration->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_device_toleration_t *v1beta1_device_toleration_parseFromJSON(cJSON *v1beta1_device_tolerationJSON){ + + v1beta1_device_toleration_t *v1beta1_device_toleration_local_var = NULL; + + // v1beta1_device_toleration->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1beta1_device_tolerationJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (effect) { + if(!cJSON_IsString(effect) && !cJSON_IsNull(effect)) + { + goto end; //String + } + } + + // v1beta1_device_toleration->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1beta1_device_tolerationJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (key) { + if(!cJSON_IsString(key) && !cJSON_IsNull(key)) + { + goto end; //String + } + } + + // v1beta1_device_toleration->_operator + cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1beta1_device_tolerationJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } + if (_operator) { + if(!cJSON_IsString(_operator) && !cJSON_IsNull(_operator)) + { + goto end; //String + } + } + + // v1beta1_device_toleration->toleration_seconds + cJSON *toleration_seconds = cJSON_GetObjectItemCaseSensitive(v1beta1_device_tolerationJSON, "tolerationSeconds"); + if (cJSON_IsNull(toleration_seconds)) { + toleration_seconds = NULL; + } + if (toleration_seconds) { + if(!cJSON_IsNumber(toleration_seconds)) + { + goto end; //Numeric + } + } + + // v1beta1_device_toleration->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta1_device_tolerationJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1beta1_device_toleration_local_var = v1beta1_device_toleration_create_internal ( + effect && !cJSON_IsNull(effect) ? strdup(effect->valuestring) : NULL, + key && !cJSON_IsNull(key) ? strdup(key->valuestring) : NULL, + _operator && !cJSON_IsNull(_operator) ? strdup(_operator->valuestring) : NULL, + toleration_seconds ? toleration_seconds->valuedouble : 0, + value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL + ); + + return v1beta1_device_toleration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_device_toleration.h b/kubernetes/model/v1beta1_device_toleration.h new file mode 100644 index 00000000..f8fc2c4e --- /dev/null +++ b/kubernetes/model/v1beta1_device_toleration.h @@ -0,0 +1,46 @@ +/* + * v1beta1_device_toleration.h + * + * The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>. + */ + +#ifndef _v1beta1_device_toleration_H_ +#define _v1beta1_device_toleration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_device_toleration_t v1beta1_device_toleration_t; + + + + +typedef struct v1beta1_device_toleration_t { + char *effect; // string + char *key; // string + char *_operator; // string + long toleration_seconds; //numeric + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_device_toleration_t; + +__attribute__((deprecated)) v1beta1_device_toleration_t *v1beta1_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value +); + +void v1beta1_device_toleration_free(v1beta1_device_toleration_t *v1beta1_device_toleration); + +v1beta1_device_toleration_t *v1beta1_device_toleration_parseFromJSON(cJSON *v1beta1_device_tolerationJSON); + +cJSON *v1beta1_device_toleration_convertToJSON(v1beta1_device_toleration_t *v1beta1_device_toleration); + +#endif /* _v1beta1_device_toleration_H_ */ + diff --git a/kubernetes/model/v1beta1_expression_warning.c b/kubernetes/model/v1beta1_expression_warning.c deleted file mode 100644 index a10dbfaf..00000000 --- a/kubernetes/model/v1beta1_expression_warning.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include "v1beta1_expression_warning.h" - - - -v1beta1_expression_warning_t *v1beta1_expression_warning_create( - char *field_ref, - char *warning - ) { - v1beta1_expression_warning_t *v1beta1_expression_warning_local_var = malloc(sizeof(v1beta1_expression_warning_t)); - if (!v1beta1_expression_warning_local_var) { - return NULL; - } - v1beta1_expression_warning_local_var->field_ref = field_ref; - v1beta1_expression_warning_local_var->warning = warning; - - return v1beta1_expression_warning_local_var; -} - - -void v1beta1_expression_warning_free(v1beta1_expression_warning_t *v1beta1_expression_warning) { - if(NULL == v1beta1_expression_warning){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_expression_warning->field_ref) { - free(v1beta1_expression_warning->field_ref); - v1beta1_expression_warning->field_ref = NULL; - } - if (v1beta1_expression_warning->warning) { - free(v1beta1_expression_warning->warning); - v1beta1_expression_warning->warning = NULL; - } - free(v1beta1_expression_warning); -} - -cJSON *v1beta1_expression_warning_convertToJSON(v1beta1_expression_warning_t *v1beta1_expression_warning) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_expression_warning->field_ref - if (!v1beta1_expression_warning->field_ref) { - goto fail; - } - if(cJSON_AddStringToObject(item, "fieldRef", v1beta1_expression_warning->field_ref) == NULL) { - goto fail; //String - } - - - // v1beta1_expression_warning->warning - if (!v1beta1_expression_warning->warning) { - goto fail; - } - if(cJSON_AddStringToObject(item, "warning", v1beta1_expression_warning->warning) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_expression_warning_t *v1beta1_expression_warning_parseFromJSON(cJSON *v1beta1_expression_warningJSON){ - - v1beta1_expression_warning_t *v1beta1_expression_warning_local_var = NULL; - - // v1beta1_expression_warning->field_ref - cJSON *field_ref = cJSON_GetObjectItemCaseSensitive(v1beta1_expression_warningJSON, "fieldRef"); - if (!field_ref) { - goto end; - } - - - if(!cJSON_IsString(field_ref)) - { - goto end; //String - } - - // v1beta1_expression_warning->warning - cJSON *warning = cJSON_GetObjectItemCaseSensitive(v1beta1_expression_warningJSON, "warning"); - if (!warning) { - goto end; - } - - - if(!cJSON_IsString(warning)) - { - goto end; //String - } - - - v1beta1_expression_warning_local_var = v1beta1_expression_warning_create ( - strdup(field_ref->valuestring), - strdup(warning->valuestring) - ); - - return v1beta1_expression_warning_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta1_expression_warning.h b/kubernetes/model/v1beta1_expression_warning.h deleted file mode 100644 index 62689f02..00000000 --- a/kubernetes/model/v1beta1_expression_warning.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1beta1_expression_warning.h - * - * ExpressionWarning is a warning information that targets a specific expression. - */ - -#ifndef _v1beta1_expression_warning_H_ -#define _v1beta1_expression_warning_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_expression_warning_t v1beta1_expression_warning_t; - - - - -typedef struct v1beta1_expression_warning_t { - char *field_ref; // string - char *warning; // string - -} v1beta1_expression_warning_t; - -v1beta1_expression_warning_t *v1beta1_expression_warning_create( - char *field_ref, - char *warning -); - -void v1beta1_expression_warning_free(v1beta1_expression_warning_t *v1beta1_expression_warning); - -v1beta1_expression_warning_t *v1beta1_expression_warning_parseFromJSON(cJSON *v1beta1_expression_warningJSON); - -cJSON *v1beta1_expression_warning_convertToJSON(v1beta1_expression_warning_t *v1beta1_expression_warning); - -#endif /* _v1beta1_expression_warning_H_ */ - diff --git a/kubernetes/model/v1beta1_ip_address.c b/kubernetes/model/v1beta1_ip_address.c new file mode 100644 index 00000000..72727325 --- /dev/null +++ b/kubernetes/model/v1beta1_ip_address.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1beta1_ip_address.h" + + + +static v1beta1_ip_address_t *v1beta1_ip_address_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_ip_address_spec_t *spec + ) { + v1beta1_ip_address_t *v1beta1_ip_address_local_var = malloc(sizeof(v1beta1_ip_address_t)); + if (!v1beta1_ip_address_local_var) { + return NULL; + } + v1beta1_ip_address_local_var->api_version = api_version; + v1beta1_ip_address_local_var->kind = kind; + v1beta1_ip_address_local_var->metadata = metadata; + v1beta1_ip_address_local_var->spec = spec; + + v1beta1_ip_address_local_var->_library_owned = 1; + return v1beta1_ip_address_local_var; +} + +__attribute__((deprecated)) v1beta1_ip_address_t *v1beta1_ip_address_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_ip_address_spec_t *spec + ) { + return v1beta1_ip_address_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_ip_address_free(v1beta1_ip_address_t *v1beta1_ip_address) { + if(NULL == v1beta1_ip_address){ + return ; + } + if(v1beta1_ip_address->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_ip_address_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_ip_address->api_version) { + free(v1beta1_ip_address->api_version); + v1beta1_ip_address->api_version = NULL; + } + if (v1beta1_ip_address->kind) { + free(v1beta1_ip_address->kind); + v1beta1_ip_address->kind = NULL; + } + if (v1beta1_ip_address->metadata) { + v1_object_meta_free(v1beta1_ip_address->metadata); + v1beta1_ip_address->metadata = NULL; + } + if (v1beta1_ip_address->spec) { + v1beta1_ip_address_spec_free(v1beta1_ip_address->spec); + v1beta1_ip_address->spec = NULL; + } + free(v1beta1_ip_address); +} + +cJSON *v1beta1_ip_address_convertToJSON(v1beta1_ip_address_t *v1beta1_ip_address) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_ip_address->api_version + if(v1beta1_ip_address->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_ip_address->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_ip_address->kind + if(v1beta1_ip_address->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_ip_address->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_ip_address->metadata + if(v1beta1_ip_address->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_ip_address->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_ip_address->spec + if(v1beta1_ip_address->spec) { + cJSON *spec_local_JSON = v1beta1_ip_address_spec_convertToJSON(v1beta1_ip_address->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_ip_address_t *v1beta1_ip_address_parseFromJSON(cJSON *v1beta1_ip_addressJSON){ + + v1beta1_ip_address_t *v1beta1_ip_address_local_var = NULL; + + // define the local variable for v1beta1_ip_address->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_ip_address->spec + v1beta1_ip_address_spec_t *spec_local_nonprim = NULL; + + // v1beta1_ip_address->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_addressJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_ip_address->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_addressJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_ip_address->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_addressJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_ip_address->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_addressJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1beta1_ip_address_spec_parseFromJSON(spec); //nonprimitive + } + + + v1beta1_ip_address_local_var = v1beta1_ip_address_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1beta1_ip_address_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_ip_address_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_ip_address.h b/kubernetes/model/v1beta1_ip_address.h new file mode 100644 index 00000000..97f7b8f7 --- /dev/null +++ b/kubernetes/model/v1beta1_ip_address.h @@ -0,0 +1,46 @@ +/* + * v1beta1_ip_address.h + * + * IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 + */ + +#ifndef _v1beta1_ip_address_H_ +#define _v1beta1_ip_address_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_ip_address_t v1beta1_ip_address_t; + +#include "v1_object_meta.h" +#include "v1beta1_ip_address_spec.h" + + + +typedef struct v1beta1_ip_address_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_ip_address_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_ip_address_t; + +__attribute__((deprecated)) v1beta1_ip_address_t *v1beta1_ip_address_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_ip_address_spec_t *spec +); + +void v1beta1_ip_address_free(v1beta1_ip_address_t *v1beta1_ip_address); + +v1beta1_ip_address_t *v1beta1_ip_address_parseFromJSON(cJSON *v1beta1_ip_addressJSON); + +cJSON *v1beta1_ip_address_convertToJSON(v1beta1_ip_address_t *v1beta1_ip_address); + +#endif /* _v1beta1_ip_address_H_ */ + diff --git a/kubernetes/model/v1beta1_ip_address_list.c b/kubernetes/model/v1beta1_ip_address_list.c new file mode 100644 index 00000000..6849a660 --- /dev/null +++ b/kubernetes/model/v1beta1_ip_address_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_ip_address_list.h" + + + +static v1beta1_ip_address_list_t *v1beta1_ip_address_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_ip_address_list_t *v1beta1_ip_address_list_local_var = malloc(sizeof(v1beta1_ip_address_list_t)); + if (!v1beta1_ip_address_list_local_var) { + return NULL; + } + v1beta1_ip_address_list_local_var->api_version = api_version; + v1beta1_ip_address_list_local_var->items = items; + v1beta1_ip_address_list_local_var->kind = kind; + v1beta1_ip_address_list_local_var->metadata = metadata; + + v1beta1_ip_address_list_local_var->_library_owned = 1; + return v1beta1_ip_address_list_local_var; +} + +__attribute__((deprecated)) v1beta1_ip_address_list_t *v1beta1_ip_address_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_ip_address_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_ip_address_list_free(v1beta1_ip_address_list_t *v1beta1_ip_address_list) { + if(NULL == v1beta1_ip_address_list){ + return ; + } + if(v1beta1_ip_address_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_ip_address_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_ip_address_list->api_version) { + free(v1beta1_ip_address_list->api_version); + v1beta1_ip_address_list->api_version = NULL; + } + if (v1beta1_ip_address_list->items) { + list_ForEach(listEntry, v1beta1_ip_address_list->items) { + v1beta1_ip_address_free(listEntry->data); + } + list_freeList(v1beta1_ip_address_list->items); + v1beta1_ip_address_list->items = NULL; + } + if (v1beta1_ip_address_list->kind) { + free(v1beta1_ip_address_list->kind); + v1beta1_ip_address_list->kind = NULL; + } + if (v1beta1_ip_address_list->metadata) { + v1_list_meta_free(v1beta1_ip_address_list->metadata); + v1beta1_ip_address_list->metadata = NULL; + } + free(v1beta1_ip_address_list); +} + +cJSON *v1beta1_ip_address_list_convertToJSON(v1beta1_ip_address_list_t *v1beta1_ip_address_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_ip_address_list->api_version + if(v1beta1_ip_address_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_ip_address_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_ip_address_list->items + if (!v1beta1_ip_address_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_ip_address_list->items) { + list_ForEach(itemsListEntry, v1beta1_ip_address_list->items) { + cJSON *itemLocal = v1beta1_ip_address_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_ip_address_list->kind + if(v1beta1_ip_address_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_ip_address_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_ip_address_list->metadata + if(v1beta1_ip_address_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_ip_address_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_ip_address_list_t *v1beta1_ip_address_list_parseFromJSON(cJSON *v1beta1_ip_address_listJSON){ + + v1beta1_ip_address_list_t *v1beta1_ip_address_list_local_var = NULL; + + // define the local list for v1beta1_ip_address_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_ip_address_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_ip_address_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_address_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_ip_address_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_address_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_ip_address_t *itemsItem = v1beta1_ip_address_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_ip_address_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_address_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_ip_address_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_address_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_ip_address_list_local_var = v1beta1_ip_address_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_ip_address_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_ip_address_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_ip_address_list.h b/kubernetes/model/v1beta1_ip_address_list.h new file mode 100644 index 00000000..08836565 --- /dev/null +++ b/kubernetes/model/v1beta1_ip_address_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_ip_address_list.h + * + * IPAddressList contains a list of IPAddress. + */ + +#ifndef _v1beta1_ip_address_list_H_ +#define _v1beta1_ip_address_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_ip_address_list_t v1beta1_ip_address_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_ip_address.h" + + + +typedef struct v1beta1_ip_address_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_ip_address_list_t; + +__attribute__((deprecated)) v1beta1_ip_address_list_t *v1beta1_ip_address_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_ip_address_list_free(v1beta1_ip_address_list_t *v1beta1_ip_address_list); + +v1beta1_ip_address_list_t *v1beta1_ip_address_list_parseFromJSON(cJSON *v1beta1_ip_address_listJSON); + +cJSON *v1beta1_ip_address_list_convertToJSON(v1beta1_ip_address_list_t *v1beta1_ip_address_list); + +#endif /* _v1beta1_ip_address_list_H_ */ + diff --git a/kubernetes/model/v1beta1_ip_address_spec.c b/kubernetes/model/v1beta1_ip_address_spec.c new file mode 100644 index 00000000..7b2cefd4 --- /dev/null +++ b/kubernetes/model/v1beta1_ip_address_spec.c @@ -0,0 +1,101 @@ +#include +#include +#include +#include "v1beta1_ip_address_spec.h" + + + +static v1beta1_ip_address_spec_t *v1beta1_ip_address_spec_create_internal( + v1beta1_parent_reference_t *parent_ref + ) { + v1beta1_ip_address_spec_t *v1beta1_ip_address_spec_local_var = malloc(sizeof(v1beta1_ip_address_spec_t)); + if (!v1beta1_ip_address_spec_local_var) { + return NULL; + } + v1beta1_ip_address_spec_local_var->parent_ref = parent_ref; + + v1beta1_ip_address_spec_local_var->_library_owned = 1; + return v1beta1_ip_address_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_ip_address_spec_t *v1beta1_ip_address_spec_create( + v1beta1_parent_reference_t *parent_ref + ) { + return v1beta1_ip_address_spec_create_internal ( + parent_ref + ); +} + +void v1beta1_ip_address_spec_free(v1beta1_ip_address_spec_t *v1beta1_ip_address_spec) { + if(NULL == v1beta1_ip_address_spec){ + return ; + } + if(v1beta1_ip_address_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_ip_address_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_ip_address_spec->parent_ref) { + v1beta1_parent_reference_free(v1beta1_ip_address_spec->parent_ref); + v1beta1_ip_address_spec->parent_ref = NULL; + } + free(v1beta1_ip_address_spec); +} + +cJSON *v1beta1_ip_address_spec_convertToJSON(v1beta1_ip_address_spec_t *v1beta1_ip_address_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_ip_address_spec->parent_ref + if (!v1beta1_ip_address_spec->parent_ref) { + goto fail; + } + cJSON *parent_ref_local_JSON = v1beta1_parent_reference_convertToJSON(v1beta1_ip_address_spec->parent_ref); + if(parent_ref_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "parentRef", parent_ref_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_ip_address_spec_t *v1beta1_ip_address_spec_parseFromJSON(cJSON *v1beta1_ip_address_specJSON){ + + v1beta1_ip_address_spec_t *v1beta1_ip_address_spec_local_var = NULL; + + // define the local variable for v1beta1_ip_address_spec->parent_ref + v1beta1_parent_reference_t *parent_ref_local_nonprim = NULL; + + // v1beta1_ip_address_spec->parent_ref + cJSON *parent_ref = cJSON_GetObjectItemCaseSensitive(v1beta1_ip_address_specJSON, "parentRef"); + if (cJSON_IsNull(parent_ref)) { + parent_ref = NULL; + } + if (!parent_ref) { + goto end; + } + + + parent_ref_local_nonprim = v1beta1_parent_reference_parseFromJSON(parent_ref); //nonprimitive + + + v1beta1_ip_address_spec_local_var = v1beta1_ip_address_spec_create_internal ( + parent_ref_local_nonprim + ); + + return v1beta1_ip_address_spec_local_var; +end: + if (parent_ref_local_nonprim) { + v1beta1_parent_reference_free(parent_ref_local_nonprim); + parent_ref_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_ip_address_spec.h b/kubernetes/model/v1beta1_ip_address_spec.h new file mode 100644 index 00000000..e1260cb3 --- /dev/null +++ b/kubernetes/model/v1beta1_ip_address_spec.h @@ -0,0 +1,39 @@ +/* + * v1beta1_ip_address_spec.h + * + * IPAddressSpec describe the attributes in an IP Address. + */ + +#ifndef _v1beta1_ip_address_spec_H_ +#define _v1beta1_ip_address_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_ip_address_spec_t v1beta1_ip_address_spec_t; + +#include "v1beta1_parent_reference.h" + + + +typedef struct v1beta1_ip_address_spec_t { + struct v1beta1_parent_reference_t *parent_ref; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_ip_address_spec_t; + +__attribute__((deprecated)) v1beta1_ip_address_spec_t *v1beta1_ip_address_spec_create( + v1beta1_parent_reference_t *parent_ref +); + +void v1beta1_ip_address_spec_free(v1beta1_ip_address_spec_t *v1beta1_ip_address_spec); + +v1beta1_ip_address_spec_t *v1beta1_ip_address_spec_parseFromJSON(cJSON *v1beta1_ip_address_specJSON); + +cJSON *v1beta1_ip_address_spec_convertToJSON(v1beta1_ip_address_spec_t *v1beta1_ip_address_spec); + +#endif /* _v1beta1_ip_address_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_json_patch.c b/kubernetes/model/v1beta1_json_patch.c new file mode 100644 index 00000000..f36dc5a0 --- /dev/null +++ b/kubernetes/model/v1beta1_json_patch.c @@ -0,0 +1,88 @@ +#include +#include +#include +#include "v1beta1_json_patch.h" + + + +static v1beta1_json_patch_t *v1beta1_json_patch_create_internal( + char *expression + ) { + v1beta1_json_patch_t *v1beta1_json_patch_local_var = malloc(sizeof(v1beta1_json_patch_t)); + if (!v1beta1_json_patch_local_var) { + return NULL; + } + v1beta1_json_patch_local_var->expression = expression; + + v1beta1_json_patch_local_var->_library_owned = 1; + return v1beta1_json_patch_local_var; +} + +__attribute__((deprecated)) v1beta1_json_patch_t *v1beta1_json_patch_create( + char *expression + ) { + return v1beta1_json_patch_create_internal ( + expression + ); +} + +void v1beta1_json_patch_free(v1beta1_json_patch_t *v1beta1_json_patch) { + if(NULL == v1beta1_json_patch){ + return ; + } + if(v1beta1_json_patch->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_json_patch_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_json_patch->expression) { + free(v1beta1_json_patch->expression); + v1beta1_json_patch->expression = NULL; + } + free(v1beta1_json_patch); +} + +cJSON *v1beta1_json_patch_convertToJSON(v1beta1_json_patch_t *v1beta1_json_patch) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_json_patch->expression + if(v1beta1_json_patch->expression) { + if(cJSON_AddStringToObject(item, "expression", v1beta1_json_patch->expression) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_json_patch_t *v1beta1_json_patch_parseFromJSON(cJSON *v1beta1_json_patchJSON){ + + v1beta1_json_patch_t *v1beta1_json_patch_local_var = NULL; + + // v1beta1_json_patch->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1beta1_json_patchJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (expression) { + if(!cJSON_IsString(expression) && !cJSON_IsNull(expression)) + { + goto end; //String + } + } + + + v1beta1_json_patch_local_var = v1beta1_json_patch_create_internal ( + expression && !cJSON_IsNull(expression) ? strdup(expression->valuestring) : NULL + ); + + return v1beta1_json_patch_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_json_patch.h b/kubernetes/model/v1beta1_json_patch.h new file mode 100644 index 00000000..870830b3 --- /dev/null +++ b/kubernetes/model/v1beta1_json_patch.h @@ -0,0 +1,38 @@ +/* + * v1beta1_json_patch.h + * + * JSONPatch defines a JSON Patch. + */ + +#ifndef _v1beta1_json_patch_H_ +#define _v1beta1_json_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_json_patch_t v1beta1_json_patch_t; + + + + +typedef struct v1beta1_json_patch_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_json_patch_t; + +__attribute__((deprecated)) v1beta1_json_patch_t *v1beta1_json_patch_create( + char *expression +); + +void v1beta1_json_patch_free(v1beta1_json_patch_t *v1beta1_json_patch); + +v1beta1_json_patch_t *v1beta1_json_patch_parseFromJSON(cJSON *v1beta1_json_patchJSON); + +cJSON *v1beta1_json_patch_convertToJSON(v1beta1_json_patch_t *v1beta1_json_patch); + +#endif /* _v1beta1_json_patch_H_ */ + diff --git a/kubernetes/model/v1beta1_lease_candidate.c b/kubernetes/model/v1beta1_lease_candidate.c new file mode 100644 index 00000000..4e1b14c1 --- /dev/null +++ b/kubernetes/model/v1beta1_lease_candidate.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1beta1_lease_candidate.h" + + + +static v1beta1_lease_candidate_t *v1beta1_lease_candidate_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_lease_candidate_spec_t *spec + ) { + v1beta1_lease_candidate_t *v1beta1_lease_candidate_local_var = malloc(sizeof(v1beta1_lease_candidate_t)); + if (!v1beta1_lease_candidate_local_var) { + return NULL; + } + v1beta1_lease_candidate_local_var->api_version = api_version; + v1beta1_lease_candidate_local_var->kind = kind; + v1beta1_lease_candidate_local_var->metadata = metadata; + v1beta1_lease_candidate_local_var->spec = spec; + + v1beta1_lease_candidate_local_var->_library_owned = 1; + return v1beta1_lease_candidate_local_var; +} + +__attribute__((deprecated)) v1beta1_lease_candidate_t *v1beta1_lease_candidate_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_lease_candidate_spec_t *spec + ) { + return v1beta1_lease_candidate_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_lease_candidate_free(v1beta1_lease_candidate_t *v1beta1_lease_candidate) { + if(NULL == v1beta1_lease_candidate){ + return ; + } + if(v1beta1_lease_candidate->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_lease_candidate_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_lease_candidate->api_version) { + free(v1beta1_lease_candidate->api_version); + v1beta1_lease_candidate->api_version = NULL; + } + if (v1beta1_lease_candidate->kind) { + free(v1beta1_lease_candidate->kind); + v1beta1_lease_candidate->kind = NULL; + } + if (v1beta1_lease_candidate->metadata) { + v1_object_meta_free(v1beta1_lease_candidate->metadata); + v1beta1_lease_candidate->metadata = NULL; + } + if (v1beta1_lease_candidate->spec) { + v1beta1_lease_candidate_spec_free(v1beta1_lease_candidate->spec); + v1beta1_lease_candidate->spec = NULL; + } + free(v1beta1_lease_candidate); +} + +cJSON *v1beta1_lease_candidate_convertToJSON(v1beta1_lease_candidate_t *v1beta1_lease_candidate) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_lease_candidate->api_version + if(v1beta1_lease_candidate->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_lease_candidate->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_lease_candidate->kind + if(v1beta1_lease_candidate->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_lease_candidate->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_lease_candidate->metadata + if(v1beta1_lease_candidate->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_lease_candidate->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_lease_candidate->spec + if(v1beta1_lease_candidate->spec) { + cJSON *spec_local_JSON = v1beta1_lease_candidate_spec_convertToJSON(v1beta1_lease_candidate->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_lease_candidate_t *v1beta1_lease_candidate_parseFromJSON(cJSON *v1beta1_lease_candidateJSON){ + + v1beta1_lease_candidate_t *v1beta1_lease_candidate_local_var = NULL; + + // define the local variable for v1beta1_lease_candidate->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_lease_candidate->spec + v1beta1_lease_candidate_spec_t *spec_local_nonprim = NULL; + + // v1beta1_lease_candidate->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidateJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_lease_candidate->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidateJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_lease_candidate->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidateJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_lease_candidate->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidateJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1beta1_lease_candidate_spec_parseFromJSON(spec); //nonprimitive + } + + + v1beta1_lease_candidate_local_var = v1beta1_lease_candidate_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1beta1_lease_candidate_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_lease_candidate_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_lease_candidate.h b/kubernetes/model/v1beta1_lease_candidate.h new file mode 100644 index 00000000..a52a4a24 --- /dev/null +++ b/kubernetes/model/v1beta1_lease_candidate.h @@ -0,0 +1,46 @@ +/* + * v1beta1_lease_candidate.h + * + * LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. + */ + +#ifndef _v1beta1_lease_candidate_H_ +#define _v1beta1_lease_candidate_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_lease_candidate_t v1beta1_lease_candidate_t; + +#include "v1_object_meta.h" +#include "v1beta1_lease_candidate_spec.h" + + + +typedef struct v1beta1_lease_candidate_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_lease_candidate_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_lease_candidate_t; + +__attribute__((deprecated)) v1beta1_lease_candidate_t *v1beta1_lease_candidate_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_lease_candidate_spec_t *spec +); + +void v1beta1_lease_candidate_free(v1beta1_lease_candidate_t *v1beta1_lease_candidate); + +v1beta1_lease_candidate_t *v1beta1_lease_candidate_parseFromJSON(cJSON *v1beta1_lease_candidateJSON); + +cJSON *v1beta1_lease_candidate_convertToJSON(v1beta1_lease_candidate_t *v1beta1_lease_candidate); + +#endif /* _v1beta1_lease_candidate_H_ */ + diff --git a/kubernetes/model/v1beta1_lease_candidate_list.c b/kubernetes/model/v1beta1_lease_candidate_list.c new file mode 100644 index 00000000..bd1395da --- /dev/null +++ b/kubernetes/model/v1beta1_lease_candidate_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_lease_candidate_list.h" + + + +static v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list_local_var = malloc(sizeof(v1beta1_lease_candidate_list_t)); + if (!v1beta1_lease_candidate_list_local_var) { + return NULL; + } + v1beta1_lease_candidate_list_local_var->api_version = api_version; + v1beta1_lease_candidate_list_local_var->items = items; + v1beta1_lease_candidate_list_local_var->kind = kind; + v1beta1_lease_candidate_list_local_var->metadata = metadata; + + v1beta1_lease_candidate_list_local_var->_library_owned = 1; + return v1beta1_lease_candidate_list_local_var; +} + +__attribute__((deprecated)) v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_lease_candidate_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_lease_candidate_list_free(v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list) { + if(NULL == v1beta1_lease_candidate_list){ + return ; + } + if(v1beta1_lease_candidate_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_lease_candidate_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_lease_candidate_list->api_version) { + free(v1beta1_lease_candidate_list->api_version); + v1beta1_lease_candidate_list->api_version = NULL; + } + if (v1beta1_lease_candidate_list->items) { + list_ForEach(listEntry, v1beta1_lease_candidate_list->items) { + v1beta1_lease_candidate_free(listEntry->data); + } + list_freeList(v1beta1_lease_candidate_list->items); + v1beta1_lease_candidate_list->items = NULL; + } + if (v1beta1_lease_candidate_list->kind) { + free(v1beta1_lease_candidate_list->kind); + v1beta1_lease_candidate_list->kind = NULL; + } + if (v1beta1_lease_candidate_list->metadata) { + v1_list_meta_free(v1beta1_lease_candidate_list->metadata); + v1beta1_lease_candidate_list->metadata = NULL; + } + free(v1beta1_lease_candidate_list); +} + +cJSON *v1beta1_lease_candidate_list_convertToJSON(v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_lease_candidate_list->api_version + if(v1beta1_lease_candidate_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_lease_candidate_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_lease_candidate_list->items + if (!v1beta1_lease_candidate_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_lease_candidate_list->items) { + list_ForEach(itemsListEntry, v1beta1_lease_candidate_list->items) { + cJSON *itemLocal = v1beta1_lease_candidate_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_lease_candidate_list->kind + if(v1beta1_lease_candidate_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_lease_candidate_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_lease_candidate_list->metadata + if(v1beta1_lease_candidate_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_lease_candidate_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list_parseFromJSON(cJSON *v1beta1_lease_candidate_listJSON){ + + v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list_local_var = NULL; + + // define the local list for v1beta1_lease_candidate_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_lease_candidate_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_lease_candidate_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_lease_candidate_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_lease_candidate_t *itemsItem = v1beta1_lease_candidate_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_lease_candidate_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_lease_candidate_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_lease_candidate_list_local_var = v1beta1_lease_candidate_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_lease_candidate_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_lease_candidate_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_lease_candidate_list.h b/kubernetes/model/v1beta1_lease_candidate_list.h new file mode 100644 index 00000000..3db8c545 --- /dev/null +++ b/kubernetes/model/v1beta1_lease_candidate_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_lease_candidate_list.h + * + * LeaseCandidateList is a list of Lease objects. + */ + +#ifndef _v1beta1_lease_candidate_list_H_ +#define _v1beta1_lease_candidate_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_lease_candidate_list_t v1beta1_lease_candidate_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_lease_candidate.h" + + + +typedef struct v1beta1_lease_candidate_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_lease_candidate_list_t; + +__attribute__((deprecated)) v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_lease_candidate_list_free(v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list); + +v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list_parseFromJSON(cJSON *v1beta1_lease_candidate_listJSON); + +cJSON *v1beta1_lease_candidate_list_convertToJSON(v1beta1_lease_candidate_list_t *v1beta1_lease_candidate_list); + +#endif /* _v1beta1_lease_candidate_list_H_ */ + diff --git a/kubernetes/model/v1beta1_lease_candidate_spec.c b/kubernetes/model/v1beta1_lease_candidate_spec.c new file mode 100644 index 00000000..5e1ef296 --- /dev/null +++ b/kubernetes/model/v1beta1_lease_candidate_spec.c @@ -0,0 +1,245 @@ +#include +#include +#include +#include "v1beta1_lease_candidate_spec.h" + + + +static v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec_create_internal( + char *binary_version, + char *emulation_version, + char *lease_name, + char *ping_time, + char *renew_time, + char *strategy + ) { + v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec_local_var = malloc(sizeof(v1beta1_lease_candidate_spec_t)); + if (!v1beta1_lease_candidate_spec_local_var) { + return NULL; + } + v1beta1_lease_candidate_spec_local_var->binary_version = binary_version; + v1beta1_lease_candidate_spec_local_var->emulation_version = emulation_version; + v1beta1_lease_candidate_spec_local_var->lease_name = lease_name; + v1beta1_lease_candidate_spec_local_var->ping_time = ping_time; + v1beta1_lease_candidate_spec_local_var->renew_time = renew_time; + v1beta1_lease_candidate_spec_local_var->strategy = strategy; + + v1beta1_lease_candidate_spec_local_var->_library_owned = 1; + return v1beta1_lease_candidate_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec_create( + char *binary_version, + char *emulation_version, + char *lease_name, + char *ping_time, + char *renew_time, + char *strategy + ) { + return v1beta1_lease_candidate_spec_create_internal ( + binary_version, + emulation_version, + lease_name, + ping_time, + renew_time, + strategy + ); +} + +void v1beta1_lease_candidate_spec_free(v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec) { + if(NULL == v1beta1_lease_candidate_spec){ + return ; + } + if(v1beta1_lease_candidate_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_lease_candidate_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_lease_candidate_spec->binary_version) { + free(v1beta1_lease_candidate_spec->binary_version); + v1beta1_lease_candidate_spec->binary_version = NULL; + } + if (v1beta1_lease_candidate_spec->emulation_version) { + free(v1beta1_lease_candidate_spec->emulation_version); + v1beta1_lease_candidate_spec->emulation_version = NULL; + } + if (v1beta1_lease_candidate_spec->lease_name) { + free(v1beta1_lease_candidate_spec->lease_name); + v1beta1_lease_candidate_spec->lease_name = NULL; + } + if (v1beta1_lease_candidate_spec->ping_time) { + free(v1beta1_lease_candidate_spec->ping_time); + v1beta1_lease_candidate_spec->ping_time = NULL; + } + if (v1beta1_lease_candidate_spec->renew_time) { + free(v1beta1_lease_candidate_spec->renew_time); + v1beta1_lease_candidate_spec->renew_time = NULL; + } + if (v1beta1_lease_candidate_spec->strategy) { + free(v1beta1_lease_candidate_spec->strategy); + v1beta1_lease_candidate_spec->strategy = NULL; + } + free(v1beta1_lease_candidate_spec); +} + +cJSON *v1beta1_lease_candidate_spec_convertToJSON(v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_lease_candidate_spec->binary_version + if (!v1beta1_lease_candidate_spec->binary_version) { + goto fail; + } + if(cJSON_AddStringToObject(item, "binaryVersion", v1beta1_lease_candidate_spec->binary_version) == NULL) { + goto fail; //String + } + + + // v1beta1_lease_candidate_spec->emulation_version + if(v1beta1_lease_candidate_spec->emulation_version) { + if(cJSON_AddStringToObject(item, "emulationVersion", v1beta1_lease_candidate_spec->emulation_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_lease_candidate_spec->lease_name + if (!v1beta1_lease_candidate_spec->lease_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "leaseName", v1beta1_lease_candidate_spec->lease_name) == NULL) { + goto fail; //String + } + + + // v1beta1_lease_candidate_spec->ping_time + if(v1beta1_lease_candidate_spec->ping_time) { + if(cJSON_AddStringToObject(item, "pingTime", v1beta1_lease_candidate_spec->ping_time) == NULL) { + goto fail; //Date-Time + } + } + + + // v1beta1_lease_candidate_spec->renew_time + if(v1beta1_lease_candidate_spec->renew_time) { + if(cJSON_AddStringToObject(item, "renewTime", v1beta1_lease_candidate_spec->renew_time) == NULL) { + goto fail; //Date-Time + } + } + + + // v1beta1_lease_candidate_spec->strategy + if (!v1beta1_lease_candidate_spec->strategy) { + goto fail; + } + if(cJSON_AddStringToObject(item, "strategy", v1beta1_lease_candidate_spec->strategy) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec_parseFromJSON(cJSON *v1beta1_lease_candidate_specJSON){ + + v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec_local_var = NULL; + + // v1beta1_lease_candidate_spec->binary_version + cJSON *binary_version = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_specJSON, "binaryVersion"); + if (cJSON_IsNull(binary_version)) { + binary_version = NULL; + } + if (!binary_version) { + goto end; + } + + + if(!cJSON_IsString(binary_version)) + { + goto end; //String + } + + // v1beta1_lease_candidate_spec->emulation_version + cJSON *emulation_version = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_specJSON, "emulationVersion"); + if (cJSON_IsNull(emulation_version)) { + emulation_version = NULL; + } + if (emulation_version) { + if(!cJSON_IsString(emulation_version) && !cJSON_IsNull(emulation_version)) + { + goto end; //String + } + } + + // v1beta1_lease_candidate_spec->lease_name + cJSON *lease_name = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_specJSON, "leaseName"); + if (cJSON_IsNull(lease_name)) { + lease_name = NULL; + } + if (!lease_name) { + goto end; + } + + + if(!cJSON_IsString(lease_name)) + { + goto end; //String + } + + // v1beta1_lease_candidate_spec->ping_time + cJSON *ping_time = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_specJSON, "pingTime"); + if (cJSON_IsNull(ping_time)) { + ping_time = NULL; + } + if (ping_time) { + if(!cJSON_IsString(ping_time) && !cJSON_IsNull(ping_time)) + { + goto end; //DateTime + } + } + + // v1beta1_lease_candidate_spec->renew_time + cJSON *renew_time = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_specJSON, "renewTime"); + if (cJSON_IsNull(renew_time)) { + renew_time = NULL; + } + if (renew_time) { + if(!cJSON_IsString(renew_time) && !cJSON_IsNull(renew_time)) + { + goto end; //DateTime + } + } + + // v1beta1_lease_candidate_spec->strategy + cJSON *strategy = cJSON_GetObjectItemCaseSensitive(v1beta1_lease_candidate_specJSON, "strategy"); + if (cJSON_IsNull(strategy)) { + strategy = NULL; + } + if (!strategy) { + goto end; + } + + + if(!cJSON_IsString(strategy)) + { + goto end; //String + } + + + v1beta1_lease_candidate_spec_local_var = v1beta1_lease_candidate_spec_create_internal ( + strdup(binary_version->valuestring), + emulation_version && !cJSON_IsNull(emulation_version) ? strdup(emulation_version->valuestring) : NULL, + strdup(lease_name->valuestring), + ping_time && !cJSON_IsNull(ping_time) ? strdup(ping_time->valuestring) : NULL, + renew_time && !cJSON_IsNull(renew_time) ? strdup(renew_time->valuestring) : NULL, + strdup(strategy->valuestring) + ); + + return v1beta1_lease_candidate_spec_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_lease_candidate_spec.h b/kubernetes/model/v1beta1_lease_candidate_spec.h new file mode 100644 index 00000000..ca9941ae --- /dev/null +++ b/kubernetes/model/v1beta1_lease_candidate_spec.h @@ -0,0 +1,48 @@ +/* + * v1beta1_lease_candidate_spec.h + * + * LeaseCandidateSpec is a specification of a Lease. + */ + +#ifndef _v1beta1_lease_candidate_spec_H_ +#define _v1beta1_lease_candidate_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_lease_candidate_spec_t v1beta1_lease_candidate_spec_t; + + + + +typedef struct v1beta1_lease_candidate_spec_t { + char *binary_version; // string + char *emulation_version; // string + char *lease_name; // string + char *ping_time; //date time + char *renew_time; //date time + char *strategy; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_lease_candidate_spec_t; + +__attribute__((deprecated)) v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec_create( + char *binary_version, + char *emulation_version, + char *lease_name, + char *ping_time, + char *renew_time, + char *strategy +); + +void v1beta1_lease_candidate_spec_free(v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec); + +v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec_parseFromJSON(cJSON *v1beta1_lease_candidate_specJSON); + +cJSON *v1beta1_lease_candidate_spec_convertToJSON(v1beta1_lease_candidate_spec_t *v1beta1_lease_candidate_spec); + +#endif /* _v1beta1_lease_candidate_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_match_condition.c b/kubernetes/model/v1beta1_match_condition.c index 247e807d..e3cad4b2 100644 --- a/kubernetes/model/v1beta1_match_condition.c +++ b/kubernetes/model/v1beta1_match_condition.c @@ -5,7 +5,7 @@ -v1beta1_match_condition_t *v1beta1_match_condition_create( +static v1beta1_match_condition_t *v1beta1_match_condition_create_internal( char *expression, char *name ) { @@ -16,14 +16,28 @@ v1beta1_match_condition_t *v1beta1_match_condition_create( v1beta1_match_condition_local_var->expression = expression; v1beta1_match_condition_local_var->name = name; + v1beta1_match_condition_local_var->_library_owned = 1; return v1beta1_match_condition_local_var; } +__attribute__((deprecated)) v1beta1_match_condition_t *v1beta1_match_condition_create( + char *expression, + char *name + ) { + return v1beta1_match_condition_create_internal ( + expression, + name + ); +} void v1beta1_match_condition_free(v1beta1_match_condition_t *v1beta1_match_condition) { if(NULL == v1beta1_match_condition){ return ; } + if(v1beta1_match_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_match_condition_free"); + return ; + } listEntry_t *listEntry; if (v1beta1_match_condition->expression) { free(v1beta1_match_condition->expression); @@ -70,6 +84,9 @@ v1beta1_match_condition_t *v1beta1_match_condition_parseFromJSON(cJSON *v1beta1_ // v1beta1_match_condition->expression cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1beta1_match_conditionJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } if (!expression) { goto end; } @@ -82,6 +99,9 @@ v1beta1_match_condition_t *v1beta1_match_condition_parseFromJSON(cJSON *v1beta1_ // v1beta1_match_condition->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_match_conditionJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1beta1_match_condition_t *v1beta1_match_condition_parseFromJSON(cJSON *v1beta1_ } - v1beta1_match_condition_local_var = v1beta1_match_condition_create ( + v1beta1_match_condition_local_var = v1beta1_match_condition_create_internal ( strdup(expression->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1beta1_match_condition.h b/kubernetes/model/v1beta1_match_condition.h index c7287181..de5e8b9a 100644 --- a/kubernetes/model/v1beta1_match_condition.h +++ b/kubernetes/model/v1beta1_match_condition.h @@ -22,9 +22,10 @@ typedef struct v1beta1_match_condition_t { char *expression; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1beta1_match_condition_t; -v1beta1_match_condition_t *v1beta1_match_condition_create( +__attribute__((deprecated)) v1beta1_match_condition_t *v1beta1_match_condition_create( char *expression, char *name ); diff --git a/kubernetes/model/v1beta1_match_resources.c b/kubernetes/model/v1beta1_match_resources.c index e760e0bd..080636cf 100644 --- a/kubernetes/model/v1beta1_match_resources.c +++ b/kubernetes/model/v1beta1_match_resources.c @@ -5,7 +5,7 @@ -v1beta1_match_resources_t *v1beta1_match_resources_create( +static v1beta1_match_resources_t *v1beta1_match_resources_create_internal( list_t *exclude_resource_rules, char *match_policy, v1_label_selector_t *namespace_selector, @@ -22,14 +22,34 @@ v1beta1_match_resources_t *v1beta1_match_resources_create( v1beta1_match_resources_local_var->object_selector = object_selector; v1beta1_match_resources_local_var->resource_rules = resource_rules; + v1beta1_match_resources_local_var->_library_owned = 1; return v1beta1_match_resources_local_var; } +__attribute__((deprecated)) v1beta1_match_resources_t *v1beta1_match_resources_create( + list_t *exclude_resource_rules, + char *match_policy, + v1_label_selector_t *namespace_selector, + v1_label_selector_t *object_selector, + list_t *resource_rules + ) { + return v1beta1_match_resources_create_internal ( + exclude_resource_rules, + match_policy, + namespace_selector, + object_selector, + resource_rules + ); +} void v1beta1_match_resources_free(v1beta1_match_resources_t *v1beta1_match_resources) { if(NULL == v1beta1_match_resources){ return ; } + if(v1beta1_match_resources->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_match_resources_free"); + return ; + } listEntry_t *listEntry; if (v1beta1_match_resources->exclude_resource_rules) { list_ForEach(listEntry, v1beta1_match_resources->exclude_resource_rules) { @@ -162,6 +182,9 @@ v1beta1_match_resources_t *v1beta1_match_resources_parseFromJSON(cJSON *v1beta1_ // v1beta1_match_resources->exclude_resource_rules cJSON *exclude_resource_rules = cJSON_GetObjectItemCaseSensitive(v1beta1_match_resourcesJSON, "excludeResourceRules"); + if (cJSON_IsNull(exclude_resource_rules)) { + exclude_resource_rules = NULL; + } if (exclude_resource_rules) { cJSON *exclude_resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(exclude_resource_rules)){ @@ -183,6 +206,9 @@ v1beta1_match_resources_t *v1beta1_match_resources_parseFromJSON(cJSON *v1beta1_ // v1beta1_match_resources->match_policy cJSON *match_policy = cJSON_GetObjectItemCaseSensitive(v1beta1_match_resourcesJSON, "matchPolicy"); + if (cJSON_IsNull(match_policy)) { + match_policy = NULL; + } if (match_policy) { if(!cJSON_IsString(match_policy) && !cJSON_IsNull(match_policy)) { @@ -192,18 +218,27 @@ v1beta1_match_resources_t *v1beta1_match_resources_parseFromJSON(cJSON *v1beta1_ // v1beta1_match_resources->namespace_selector cJSON *namespace_selector = cJSON_GetObjectItemCaseSensitive(v1beta1_match_resourcesJSON, "namespaceSelector"); + if (cJSON_IsNull(namespace_selector)) { + namespace_selector = NULL; + } if (namespace_selector) { namespace_selector_local_nonprim = v1_label_selector_parseFromJSON(namespace_selector); //nonprimitive } // v1beta1_match_resources->object_selector cJSON *object_selector = cJSON_GetObjectItemCaseSensitive(v1beta1_match_resourcesJSON, "objectSelector"); + if (cJSON_IsNull(object_selector)) { + object_selector = NULL; + } if (object_selector) { object_selector_local_nonprim = v1_label_selector_parseFromJSON(object_selector); //nonprimitive } // v1beta1_match_resources->resource_rules cJSON *resource_rules = cJSON_GetObjectItemCaseSensitive(v1beta1_match_resourcesJSON, "resourceRules"); + if (cJSON_IsNull(resource_rules)) { + resource_rules = NULL; + } if (resource_rules) { cJSON *resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_rules)){ @@ -224,7 +259,7 @@ v1beta1_match_resources_t *v1beta1_match_resources_parseFromJSON(cJSON *v1beta1_ } - v1beta1_match_resources_local_var = v1beta1_match_resources_create ( + v1beta1_match_resources_local_var = v1beta1_match_resources_create_internal ( exclude_resource_rules ? exclude_resource_rulesList : NULL, match_policy && !cJSON_IsNull(match_policy) ? strdup(match_policy->valuestring) : NULL, namespace_selector ? namespace_selector_local_nonprim : NULL, diff --git a/kubernetes/model/v1beta1_match_resources.h b/kubernetes/model/v1beta1_match_resources.h index 6938a4d6..dc5b498e 100644 --- a/kubernetes/model/v1beta1_match_resources.h +++ b/kubernetes/model/v1beta1_match_resources.h @@ -27,9 +27,10 @@ typedef struct v1beta1_match_resources_t { struct v1_label_selector_t *object_selector; //model list_t *resource_rules; //nonprimitive container + int _library_owned; // Is the library responsible for freeing this object? } v1beta1_match_resources_t; -v1beta1_match_resources_t *v1beta1_match_resources_create( +__attribute__((deprecated)) v1beta1_match_resources_t *v1beta1_match_resources_create( list_t *exclude_resource_rules, char *match_policy, v1_label_selector_t *namespace_selector, diff --git a/kubernetes/model/v1beta1_mutating_admission_policy.c b/kubernetes/model/v1beta1_mutating_admission_policy.c new file mode 100644 index 00000000..dfae7f58 --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1beta1_mutating_admission_policy.h" + + + +static v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_mutating_admission_policy_spec_t *spec + ) { + v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy_local_var = malloc(sizeof(v1beta1_mutating_admission_policy_t)); + if (!v1beta1_mutating_admission_policy_local_var) { + return NULL; + } + v1beta1_mutating_admission_policy_local_var->api_version = api_version; + v1beta1_mutating_admission_policy_local_var->kind = kind; + v1beta1_mutating_admission_policy_local_var->metadata = metadata; + v1beta1_mutating_admission_policy_local_var->spec = spec; + + v1beta1_mutating_admission_policy_local_var->_library_owned = 1; + return v1beta1_mutating_admission_policy_local_var; +} + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_mutating_admission_policy_spec_t *spec + ) { + return v1beta1_mutating_admission_policy_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_mutating_admission_policy_free(v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy) { + if(NULL == v1beta1_mutating_admission_policy){ + return ; + } + if(v1beta1_mutating_admission_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_mutating_admission_policy_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_mutating_admission_policy->api_version) { + free(v1beta1_mutating_admission_policy->api_version); + v1beta1_mutating_admission_policy->api_version = NULL; + } + if (v1beta1_mutating_admission_policy->kind) { + free(v1beta1_mutating_admission_policy->kind); + v1beta1_mutating_admission_policy->kind = NULL; + } + if (v1beta1_mutating_admission_policy->metadata) { + v1_object_meta_free(v1beta1_mutating_admission_policy->metadata); + v1beta1_mutating_admission_policy->metadata = NULL; + } + if (v1beta1_mutating_admission_policy->spec) { + v1beta1_mutating_admission_policy_spec_free(v1beta1_mutating_admission_policy->spec); + v1beta1_mutating_admission_policy->spec = NULL; + } + free(v1beta1_mutating_admission_policy); +} + +cJSON *v1beta1_mutating_admission_policy_convertToJSON(v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_mutating_admission_policy->api_version + if(v1beta1_mutating_admission_policy->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_mutating_admission_policy->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy->kind + if(v1beta1_mutating_admission_policy->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_mutating_admission_policy->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy->metadata + if(v1beta1_mutating_admission_policy->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_mutating_admission_policy->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutating_admission_policy->spec + if(v1beta1_mutating_admission_policy->spec) { + cJSON *spec_local_JSON = v1beta1_mutating_admission_policy_spec_convertToJSON(v1beta1_mutating_admission_policy->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy_parseFromJSON(cJSON *v1beta1_mutating_admission_policyJSON){ + + v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy_local_var = NULL; + + // define the local variable for v1beta1_mutating_admission_policy->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_mutating_admission_policy->spec + v1beta1_mutating_admission_policy_spec_t *spec_local_nonprim = NULL; + + // v1beta1_mutating_admission_policy->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policyJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policyJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policyJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_mutating_admission_policy->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policyJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1beta1_mutating_admission_policy_spec_parseFromJSON(spec); //nonprimitive + } + + + v1beta1_mutating_admission_policy_local_var = v1beta1_mutating_admission_policy_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1beta1_mutating_admission_policy_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_mutating_admission_policy_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_mutating_admission_policy.h b/kubernetes/model/v1beta1_mutating_admission_policy.h new file mode 100644 index 00000000..2b701bda --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy.h @@ -0,0 +1,46 @@ +/* + * v1beta1_mutating_admission_policy.h + * + * MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. + */ + +#ifndef _v1beta1_mutating_admission_policy_H_ +#define _v1beta1_mutating_admission_policy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_mutating_admission_policy_t v1beta1_mutating_admission_policy_t; + +#include "v1_object_meta.h" +#include "v1beta1_mutating_admission_policy_spec.h" + + + +typedef struct v1beta1_mutating_admission_policy_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_mutating_admission_policy_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_mutating_admission_policy_t; + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_mutating_admission_policy_spec_t *spec +); + +void v1beta1_mutating_admission_policy_free(v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy); + +v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy_parseFromJSON(cJSON *v1beta1_mutating_admission_policyJSON); + +cJSON *v1beta1_mutating_admission_policy_convertToJSON(v1beta1_mutating_admission_policy_t *v1beta1_mutating_admission_policy); + +#endif /* _v1beta1_mutating_admission_policy_H_ */ + diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_binding.c b/kubernetes/model/v1beta1_mutating_admission_policy_binding.c new file mode 100644 index 00000000..f503cd5e --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_binding.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1beta1_mutating_admission_policy_binding.h" + + + +static v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_mutating_admission_policy_binding_spec_t *spec + ) { + v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding_local_var = malloc(sizeof(v1beta1_mutating_admission_policy_binding_t)); + if (!v1beta1_mutating_admission_policy_binding_local_var) { + return NULL; + } + v1beta1_mutating_admission_policy_binding_local_var->api_version = api_version; + v1beta1_mutating_admission_policy_binding_local_var->kind = kind; + v1beta1_mutating_admission_policy_binding_local_var->metadata = metadata; + v1beta1_mutating_admission_policy_binding_local_var->spec = spec; + + v1beta1_mutating_admission_policy_binding_local_var->_library_owned = 1; + return v1beta1_mutating_admission_policy_binding_local_var; +} + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_mutating_admission_policy_binding_spec_t *spec + ) { + return v1beta1_mutating_admission_policy_binding_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_mutating_admission_policy_binding_free(v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding) { + if(NULL == v1beta1_mutating_admission_policy_binding){ + return ; + } + if(v1beta1_mutating_admission_policy_binding->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_mutating_admission_policy_binding_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_mutating_admission_policy_binding->api_version) { + free(v1beta1_mutating_admission_policy_binding->api_version); + v1beta1_mutating_admission_policy_binding->api_version = NULL; + } + if (v1beta1_mutating_admission_policy_binding->kind) { + free(v1beta1_mutating_admission_policy_binding->kind); + v1beta1_mutating_admission_policy_binding->kind = NULL; + } + if (v1beta1_mutating_admission_policy_binding->metadata) { + v1_object_meta_free(v1beta1_mutating_admission_policy_binding->metadata); + v1beta1_mutating_admission_policy_binding->metadata = NULL; + } + if (v1beta1_mutating_admission_policy_binding->spec) { + v1beta1_mutating_admission_policy_binding_spec_free(v1beta1_mutating_admission_policy_binding->spec); + v1beta1_mutating_admission_policy_binding->spec = NULL; + } + free(v1beta1_mutating_admission_policy_binding); +} + +cJSON *v1beta1_mutating_admission_policy_binding_convertToJSON(v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_mutating_admission_policy_binding->api_version + if(v1beta1_mutating_admission_policy_binding->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_mutating_admission_policy_binding->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_binding->kind + if(v1beta1_mutating_admission_policy_binding->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_mutating_admission_policy_binding->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_binding->metadata + if(v1beta1_mutating_admission_policy_binding->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_mutating_admission_policy_binding->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutating_admission_policy_binding->spec + if(v1beta1_mutating_admission_policy_binding->spec) { + cJSON *spec_local_JSON = v1beta1_mutating_admission_policy_binding_spec_convertToJSON(v1beta1_mutating_admission_policy_binding->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_bindingJSON){ + + v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding_local_var = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_binding->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_binding->spec + v1beta1_mutating_admission_policy_binding_spec_t *spec_local_nonprim = NULL; + + // v1beta1_mutating_admission_policy_binding->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_bindingJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_binding->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_bindingJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_binding->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_bindingJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_mutating_admission_policy_binding->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_bindingJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1beta1_mutating_admission_policy_binding_spec_parseFromJSON(spec); //nonprimitive + } + + + v1beta1_mutating_admission_policy_binding_local_var = v1beta1_mutating_admission_policy_binding_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL + ); + + return v1beta1_mutating_admission_policy_binding_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_mutating_admission_policy_binding_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_binding.h b/kubernetes/model/v1beta1_mutating_admission_policy_binding.h new file mode 100644 index 00000000..f38ca3c2 --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_binding.h @@ -0,0 +1,46 @@ +/* + * v1beta1_mutating_admission_policy_binding.h + * + * MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters. For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget). Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget. + */ + +#ifndef _v1beta1_mutating_admission_policy_binding_H_ +#define _v1beta1_mutating_admission_policy_binding_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_mutating_admission_policy_binding_t v1beta1_mutating_admission_policy_binding_t; + +#include "v1_object_meta.h" +#include "v1beta1_mutating_admission_policy_binding_spec.h" + + + +typedef struct v1beta1_mutating_admission_policy_binding_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_mutating_admission_policy_binding_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_mutating_admission_policy_binding_t; + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_mutating_admission_policy_binding_spec_t *spec +); + +void v1beta1_mutating_admission_policy_binding_free(v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding); + +v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_bindingJSON); + +cJSON *v1beta1_mutating_admission_policy_binding_convertToJSON(v1beta1_mutating_admission_policy_binding_t *v1beta1_mutating_admission_policy_binding); + +#endif /* _v1beta1_mutating_admission_policy_binding_H_ */ + diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_binding_list.c b/kubernetes/model/v1beta1_mutating_admission_policy_binding_list.c new file mode 100644 index 00000000..fd303cfb --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_binding_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_mutating_admission_policy_binding_list.h" + + + +static v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list_local_var = malloc(sizeof(v1beta1_mutating_admission_policy_binding_list_t)); + if (!v1beta1_mutating_admission_policy_binding_list_local_var) { + return NULL; + } + v1beta1_mutating_admission_policy_binding_list_local_var->api_version = api_version; + v1beta1_mutating_admission_policy_binding_list_local_var->items = items; + v1beta1_mutating_admission_policy_binding_list_local_var->kind = kind; + v1beta1_mutating_admission_policy_binding_list_local_var->metadata = metadata; + + v1beta1_mutating_admission_policy_binding_list_local_var->_library_owned = 1; + return v1beta1_mutating_admission_policy_binding_list_local_var; +} + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_mutating_admission_policy_binding_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_mutating_admission_policy_binding_list_free(v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list) { + if(NULL == v1beta1_mutating_admission_policy_binding_list){ + return ; + } + if(v1beta1_mutating_admission_policy_binding_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_mutating_admission_policy_binding_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_mutating_admission_policy_binding_list->api_version) { + free(v1beta1_mutating_admission_policy_binding_list->api_version); + v1beta1_mutating_admission_policy_binding_list->api_version = NULL; + } + if (v1beta1_mutating_admission_policy_binding_list->items) { + list_ForEach(listEntry, v1beta1_mutating_admission_policy_binding_list->items) { + v1beta1_mutating_admission_policy_binding_free(listEntry->data); + } + list_freeList(v1beta1_mutating_admission_policy_binding_list->items); + v1beta1_mutating_admission_policy_binding_list->items = NULL; + } + if (v1beta1_mutating_admission_policy_binding_list->kind) { + free(v1beta1_mutating_admission_policy_binding_list->kind); + v1beta1_mutating_admission_policy_binding_list->kind = NULL; + } + if (v1beta1_mutating_admission_policy_binding_list->metadata) { + v1_list_meta_free(v1beta1_mutating_admission_policy_binding_list->metadata); + v1beta1_mutating_admission_policy_binding_list->metadata = NULL; + } + free(v1beta1_mutating_admission_policy_binding_list); +} + +cJSON *v1beta1_mutating_admission_policy_binding_list_convertToJSON(v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_mutating_admission_policy_binding_list->api_version + if(v1beta1_mutating_admission_policy_binding_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_mutating_admission_policy_binding_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_binding_list->items + if (!v1beta1_mutating_admission_policy_binding_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_mutating_admission_policy_binding_list->items) { + list_ForEach(itemsListEntry, v1beta1_mutating_admission_policy_binding_list->items) { + cJSON *itemLocal = v1beta1_mutating_admission_policy_binding_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_mutating_admission_policy_binding_list->kind + if(v1beta1_mutating_admission_policy_binding_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_mutating_admission_policy_binding_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_binding_list->metadata + if(v1beta1_mutating_admission_policy_binding_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_mutating_admission_policy_binding_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_binding_listJSON){ + + v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list_local_var = NULL; + + // define the local list for v1beta1_mutating_admission_policy_binding_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_binding_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_mutating_admission_policy_binding_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_binding_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_binding_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_binding_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_mutating_admission_policy_binding_t *itemsItem = v1beta1_mutating_admission_policy_binding_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_mutating_admission_policy_binding_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_binding_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_binding_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_binding_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_mutating_admission_policy_binding_list_local_var = v1beta1_mutating_admission_policy_binding_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_mutating_admission_policy_binding_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_mutating_admission_policy_binding_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_binding_list.h b/kubernetes/model/v1beta1_mutating_admission_policy_binding_list.h new file mode 100644 index 00000000..a5858a71 --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_binding_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_mutating_admission_policy_binding_list.h + * + * MutatingAdmissionPolicyBindingList is a list of MutatingAdmissionPolicyBinding. + */ + +#ifndef _v1beta1_mutating_admission_policy_binding_list_H_ +#define _v1beta1_mutating_admission_policy_binding_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_mutating_admission_policy_binding_list_t v1beta1_mutating_admission_policy_binding_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_mutating_admission_policy_binding.h" + + + +typedef struct v1beta1_mutating_admission_policy_binding_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_mutating_admission_policy_binding_list_t; + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_mutating_admission_policy_binding_list_free(v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list); + +v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_binding_listJSON); + +cJSON *v1beta1_mutating_admission_policy_binding_list_convertToJSON(v1beta1_mutating_admission_policy_binding_list_t *v1beta1_mutating_admission_policy_binding_list); + +#endif /* _v1beta1_mutating_admission_policy_binding_list_H_ */ + diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_binding_spec.c b/kubernetes/model/v1beta1_mutating_admission_policy_binding_spec.c new file mode 100644 index 00000000..0501ca41 --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_binding_spec.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include "v1beta1_mutating_admission_policy_binding_spec.h" + + + +static v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec_create_internal( + v1beta1_match_resources_t *match_resources, + v1beta1_param_ref_t *param_ref, + char *policy_name + ) { + v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec_local_var = malloc(sizeof(v1beta1_mutating_admission_policy_binding_spec_t)); + if (!v1beta1_mutating_admission_policy_binding_spec_local_var) { + return NULL; + } + v1beta1_mutating_admission_policy_binding_spec_local_var->match_resources = match_resources; + v1beta1_mutating_admission_policy_binding_spec_local_var->param_ref = param_ref; + v1beta1_mutating_admission_policy_binding_spec_local_var->policy_name = policy_name; + + v1beta1_mutating_admission_policy_binding_spec_local_var->_library_owned = 1; + return v1beta1_mutating_admission_policy_binding_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec_create( + v1beta1_match_resources_t *match_resources, + v1beta1_param_ref_t *param_ref, + char *policy_name + ) { + return v1beta1_mutating_admission_policy_binding_spec_create_internal ( + match_resources, + param_ref, + policy_name + ); +} + +void v1beta1_mutating_admission_policy_binding_spec_free(v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec) { + if(NULL == v1beta1_mutating_admission_policy_binding_spec){ + return ; + } + if(v1beta1_mutating_admission_policy_binding_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_mutating_admission_policy_binding_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_mutating_admission_policy_binding_spec->match_resources) { + v1beta1_match_resources_free(v1beta1_mutating_admission_policy_binding_spec->match_resources); + v1beta1_mutating_admission_policy_binding_spec->match_resources = NULL; + } + if (v1beta1_mutating_admission_policy_binding_spec->param_ref) { + v1beta1_param_ref_free(v1beta1_mutating_admission_policy_binding_spec->param_ref); + v1beta1_mutating_admission_policy_binding_spec->param_ref = NULL; + } + if (v1beta1_mutating_admission_policy_binding_spec->policy_name) { + free(v1beta1_mutating_admission_policy_binding_spec->policy_name); + v1beta1_mutating_admission_policy_binding_spec->policy_name = NULL; + } + free(v1beta1_mutating_admission_policy_binding_spec); +} + +cJSON *v1beta1_mutating_admission_policy_binding_spec_convertToJSON(v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_mutating_admission_policy_binding_spec->match_resources + if(v1beta1_mutating_admission_policy_binding_spec->match_resources) { + cJSON *match_resources_local_JSON = v1beta1_match_resources_convertToJSON(v1beta1_mutating_admission_policy_binding_spec->match_resources); + if(match_resources_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "matchResources", match_resources_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutating_admission_policy_binding_spec->param_ref + if(v1beta1_mutating_admission_policy_binding_spec->param_ref) { + cJSON *param_ref_local_JSON = v1beta1_param_ref_convertToJSON(v1beta1_mutating_admission_policy_binding_spec->param_ref); + if(param_ref_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "paramRef", param_ref_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutating_admission_policy_binding_spec->policy_name + if(v1beta1_mutating_admission_policy_binding_spec->policy_name) { + if(cJSON_AddStringToObject(item, "policyName", v1beta1_mutating_admission_policy_binding_spec->policy_name) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_binding_specJSON){ + + v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec_local_var = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_binding_spec->match_resources + v1beta1_match_resources_t *match_resources_local_nonprim = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_binding_spec->param_ref + v1beta1_param_ref_t *param_ref_local_nonprim = NULL; + + // v1beta1_mutating_admission_policy_binding_spec->match_resources + cJSON *match_resources = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_binding_specJSON, "matchResources"); + if (cJSON_IsNull(match_resources)) { + match_resources = NULL; + } + if (match_resources) { + match_resources_local_nonprim = v1beta1_match_resources_parseFromJSON(match_resources); //nonprimitive + } + + // v1beta1_mutating_admission_policy_binding_spec->param_ref + cJSON *param_ref = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_binding_specJSON, "paramRef"); + if (cJSON_IsNull(param_ref)) { + param_ref = NULL; + } + if (param_ref) { + param_ref_local_nonprim = v1beta1_param_ref_parseFromJSON(param_ref); //nonprimitive + } + + // v1beta1_mutating_admission_policy_binding_spec->policy_name + cJSON *policy_name = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_binding_specJSON, "policyName"); + if (cJSON_IsNull(policy_name)) { + policy_name = NULL; + } + if (policy_name) { + if(!cJSON_IsString(policy_name) && !cJSON_IsNull(policy_name)) + { + goto end; //String + } + } + + + v1beta1_mutating_admission_policy_binding_spec_local_var = v1beta1_mutating_admission_policy_binding_spec_create_internal ( + match_resources ? match_resources_local_nonprim : NULL, + param_ref ? param_ref_local_nonprim : NULL, + policy_name && !cJSON_IsNull(policy_name) ? strdup(policy_name->valuestring) : NULL + ); + + return v1beta1_mutating_admission_policy_binding_spec_local_var; +end: + if (match_resources_local_nonprim) { + v1beta1_match_resources_free(match_resources_local_nonprim); + match_resources_local_nonprim = NULL; + } + if (param_ref_local_nonprim) { + v1beta1_param_ref_free(param_ref_local_nonprim); + param_ref_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_binding_spec.h b/kubernetes/model/v1beta1_mutating_admission_policy_binding_spec.h new file mode 100644 index 00000000..efe41a66 --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_binding_spec.h @@ -0,0 +1,44 @@ +/* + * v1beta1_mutating_admission_policy_binding_spec.h + * + * MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding. + */ + +#ifndef _v1beta1_mutating_admission_policy_binding_spec_H_ +#define _v1beta1_mutating_admission_policy_binding_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_mutating_admission_policy_binding_spec_t v1beta1_mutating_admission_policy_binding_spec_t; + +#include "v1beta1_match_resources.h" +#include "v1beta1_param_ref.h" + + + +typedef struct v1beta1_mutating_admission_policy_binding_spec_t { + struct v1beta1_match_resources_t *match_resources; //model + struct v1beta1_param_ref_t *param_ref; //model + char *policy_name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_mutating_admission_policy_binding_spec_t; + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec_create( + v1beta1_match_resources_t *match_resources, + v1beta1_param_ref_t *param_ref, + char *policy_name +); + +void v1beta1_mutating_admission_policy_binding_spec_free(v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec); + +v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_binding_specJSON); + +cJSON *v1beta1_mutating_admission_policy_binding_spec_convertToJSON(v1beta1_mutating_admission_policy_binding_spec_t *v1beta1_mutating_admission_policy_binding_spec); + +#endif /* _v1beta1_mutating_admission_policy_binding_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_list.c b/kubernetes/model/v1beta1_mutating_admission_policy_list.c new file mode 100644 index 00000000..7232e7eb --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_mutating_admission_policy_list.h" + + + +static v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list_local_var = malloc(sizeof(v1beta1_mutating_admission_policy_list_t)); + if (!v1beta1_mutating_admission_policy_list_local_var) { + return NULL; + } + v1beta1_mutating_admission_policy_list_local_var->api_version = api_version; + v1beta1_mutating_admission_policy_list_local_var->items = items; + v1beta1_mutating_admission_policy_list_local_var->kind = kind; + v1beta1_mutating_admission_policy_list_local_var->metadata = metadata; + + v1beta1_mutating_admission_policy_list_local_var->_library_owned = 1; + return v1beta1_mutating_admission_policy_list_local_var; +} + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_mutating_admission_policy_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_mutating_admission_policy_list_free(v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list) { + if(NULL == v1beta1_mutating_admission_policy_list){ + return ; + } + if(v1beta1_mutating_admission_policy_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_mutating_admission_policy_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_mutating_admission_policy_list->api_version) { + free(v1beta1_mutating_admission_policy_list->api_version); + v1beta1_mutating_admission_policy_list->api_version = NULL; + } + if (v1beta1_mutating_admission_policy_list->items) { + list_ForEach(listEntry, v1beta1_mutating_admission_policy_list->items) { + v1beta1_mutating_admission_policy_free(listEntry->data); + } + list_freeList(v1beta1_mutating_admission_policy_list->items); + v1beta1_mutating_admission_policy_list->items = NULL; + } + if (v1beta1_mutating_admission_policy_list->kind) { + free(v1beta1_mutating_admission_policy_list->kind); + v1beta1_mutating_admission_policy_list->kind = NULL; + } + if (v1beta1_mutating_admission_policy_list->metadata) { + v1_list_meta_free(v1beta1_mutating_admission_policy_list->metadata); + v1beta1_mutating_admission_policy_list->metadata = NULL; + } + free(v1beta1_mutating_admission_policy_list); +} + +cJSON *v1beta1_mutating_admission_policy_list_convertToJSON(v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_mutating_admission_policy_list->api_version + if(v1beta1_mutating_admission_policy_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_mutating_admission_policy_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_list->items + if (!v1beta1_mutating_admission_policy_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_mutating_admission_policy_list->items) { + list_ForEach(itemsListEntry, v1beta1_mutating_admission_policy_list->items) { + cJSON *itemLocal = v1beta1_mutating_admission_policy_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_mutating_admission_policy_list->kind + if(v1beta1_mutating_admission_policy_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_mutating_admission_policy_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_list->metadata + if(v1beta1_mutating_admission_policy_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_mutating_admission_policy_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_listJSON){ + + v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list_local_var = NULL; + + // define the local list for v1beta1_mutating_admission_policy_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_mutating_admission_policy_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_mutating_admission_policy_t *itemsItem = v1beta1_mutating_admission_policy_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_mutating_admission_policy_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_mutating_admission_policy_list_local_var = v1beta1_mutating_admission_policy_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_mutating_admission_policy_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_mutating_admission_policy_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_list.h b/kubernetes/model/v1beta1_mutating_admission_policy_list.h new file mode 100644 index 00000000..d8e3cc2c --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_mutating_admission_policy_list.h + * + * MutatingAdmissionPolicyList is a list of MutatingAdmissionPolicy. + */ + +#ifndef _v1beta1_mutating_admission_policy_list_H_ +#define _v1beta1_mutating_admission_policy_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_mutating_admission_policy_list_t v1beta1_mutating_admission_policy_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_mutating_admission_policy.h" + + + +typedef struct v1beta1_mutating_admission_policy_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_mutating_admission_policy_list_t; + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_mutating_admission_policy_list_free(v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list); + +v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_listJSON); + +cJSON *v1beta1_mutating_admission_policy_list_convertToJSON(v1beta1_mutating_admission_policy_list_t *v1beta1_mutating_admission_policy_list); + +#endif /* _v1beta1_mutating_admission_policy_list_H_ */ + diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_spec.c b/kubernetes/model/v1beta1_mutating_admission_policy_spec.c new file mode 100644 index 00000000..fce01b4b --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_spec.c @@ -0,0 +1,397 @@ +#include +#include +#include +#include "v1beta1_mutating_admission_policy_spec.h" + + + +static v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec_create_internal( + char *failure_policy, + list_t *match_conditions, + v1beta1_match_resources_t *match_constraints, + list_t *mutations, + v1beta1_param_kind_t *param_kind, + char *reinvocation_policy, + list_t *variables + ) { + v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec_local_var = malloc(sizeof(v1beta1_mutating_admission_policy_spec_t)); + if (!v1beta1_mutating_admission_policy_spec_local_var) { + return NULL; + } + v1beta1_mutating_admission_policy_spec_local_var->failure_policy = failure_policy; + v1beta1_mutating_admission_policy_spec_local_var->match_conditions = match_conditions; + v1beta1_mutating_admission_policy_spec_local_var->match_constraints = match_constraints; + v1beta1_mutating_admission_policy_spec_local_var->mutations = mutations; + v1beta1_mutating_admission_policy_spec_local_var->param_kind = param_kind; + v1beta1_mutating_admission_policy_spec_local_var->reinvocation_policy = reinvocation_policy; + v1beta1_mutating_admission_policy_spec_local_var->variables = variables; + + v1beta1_mutating_admission_policy_spec_local_var->_library_owned = 1; + return v1beta1_mutating_admission_policy_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec_create( + char *failure_policy, + list_t *match_conditions, + v1beta1_match_resources_t *match_constraints, + list_t *mutations, + v1beta1_param_kind_t *param_kind, + char *reinvocation_policy, + list_t *variables + ) { + return v1beta1_mutating_admission_policy_spec_create_internal ( + failure_policy, + match_conditions, + match_constraints, + mutations, + param_kind, + reinvocation_policy, + variables + ); +} + +void v1beta1_mutating_admission_policy_spec_free(v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec) { + if(NULL == v1beta1_mutating_admission_policy_spec){ + return ; + } + if(v1beta1_mutating_admission_policy_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_mutating_admission_policy_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_mutating_admission_policy_spec->failure_policy) { + free(v1beta1_mutating_admission_policy_spec->failure_policy); + v1beta1_mutating_admission_policy_spec->failure_policy = NULL; + } + if (v1beta1_mutating_admission_policy_spec->match_conditions) { + list_ForEach(listEntry, v1beta1_mutating_admission_policy_spec->match_conditions) { + v1beta1_match_condition_free(listEntry->data); + } + list_freeList(v1beta1_mutating_admission_policy_spec->match_conditions); + v1beta1_mutating_admission_policy_spec->match_conditions = NULL; + } + if (v1beta1_mutating_admission_policy_spec->match_constraints) { + v1beta1_match_resources_free(v1beta1_mutating_admission_policy_spec->match_constraints); + v1beta1_mutating_admission_policy_spec->match_constraints = NULL; + } + if (v1beta1_mutating_admission_policy_spec->mutations) { + list_ForEach(listEntry, v1beta1_mutating_admission_policy_spec->mutations) { + v1beta1_mutation_free(listEntry->data); + } + list_freeList(v1beta1_mutating_admission_policy_spec->mutations); + v1beta1_mutating_admission_policy_spec->mutations = NULL; + } + if (v1beta1_mutating_admission_policy_spec->param_kind) { + v1beta1_param_kind_free(v1beta1_mutating_admission_policy_spec->param_kind); + v1beta1_mutating_admission_policy_spec->param_kind = NULL; + } + if (v1beta1_mutating_admission_policy_spec->reinvocation_policy) { + free(v1beta1_mutating_admission_policy_spec->reinvocation_policy); + v1beta1_mutating_admission_policy_spec->reinvocation_policy = NULL; + } + if (v1beta1_mutating_admission_policy_spec->variables) { + list_ForEach(listEntry, v1beta1_mutating_admission_policy_spec->variables) { + v1beta1_variable_free(listEntry->data); + } + list_freeList(v1beta1_mutating_admission_policy_spec->variables); + v1beta1_mutating_admission_policy_spec->variables = NULL; + } + free(v1beta1_mutating_admission_policy_spec); +} + +cJSON *v1beta1_mutating_admission_policy_spec_convertToJSON(v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_mutating_admission_policy_spec->failure_policy + if(v1beta1_mutating_admission_policy_spec->failure_policy) { + if(cJSON_AddStringToObject(item, "failurePolicy", v1beta1_mutating_admission_policy_spec->failure_policy) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_spec->match_conditions + if(v1beta1_mutating_admission_policy_spec->match_conditions) { + cJSON *match_conditions = cJSON_AddArrayToObject(item, "matchConditions"); + if(match_conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *match_conditionsListEntry; + if (v1beta1_mutating_admission_policy_spec->match_conditions) { + list_ForEach(match_conditionsListEntry, v1beta1_mutating_admission_policy_spec->match_conditions) { + cJSON *itemLocal = v1beta1_match_condition_convertToJSON(match_conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(match_conditions, itemLocal); + } + } + } + + + // v1beta1_mutating_admission_policy_spec->match_constraints + if(v1beta1_mutating_admission_policy_spec->match_constraints) { + cJSON *match_constraints_local_JSON = v1beta1_match_resources_convertToJSON(v1beta1_mutating_admission_policy_spec->match_constraints); + if(match_constraints_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "matchConstraints", match_constraints_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutating_admission_policy_spec->mutations + if(v1beta1_mutating_admission_policy_spec->mutations) { + cJSON *mutations = cJSON_AddArrayToObject(item, "mutations"); + if(mutations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *mutationsListEntry; + if (v1beta1_mutating_admission_policy_spec->mutations) { + list_ForEach(mutationsListEntry, v1beta1_mutating_admission_policy_spec->mutations) { + cJSON *itemLocal = v1beta1_mutation_convertToJSON(mutationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(mutations, itemLocal); + } + } + } + + + // v1beta1_mutating_admission_policy_spec->param_kind + if(v1beta1_mutating_admission_policy_spec->param_kind) { + cJSON *param_kind_local_JSON = v1beta1_param_kind_convertToJSON(v1beta1_mutating_admission_policy_spec->param_kind); + if(param_kind_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "paramKind", param_kind_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutating_admission_policy_spec->reinvocation_policy + if(v1beta1_mutating_admission_policy_spec->reinvocation_policy) { + if(cJSON_AddStringToObject(item, "reinvocationPolicy", v1beta1_mutating_admission_policy_spec->reinvocation_policy) == NULL) { + goto fail; //String + } + } + + + // v1beta1_mutating_admission_policy_spec->variables + if(v1beta1_mutating_admission_policy_spec->variables) { + cJSON *variables = cJSON_AddArrayToObject(item, "variables"); + if(variables == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *variablesListEntry; + if (v1beta1_mutating_admission_policy_spec->variables) { + list_ForEach(variablesListEntry, v1beta1_mutating_admission_policy_spec->variables) { + cJSON *itemLocal = v1beta1_variable_convertToJSON(variablesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(variables, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_specJSON){ + + v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec_local_var = NULL; + + // define the local list for v1beta1_mutating_admission_policy_spec->match_conditions + list_t *match_conditionsList = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_spec->match_constraints + v1beta1_match_resources_t *match_constraints_local_nonprim = NULL; + + // define the local list for v1beta1_mutating_admission_policy_spec->mutations + list_t *mutationsList = NULL; + + // define the local variable for v1beta1_mutating_admission_policy_spec->param_kind + v1beta1_param_kind_t *param_kind_local_nonprim = NULL; + + // define the local list for v1beta1_mutating_admission_policy_spec->variables + list_t *variablesList = NULL; + + // v1beta1_mutating_admission_policy_spec->failure_policy + cJSON *failure_policy = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_specJSON, "failurePolicy"); + if (cJSON_IsNull(failure_policy)) { + failure_policy = NULL; + } + if (failure_policy) { + if(!cJSON_IsString(failure_policy) && !cJSON_IsNull(failure_policy)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_spec->match_conditions + cJSON *match_conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_specJSON, "matchConditions"); + if (cJSON_IsNull(match_conditions)) { + match_conditions = NULL; + } + if (match_conditions) { + cJSON *match_conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(match_conditions)){ + goto end; //nonprimitive container + } + + match_conditionsList = list_createList(); + + cJSON_ArrayForEach(match_conditions_local_nonprimitive,match_conditions ) + { + if(!cJSON_IsObject(match_conditions_local_nonprimitive)){ + goto end; + } + v1beta1_match_condition_t *match_conditionsItem = v1beta1_match_condition_parseFromJSON(match_conditions_local_nonprimitive); + + list_addElement(match_conditionsList, match_conditionsItem); + } + } + + // v1beta1_mutating_admission_policy_spec->match_constraints + cJSON *match_constraints = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_specJSON, "matchConstraints"); + if (cJSON_IsNull(match_constraints)) { + match_constraints = NULL; + } + if (match_constraints) { + match_constraints_local_nonprim = v1beta1_match_resources_parseFromJSON(match_constraints); //nonprimitive + } + + // v1beta1_mutating_admission_policy_spec->mutations + cJSON *mutations = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_specJSON, "mutations"); + if (cJSON_IsNull(mutations)) { + mutations = NULL; + } + if (mutations) { + cJSON *mutations_local_nonprimitive = NULL; + if(!cJSON_IsArray(mutations)){ + goto end; //nonprimitive container + } + + mutationsList = list_createList(); + + cJSON_ArrayForEach(mutations_local_nonprimitive,mutations ) + { + if(!cJSON_IsObject(mutations_local_nonprimitive)){ + goto end; + } + v1beta1_mutation_t *mutationsItem = v1beta1_mutation_parseFromJSON(mutations_local_nonprimitive); + + list_addElement(mutationsList, mutationsItem); + } + } + + // v1beta1_mutating_admission_policy_spec->param_kind + cJSON *param_kind = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_specJSON, "paramKind"); + if (cJSON_IsNull(param_kind)) { + param_kind = NULL; + } + if (param_kind) { + param_kind_local_nonprim = v1beta1_param_kind_parseFromJSON(param_kind); //nonprimitive + } + + // v1beta1_mutating_admission_policy_spec->reinvocation_policy + cJSON *reinvocation_policy = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_specJSON, "reinvocationPolicy"); + if (cJSON_IsNull(reinvocation_policy)) { + reinvocation_policy = NULL; + } + if (reinvocation_policy) { + if(!cJSON_IsString(reinvocation_policy) && !cJSON_IsNull(reinvocation_policy)) + { + goto end; //String + } + } + + // v1beta1_mutating_admission_policy_spec->variables + cJSON *variables = cJSON_GetObjectItemCaseSensitive(v1beta1_mutating_admission_policy_specJSON, "variables"); + if (cJSON_IsNull(variables)) { + variables = NULL; + } + if (variables) { + cJSON *variables_local_nonprimitive = NULL; + if(!cJSON_IsArray(variables)){ + goto end; //nonprimitive container + } + + variablesList = list_createList(); + + cJSON_ArrayForEach(variables_local_nonprimitive,variables ) + { + if(!cJSON_IsObject(variables_local_nonprimitive)){ + goto end; + } + v1beta1_variable_t *variablesItem = v1beta1_variable_parseFromJSON(variables_local_nonprimitive); + + list_addElement(variablesList, variablesItem); + } + } + + + v1beta1_mutating_admission_policy_spec_local_var = v1beta1_mutating_admission_policy_spec_create_internal ( + failure_policy && !cJSON_IsNull(failure_policy) ? strdup(failure_policy->valuestring) : NULL, + match_conditions ? match_conditionsList : NULL, + match_constraints ? match_constraints_local_nonprim : NULL, + mutations ? mutationsList : NULL, + param_kind ? param_kind_local_nonprim : NULL, + reinvocation_policy && !cJSON_IsNull(reinvocation_policy) ? strdup(reinvocation_policy->valuestring) : NULL, + variables ? variablesList : NULL + ); + + return v1beta1_mutating_admission_policy_spec_local_var; +end: + if (match_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_conditionsList) { + v1beta1_match_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(match_conditionsList); + match_conditionsList = NULL; + } + if (match_constraints_local_nonprim) { + v1beta1_match_resources_free(match_constraints_local_nonprim); + match_constraints_local_nonprim = NULL; + } + if (mutationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, mutationsList) { + v1beta1_mutation_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(mutationsList); + mutationsList = NULL; + } + if (param_kind_local_nonprim) { + v1beta1_param_kind_free(param_kind_local_nonprim); + param_kind_local_nonprim = NULL; + } + if (variablesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, variablesList) { + v1beta1_variable_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(variablesList); + variablesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_mutating_admission_policy_spec.h b/kubernetes/model/v1beta1_mutating_admission_policy_spec.h new file mode 100644 index 00000000..a2956643 --- /dev/null +++ b/kubernetes/model/v1beta1_mutating_admission_policy_spec.h @@ -0,0 +1,55 @@ +/* + * v1beta1_mutating_admission_policy_spec.h + * + * MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy. + */ + +#ifndef _v1beta1_mutating_admission_policy_spec_H_ +#define _v1beta1_mutating_admission_policy_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_mutating_admission_policy_spec_t v1beta1_mutating_admission_policy_spec_t; + +#include "v1beta1_match_condition.h" +#include "v1beta1_match_resources.h" +#include "v1beta1_mutation.h" +#include "v1beta1_param_kind.h" +#include "v1beta1_variable.h" + + + +typedef struct v1beta1_mutating_admission_policy_spec_t { + char *failure_policy; // string + list_t *match_conditions; //nonprimitive container + struct v1beta1_match_resources_t *match_constraints; //model + list_t *mutations; //nonprimitive container + struct v1beta1_param_kind_t *param_kind; //model + char *reinvocation_policy; // string + list_t *variables; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_mutating_admission_policy_spec_t; + +__attribute__((deprecated)) v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec_create( + char *failure_policy, + list_t *match_conditions, + v1beta1_match_resources_t *match_constraints, + list_t *mutations, + v1beta1_param_kind_t *param_kind, + char *reinvocation_policy, + list_t *variables +); + +void v1beta1_mutating_admission_policy_spec_free(v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec); + +v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec_parseFromJSON(cJSON *v1beta1_mutating_admission_policy_specJSON); + +cJSON *v1beta1_mutating_admission_policy_spec_convertToJSON(v1beta1_mutating_admission_policy_spec_t *v1beta1_mutating_admission_policy_spec); + +#endif /* _v1beta1_mutating_admission_policy_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_mutation.c b/kubernetes/model/v1beta1_mutation.c new file mode 100644 index 00000000..f2638a4e --- /dev/null +++ b/kubernetes/model/v1beta1_mutation.c @@ -0,0 +1,168 @@ +#include +#include +#include +#include "v1beta1_mutation.h" + + + +static v1beta1_mutation_t *v1beta1_mutation_create_internal( + v1beta1_apply_configuration_t *apply_configuration, + v1beta1_json_patch_t *json_patch, + char *patch_type + ) { + v1beta1_mutation_t *v1beta1_mutation_local_var = malloc(sizeof(v1beta1_mutation_t)); + if (!v1beta1_mutation_local_var) { + return NULL; + } + v1beta1_mutation_local_var->apply_configuration = apply_configuration; + v1beta1_mutation_local_var->json_patch = json_patch; + v1beta1_mutation_local_var->patch_type = patch_type; + + v1beta1_mutation_local_var->_library_owned = 1; + return v1beta1_mutation_local_var; +} + +__attribute__((deprecated)) v1beta1_mutation_t *v1beta1_mutation_create( + v1beta1_apply_configuration_t *apply_configuration, + v1beta1_json_patch_t *json_patch, + char *patch_type + ) { + return v1beta1_mutation_create_internal ( + apply_configuration, + json_patch, + patch_type + ); +} + +void v1beta1_mutation_free(v1beta1_mutation_t *v1beta1_mutation) { + if(NULL == v1beta1_mutation){ + return ; + } + if(v1beta1_mutation->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_mutation_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_mutation->apply_configuration) { + v1beta1_apply_configuration_free(v1beta1_mutation->apply_configuration); + v1beta1_mutation->apply_configuration = NULL; + } + if (v1beta1_mutation->json_patch) { + v1beta1_json_patch_free(v1beta1_mutation->json_patch); + v1beta1_mutation->json_patch = NULL; + } + if (v1beta1_mutation->patch_type) { + free(v1beta1_mutation->patch_type); + v1beta1_mutation->patch_type = NULL; + } + free(v1beta1_mutation); +} + +cJSON *v1beta1_mutation_convertToJSON(v1beta1_mutation_t *v1beta1_mutation) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_mutation->apply_configuration + if(v1beta1_mutation->apply_configuration) { + cJSON *apply_configuration_local_JSON = v1beta1_apply_configuration_convertToJSON(v1beta1_mutation->apply_configuration); + if(apply_configuration_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "applyConfiguration", apply_configuration_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutation->json_patch + if(v1beta1_mutation->json_patch) { + cJSON *json_patch_local_JSON = v1beta1_json_patch_convertToJSON(v1beta1_mutation->json_patch); + if(json_patch_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "jsonPatch", json_patch_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_mutation->patch_type + if (!v1beta1_mutation->patch_type) { + goto fail; + } + if(cJSON_AddStringToObject(item, "patchType", v1beta1_mutation->patch_type) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_mutation_t *v1beta1_mutation_parseFromJSON(cJSON *v1beta1_mutationJSON){ + + v1beta1_mutation_t *v1beta1_mutation_local_var = NULL; + + // define the local variable for v1beta1_mutation->apply_configuration + v1beta1_apply_configuration_t *apply_configuration_local_nonprim = NULL; + + // define the local variable for v1beta1_mutation->json_patch + v1beta1_json_patch_t *json_patch_local_nonprim = NULL; + + // v1beta1_mutation->apply_configuration + cJSON *apply_configuration = cJSON_GetObjectItemCaseSensitive(v1beta1_mutationJSON, "applyConfiguration"); + if (cJSON_IsNull(apply_configuration)) { + apply_configuration = NULL; + } + if (apply_configuration) { + apply_configuration_local_nonprim = v1beta1_apply_configuration_parseFromJSON(apply_configuration); //nonprimitive + } + + // v1beta1_mutation->json_patch + cJSON *json_patch = cJSON_GetObjectItemCaseSensitive(v1beta1_mutationJSON, "jsonPatch"); + if (cJSON_IsNull(json_patch)) { + json_patch = NULL; + } + if (json_patch) { + json_patch_local_nonprim = v1beta1_json_patch_parseFromJSON(json_patch); //nonprimitive + } + + // v1beta1_mutation->patch_type + cJSON *patch_type = cJSON_GetObjectItemCaseSensitive(v1beta1_mutationJSON, "patchType"); + if (cJSON_IsNull(patch_type)) { + patch_type = NULL; + } + if (!patch_type) { + goto end; + } + + + if(!cJSON_IsString(patch_type)) + { + goto end; //String + } + + + v1beta1_mutation_local_var = v1beta1_mutation_create_internal ( + apply_configuration ? apply_configuration_local_nonprim : NULL, + json_patch ? json_patch_local_nonprim : NULL, + strdup(patch_type->valuestring) + ); + + return v1beta1_mutation_local_var; +end: + if (apply_configuration_local_nonprim) { + v1beta1_apply_configuration_free(apply_configuration_local_nonprim); + apply_configuration_local_nonprim = NULL; + } + if (json_patch_local_nonprim) { + v1beta1_json_patch_free(json_patch_local_nonprim); + json_patch_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_mutation.h b/kubernetes/model/v1beta1_mutation.h new file mode 100644 index 00000000..7e96ea29 --- /dev/null +++ b/kubernetes/model/v1beta1_mutation.h @@ -0,0 +1,44 @@ +/* + * v1beta1_mutation.h + * + * Mutation specifies the CEL expression which is used to apply the Mutation. + */ + +#ifndef _v1beta1_mutation_H_ +#define _v1beta1_mutation_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_mutation_t v1beta1_mutation_t; + +#include "v1beta1_apply_configuration.h" +#include "v1beta1_json_patch.h" + + + +typedef struct v1beta1_mutation_t { + struct v1beta1_apply_configuration_t *apply_configuration; //model + struct v1beta1_json_patch_t *json_patch; //model + char *patch_type; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_mutation_t; + +__attribute__((deprecated)) v1beta1_mutation_t *v1beta1_mutation_create( + v1beta1_apply_configuration_t *apply_configuration, + v1beta1_json_patch_t *json_patch, + char *patch_type +); + +void v1beta1_mutation_free(v1beta1_mutation_t *v1beta1_mutation); + +v1beta1_mutation_t *v1beta1_mutation_parseFromJSON(cJSON *v1beta1_mutationJSON); + +cJSON *v1beta1_mutation_convertToJSON(v1beta1_mutation_t *v1beta1_mutation); + +#endif /* _v1beta1_mutation_H_ */ + diff --git a/kubernetes/model/v1beta1_named_rule_with_operations.c b/kubernetes/model/v1beta1_named_rule_with_operations.c index 7e69a404..2b729db9 100644 --- a/kubernetes/model/v1beta1_named_rule_with_operations.c +++ b/kubernetes/model/v1beta1_named_rule_with_operations.c @@ -5,7 +5,7 @@ -v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_create( +static v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_create_internal( list_t *api_groups, list_t *api_versions, list_t *operations, @@ -24,14 +24,36 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_create( v1beta1_named_rule_with_operations_local_var->resources = resources; v1beta1_named_rule_with_operations_local_var->scope = scope; + v1beta1_named_rule_with_operations_local_var->_library_owned = 1; return v1beta1_named_rule_with_operations_local_var; } +__attribute__((deprecated)) v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_create( + list_t *api_groups, + list_t *api_versions, + list_t *operations, + list_t *resource_names, + list_t *resources, + char *scope + ) { + return v1beta1_named_rule_with_operations_create_internal ( + api_groups, + api_versions, + operations, + resource_names, + resources, + scope + ); +} void v1beta1_named_rule_with_operations_free(v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations) { if(NULL == v1beta1_named_rule_with_operations){ return ; } + if(v1beta1_named_rule_with_operations->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_named_rule_with_operations_free"); + return ; + } listEntry_t *listEntry; if (v1beta1_named_rule_with_operations->api_groups) { list_ForEach(listEntry, v1beta1_named_rule_with_operations->api_groups) { @@ -87,7 +109,7 @@ cJSON *v1beta1_named_rule_with_operations_convertToJSON(v1beta1_named_rule_with_ listEntry_t *api_groupsListEntry; list_ForEach(api_groupsListEntry, v1beta1_named_rule_with_operations->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_groups, "", api_groupsListEntry->data) == NULL) { goto fail; } @@ -104,7 +126,7 @@ cJSON *v1beta1_named_rule_with_operations_convertToJSON(v1beta1_named_rule_with_ listEntry_t *api_versionsListEntry; list_ForEach(api_versionsListEntry, v1beta1_named_rule_with_operations->api_versions) { - if(cJSON_AddStringToObject(api_versions, "", (char*)api_versionsListEntry->data) == NULL) + if(cJSON_AddStringToObject(api_versions, "", api_versionsListEntry->data) == NULL) { goto fail; } @@ -121,7 +143,7 @@ cJSON *v1beta1_named_rule_with_operations_convertToJSON(v1beta1_named_rule_with_ listEntry_t *operationsListEntry; list_ForEach(operationsListEntry, v1beta1_named_rule_with_operations->operations) { - if(cJSON_AddStringToObject(operations, "", (char*)operationsListEntry->data) == NULL) + if(cJSON_AddStringToObject(operations, "", operationsListEntry->data) == NULL) { goto fail; } @@ -138,7 +160,7 @@ cJSON *v1beta1_named_rule_with_operations_convertToJSON(v1beta1_named_rule_with_ listEntry_t *resource_namesListEntry; list_ForEach(resource_namesListEntry, v1beta1_named_rule_with_operations->resource_names) { - if(cJSON_AddStringToObject(resource_names, "", (char*)resource_namesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resource_names, "", resource_namesListEntry->data) == NULL) { goto fail; } @@ -155,7 +177,7 @@ cJSON *v1beta1_named_rule_with_operations_convertToJSON(v1beta1_named_rule_with_ listEntry_t *resourcesListEntry; list_ForEach(resourcesListEntry, v1beta1_named_rule_with_operations->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) + if(cJSON_AddStringToObject(resources, "", resourcesListEntry->data) == NULL) { goto fail; } @@ -199,6 +221,9 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_parseFr // v1beta1_named_rule_with_operations->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1beta1_named_rule_with_operationsJSON, "apiGroups"); + if (cJSON_IsNull(api_groups)) { + api_groups = NULL; + } if (api_groups) { cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { @@ -218,6 +243,9 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_parseFr // v1beta1_named_rule_with_operations->api_versions cJSON *api_versions = cJSON_GetObjectItemCaseSensitive(v1beta1_named_rule_with_operationsJSON, "apiVersions"); + if (cJSON_IsNull(api_versions)) { + api_versions = NULL; + } if (api_versions) { cJSON *api_versions_local = NULL; if(!cJSON_IsArray(api_versions)) { @@ -237,6 +265,9 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_parseFr // v1beta1_named_rule_with_operations->operations cJSON *operations = cJSON_GetObjectItemCaseSensitive(v1beta1_named_rule_with_operationsJSON, "operations"); + if (cJSON_IsNull(operations)) { + operations = NULL; + } if (operations) { cJSON *operations_local = NULL; if(!cJSON_IsArray(operations)) { @@ -256,6 +287,9 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_parseFr // v1beta1_named_rule_with_operations->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1beta1_named_rule_with_operationsJSON, "resourceNames"); + if (cJSON_IsNull(resource_names)) { + resource_names = NULL; + } if (resource_names) { cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { @@ -275,6 +309,9 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_parseFr // v1beta1_named_rule_with_operations->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1beta1_named_rule_with_operationsJSON, "resources"); + if (cJSON_IsNull(resources)) { + resources = NULL; + } if (resources) { cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { @@ -294,6 +331,9 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_parseFr // v1beta1_named_rule_with_operations->scope cJSON *scope = cJSON_GetObjectItemCaseSensitive(v1beta1_named_rule_with_operationsJSON, "scope"); + if (cJSON_IsNull(scope)) { + scope = NULL; + } if (scope) { if(!cJSON_IsString(scope) && !cJSON_IsNull(scope)) { @@ -302,7 +342,7 @@ v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_parseFr } - v1beta1_named_rule_with_operations_local_var = v1beta1_named_rule_with_operations_create ( + v1beta1_named_rule_with_operations_local_var = v1beta1_named_rule_with_operations_create_internal ( api_groups ? api_groupsList : NULL, api_versions ? api_versionsList : NULL, operations ? operationsList : NULL, diff --git a/kubernetes/model/v1beta1_named_rule_with_operations.h b/kubernetes/model/v1beta1_named_rule_with_operations.h index d828d427..fd3aebd0 100644 --- a/kubernetes/model/v1beta1_named_rule_with_operations.h +++ b/kubernetes/model/v1beta1_named_rule_with_operations.h @@ -26,9 +26,10 @@ typedef struct v1beta1_named_rule_with_operations_t { list_t *resources; //primitive container char *scope; // string + int _library_owned; // Is the library responsible for freeing this object? } v1beta1_named_rule_with_operations_t; -v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_create( +__attribute__((deprecated)) v1beta1_named_rule_with_operations_t *v1beta1_named_rule_with_operations_create( list_t *api_groups, list_t *api_versions, list_t *operations, diff --git a/kubernetes/model/v1beta1_network_device_data.c b/kubernetes/model/v1beta1_network_device_data.c new file mode 100644 index 00000000..feb7f4e5 --- /dev/null +++ b/kubernetes/model/v1beta1_network_device_data.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include "v1beta1_network_device_data.h" + + + +static v1beta1_network_device_data_t *v1beta1_network_device_data_create_internal( + char *hardware_address, + char *interface_name, + list_t *ips + ) { + v1beta1_network_device_data_t *v1beta1_network_device_data_local_var = malloc(sizeof(v1beta1_network_device_data_t)); + if (!v1beta1_network_device_data_local_var) { + return NULL; + } + v1beta1_network_device_data_local_var->hardware_address = hardware_address; + v1beta1_network_device_data_local_var->interface_name = interface_name; + v1beta1_network_device_data_local_var->ips = ips; + + v1beta1_network_device_data_local_var->_library_owned = 1; + return v1beta1_network_device_data_local_var; +} + +__attribute__((deprecated)) v1beta1_network_device_data_t *v1beta1_network_device_data_create( + char *hardware_address, + char *interface_name, + list_t *ips + ) { + return v1beta1_network_device_data_create_internal ( + hardware_address, + interface_name, + ips + ); +} + +void v1beta1_network_device_data_free(v1beta1_network_device_data_t *v1beta1_network_device_data) { + if(NULL == v1beta1_network_device_data){ + return ; + } + if(v1beta1_network_device_data->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_network_device_data_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_network_device_data->hardware_address) { + free(v1beta1_network_device_data->hardware_address); + v1beta1_network_device_data->hardware_address = NULL; + } + if (v1beta1_network_device_data->interface_name) { + free(v1beta1_network_device_data->interface_name); + v1beta1_network_device_data->interface_name = NULL; + } + if (v1beta1_network_device_data->ips) { + list_ForEach(listEntry, v1beta1_network_device_data->ips) { + free(listEntry->data); + } + list_freeList(v1beta1_network_device_data->ips); + v1beta1_network_device_data->ips = NULL; + } + free(v1beta1_network_device_data); +} + +cJSON *v1beta1_network_device_data_convertToJSON(v1beta1_network_device_data_t *v1beta1_network_device_data) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_network_device_data->hardware_address + if(v1beta1_network_device_data->hardware_address) { + if(cJSON_AddStringToObject(item, "hardwareAddress", v1beta1_network_device_data->hardware_address) == NULL) { + goto fail; //String + } + } + + + // v1beta1_network_device_data->interface_name + if(v1beta1_network_device_data->interface_name) { + if(cJSON_AddStringToObject(item, "interfaceName", v1beta1_network_device_data->interface_name) == NULL) { + goto fail; //String + } + } + + + // v1beta1_network_device_data->ips + if(v1beta1_network_device_data->ips) { + cJSON *ips = cJSON_AddArrayToObject(item, "ips"); + if(ips == NULL) { + goto fail; //primitive container + } + + listEntry_t *ipsListEntry; + list_ForEach(ipsListEntry, v1beta1_network_device_data->ips) { + if(cJSON_AddStringToObject(ips, "", ipsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_network_device_data_t *v1beta1_network_device_data_parseFromJSON(cJSON *v1beta1_network_device_dataJSON){ + + v1beta1_network_device_data_t *v1beta1_network_device_data_local_var = NULL; + + // define the local list for v1beta1_network_device_data->ips + list_t *ipsList = NULL; + + // v1beta1_network_device_data->hardware_address + cJSON *hardware_address = cJSON_GetObjectItemCaseSensitive(v1beta1_network_device_dataJSON, "hardwareAddress"); + if (cJSON_IsNull(hardware_address)) { + hardware_address = NULL; + } + if (hardware_address) { + if(!cJSON_IsString(hardware_address) && !cJSON_IsNull(hardware_address)) + { + goto end; //String + } + } + + // v1beta1_network_device_data->interface_name + cJSON *interface_name = cJSON_GetObjectItemCaseSensitive(v1beta1_network_device_dataJSON, "interfaceName"); + if (cJSON_IsNull(interface_name)) { + interface_name = NULL; + } + if (interface_name) { + if(!cJSON_IsString(interface_name) && !cJSON_IsNull(interface_name)) + { + goto end; //String + } + } + + // v1beta1_network_device_data->ips + cJSON *ips = cJSON_GetObjectItemCaseSensitive(v1beta1_network_device_dataJSON, "ips"); + if (cJSON_IsNull(ips)) { + ips = NULL; + } + if (ips) { + cJSON *ips_local = NULL; + if(!cJSON_IsArray(ips)) { + goto end;//primitive container + } + ipsList = list_createList(); + + cJSON_ArrayForEach(ips_local, ips) + { + if(!cJSON_IsString(ips_local)) + { + goto end; + } + list_addElement(ipsList , strdup(ips_local->valuestring)); + } + } + + + v1beta1_network_device_data_local_var = v1beta1_network_device_data_create_internal ( + hardware_address && !cJSON_IsNull(hardware_address) ? strdup(hardware_address->valuestring) : NULL, + interface_name && !cJSON_IsNull(interface_name) ? strdup(interface_name->valuestring) : NULL, + ips ? ipsList : NULL + ); + + return v1beta1_network_device_data_local_var; +end: + if (ipsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ipsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ipsList); + ipsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_network_device_data.h b/kubernetes/model/v1beta1_network_device_data.h new file mode 100644 index 00000000..44f47539 --- /dev/null +++ b/kubernetes/model/v1beta1_network_device_data.h @@ -0,0 +1,42 @@ +/* + * v1beta1_network_device_data.h + * + * NetworkDeviceData provides network-related details for the allocated device. This information may be filled by drivers or other components to configure or identify the device within a network context. + */ + +#ifndef _v1beta1_network_device_data_H_ +#define _v1beta1_network_device_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_network_device_data_t v1beta1_network_device_data_t; + + + + +typedef struct v1beta1_network_device_data_t { + char *hardware_address; // string + char *interface_name; // string + list_t *ips; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_network_device_data_t; + +__attribute__((deprecated)) v1beta1_network_device_data_t *v1beta1_network_device_data_create( + char *hardware_address, + char *interface_name, + list_t *ips +); + +void v1beta1_network_device_data_free(v1beta1_network_device_data_t *v1beta1_network_device_data); + +v1beta1_network_device_data_t *v1beta1_network_device_data_parseFromJSON(cJSON *v1beta1_network_device_dataJSON); + +cJSON *v1beta1_network_device_data_convertToJSON(v1beta1_network_device_data_t *v1beta1_network_device_data); + +#endif /* _v1beta1_network_device_data_H_ */ + diff --git a/kubernetes/model/v1beta1_opaque_device_configuration.c b/kubernetes/model/v1beta1_opaque_device_configuration.c new file mode 100644 index 00000000..57ca5721 --- /dev/null +++ b/kubernetes/model/v1beta1_opaque_device_configuration.c @@ -0,0 +1,128 @@ +#include +#include +#include +#include "v1beta1_opaque_device_configuration.h" + + + +static v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration_create_internal( + char *driver, + object_t *parameters + ) { + v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration_local_var = malloc(sizeof(v1beta1_opaque_device_configuration_t)); + if (!v1beta1_opaque_device_configuration_local_var) { + return NULL; + } + v1beta1_opaque_device_configuration_local_var->driver = driver; + v1beta1_opaque_device_configuration_local_var->parameters = parameters; + + v1beta1_opaque_device_configuration_local_var->_library_owned = 1; + return v1beta1_opaque_device_configuration_local_var; +} + +__attribute__((deprecated)) v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration_create( + char *driver, + object_t *parameters + ) { + return v1beta1_opaque_device_configuration_create_internal ( + driver, + parameters + ); +} + +void v1beta1_opaque_device_configuration_free(v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration) { + if(NULL == v1beta1_opaque_device_configuration){ + return ; + } + if(v1beta1_opaque_device_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_opaque_device_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_opaque_device_configuration->driver) { + free(v1beta1_opaque_device_configuration->driver); + v1beta1_opaque_device_configuration->driver = NULL; + } + if (v1beta1_opaque_device_configuration->parameters) { + object_free(v1beta1_opaque_device_configuration->parameters); + v1beta1_opaque_device_configuration->parameters = NULL; + } + free(v1beta1_opaque_device_configuration); +} + +cJSON *v1beta1_opaque_device_configuration_convertToJSON(v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_opaque_device_configuration->driver + if (!v1beta1_opaque_device_configuration->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta1_opaque_device_configuration->driver) == NULL) { + goto fail; //String + } + + + // v1beta1_opaque_device_configuration->parameters + if (!v1beta1_opaque_device_configuration->parameters) { + goto fail; + } + cJSON *parameters_object = object_convertToJSON(v1beta1_opaque_device_configuration->parameters); + if(parameters_object == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "parameters", parameters_object); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration_parseFromJSON(cJSON *v1beta1_opaque_device_configurationJSON){ + + v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration_local_var = NULL; + + // v1beta1_opaque_device_configuration->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta1_opaque_device_configurationJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta1_opaque_device_configuration->parameters + cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1beta1_opaque_device_configurationJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } + if (!parameters) { + goto end; + } + + object_t *parameters_local_object = NULL; + + parameters_local_object = object_parseFromJSON(parameters); //object + + + v1beta1_opaque_device_configuration_local_var = v1beta1_opaque_device_configuration_create_internal ( + strdup(driver->valuestring), + parameters_local_object + ); + + return v1beta1_opaque_device_configuration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_opaque_device_configuration.h b/kubernetes/model/v1beta1_opaque_device_configuration.h new file mode 100644 index 00000000..517b29fc --- /dev/null +++ b/kubernetes/model/v1beta1_opaque_device_configuration.h @@ -0,0 +1,41 @@ +/* + * v1beta1_opaque_device_configuration.h + * + * OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor. + */ + +#ifndef _v1beta1_opaque_device_configuration_H_ +#define _v1beta1_opaque_device_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_opaque_device_configuration_t v1beta1_opaque_device_configuration_t; + +#include "object.h" + + + +typedef struct v1beta1_opaque_device_configuration_t { + char *driver; // string + object_t *parameters; //object + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_opaque_device_configuration_t; + +__attribute__((deprecated)) v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration_create( + char *driver, + object_t *parameters +); + +void v1beta1_opaque_device_configuration_free(v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration); + +v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration_parseFromJSON(cJSON *v1beta1_opaque_device_configurationJSON); + +cJSON *v1beta1_opaque_device_configuration_convertToJSON(v1beta1_opaque_device_configuration_t *v1beta1_opaque_device_configuration); + +#endif /* _v1beta1_opaque_device_configuration_H_ */ + diff --git a/kubernetes/model/v1beta1_param_kind.c b/kubernetes/model/v1beta1_param_kind.c index 01c929a5..c1c08410 100644 --- a/kubernetes/model/v1beta1_param_kind.c +++ b/kubernetes/model/v1beta1_param_kind.c @@ -5,7 +5,7 @@ -v1beta1_param_kind_t *v1beta1_param_kind_create( +static v1beta1_param_kind_t *v1beta1_param_kind_create_internal( char *api_version, char *kind ) { @@ -16,14 +16,28 @@ v1beta1_param_kind_t *v1beta1_param_kind_create( v1beta1_param_kind_local_var->api_version = api_version; v1beta1_param_kind_local_var->kind = kind; + v1beta1_param_kind_local_var->_library_owned = 1; return v1beta1_param_kind_local_var; } +__attribute__((deprecated)) v1beta1_param_kind_t *v1beta1_param_kind_create( + char *api_version, + char *kind + ) { + return v1beta1_param_kind_create_internal ( + api_version, + kind + ); +} void v1beta1_param_kind_free(v1beta1_param_kind_t *v1beta1_param_kind) { if(NULL == v1beta1_param_kind){ return ; } + if(v1beta1_param_kind->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_param_kind_free"); + return ; + } listEntry_t *listEntry; if (v1beta1_param_kind->api_version) { free(v1beta1_param_kind->api_version); @@ -68,6 +82,9 @@ v1beta1_param_kind_t *v1beta1_param_kind_parseFromJSON(cJSON *v1beta1_param_kind // v1beta1_param_kind->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_param_kindJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -77,6 +94,9 @@ v1beta1_param_kind_t *v1beta1_param_kind_parseFromJSON(cJSON *v1beta1_param_kind // v1beta1_param_kind->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_param_kindJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -85,7 +105,7 @@ v1beta1_param_kind_t *v1beta1_param_kind_parseFromJSON(cJSON *v1beta1_param_kind } - v1beta1_param_kind_local_var = v1beta1_param_kind_create ( + v1beta1_param_kind_local_var = v1beta1_param_kind_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL ); diff --git a/kubernetes/model/v1beta1_param_kind.h b/kubernetes/model/v1beta1_param_kind.h index 7f26544d..bbc22fb2 100644 --- a/kubernetes/model/v1beta1_param_kind.h +++ b/kubernetes/model/v1beta1_param_kind.h @@ -22,9 +22,10 @@ typedef struct v1beta1_param_kind_t { char *api_version; // string char *kind; // string + int _library_owned; // Is the library responsible for freeing this object? } v1beta1_param_kind_t; -v1beta1_param_kind_t *v1beta1_param_kind_create( +__attribute__((deprecated)) v1beta1_param_kind_t *v1beta1_param_kind_create( char *api_version, char *kind ); diff --git a/kubernetes/model/v1beta1_param_ref.c b/kubernetes/model/v1beta1_param_ref.c index 62ffb4d7..8c0b6e45 100644 --- a/kubernetes/model/v1beta1_param_ref.c +++ b/kubernetes/model/v1beta1_param_ref.c @@ -5,7 +5,7 @@ -v1beta1_param_ref_t *v1beta1_param_ref_create( +static v1beta1_param_ref_t *v1beta1_param_ref_create_internal( char *name, char *_namespace, char *parameter_not_found_action, @@ -20,14 +20,32 @@ v1beta1_param_ref_t *v1beta1_param_ref_create( v1beta1_param_ref_local_var->parameter_not_found_action = parameter_not_found_action; v1beta1_param_ref_local_var->selector = selector; + v1beta1_param_ref_local_var->_library_owned = 1; return v1beta1_param_ref_local_var; } +__attribute__((deprecated)) v1beta1_param_ref_t *v1beta1_param_ref_create( + char *name, + char *_namespace, + char *parameter_not_found_action, + v1_label_selector_t *selector + ) { + return v1beta1_param_ref_create_internal ( + name, + _namespace, + parameter_not_found_action, + selector + ); +} void v1beta1_param_ref_free(v1beta1_param_ref_t *v1beta1_param_ref) { if(NULL == v1beta1_param_ref){ return ; } + if(v1beta1_param_ref->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_param_ref_free"); + return ; + } listEntry_t *listEntry; if (v1beta1_param_ref->name) { free(v1beta1_param_ref->name); @@ -104,6 +122,9 @@ v1beta1_param_ref_t *v1beta1_param_ref_parseFromJSON(cJSON *v1beta1_param_refJSO // v1beta1_param_ref->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_param_refJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { @@ -113,6 +134,9 @@ v1beta1_param_ref_t *v1beta1_param_ref_parseFromJSON(cJSON *v1beta1_param_refJSO // v1beta1_param_ref->_namespace cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1beta1_param_refJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } if (_namespace) { if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) { @@ -122,6 +146,9 @@ v1beta1_param_ref_t *v1beta1_param_ref_parseFromJSON(cJSON *v1beta1_param_refJSO // v1beta1_param_ref->parameter_not_found_action cJSON *parameter_not_found_action = cJSON_GetObjectItemCaseSensitive(v1beta1_param_refJSON, "parameterNotFoundAction"); + if (cJSON_IsNull(parameter_not_found_action)) { + parameter_not_found_action = NULL; + } if (parameter_not_found_action) { if(!cJSON_IsString(parameter_not_found_action) && !cJSON_IsNull(parameter_not_found_action)) { @@ -131,12 +158,15 @@ v1beta1_param_ref_t *v1beta1_param_ref_parseFromJSON(cJSON *v1beta1_param_refJSO // v1beta1_param_ref->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1beta1_param_refJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { selector_local_nonprim = v1_label_selector_parseFromJSON(selector); //nonprimitive } - v1beta1_param_ref_local_var = v1beta1_param_ref_create ( + v1beta1_param_ref_local_var = v1beta1_param_ref_create_internal ( name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL, _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, parameter_not_found_action && !cJSON_IsNull(parameter_not_found_action) ? strdup(parameter_not_found_action->valuestring) : NULL, diff --git a/kubernetes/model/v1beta1_param_ref.h b/kubernetes/model/v1beta1_param_ref.h index 555c69f4..9f97e662 100644 --- a/kubernetes/model/v1beta1_param_ref.h +++ b/kubernetes/model/v1beta1_param_ref.h @@ -25,9 +25,10 @@ typedef struct v1beta1_param_ref_t { char *parameter_not_found_action; // string struct v1_label_selector_t *selector; //model + int _library_owned; // Is the library responsible for freeing this object? } v1beta1_param_ref_t; -v1beta1_param_ref_t *v1beta1_param_ref_create( +__attribute__((deprecated)) v1beta1_param_ref_t *v1beta1_param_ref_create( char *name, char *_namespace, char *parameter_not_found_action, diff --git a/kubernetes/model/v1beta1_parent_reference.c b/kubernetes/model/v1beta1_parent_reference.c new file mode 100644 index 00000000..26584b80 --- /dev/null +++ b/kubernetes/model/v1beta1_parent_reference.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include "v1beta1_parent_reference.h" + + + +static v1beta1_parent_reference_t *v1beta1_parent_reference_create_internal( + char *group, + char *name, + char *_namespace, + char *resource + ) { + v1beta1_parent_reference_t *v1beta1_parent_reference_local_var = malloc(sizeof(v1beta1_parent_reference_t)); + if (!v1beta1_parent_reference_local_var) { + return NULL; + } + v1beta1_parent_reference_local_var->group = group; + v1beta1_parent_reference_local_var->name = name; + v1beta1_parent_reference_local_var->_namespace = _namespace; + v1beta1_parent_reference_local_var->resource = resource; + + v1beta1_parent_reference_local_var->_library_owned = 1; + return v1beta1_parent_reference_local_var; +} + +__attribute__((deprecated)) v1beta1_parent_reference_t *v1beta1_parent_reference_create( + char *group, + char *name, + char *_namespace, + char *resource + ) { + return v1beta1_parent_reference_create_internal ( + group, + name, + _namespace, + resource + ); +} + +void v1beta1_parent_reference_free(v1beta1_parent_reference_t *v1beta1_parent_reference) { + if(NULL == v1beta1_parent_reference){ + return ; + } + if(v1beta1_parent_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_parent_reference_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_parent_reference->group) { + free(v1beta1_parent_reference->group); + v1beta1_parent_reference->group = NULL; + } + if (v1beta1_parent_reference->name) { + free(v1beta1_parent_reference->name); + v1beta1_parent_reference->name = NULL; + } + if (v1beta1_parent_reference->_namespace) { + free(v1beta1_parent_reference->_namespace); + v1beta1_parent_reference->_namespace = NULL; + } + if (v1beta1_parent_reference->resource) { + free(v1beta1_parent_reference->resource); + v1beta1_parent_reference->resource = NULL; + } + free(v1beta1_parent_reference); +} + +cJSON *v1beta1_parent_reference_convertToJSON(v1beta1_parent_reference_t *v1beta1_parent_reference) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_parent_reference->group + if(v1beta1_parent_reference->group) { + if(cJSON_AddStringToObject(item, "group", v1beta1_parent_reference->group) == NULL) { + goto fail; //String + } + } + + + // v1beta1_parent_reference->name + if (!v1beta1_parent_reference->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta1_parent_reference->name) == NULL) { + goto fail; //String + } + + + // v1beta1_parent_reference->_namespace + if(v1beta1_parent_reference->_namespace) { + if(cJSON_AddStringToObject(item, "namespace", v1beta1_parent_reference->_namespace) == NULL) { + goto fail; //String + } + } + + + // v1beta1_parent_reference->resource + if (!v1beta1_parent_reference->resource) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resource", v1beta1_parent_reference->resource) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_parent_reference_t *v1beta1_parent_reference_parseFromJSON(cJSON *v1beta1_parent_referenceJSON){ + + v1beta1_parent_reference_t *v1beta1_parent_reference_local_var = NULL; + + // v1beta1_parent_reference->group + cJSON *group = cJSON_GetObjectItemCaseSensitive(v1beta1_parent_referenceJSON, "group"); + if (cJSON_IsNull(group)) { + group = NULL; + } + if (group) { + if(!cJSON_IsString(group) && !cJSON_IsNull(group)) + { + goto end; //String + } + } + + // v1beta1_parent_reference->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_parent_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta1_parent_reference->_namespace + cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1beta1_parent_referenceJSON, "namespace"); + if (cJSON_IsNull(_namespace)) { + _namespace = NULL; + } + if (_namespace) { + if(!cJSON_IsString(_namespace) && !cJSON_IsNull(_namespace)) + { + goto end; //String + } + } + + // v1beta1_parent_reference->resource + cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1beta1_parent_referenceJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } + if (!resource) { + goto end; + } + + + if(!cJSON_IsString(resource)) + { + goto end; //String + } + + + v1beta1_parent_reference_local_var = v1beta1_parent_reference_create_internal ( + group && !cJSON_IsNull(group) ? strdup(group->valuestring) : NULL, + strdup(name->valuestring), + _namespace && !cJSON_IsNull(_namespace) ? strdup(_namespace->valuestring) : NULL, + strdup(resource->valuestring) + ); + + return v1beta1_parent_reference_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_parent_reference.h b/kubernetes/model/v1beta1_parent_reference.h new file mode 100644 index 00000000..87bc686e --- /dev/null +++ b/kubernetes/model/v1beta1_parent_reference.h @@ -0,0 +1,44 @@ +/* + * v1beta1_parent_reference.h + * + * ParentReference describes a reference to a parent object. + */ + +#ifndef _v1beta1_parent_reference_H_ +#define _v1beta1_parent_reference_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_parent_reference_t v1beta1_parent_reference_t; + + + + +typedef struct v1beta1_parent_reference_t { + char *group; // string + char *name; // string + char *_namespace; // string + char *resource; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_parent_reference_t; + +__attribute__((deprecated)) v1beta1_parent_reference_t *v1beta1_parent_reference_create( + char *group, + char *name, + char *_namespace, + char *resource +); + +void v1beta1_parent_reference_free(v1beta1_parent_reference_t *v1beta1_parent_reference); + +v1beta1_parent_reference_t *v1beta1_parent_reference_parseFromJSON(cJSON *v1beta1_parent_referenceJSON); + +cJSON *v1beta1_parent_reference_convertToJSON(v1beta1_parent_reference_t *v1beta1_parent_reference); + +#endif /* _v1beta1_parent_reference_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim.c b/kubernetes/model/v1beta1_resource_claim.c new file mode 100644 index 00000000..a29fb840 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim.c @@ -0,0 +1,235 @@ +#include +#include +#include +#include "v1beta1_resource_claim.h" + + + +static v1beta1_resource_claim_t *v1beta1_resource_claim_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_claim_spec_t *spec, + v1beta1_resource_claim_status_t *status + ) { + v1beta1_resource_claim_t *v1beta1_resource_claim_local_var = malloc(sizeof(v1beta1_resource_claim_t)); + if (!v1beta1_resource_claim_local_var) { + return NULL; + } + v1beta1_resource_claim_local_var->api_version = api_version; + v1beta1_resource_claim_local_var->kind = kind; + v1beta1_resource_claim_local_var->metadata = metadata; + v1beta1_resource_claim_local_var->spec = spec; + v1beta1_resource_claim_local_var->status = status; + + v1beta1_resource_claim_local_var->_library_owned = 1; + return v1beta1_resource_claim_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_t *v1beta1_resource_claim_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_claim_spec_t *spec, + v1beta1_resource_claim_status_t *status + ) { + return v1beta1_resource_claim_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} + +void v1beta1_resource_claim_free(v1beta1_resource_claim_t *v1beta1_resource_claim) { + if(NULL == v1beta1_resource_claim){ + return ; + } + if(v1beta1_resource_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim->api_version) { + free(v1beta1_resource_claim->api_version); + v1beta1_resource_claim->api_version = NULL; + } + if (v1beta1_resource_claim->kind) { + free(v1beta1_resource_claim->kind); + v1beta1_resource_claim->kind = NULL; + } + if (v1beta1_resource_claim->metadata) { + v1_object_meta_free(v1beta1_resource_claim->metadata); + v1beta1_resource_claim->metadata = NULL; + } + if (v1beta1_resource_claim->spec) { + v1beta1_resource_claim_spec_free(v1beta1_resource_claim->spec); + v1beta1_resource_claim->spec = NULL; + } + if (v1beta1_resource_claim->status) { + v1beta1_resource_claim_status_free(v1beta1_resource_claim->status); + v1beta1_resource_claim->status = NULL; + } + free(v1beta1_resource_claim); +} + +cJSON *v1beta1_resource_claim_convertToJSON(v1beta1_resource_claim_t *v1beta1_resource_claim) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim->api_version + if(v1beta1_resource_claim->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_resource_claim->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim->kind + if(v1beta1_resource_claim->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_resource_claim->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim->metadata + if(v1beta1_resource_claim->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_resource_claim->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_resource_claim->spec + if (!v1beta1_resource_claim->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta1_resource_claim_spec_convertToJSON(v1beta1_resource_claim->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + + // v1beta1_resource_claim->status + if(v1beta1_resource_claim->status) { + cJSON *status_local_JSON = v1beta1_resource_claim_status_convertToJSON(v1beta1_resource_claim->status); + if(status_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "status", status_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_t *v1beta1_resource_claim_parseFromJSON(cJSON *v1beta1_resource_claimJSON){ + + v1beta1_resource_claim_t *v1beta1_resource_claim_local_var = NULL; + + // define the local variable for v1beta1_resource_claim->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_resource_claim->spec + v1beta1_resource_claim_spec_t *spec_local_nonprim = NULL; + + // define the local variable for v1beta1_resource_claim->status + v1beta1_resource_claim_status_t *status_local_nonprim = NULL; + + // v1beta1_resource_claim->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claimJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_resource_claim->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claimJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_resource_claim->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claimJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_resource_claim->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claimJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta1_resource_claim_spec_parseFromJSON(spec); //nonprimitive + + // v1beta1_resource_claim->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claimJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } + if (status) { + status_local_nonprim = v1beta1_resource_claim_status_parseFromJSON(status); //nonprimitive + } + + + v1beta1_resource_claim_local_var = v1beta1_resource_claim_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim, + status ? status_local_nonprim : NULL + ); + + return v1beta1_resource_claim_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_resource_claim_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + if (status_local_nonprim) { + v1beta1_resource_claim_status_free(status_local_nonprim); + status_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim.h b/kubernetes/model/v1beta1_resource_claim.h new file mode 100644 index 00000000..6336a4bd --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim.h @@ -0,0 +1,49 @@ +/* + * v1beta1_resource_claim.h + * + * ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta1_resource_claim_H_ +#define _v1beta1_resource_claim_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_t v1beta1_resource_claim_t; + +#include "v1_object_meta.h" +#include "v1beta1_resource_claim_spec.h" +#include "v1beta1_resource_claim_status.h" + + + +typedef struct v1beta1_resource_claim_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_resource_claim_spec_t *spec; //model + struct v1beta1_resource_claim_status_t *status; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_t; + +__attribute__((deprecated)) v1beta1_resource_claim_t *v1beta1_resource_claim_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_claim_spec_t *spec, + v1beta1_resource_claim_status_t *status +); + +void v1beta1_resource_claim_free(v1beta1_resource_claim_t *v1beta1_resource_claim); + +v1beta1_resource_claim_t *v1beta1_resource_claim_parseFromJSON(cJSON *v1beta1_resource_claimJSON); + +cJSON *v1beta1_resource_claim_convertToJSON(v1beta1_resource_claim_t *v1beta1_resource_claim); + +#endif /* _v1beta1_resource_claim_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim_consumer_reference.c b/kubernetes/model/v1beta1_resource_claim_consumer_reference.c new file mode 100644 index 00000000..e16bbd99 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_consumer_reference.c @@ -0,0 +1,187 @@ +#include +#include +#include +#include "v1beta1_resource_claim_consumer_reference.h" + + + +static v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference_create_internal( + char *api_group, + char *name, + char *resource, + char *uid + ) { + v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference_local_var = malloc(sizeof(v1beta1_resource_claim_consumer_reference_t)); + if (!v1beta1_resource_claim_consumer_reference_local_var) { + return NULL; + } + v1beta1_resource_claim_consumer_reference_local_var->api_group = api_group; + v1beta1_resource_claim_consumer_reference_local_var->name = name; + v1beta1_resource_claim_consumer_reference_local_var->resource = resource; + v1beta1_resource_claim_consumer_reference_local_var->uid = uid; + + v1beta1_resource_claim_consumer_reference_local_var->_library_owned = 1; + return v1beta1_resource_claim_consumer_reference_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference_create( + char *api_group, + char *name, + char *resource, + char *uid + ) { + return v1beta1_resource_claim_consumer_reference_create_internal ( + api_group, + name, + resource, + uid + ); +} + +void v1beta1_resource_claim_consumer_reference_free(v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference) { + if(NULL == v1beta1_resource_claim_consumer_reference){ + return ; + } + if(v1beta1_resource_claim_consumer_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_consumer_reference_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim_consumer_reference->api_group) { + free(v1beta1_resource_claim_consumer_reference->api_group); + v1beta1_resource_claim_consumer_reference->api_group = NULL; + } + if (v1beta1_resource_claim_consumer_reference->name) { + free(v1beta1_resource_claim_consumer_reference->name); + v1beta1_resource_claim_consumer_reference->name = NULL; + } + if (v1beta1_resource_claim_consumer_reference->resource) { + free(v1beta1_resource_claim_consumer_reference->resource); + v1beta1_resource_claim_consumer_reference->resource = NULL; + } + if (v1beta1_resource_claim_consumer_reference->uid) { + free(v1beta1_resource_claim_consumer_reference->uid); + v1beta1_resource_claim_consumer_reference->uid = NULL; + } + free(v1beta1_resource_claim_consumer_reference); +} + +cJSON *v1beta1_resource_claim_consumer_reference_convertToJSON(v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim_consumer_reference->api_group + if(v1beta1_resource_claim_consumer_reference->api_group) { + if(cJSON_AddStringToObject(item, "apiGroup", v1beta1_resource_claim_consumer_reference->api_group) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim_consumer_reference->name + if (!v1beta1_resource_claim_consumer_reference->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta1_resource_claim_consumer_reference->name) == NULL) { + goto fail; //String + } + + + // v1beta1_resource_claim_consumer_reference->resource + if (!v1beta1_resource_claim_consumer_reference->resource) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resource", v1beta1_resource_claim_consumer_reference->resource) == NULL) { + goto fail; //String + } + + + // v1beta1_resource_claim_consumer_reference->uid + if (!v1beta1_resource_claim_consumer_reference->uid) { + goto fail; + } + if(cJSON_AddStringToObject(item, "uid", v1beta1_resource_claim_consumer_reference->uid) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference_parseFromJSON(cJSON *v1beta1_resource_claim_consumer_referenceJSON){ + + v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference_local_var = NULL; + + // v1beta1_resource_claim_consumer_reference->api_group + cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_consumer_referenceJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } + if (api_group) { + if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) + { + goto end; //String + } + } + + // v1beta1_resource_claim_consumer_reference->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_consumer_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta1_resource_claim_consumer_reference->resource + cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_consumer_referenceJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } + if (!resource) { + goto end; + } + + + if(!cJSON_IsString(resource)) + { + goto end; //String + } + + // v1beta1_resource_claim_consumer_reference->uid + cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_consumer_referenceJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } + if (!uid) { + goto end; + } + + + if(!cJSON_IsString(uid)) + { + goto end; //String + } + + + v1beta1_resource_claim_consumer_reference_local_var = v1beta1_resource_claim_consumer_reference_create_internal ( + api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, + strdup(name->valuestring), + strdup(resource->valuestring), + strdup(uid->valuestring) + ); + + return v1beta1_resource_claim_consumer_reference_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim_consumer_reference.h b/kubernetes/model/v1beta1_resource_claim_consumer_reference.h new file mode 100644 index 00000000..ec9b7879 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_consumer_reference.h @@ -0,0 +1,44 @@ +/* + * v1beta1_resource_claim_consumer_reference.h + * + * ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim. + */ + +#ifndef _v1beta1_resource_claim_consumer_reference_H_ +#define _v1beta1_resource_claim_consumer_reference_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_consumer_reference_t v1beta1_resource_claim_consumer_reference_t; + + + + +typedef struct v1beta1_resource_claim_consumer_reference_t { + char *api_group; // string + char *name; // string + char *resource; // string + char *uid; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_consumer_reference_t; + +__attribute__((deprecated)) v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference_create( + char *api_group, + char *name, + char *resource, + char *uid +); + +void v1beta1_resource_claim_consumer_reference_free(v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference); + +v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference_parseFromJSON(cJSON *v1beta1_resource_claim_consumer_referenceJSON); + +cJSON *v1beta1_resource_claim_consumer_reference_convertToJSON(v1beta1_resource_claim_consumer_reference_t *v1beta1_resource_claim_consumer_reference); + +#endif /* _v1beta1_resource_claim_consumer_reference_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim_list.c b/kubernetes/model/v1beta1_resource_claim_list.c new file mode 100644 index 00000000..0448ec75 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_resource_claim_list.h" + + + +static v1beta1_resource_claim_list_t *v1beta1_resource_claim_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_resource_claim_list_t *v1beta1_resource_claim_list_local_var = malloc(sizeof(v1beta1_resource_claim_list_t)); + if (!v1beta1_resource_claim_list_local_var) { + return NULL; + } + v1beta1_resource_claim_list_local_var->api_version = api_version; + v1beta1_resource_claim_list_local_var->items = items; + v1beta1_resource_claim_list_local_var->kind = kind; + v1beta1_resource_claim_list_local_var->metadata = metadata; + + v1beta1_resource_claim_list_local_var->_library_owned = 1; + return v1beta1_resource_claim_list_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_list_t *v1beta1_resource_claim_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_resource_claim_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_resource_claim_list_free(v1beta1_resource_claim_list_t *v1beta1_resource_claim_list) { + if(NULL == v1beta1_resource_claim_list){ + return ; + } + if(v1beta1_resource_claim_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim_list->api_version) { + free(v1beta1_resource_claim_list->api_version); + v1beta1_resource_claim_list->api_version = NULL; + } + if (v1beta1_resource_claim_list->items) { + list_ForEach(listEntry, v1beta1_resource_claim_list->items) { + v1beta1_resource_claim_free(listEntry->data); + } + list_freeList(v1beta1_resource_claim_list->items); + v1beta1_resource_claim_list->items = NULL; + } + if (v1beta1_resource_claim_list->kind) { + free(v1beta1_resource_claim_list->kind); + v1beta1_resource_claim_list->kind = NULL; + } + if (v1beta1_resource_claim_list->metadata) { + v1_list_meta_free(v1beta1_resource_claim_list->metadata); + v1beta1_resource_claim_list->metadata = NULL; + } + free(v1beta1_resource_claim_list); +} + +cJSON *v1beta1_resource_claim_list_convertToJSON(v1beta1_resource_claim_list_t *v1beta1_resource_claim_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim_list->api_version + if(v1beta1_resource_claim_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_resource_claim_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim_list->items + if (!v1beta1_resource_claim_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_resource_claim_list->items) { + list_ForEach(itemsListEntry, v1beta1_resource_claim_list->items) { + cJSON *itemLocal = v1beta1_resource_claim_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_resource_claim_list->kind + if(v1beta1_resource_claim_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_resource_claim_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim_list->metadata + if(v1beta1_resource_claim_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_resource_claim_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_list_t *v1beta1_resource_claim_list_parseFromJSON(cJSON *v1beta1_resource_claim_listJSON){ + + v1beta1_resource_claim_list_t *v1beta1_resource_claim_list_local_var = NULL; + + // define the local list for v1beta1_resource_claim_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_resource_claim_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_resource_claim_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_resource_claim_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_resource_claim_t *itemsItem = v1beta1_resource_claim_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_resource_claim_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_resource_claim_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_resource_claim_list_local_var = v1beta1_resource_claim_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_resource_claim_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_resource_claim_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim_list.h b/kubernetes/model/v1beta1_resource_claim_list.h new file mode 100644 index 00000000..a84d808e --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_resource_claim_list.h + * + * ResourceClaimList is a collection of claims. + */ + +#ifndef _v1beta1_resource_claim_list_H_ +#define _v1beta1_resource_claim_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_list_t v1beta1_resource_claim_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_resource_claim.h" + + + +typedef struct v1beta1_resource_claim_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_list_t; + +__attribute__((deprecated)) v1beta1_resource_claim_list_t *v1beta1_resource_claim_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_resource_claim_list_free(v1beta1_resource_claim_list_t *v1beta1_resource_claim_list); + +v1beta1_resource_claim_list_t *v1beta1_resource_claim_list_parseFromJSON(cJSON *v1beta1_resource_claim_listJSON); + +cJSON *v1beta1_resource_claim_list_convertToJSON(v1beta1_resource_claim_list_t *v1beta1_resource_claim_list); + +#endif /* _v1beta1_resource_claim_list_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim_spec.c b/kubernetes/model/v1beta1_resource_claim_spec.c new file mode 100644 index 00000000..1b4f23e4 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_spec.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1beta1_resource_claim_spec.h" + + + +static v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec_create_internal( + v1beta1_device_claim_t *devices + ) { + v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec_local_var = malloc(sizeof(v1beta1_resource_claim_spec_t)); + if (!v1beta1_resource_claim_spec_local_var) { + return NULL; + } + v1beta1_resource_claim_spec_local_var->devices = devices; + + v1beta1_resource_claim_spec_local_var->_library_owned = 1; + return v1beta1_resource_claim_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec_create( + v1beta1_device_claim_t *devices + ) { + return v1beta1_resource_claim_spec_create_internal ( + devices + ); +} + +void v1beta1_resource_claim_spec_free(v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec) { + if(NULL == v1beta1_resource_claim_spec){ + return ; + } + if(v1beta1_resource_claim_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim_spec->devices) { + v1beta1_device_claim_free(v1beta1_resource_claim_spec->devices); + v1beta1_resource_claim_spec->devices = NULL; + } + free(v1beta1_resource_claim_spec); +} + +cJSON *v1beta1_resource_claim_spec_convertToJSON(v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim_spec->devices + if(v1beta1_resource_claim_spec->devices) { + cJSON *devices_local_JSON = v1beta1_device_claim_convertToJSON(v1beta1_resource_claim_spec->devices); + if(devices_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "devices", devices_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec_parseFromJSON(cJSON *v1beta1_resource_claim_specJSON){ + + v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec_local_var = NULL; + + // define the local variable for v1beta1_resource_claim_spec->devices + v1beta1_device_claim_t *devices_local_nonprim = NULL; + + // v1beta1_resource_claim_spec->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_specJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + devices_local_nonprim = v1beta1_device_claim_parseFromJSON(devices); //nonprimitive + } + + + v1beta1_resource_claim_spec_local_var = v1beta1_resource_claim_spec_create_internal ( + devices ? devices_local_nonprim : NULL + ); + + return v1beta1_resource_claim_spec_local_var; +end: + if (devices_local_nonprim) { + v1beta1_device_claim_free(devices_local_nonprim); + devices_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim_spec.h b/kubernetes/model/v1beta1_resource_claim_spec.h new file mode 100644 index 00000000..3b877c2f --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_spec.h @@ -0,0 +1,39 @@ +/* + * v1beta1_resource_claim_spec.h + * + * ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it. + */ + +#ifndef _v1beta1_resource_claim_spec_H_ +#define _v1beta1_resource_claim_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_spec_t v1beta1_resource_claim_spec_t; + +#include "v1beta1_device_claim.h" + + + +typedef struct v1beta1_resource_claim_spec_t { + struct v1beta1_device_claim_t *devices; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_spec_t; + +__attribute__((deprecated)) v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec_create( + v1beta1_device_claim_t *devices +); + +void v1beta1_resource_claim_spec_free(v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec); + +v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec_parseFromJSON(cJSON *v1beta1_resource_claim_specJSON); + +cJSON *v1beta1_resource_claim_spec_convertToJSON(v1beta1_resource_claim_spec_t *v1beta1_resource_claim_spec); + +#endif /* _v1beta1_resource_claim_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim_status.c b/kubernetes/model/v1beta1_resource_claim_status.c new file mode 100644 index 00000000..017d1712 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_status.c @@ -0,0 +1,233 @@ +#include +#include +#include +#include "v1beta1_resource_claim_status.h" + + + +static v1beta1_resource_claim_status_t *v1beta1_resource_claim_status_create_internal( + v1beta1_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for + ) { + v1beta1_resource_claim_status_t *v1beta1_resource_claim_status_local_var = malloc(sizeof(v1beta1_resource_claim_status_t)); + if (!v1beta1_resource_claim_status_local_var) { + return NULL; + } + v1beta1_resource_claim_status_local_var->allocation = allocation; + v1beta1_resource_claim_status_local_var->devices = devices; + v1beta1_resource_claim_status_local_var->reserved_for = reserved_for; + + v1beta1_resource_claim_status_local_var->_library_owned = 1; + return v1beta1_resource_claim_status_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_status_t *v1beta1_resource_claim_status_create( + v1beta1_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for + ) { + return v1beta1_resource_claim_status_create_internal ( + allocation, + devices, + reserved_for + ); +} + +void v1beta1_resource_claim_status_free(v1beta1_resource_claim_status_t *v1beta1_resource_claim_status) { + if(NULL == v1beta1_resource_claim_status){ + return ; + } + if(v1beta1_resource_claim_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim_status->allocation) { + v1beta1_allocation_result_free(v1beta1_resource_claim_status->allocation); + v1beta1_resource_claim_status->allocation = NULL; + } + if (v1beta1_resource_claim_status->devices) { + list_ForEach(listEntry, v1beta1_resource_claim_status->devices) { + v1beta1_allocated_device_status_free(listEntry->data); + } + list_freeList(v1beta1_resource_claim_status->devices); + v1beta1_resource_claim_status->devices = NULL; + } + if (v1beta1_resource_claim_status->reserved_for) { + list_ForEach(listEntry, v1beta1_resource_claim_status->reserved_for) { + v1beta1_resource_claim_consumer_reference_free(listEntry->data); + } + list_freeList(v1beta1_resource_claim_status->reserved_for); + v1beta1_resource_claim_status->reserved_for = NULL; + } + free(v1beta1_resource_claim_status); +} + +cJSON *v1beta1_resource_claim_status_convertToJSON(v1beta1_resource_claim_status_t *v1beta1_resource_claim_status) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim_status->allocation + if(v1beta1_resource_claim_status->allocation) { + cJSON *allocation_local_JSON = v1beta1_allocation_result_convertToJSON(v1beta1_resource_claim_status->allocation); + if(allocation_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "allocation", allocation_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_resource_claim_status->devices + if(v1beta1_resource_claim_status->devices) { + cJSON *devices = cJSON_AddArrayToObject(item, "devices"); + if(devices == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *devicesListEntry; + if (v1beta1_resource_claim_status->devices) { + list_ForEach(devicesListEntry, v1beta1_resource_claim_status->devices) { + cJSON *itemLocal = v1beta1_allocated_device_status_convertToJSON(devicesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(devices, itemLocal); + } + } + } + + + // v1beta1_resource_claim_status->reserved_for + if(v1beta1_resource_claim_status->reserved_for) { + cJSON *reserved_for = cJSON_AddArrayToObject(item, "reservedFor"); + if(reserved_for == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *reserved_forListEntry; + if (v1beta1_resource_claim_status->reserved_for) { + list_ForEach(reserved_forListEntry, v1beta1_resource_claim_status->reserved_for) { + cJSON *itemLocal = v1beta1_resource_claim_consumer_reference_convertToJSON(reserved_forListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(reserved_for, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_status_t *v1beta1_resource_claim_status_parseFromJSON(cJSON *v1beta1_resource_claim_statusJSON){ + + v1beta1_resource_claim_status_t *v1beta1_resource_claim_status_local_var = NULL; + + // define the local variable for v1beta1_resource_claim_status->allocation + v1beta1_allocation_result_t *allocation_local_nonprim = NULL; + + // define the local list for v1beta1_resource_claim_status->devices + list_t *devicesList = NULL; + + // define the local list for v1beta1_resource_claim_status->reserved_for + list_t *reserved_forList = NULL; + + // v1beta1_resource_claim_status->allocation + cJSON *allocation = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_statusJSON, "allocation"); + if (cJSON_IsNull(allocation)) { + allocation = NULL; + } + if (allocation) { + allocation_local_nonprim = v1beta1_allocation_result_parseFromJSON(allocation); //nonprimitive + } + + // v1beta1_resource_claim_status->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_statusJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + cJSON *devices_local_nonprimitive = NULL; + if(!cJSON_IsArray(devices)){ + goto end; //nonprimitive container + } + + devicesList = list_createList(); + + cJSON_ArrayForEach(devices_local_nonprimitive,devices ) + { + if(!cJSON_IsObject(devices_local_nonprimitive)){ + goto end; + } + v1beta1_allocated_device_status_t *devicesItem = v1beta1_allocated_device_status_parseFromJSON(devices_local_nonprimitive); + + list_addElement(devicesList, devicesItem); + } + } + + // v1beta1_resource_claim_status->reserved_for + cJSON *reserved_for = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_statusJSON, "reservedFor"); + if (cJSON_IsNull(reserved_for)) { + reserved_for = NULL; + } + if (reserved_for) { + cJSON *reserved_for_local_nonprimitive = NULL; + if(!cJSON_IsArray(reserved_for)){ + goto end; //nonprimitive container + } + + reserved_forList = list_createList(); + + cJSON_ArrayForEach(reserved_for_local_nonprimitive,reserved_for ) + { + if(!cJSON_IsObject(reserved_for_local_nonprimitive)){ + goto end; + } + v1beta1_resource_claim_consumer_reference_t *reserved_forItem = v1beta1_resource_claim_consumer_reference_parseFromJSON(reserved_for_local_nonprimitive); + + list_addElement(reserved_forList, reserved_forItem); + } + } + + + v1beta1_resource_claim_status_local_var = v1beta1_resource_claim_status_create_internal ( + allocation ? allocation_local_nonprim : NULL, + devices ? devicesList : NULL, + reserved_for ? reserved_forList : NULL + ); + + return v1beta1_resource_claim_status_local_var; +end: + if (allocation_local_nonprim) { + v1beta1_allocation_result_free(allocation_local_nonprim); + allocation_local_nonprim = NULL; + } + if (devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, devicesList) { + v1beta1_allocated_device_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(devicesList); + devicesList = NULL; + } + if (reserved_forList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, reserved_forList) { + v1beta1_resource_claim_consumer_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(reserved_forList); + reserved_forList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim_status.h b/kubernetes/model/v1beta1_resource_claim_status.h new file mode 100644 index 00000000..aa950e95 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_status.h @@ -0,0 +1,45 @@ +/* + * v1beta1_resource_claim_status.h + * + * ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was. + */ + +#ifndef _v1beta1_resource_claim_status_H_ +#define _v1beta1_resource_claim_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_status_t v1beta1_resource_claim_status_t; + +#include "v1beta1_allocated_device_status.h" +#include "v1beta1_allocation_result.h" +#include "v1beta1_resource_claim_consumer_reference.h" + + + +typedef struct v1beta1_resource_claim_status_t { + struct v1beta1_allocation_result_t *allocation; //model + list_t *devices; //nonprimitive container + list_t *reserved_for; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_status_t; + +__attribute__((deprecated)) v1beta1_resource_claim_status_t *v1beta1_resource_claim_status_create( + v1beta1_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for +); + +void v1beta1_resource_claim_status_free(v1beta1_resource_claim_status_t *v1beta1_resource_claim_status); + +v1beta1_resource_claim_status_t *v1beta1_resource_claim_status_parseFromJSON(cJSON *v1beta1_resource_claim_statusJSON); + +cJSON *v1beta1_resource_claim_status_convertToJSON(v1beta1_resource_claim_status_t *v1beta1_resource_claim_status); + +#endif /* _v1beta1_resource_claim_status_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim_template.c b/kubernetes/model/v1beta1_resource_claim_template.c new file mode 100644 index 00000000..7f382b8b --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_template.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1beta1_resource_claim_template.h" + + + +static v1beta1_resource_claim_template_t *v1beta1_resource_claim_template_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_claim_template_spec_t *spec + ) { + v1beta1_resource_claim_template_t *v1beta1_resource_claim_template_local_var = malloc(sizeof(v1beta1_resource_claim_template_t)); + if (!v1beta1_resource_claim_template_local_var) { + return NULL; + } + v1beta1_resource_claim_template_local_var->api_version = api_version; + v1beta1_resource_claim_template_local_var->kind = kind; + v1beta1_resource_claim_template_local_var->metadata = metadata; + v1beta1_resource_claim_template_local_var->spec = spec; + + v1beta1_resource_claim_template_local_var->_library_owned = 1; + return v1beta1_resource_claim_template_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_template_t *v1beta1_resource_claim_template_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_claim_template_spec_t *spec + ) { + return v1beta1_resource_claim_template_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_resource_claim_template_free(v1beta1_resource_claim_template_t *v1beta1_resource_claim_template) { + if(NULL == v1beta1_resource_claim_template){ + return ; + } + if(v1beta1_resource_claim_template->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_template_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim_template->api_version) { + free(v1beta1_resource_claim_template->api_version); + v1beta1_resource_claim_template->api_version = NULL; + } + if (v1beta1_resource_claim_template->kind) { + free(v1beta1_resource_claim_template->kind); + v1beta1_resource_claim_template->kind = NULL; + } + if (v1beta1_resource_claim_template->metadata) { + v1_object_meta_free(v1beta1_resource_claim_template->metadata); + v1beta1_resource_claim_template->metadata = NULL; + } + if (v1beta1_resource_claim_template->spec) { + v1beta1_resource_claim_template_spec_free(v1beta1_resource_claim_template->spec); + v1beta1_resource_claim_template->spec = NULL; + } + free(v1beta1_resource_claim_template); +} + +cJSON *v1beta1_resource_claim_template_convertToJSON(v1beta1_resource_claim_template_t *v1beta1_resource_claim_template) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim_template->api_version + if(v1beta1_resource_claim_template->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_resource_claim_template->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim_template->kind + if(v1beta1_resource_claim_template->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_resource_claim_template->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim_template->metadata + if(v1beta1_resource_claim_template->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_resource_claim_template->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_resource_claim_template->spec + if (!v1beta1_resource_claim_template->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta1_resource_claim_template_spec_convertToJSON(v1beta1_resource_claim_template->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_template_t *v1beta1_resource_claim_template_parseFromJSON(cJSON *v1beta1_resource_claim_templateJSON){ + + v1beta1_resource_claim_template_t *v1beta1_resource_claim_template_local_var = NULL; + + // define the local variable for v1beta1_resource_claim_template->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_resource_claim_template->spec + v1beta1_resource_claim_template_spec_t *spec_local_nonprim = NULL; + + // v1beta1_resource_claim_template->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_templateJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_resource_claim_template->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_templateJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_resource_claim_template->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_templateJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_resource_claim_template->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_templateJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta1_resource_claim_template_spec_parseFromJSON(spec); //nonprimitive + + + v1beta1_resource_claim_template_local_var = v1beta1_resource_claim_template_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta1_resource_claim_template_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_resource_claim_template_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim_template.h b/kubernetes/model/v1beta1_resource_claim_template.h new file mode 100644 index 00000000..936454b4 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_template.h @@ -0,0 +1,46 @@ +/* + * v1beta1_resource_claim_template.h + * + * ResourceClaimTemplate is used to produce ResourceClaim objects. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta1_resource_claim_template_H_ +#define _v1beta1_resource_claim_template_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_template_t v1beta1_resource_claim_template_t; + +#include "v1_object_meta.h" +#include "v1beta1_resource_claim_template_spec.h" + + + +typedef struct v1beta1_resource_claim_template_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_resource_claim_template_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_template_t; + +__attribute__((deprecated)) v1beta1_resource_claim_template_t *v1beta1_resource_claim_template_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_claim_template_spec_t *spec +); + +void v1beta1_resource_claim_template_free(v1beta1_resource_claim_template_t *v1beta1_resource_claim_template); + +v1beta1_resource_claim_template_t *v1beta1_resource_claim_template_parseFromJSON(cJSON *v1beta1_resource_claim_templateJSON); + +cJSON *v1beta1_resource_claim_template_convertToJSON(v1beta1_resource_claim_template_t *v1beta1_resource_claim_template); + +#endif /* _v1beta1_resource_claim_template_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim_template_list.c b/kubernetes/model/v1beta1_resource_claim_template_list.c new file mode 100644 index 00000000..de977163 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_template_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_resource_claim_template_list.h" + + + +static v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list_local_var = malloc(sizeof(v1beta1_resource_claim_template_list_t)); + if (!v1beta1_resource_claim_template_list_local_var) { + return NULL; + } + v1beta1_resource_claim_template_list_local_var->api_version = api_version; + v1beta1_resource_claim_template_list_local_var->items = items; + v1beta1_resource_claim_template_list_local_var->kind = kind; + v1beta1_resource_claim_template_list_local_var->metadata = metadata; + + v1beta1_resource_claim_template_list_local_var->_library_owned = 1; + return v1beta1_resource_claim_template_list_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_resource_claim_template_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_resource_claim_template_list_free(v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list) { + if(NULL == v1beta1_resource_claim_template_list){ + return ; + } + if(v1beta1_resource_claim_template_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_template_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim_template_list->api_version) { + free(v1beta1_resource_claim_template_list->api_version); + v1beta1_resource_claim_template_list->api_version = NULL; + } + if (v1beta1_resource_claim_template_list->items) { + list_ForEach(listEntry, v1beta1_resource_claim_template_list->items) { + v1beta1_resource_claim_template_free(listEntry->data); + } + list_freeList(v1beta1_resource_claim_template_list->items); + v1beta1_resource_claim_template_list->items = NULL; + } + if (v1beta1_resource_claim_template_list->kind) { + free(v1beta1_resource_claim_template_list->kind); + v1beta1_resource_claim_template_list->kind = NULL; + } + if (v1beta1_resource_claim_template_list->metadata) { + v1_list_meta_free(v1beta1_resource_claim_template_list->metadata); + v1beta1_resource_claim_template_list->metadata = NULL; + } + free(v1beta1_resource_claim_template_list); +} + +cJSON *v1beta1_resource_claim_template_list_convertToJSON(v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim_template_list->api_version + if(v1beta1_resource_claim_template_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_resource_claim_template_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim_template_list->items + if (!v1beta1_resource_claim_template_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_resource_claim_template_list->items) { + list_ForEach(itemsListEntry, v1beta1_resource_claim_template_list->items) { + cJSON *itemLocal = v1beta1_resource_claim_template_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_resource_claim_template_list->kind + if(v1beta1_resource_claim_template_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_resource_claim_template_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_claim_template_list->metadata + if(v1beta1_resource_claim_template_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_resource_claim_template_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list_parseFromJSON(cJSON *v1beta1_resource_claim_template_listJSON){ + + v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list_local_var = NULL; + + // define the local list for v1beta1_resource_claim_template_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_resource_claim_template_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_resource_claim_template_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_template_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_resource_claim_template_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_template_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_resource_claim_template_t *itemsItem = v1beta1_resource_claim_template_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_resource_claim_template_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_template_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_resource_claim_template_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_template_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_resource_claim_template_list_local_var = v1beta1_resource_claim_template_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_resource_claim_template_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_resource_claim_template_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim_template_list.h b/kubernetes/model/v1beta1_resource_claim_template_list.h new file mode 100644 index 00000000..1481435c --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_template_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_resource_claim_template_list.h + * + * ResourceClaimTemplateList is a collection of claim templates. + */ + +#ifndef _v1beta1_resource_claim_template_list_H_ +#define _v1beta1_resource_claim_template_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_template_list_t v1beta1_resource_claim_template_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_resource_claim_template.h" + + + +typedef struct v1beta1_resource_claim_template_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_template_list_t; + +__attribute__((deprecated)) v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_resource_claim_template_list_free(v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list); + +v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list_parseFromJSON(cJSON *v1beta1_resource_claim_template_listJSON); + +cJSON *v1beta1_resource_claim_template_list_convertToJSON(v1beta1_resource_claim_template_list_t *v1beta1_resource_claim_template_list); + +#endif /* _v1beta1_resource_claim_template_list_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_claim_template_spec.c b/kubernetes/model/v1beta1_resource_claim_template_spec.c new file mode 100644 index 00000000..46dea35a --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_template_spec.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include "v1beta1_resource_claim_template_spec.h" + + + +static v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec_create_internal( + v1_object_meta_t *metadata, + v1beta1_resource_claim_spec_t *spec + ) { + v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec_local_var = malloc(sizeof(v1beta1_resource_claim_template_spec_t)); + if (!v1beta1_resource_claim_template_spec_local_var) { + return NULL; + } + v1beta1_resource_claim_template_spec_local_var->metadata = metadata; + v1beta1_resource_claim_template_spec_local_var->spec = spec; + + v1beta1_resource_claim_template_spec_local_var->_library_owned = 1; + return v1beta1_resource_claim_template_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec_create( + v1_object_meta_t *metadata, + v1beta1_resource_claim_spec_t *spec + ) { + return v1beta1_resource_claim_template_spec_create_internal ( + metadata, + spec + ); +} + +void v1beta1_resource_claim_template_spec_free(v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec) { + if(NULL == v1beta1_resource_claim_template_spec){ + return ; + } + if(v1beta1_resource_claim_template_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_claim_template_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_claim_template_spec->metadata) { + v1_object_meta_free(v1beta1_resource_claim_template_spec->metadata); + v1beta1_resource_claim_template_spec->metadata = NULL; + } + if (v1beta1_resource_claim_template_spec->spec) { + v1beta1_resource_claim_spec_free(v1beta1_resource_claim_template_spec->spec); + v1beta1_resource_claim_template_spec->spec = NULL; + } + free(v1beta1_resource_claim_template_spec); +} + +cJSON *v1beta1_resource_claim_template_spec_convertToJSON(v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_claim_template_spec->metadata + if(v1beta1_resource_claim_template_spec->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_resource_claim_template_spec->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_resource_claim_template_spec->spec + if (!v1beta1_resource_claim_template_spec->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta1_resource_claim_spec_convertToJSON(v1beta1_resource_claim_template_spec->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec_parseFromJSON(cJSON *v1beta1_resource_claim_template_specJSON){ + + v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec_local_var = NULL; + + // define the local variable for v1beta1_resource_claim_template_spec->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_resource_claim_template_spec->spec + v1beta1_resource_claim_spec_t *spec_local_nonprim = NULL; + + // v1beta1_resource_claim_template_spec->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_template_specJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_resource_claim_template_spec->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_claim_template_specJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta1_resource_claim_spec_parseFromJSON(spec); //nonprimitive + + + v1beta1_resource_claim_template_spec_local_var = v1beta1_resource_claim_template_spec_create_internal ( + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta1_resource_claim_template_spec_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_resource_claim_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_claim_template_spec.h b/kubernetes/model/v1beta1_resource_claim_template_spec.h new file mode 100644 index 00000000..4f7202e7 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_claim_template_spec.h @@ -0,0 +1,42 @@ +/* + * v1beta1_resource_claim_template_spec.h + * + * ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. + */ + +#ifndef _v1beta1_resource_claim_template_spec_H_ +#define _v1beta1_resource_claim_template_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_claim_template_spec_t v1beta1_resource_claim_template_spec_t; + +#include "v1_object_meta.h" +#include "v1beta1_resource_claim_spec.h" + + + +typedef struct v1beta1_resource_claim_template_spec_t { + struct v1_object_meta_t *metadata; //model + struct v1beta1_resource_claim_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_claim_template_spec_t; + +__attribute__((deprecated)) v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec_create( + v1_object_meta_t *metadata, + v1beta1_resource_claim_spec_t *spec +); + +void v1beta1_resource_claim_template_spec_free(v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec); + +v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec_parseFromJSON(cJSON *v1beta1_resource_claim_template_specJSON); + +cJSON *v1beta1_resource_claim_template_spec_convertToJSON(v1beta1_resource_claim_template_spec_t *v1beta1_resource_claim_template_spec); + +#endif /* _v1beta1_resource_claim_template_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_pool.c b/kubernetes/model/v1beta1_resource_pool.c new file mode 100644 index 00000000..1ae72aea --- /dev/null +++ b/kubernetes/model/v1beta1_resource_pool.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include "v1beta1_resource_pool.h" + + + +static v1beta1_resource_pool_t *v1beta1_resource_pool_create_internal( + long generation, + char *name, + long resource_slice_count + ) { + v1beta1_resource_pool_t *v1beta1_resource_pool_local_var = malloc(sizeof(v1beta1_resource_pool_t)); + if (!v1beta1_resource_pool_local_var) { + return NULL; + } + v1beta1_resource_pool_local_var->generation = generation; + v1beta1_resource_pool_local_var->name = name; + v1beta1_resource_pool_local_var->resource_slice_count = resource_slice_count; + + v1beta1_resource_pool_local_var->_library_owned = 1; + return v1beta1_resource_pool_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_pool_t *v1beta1_resource_pool_create( + long generation, + char *name, + long resource_slice_count + ) { + return v1beta1_resource_pool_create_internal ( + generation, + name, + resource_slice_count + ); +} + +void v1beta1_resource_pool_free(v1beta1_resource_pool_t *v1beta1_resource_pool) { + if(NULL == v1beta1_resource_pool){ + return ; + } + if(v1beta1_resource_pool->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_pool_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_pool->name) { + free(v1beta1_resource_pool->name); + v1beta1_resource_pool->name = NULL; + } + free(v1beta1_resource_pool); +} + +cJSON *v1beta1_resource_pool_convertToJSON(v1beta1_resource_pool_t *v1beta1_resource_pool) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_pool->generation + if (!v1beta1_resource_pool->generation) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "generation", v1beta1_resource_pool->generation) == NULL) { + goto fail; //Numeric + } + + + // v1beta1_resource_pool->name + if (!v1beta1_resource_pool->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta1_resource_pool->name) == NULL) { + goto fail; //String + } + + + // v1beta1_resource_pool->resource_slice_count + if (!v1beta1_resource_pool->resource_slice_count) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "resourceSliceCount", v1beta1_resource_pool->resource_slice_count) == NULL) { + goto fail; //Numeric + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_pool_t *v1beta1_resource_pool_parseFromJSON(cJSON *v1beta1_resource_poolJSON){ + + v1beta1_resource_pool_t *v1beta1_resource_pool_local_var = NULL; + + // v1beta1_resource_pool->generation + cJSON *generation = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_poolJSON, "generation"); + if (cJSON_IsNull(generation)) { + generation = NULL; + } + if (!generation) { + goto end; + } + + + if(!cJSON_IsNumber(generation)) + { + goto end; //Numeric + } + + // v1beta1_resource_pool->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_poolJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta1_resource_pool->resource_slice_count + cJSON *resource_slice_count = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_poolJSON, "resourceSliceCount"); + if (cJSON_IsNull(resource_slice_count)) { + resource_slice_count = NULL; + } + if (!resource_slice_count) { + goto end; + } + + + if(!cJSON_IsNumber(resource_slice_count)) + { + goto end; //Numeric + } + + + v1beta1_resource_pool_local_var = v1beta1_resource_pool_create_internal ( + generation->valuedouble, + strdup(name->valuestring), + resource_slice_count->valuedouble + ); + + return v1beta1_resource_pool_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_pool.h b/kubernetes/model/v1beta1_resource_pool.h new file mode 100644 index 00000000..e517ac13 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_pool.h @@ -0,0 +1,42 @@ +/* + * v1beta1_resource_pool.h + * + * ResourcePool describes the pool that ResourceSlices belong to. + */ + +#ifndef _v1beta1_resource_pool_H_ +#define _v1beta1_resource_pool_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_pool_t v1beta1_resource_pool_t; + + + + +typedef struct v1beta1_resource_pool_t { + long generation; //numeric + char *name; // string + long resource_slice_count; //numeric + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_pool_t; + +__attribute__((deprecated)) v1beta1_resource_pool_t *v1beta1_resource_pool_create( + long generation, + char *name, + long resource_slice_count +); + +void v1beta1_resource_pool_free(v1beta1_resource_pool_t *v1beta1_resource_pool); + +v1beta1_resource_pool_t *v1beta1_resource_pool_parseFromJSON(cJSON *v1beta1_resource_poolJSON); + +cJSON *v1beta1_resource_pool_convertToJSON(v1beta1_resource_pool_t *v1beta1_resource_pool); + +#endif /* _v1beta1_resource_pool_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_slice.c b/kubernetes/model/v1beta1_resource_slice.c new file mode 100644 index 00000000..1501bba1 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_slice.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1beta1_resource_slice.h" + + + +static v1beta1_resource_slice_t *v1beta1_resource_slice_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_slice_spec_t *spec + ) { + v1beta1_resource_slice_t *v1beta1_resource_slice_local_var = malloc(sizeof(v1beta1_resource_slice_t)); + if (!v1beta1_resource_slice_local_var) { + return NULL; + } + v1beta1_resource_slice_local_var->api_version = api_version; + v1beta1_resource_slice_local_var->kind = kind; + v1beta1_resource_slice_local_var->metadata = metadata; + v1beta1_resource_slice_local_var->spec = spec; + + v1beta1_resource_slice_local_var->_library_owned = 1; + return v1beta1_resource_slice_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_slice_t *v1beta1_resource_slice_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_slice_spec_t *spec + ) { + return v1beta1_resource_slice_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta1_resource_slice_free(v1beta1_resource_slice_t *v1beta1_resource_slice) { + if(NULL == v1beta1_resource_slice){ + return ; + } + if(v1beta1_resource_slice->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_slice_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_slice->api_version) { + free(v1beta1_resource_slice->api_version); + v1beta1_resource_slice->api_version = NULL; + } + if (v1beta1_resource_slice->kind) { + free(v1beta1_resource_slice->kind); + v1beta1_resource_slice->kind = NULL; + } + if (v1beta1_resource_slice->metadata) { + v1_object_meta_free(v1beta1_resource_slice->metadata); + v1beta1_resource_slice->metadata = NULL; + } + if (v1beta1_resource_slice->spec) { + v1beta1_resource_slice_spec_free(v1beta1_resource_slice->spec); + v1beta1_resource_slice->spec = NULL; + } + free(v1beta1_resource_slice); +} + +cJSON *v1beta1_resource_slice_convertToJSON(v1beta1_resource_slice_t *v1beta1_resource_slice) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_slice->api_version + if(v1beta1_resource_slice->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_resource_slice->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_slice->kind + if(v1beta1_resource_slice->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_resource_slice->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_slice->metadata + if(v1beta1_resource_slice->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_resource_slice->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_resource_slice->spec + if (!v1beta1_resource_slice->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta1_resource_slice_spec_convertToJSON(v1beta1_resource_slice->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_slice_t *v1beta1_resource_slice_parseFromJSON(cJSON *v1beta1_resource_sliceJSON){ + + v1beta1_resource_slice_t *v1beta1_resource_slice_local_var = NULL; + + // define the local variable for v1beta1_resource_slice->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_resource_slice->spec + v1beta1_resource_slice_spec_t *spec_local_nonprim = NULL; + + // v1beta1_resource_slice->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_sliceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_resource_slice->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_sliceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_resource_slice->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_sliceJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_resource_slice->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_sliceJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta1_resource_slice_spec_parseFromJSON(spec); //nonprimitive + + + v1beta1_resource_slice_local_var = v1beta1_resource_slice_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta1_resource_slice_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_resource_slice_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_slice.h b/kubernetes/model/v1beta1_resource_slice.h new file mode 100644 index 00000000..697b4f3c --- /dev/null +++ b/kubernetes/model/v1beta1_resource_slice.h @@ -0,0 +1,46 @@ +/* + * v1beta1_resource_slice.h + * + * ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver. At the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple <driver name>, <pool name>, <device name>. Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others. When allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool. For resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta1_resource_slice_H_ +#define _v1beta1_resource_slice_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_slice_t v1beta1_resource_slice_t; + +#include "v1_object_meta.h" +#include "v1beta1_resource_slice_spec.h" + + + +typedef struct v1beta1_resource_slice_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_resource_slice_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_slice_t; + +__attribute__((deprecated)) v1beta1_resource_slice_t *v1beta1_resource_slice_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_resource_slice_spec_t *spec +); + +void v1beta1_resource_slice_free(v1beta1_resource_slice_t *v1beta1_resource_slice); + +v1beta1_resource_slice_t *v1beta1_resource_slice_parseFromJSON(cJSON *v1beta1_resource_sliceJSON); + +cJSON *v1beta1_resource_slice_convertToJSON(v1beta1_resource_slice_t *v1beta1_resource_slice); + +#endif /* _v1beta1_resource_slice_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_slice_list.c b/kubernetes/model/v1beta1_resource_slice_list.c new file mode 100644 index 00000000..51659c56 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_slice_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_resource_slice_list.h" + + + +static v1beta1_resource_slice_list_t *v1beta1_resource_slice_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_resource_slice_list_t *v1beta1_resource_slice_list_local_var = malloc(sizeof(v1beta1_resource_slice_list_t)); + if (!v1beta1_resource_slice_list_local_var) { + return NULL; + } + v1beta1_resource_slice_list_local_var->api_version = api_version; + v1beta1_resource_slice_list_local_var->items = items; + v1beta1_resource_slice_list_local_var->kind = kind; + v1beta1_resource_slice_list_local_var->metadata = metadata; + + v1beta1_resource_slice_list_local_var->_library_owned = 1; + return v1beta1_resource_slice_list_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_slice_list_t *v1beta1_resource_slice_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_resource_slice_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_resource_slice_list_free(v1beta1_resource_slice_list_t *v1beta1_resource_slice_list) { + if(NULL == v1beta1_resource_slice_list){ + return ; + } + if(v1beta1_resource_slice_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_slice_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_slice_list->api_version) { + free(v1beta1_resource_slice_list->api_version); + v1beta1_resource_slice_list->api_version = NULL; + } + if (v1beta1_resource_slice_list->items) { + list_ForEach(listEntry, v1beta1_resource_slice_list->items) { + v1beta1_resource_slice_free(listEntry->data); + } + list_freeList(v1beta1_resource_slice_list->items); + v1beta1_resource_slice_list->items = NULL; + } + if (v1beta1_resource_slice_list->kind) { + free(v1beta1_resource_slice_list->kind); + v1beta1_resource_slice_list->kind = NULL; + } + if (v1beta1_resource_slice_list->metadata) { + v1_list_meta_free(v1beta1_resource_slice_list->metadata); + v1beta1_resource_slice_list->metadata = NULL; + } + free(v1beta1_resource_slice_list); +} + +cJSON *v1beta1_resource_slice_list_convertToJSON(v1beta1_resource_slice_list_t *v1beta1_resource_slice_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_slice_list->api_version + if(v1beta1_resource_slice_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_resource_slice_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_slice_list->items + if (!v1beta1_resource_slice_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_resource_slice_list->items) { + list_ForEach(itemsListEntry, v1beta1_resource_slice_list->items) { + cJSON *itemLocal = v1beta1_resource_slice_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_resource_slice_list->kind + if(v1beta1_resource_slice_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_resource_slice_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_slice_list->metadata + if(v1beta1_resource_slice_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_resource_slice_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_slice_list_t *v1beta1_resource_slice_list_parseFromJSON(cJSON *v1beta1_resource_slice_listJSON){ + + v1beta1_resource_slice_list_t *v1beta1_resource_slice_list_local_var = NULL; + + // define the local list for v1beta1_resource_slice_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_resource_slice_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_resource_slice_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_resource_slice_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_resource_slice_t *itemsItem = v1beta1_resource_slice_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_resource_slice_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_resource_slice_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_resource_slice_list_local_var = v1beta1_resource_slice_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_resource_slice_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_resource_slice_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_slice_list.h b/kubernetes/model/v1beta1_resource_slice_list.h new file mode 100644 index 00000000..a5b12b06 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_slice_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_resource_slice_list.h + * + * ResourceSliceList is a collection of ResourceSlices. + */ + +#ifndef _v1beta1_resource_slice_list_H_ +#define _v1beta1_resource_slice_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_slice_list_t v1beta1_resource_slice_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_resource_slice.h" + + + +typedef struct v1beta1_resource_slice_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_slice_list_t; + +__attribute__((deprecated)) v1beta1_resource_slice_list_t *v1beta1_resource_slice_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_resource_slice_list_free(v1beta1_resource_slice_list_t *v1beta1_resource_slice_list); + +v1beta1_resource_slice_list_t *v1beta1_resource_slice_list_parseFromJSON(cJSON *v1beta1_resource_slice_listJSON); + +cJSON *v1beta1_resource_slice_list_convertToJSON(v1beta1_resource_slice_list_t *v1beta1_resource_slice_list); + +#endif /* _v1beta1_resource_slice_list_H_ */ + diff --git a/kubernetes/model/v1beta1_resource_slice_spec.c b/kubernetes/model/v1beta1_resource_slice_spec.c new file mode 100644 index 00000000..4a5d4fa7 --- /dev/null +++ b/kubernetes/model/v1beta1_resource_slice_spec.c @@ -0,0 +1,387 @@ +#include +#include +#include +#include "v1beta1_resource_slice_spec.h" + + + +static v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_create_internal( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1beta1_resource_pool_t *pool, + list_t *shared_counters + ) { + v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_local_var = malloc(sizeof(v1beta1_resource_slice_spec_t)); + if (!v1beta1_resource_slice_spec_local_var) { + return NULL; + } + v1beta1_resource_slice_spec_local_var->all_nodes = all_nodes; + v1beta1_resource_slice_spec_local_var->devices = devices; + v1beta1_resource_slice_spec_local_var->driver = driver; + v1beta1_resource_slice_spec_local_var->node_name = node_name; + v1beta1_resource_slice_spec_local_var->node_selector = node_selector; + v1beta1_resource_slice_spec_local_var->per_device_node_selection = per_device_node_selection; + v1beta1_resource_slice_spec_local_var->pool = pool; + v1beta1_resource_slice_spec_local_var->shared_counters = shared_counters; + + v1beta1_resource_slice_spec_local_var->_library_owned = 1; + return v1beta1_resource_slice_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_create( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1beta1_resource_pool_t *pool, + list_t *shared_counters + ) { + return v1beta1_resource_slice_spec_create_internal ( + all_nodes, + devices, + driver, + node_name, + node_selector, + per_device_node_selection, + pool, + shared_counters + ); +} + +void v1beta1_resource_slice_spec_free(v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec) { + if(NULL == v1beta1_resource_slice_spec){ + return ; + } + if(v1beta1_resource_slice_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_resource_slice_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_resource_slice_spec->devices) { + list_ForEach(listEntry, v1beta1_resource_slice_spec->devices) { + v1beta1_device_free(listEntry->data); + } + list_freeList(v1beta1_resource_slice_spec->devices); + v1beta1_resource_slice_spec->devices = NULL; + } + if (v1beta1_resource_slice_spec->driver) { + free(v1beta1_resource_slice_spec->driver); + v1beta1_resource_slice_spec->driver = NULL; + } + if (v1beta1_resource_slice_spec->node_name) { + free(v1beta1_resource_slice_spec->node_name); + v1beta1_resource_slice_spec->node_name = NULL; + } + if (v1beta1_resource_slice_spec->node_selector) { + v1_node_selector_free(v1beta1_resource_slice_spec->node_selector); + v1beta1_resource_slice_spec->node_selector = NULL; + } + if (v1beta1_resource_slice_spec->pool) { + v1beta1_resource_pool_free(v1beta1_resource_slice_spec->pool); + v1beta1_resource_slice_spec->pool = NULL; + } + if (v1beta1_resource_slice_spec->shared_counters) { + list_ForEach(listEntry, v1beta1_resource_slice_spec->shared_counters) { + v1beta1_counter_set_free(listEntry->data); + } + list_freeList(v1beta1_resource_slice_spec->shared_counters); + v1beta1_resource_slice_spec->shared_counters = NULL; + } + free(v1beta1_resource_slice_spec); +} + +cJSON *v1beta1_resource_slice_spec_convertToJSON(v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_resource_slice_spec->all_nodes + if(v1beta1_resource_slice_spec->all_nodes) { + if(cJSON_AddBoolToObject(item, "allNodes", v1beta1_resource_slice_spec->all_nodes) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_resource_slice_spec->devices + if(v1beta1_resource_slice_spec->devices) { + cJSON *devices = cJSON_AddArrayToObject(item, "devices"); + if(devices == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *devicesListEntry; + if (v1beta1_resource_slice_spec->devices) { + list_ForEach(devicesListEntry, v1beta1_resource_slice_spec->devices) { + cJSON *itemLocal = v1beta1_device_convertToJSON(devicesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(devices, itemLocal); + } + } + } + + + // v1beta1_resource_slice_spec->driver + if (!v1beta1_resource_slice_spec->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta1_resource_slice_spec->driver) == NULL) { + goto fail; //String + } + + + // v1beta1_resource_slice_spec->node_name + if(v1beta1_resource_slice_spec->node_name) { + if(cJSON_AddStringToObject(item, "nodeName", v1beta1_resource_slice_spec->node_name) == NULL) { + goto fail; //String + } + } + + + // v1beta1_resource_slice_spec->node_selector + if(v1beta1_resource_slice_spec->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1beta1_resource_slice_spec->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_resource_slice_spec->per_device_node_selection + if(v1beta1_resource_slice_spec->per_device_node_selection) { + if(cJSON_AddBoolToObject(item, "perDeviceNodeSelection", v1beta1_resource_slice_spec->per_device_node_selection) == NULL) { + goto fail; //Bool + } + } + + + // v1beta1_resource_slice_spec->pool + if (!v1beta1_resource_slice_spec->pool) { + goto fail; + } + cJSON *pool_local_JSON = v1beta1_resource_pool_convertToJSON(v1beta1_resource_slice_spec->pool); + if(pool_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "pool", pool_local_JSON); + if(item->child == NULL) { + goto fail; + } + + + // v1beta1_resource_slice_spec->shared_counters + if(v1beta1_resource_slice_spec->shared_counters) { + cJSON *shared_counters = cJSON_AddArrayToObject(item, "sharedCounters"); + if(shared_counters == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *shared_countersListEntry; + if (v1beta1_resource_slice_spec->shared_counters) { + list_ForEach(shared_countersListEntry, v1beta1_resource_slice_spec->shared_counters) { + cJSON *itemLocal = v1beta1_counter_set_convertToJSON(shared_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(shared_counters, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_parseFromJSON(cJSON *v1beta1_resource_slice_specJSON){ + + v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_local_var = NULL; + + // define the local list for v1beta1_resource_slice_spec->devices + list_t *devicesList = NULL; + + // define the local variable for v1beta1_resource_slice_spec->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // define the local variable for v1beta1_resource_slice_spec->pool + v1beta1_resource_pool_t *pool_local_nonprim = NULL; + + // define the local list for v1beta1_resource_slice_spec->shared_counters + list_t *shared_countersList = NULL; + + // v1beta1_resource_slice_spec->all_nodes + cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "allNodes"); + if (cJSON_IsNull(all_nodes)) { + all_nodes = NULL; + } + if (all_nodes) { + if(!cJSON_IsBool(all_nodes)) + { + goto end; //Bool + } + } + + // v1beta1_resource_slice_spec->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + cJSON *devices_local_nonprimitive = NULL; + if(!cJSON_IsArray(devices)){ + goto end; //nonprimitive container + } + + devicesList = list_createList(); + + cJSON_ArrayForEach(devices_local_nonprimitive,devices ) + { + if(!cJSON_IsObject(devices_local_nonprimitive)){ + goto end; + } + v1beta1_device_t *devicesItem = v1beta1_device_parseFromJSON(devices_local_nonprimitive); + + list_addElement(devicesList, devicesItem); + } + } + + // v1beta1_resource_slice_spec->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta1_resource_slice_spec->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } + if (node_name) { + if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) + { + goto end; //String + } + } + + // v1beta1_resource_slice_spec->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + // v1beta1_resource_slice_spec->per_device_node_selection + cJSON *per_device_node_selection = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "perDeviceNodeSelection"); + if (cJSON_IsNull(per_device_node_selection)) { + per_device_node_selection = NULL; + } + if (per_device_node_selection) { + if(!cJSON_IsBool(per_device_node_selection)) + { + goto end; //Bool + } + } + + // v1beta1_resource_slice_spec->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + pool_local_nonprim = v1beta1_resource_pool_parseFromJSON(pool); //nonprimitive + + // v1beta1_resource_slice_spec->shared_counters + cJSON *shared_counters = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_slice_specJSON, "sharedCounters"); + if (cJSON_IsNull(shared_counters)) { + shared_counters = NULL; + } + if (shared_counters) { + cJSON *shared_counters_local_nonprimitive = NULL; + if(!cJSON_IsArray(shared_counters)){ + goto end; //nonprimitive container + } + + shared_countersList = list_createList(); + + cJSON_ArrayForEach(shared_counters_local_nonprimitive,shared_counters ) + { + if(!cJSON_IsObject(shared_counters_local_nonprimitive)){ + goto end; + } + v1beta1_counter_set_t *shared_countersItem = v1beta1_counter_set_parseFromJSON(shared_counters_local_nonprimitive); + + list_addElement(shared_countersList, shared_countersItem); + } + } + + + v1beta1_resource_slice_spec_local_var = v1beta1_resource_slice_spec_create_internal ( + all_nodes ? all_nodes->valueint : 0, + devices ? devicesList : NULL, + strdup(driver->valuestring), + node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, + node_selector ? node_selector_local_nonprim : NULL, + per_device_node_selection ? per_device_node_selection->valueint : 0, + pool_local_nonprim, + shared_counters ? shared_countersList : NULL + ); + + return v1beta1_resource_slice_spec_local_var; +end: + if (devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, devicesList) { + v1beta1_device_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(devicesList); + devicesList = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + if (pool_local_nonprim) { + v1beta1_resource_pool_free(pool_local_nonprim); + pool_local_nonprim = NULL; + } + if (shared_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, shared_countersList) { + v1beta1_counter_set_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(shared_countersList); + shared_countersList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_resource_slice_spec.h b/kubernetes/model/v1beta1_resource_slice_spec.h new file mode 100644 index 00000000..7d3437bf --- /dev/null +++ b/kubernetes/model/v1beta1_resource_slice_spec.h @@ -0,0 +1,56 @@ +/* + * v1beta1_resource_slice_spec.h + * + * ResourceSliceSpec contains the information published by the driver in one ResourceSlice. + */ + +#ifndef _v1beta1_resource_slice_spec_H_ +#define _v1beta1_resource_slice_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_resource_slice_spec_t v1beta1_resource_slice_spec_t; + +#include "v1_node_selector.h" +#include "v1beta1_counter_set.h" +#include "v1beta1_device.h" +#include "v1beta1_resource_pool.h" + + + +typedef struct v1beta1_resource_slice_spec_t { + int all_nodes; //boolean + list_t *devices; //nonprimitive container + char *driver; // string + char *node_name; // string + struct v1_node_selector_t *node_selector; //model + int per_device_node_selection; //boolean + struct v1beta1_resource_pool_t *pool; //model + list_t *shared_counters; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_resource_slice_spec_t; + +__attribute__((deprecated)) v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_create( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1beta1_resource_pool_t *pool, + list_t *shared_counters +); + +void v1beta1_resource_slice_spec_free(v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec); + +v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_parseFromJSON(cJSON *v1beta1_resource_slice_specJSON); + +cJSON *v1beta1_resource_slice_spec_convertToJSON(v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec); + +#endif /* _v1beta1_resource_slice_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_self_subject_review.c b/kubernetes/model/v1beta1_self_subject_review.c deleted file mode 100644 index 6568584b..00000000 --- a/kubernetes/model/v1beta1_self_subject_review.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include "v1beta1_self_subject_review.h" - - - -v1beta1_self_subject_review_t *v1beta1_self_subject_review_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta1_self_subject_review_status_t *status - ) { - v1beta1_self_subject_review_t *v1beta1_self_subject_review_local_var = malloc(sizeof(v1beta1_self_subject_review_t)); - if (!v1beta1_self_subject_review_local_var) { - return NULL; - } - v1beta1_self_subject_review_local_var->api_version = api_version; - v1beta1_self_subject_review_local_var->kind = kind; - v1beta1_self_subject_review_local_var->metadata = metadata; - v1beta1_self_subject_review_local_var->status = status; - - return v1beta1_self_subject_review_local_var; -} - - -void v1beta1_self_subject_review_free(v1beta1_self_subject_review_t *v1beta1_self_subject_review) { - if(NULL == v1beta1_self_subject_review){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_self_subject_review->api_version) { - free(v1beta1_self_subject_review->api_version); - v1beta1_self_subject_review->api_version = NULL; - } - if (v1beta1_self_subject_review->kind) { - free(v1beta1_self_subject_review->kind); - v1beta1_self_subject_review->kind = NULL; - } - if (v1beta1_self_subject_review->metadata) { - v1_object_meta_free(v1beta1_self_subject_review->metadata); - v1beta1_self_subject_review->metadata = NULL; - } - if (v1beta1_self_subject_review->status) { - v1beta1_self_subject_review_status_free(v1beta1_self_subject_review->status); - v1beta1_self_subject_review->status = NULL; - } - free(v1beta1_self_subject_review); -} - -cJSON *v1beta1_self_subject_review_convertToJSON(v1beta1_self_subject_review_t *v1beta1_self_subject_review) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_self_subject_review->api_version - if(v1beta1_self_subject_review->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_self_subject_review->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta1_self_subject_review->kind - if(v1beta1_self_subject_review->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta1_self_subject_review->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta1_self_subject_review->metadata - if(v1beta1_self_subject_review->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_self_subject_review->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_self_subject_review->status - if(v1beta1_self_subject_review->status) { - cJSON *status_local_JSON = v1beta1_self_subject_review_status_convertToJSON(v1beta1_self_subject_review->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_self_subject_review_t *v1beta1_self_subject_review_parseFromJSON(cJSON *v1beta1_self_subject_reviewJSON){ - - v1beta1_self_subject_review_t *v1beta1_self_subject_review_local_var = NULL; - - // define the local variable for v1beta1_self_subject_review->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1beta1_self_subject_review->status - v1beta1_self_subject_review_status_t *status_local_nonprim = NULL; - - // v1beta1_self_subject_review->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_self_subject_reviewJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta1_self_subject_review->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_self_subject_reviewJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta1_self_subject_review->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_self_subject_reviewJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1beta1_self_subject_review->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta1_self_subject_reviewJSON, "status"); - if (status) { - status_local_nonprim = v1beta1_self_subject_review_status_parseFromJSON(status); //nonprimitive - } - - - v1beta1_self_subject_review_local_var = v1beta1_self_subject_review_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - status ? status_local_nonprim : NULL - ); - - return v1beta1_self_subject_review_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1beta1_self_subject_review_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_self_subject_review.h b/kubernetes/model/v1beta1_self_subject_review.h deleted file mode 100644 index 830db607..00000000 --- a/kubernetes/model/v1beta1_self_subject_review.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta1_self_subject_review.h - * - * SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. When using impersonation, users will receive the user info of the user being impersonated. If impersonation or request header authentication is used, any extra keys will have their case ignored and returned as lowercase. - */ - -#ifndef _v1beta1_self_subject_review_H_ -#define _v1beta1_self_subject_review_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_self_subject_review_t v1beta1_self_subject_review_t; - -#include "v1_object_meta.h" -#include "v1beta1_self_subject_review_status.h" - - - -typedef struct v1beta1_self_subject_review_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1beta1_self_subject_review_status_t *status; //model - -} v1beta1_self_subject_review_t; - -v1beta1_self_subject_review_t *v1beta1_self_subject_review_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta1_self_subject_review_status_t *status -); - -void v1beta1_self_subject_review_free(v1beta1_self_subject_review_t *v1beta1_self_subject_review); - -v1beta1_self_subject_review_t *v1beta1_self_subject_review_parseFromJSON(cJSON *v1beta1_self_subject_reviewJSON); - -cJSON *v1beta1_self_subject_review_convertToJSON(v1beta1_self_subject_review_t *v1beta1_self_subject_review); - -#endif /* _v1beta1_self_subject_review_H_ */ - diff --git a/kubernetes/model/v1beta1_self_subject_review_status.c b/kubernetes/model/v1beta1_self_subject_review_status.c deleted file mode 100644 index f128fba6..00000000 --- a/kubernetes/model/v1beta1_self_subject_review_status.c +++ /dev/null @@ -1,82 +0,0 @@ -#include -#include -#include -#include "v1beta1_self_subject_review_status.h" - - - -v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_create( - v1_user_info_t *user_info - ) { - v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_local_var = malloc(sizeof(v1beta1_self_subject_review_status_t)); - if (!v1beta1_self_subject_review_status_local_var) { - return NULL; - } - v1beta1_self_subject_review_status_local_var->user_info = user_info; - - return v1beta1_self_subject_review_status_local_var; -} - - -void v1beta1_self_subject_review_status_free(v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status) { - if(NULL == v1beta1_self_subject_review_status){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_self_subject_review_status->user_info) { - v1_user_info_free(v1beta1_self_subject_review_status->user_info); - v1beta1_self_subject_review_status->user_info = NULL; - } - free(v1beta1_self_subject_review_status); -} - -cJSON *v1beta1_self_subject_review_status_convertToJSON(v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_self_subject_review_status->user_info - if(v1beta1_self_subject_review_status->user_info) { - cJSON *user_info_local_JSON = v1_user_info_convertToJSON(v1beta1_self_subject_review_status->user_info); - if(user_info_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "userInfo", user_info_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_parseFromJSON(cJSON *v1beta1_self_subject_review_statusJSON){ - - v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_local_var = NULL; - - // define the local variable for v1beta1_self_subject_review_status->user_info - v1_user_info_t *user_info_local_nonprim = NULL; - - // v1beta1_self_subject_review_status->user_info - cJSON *user_info = cJSON_GetObjectItemCaseSensitive(v1beta1_self_subject_review_statusJSON, "userInfo"); - if (user_info) { - user_info_local_nonprim = v1_user_info_parseFromJSON(user_info); //nonprimitive - } - - - v1beta1_self_subject_review_status_local_var = v1beta1_self_subject_review_status_create ( - user_info ? user_info_local_nonprim : NULL - ); - - return v1beta1_self_subject_review_status_local_var; -end: - if (user_info_local_nonprim) { - v1_user_info_free(user_info_local_nonprim); - user_info_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_self_subject_review_status.h b/kubernetes/model/v1beta1_self_subject_review_status.h deleted file mode 100644 index 8af7b086..00000000 --- a/kubernetes/model/v1beta1_self_subject_review_status.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1beta1_self_subject_review_status.h - * - * SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user. - */ - -#ifndef _v1beta1_self_subject_review_status_H_ -#define _v1beta1_self_subject_review_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_self_subject_review_status_t v1beta1_self_subject_review_status_t; - -#include "v1_user_info.h" - - - -typedef struct v1beta1_self_subject_review_status_t { - struct v1_user_info_t *user_info; //model - -} v1beta1_self_subject_review_status_t; - -v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_create( - v1_user_info_t *user_info -); - -void v1beta1_self_subject_review_status_free(v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status); - -v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_parseFromJSON(cJSON *v1beta1_self_subject_review_statusJSON); - -cJSON *v1beta1_self_subject_review_status_convertToJSON(v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status); - -#endif /* _v1beta1_self_subject_review_status_H_ */ - diff --git a/kubernetes/model/v1beta1_service_cidr.c b/kubernetes/model/v1beta1_service_cidr.c new file mode 100644 index 00000000..15ff0401 --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr.c @@ -0,0 +1,231 @@ +#include +#include +#include +#include "v1beta1_service_cidr.h" + + + +static v1beta1_service_cidr_t *v1beta1_service_cidr_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_service_cidr_spec_t *spec, + v1beta1_service_cidr_status_t *status + ) { + v1beta1_service_cidr_t *v1beta1_service_cidr_local_var = malloc(sizeof(v1beta1_service_cidr_t)); + if (!v1beta1_service_cidr_local_var) { + return NULL; + } + v1beta1_service_cidr_local_var->api_version = api_version; + v1beta1_service_cidr_local_var->kind = kind; + v1beta1_service_cidr_local_var->metadata = metadata; + v1beta1_service_cidr_local_var->spec = spec; + v1beta1_service_cidr_local_var->status = status; + + v1beta1_service_cidr_local_var->_library_owned = 1; + return v1beta1_service_cidr_local_var; +} + +__attribute__((deprecated)) v1beta1_service_cidr_t *v1beta1_service_cidr_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_service_cidr_spec_t *spec, + v1beta1_service_cidr_status_t *status + ) { + return v1beta1_service_cidr_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} + +void v1beta1_service_cidr_free(v1beta1_service_cidr_t *v1beta1_service_cidr) { + if(NULL == v1beta1_service_cidr){ + return ; + } + if(v1beta1_service_cidr->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_service_cidr_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_service_cidr->api_version) { + free(v1beta1_service_cidr->api_version); + v1beta1_service_cidr->api_version = NULL; + } + if (v1beta1_service_cidr->kind) { + free(v1beta1_service_cidr->kind); + v1beta1_service_cidr->kind = NULL; + } + if (v1beta1_service_cidr->metadata) { + v1_object_meta_free(v1beta1_service_cidr->metadata); + v1beta1_service_cidr->metadata = NULL; + } + if (v1beta1_service_cidr->spec) { + v1beta1_service_cidr_spec_free(v1beta1_service_cidr->spec); + v1beta1_service_cidr->spec = NULL; + } + if (v1beta1_service_cidr->status) { + v1beta1_service_cidr_status_free(v1beta1_service_cidr->status); + v1beta1_service_cidr->status = NULL; + } + free(v1beta1_service_cidr); +} + +cJSON *v1beta1_service_cidr_convertToJSON(v1beta1_service_cidr_t *v1beta1_service_cidr) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_service_cidr->api_version + if(v1beta1_service_cidr->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_service_cidr->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_service_cidr->kind + if(v1beta1_service_cidr->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_service_cidr->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_service_cidr->metadata + if(v1beta1_service_cidr->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_service_cidr->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_service_cidr->spec + if(v1beta1_service_cidr->spec) { + cJSON *spec_local_JSON = v1beta1_service_cidr_spec_convertToJSON(v1beta1_service_cidr->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_service_cidr->status + if(v1beta1_service_cidr->status) { + cJSON *status_local_JSON = v1beta1_service_cidr_status_convertToJSON(v1beta1_service_cidr->status); + if(status_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "status", status_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_service_cidr_t *v1beta1_service_cidr_parseFromJSON(cJSON *v1beta1_service_cidrJSON){ + + v1beta1_service_cidr_t *v1beta1_service_cidr_local_var = NULL; + + // define the local variable for v1beta1_service_cidr->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta1_service_cidr->spec + v1beta1_service_cidr_spec_t *spec_local_nonprim = NULL; + + // define the local variable for v1beta1_service_cidr->status + v1beta1_service_cidr_status_t *status_local_nonprim = NULL; + + // v1beta1_service_cidr->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidrJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_service_cidr->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidrJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_service_cidr->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidrJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_service_cidr->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidrJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (spec) { + spec_local_nonprim = v1beta1_service_cidr_spec_parseFromJSON(spec); //nonprimitive + } + + // v1beta1_service_cidr->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidrJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } + if (status) { + status_local_nonprim = v1beta1_service_cidr_status_parseFromJSON(status); //nonprimitive + } + + + v1beta1_service_cidr_local_var = v1beta1_service_cidr_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec ? spec_local_nonprim : NULL, + status ? status_local_nonprim : NULL + ); + + return v1beta1_service_cidr_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta1_service_cidr_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + if (status_local_nonprim) { + v1beta1_service_cidr_status_free(status_local_nonprim); + status_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_service_cidr.h b/kubernetes/model/v1beta1_service_cidr.h new file mode 100644 index 00000000..214e7351 --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr.h @@ -0,0 +1,49 @@ +/* + * v1beta1_service_cidr.h + * + * ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects. + */ + +#ifndef _v1beta1_service_cidr_H_ +#define _v1beta1_service_cidr_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_service_cidr_t v1beta1_service_cidr_t; + +#include "v1_object_meta.h" +#include "v1beta1_service_cidr_spec.h" +#include "v1beta1_service_cidr_status.h" + + + +typedef struct v1beta1_service_cidr_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta1_service_cidr_spec_t *spec; //model + struct v1beta1_service_cidr_status_t *status; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_service_cidr_t; + +__attribute__((deprecated)) v1beta1_service_cidr_t *v1beta1_service_cidr_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta1_service_cidr_spec_t *spec, + v1beta1_service_cidr_status_t *status +); + +void v1beta1_service_cidr_free(v1beta1_service_cidr_t *v1beta1_service_cidr); + +v1beta1_service_cidr_t *v1beta1_service_cidr_parseFromJSON(cJSON *v1beta1_service_cidrJSON); + +cJSON *v1beta1_service_cidr_convertToJSON(v1beta1_service_cidr_t *v1beta1_service_cidr); + +#endif /* _v1beta1_service_cidr_H_ */ + diff --git a/kubernetes/model/v1beta1_service_cidr_list.c b/kubernetes/model/v1beta1_service_cidr_list.c new file mode 100644 index 00000000..c1a1be50 --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_service_cidr_list.h" + + + +static v1beta1_service_cidr_list_t *v1beta1_service_cidr_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_service_cidr_list_t *v1beta1_service_cidr_list_local_var = malloc(sizeof(v1beta1_service_cidr_list_t)); + if (!v1beta1_service_cidr_list_local_var) { + return NULL; + } + v1beta1_service_cidr_list_local_var->api_version = api_version; + v1beta1_service_cidr_list_local_var->items = items; + v1beta1_service_cidr_list_local_var->kind = kind; + v1beta1_service_cidr_list_local_var->metadata = metadata; + + v1beta1_service_cidr_list_local_var->_library_owned = 1; + return v1beta1_service_cidr_list_local_var; +} + +__attribute__((deprecated)) v1beta1_service_cidr_list_t *v1beta1_service_cidr_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_service_cidr_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_service_cidr_list_free(v1beta1_service_cidr_list_t *v1beta1_service_cidr_list) { + if(NULL == v1beta1_service_cidr_list){ + return ; + } + if(v1beta1_service_cidr_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_service_cidr_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_service_cidr_list->api_version) { + free(v1beta1_service_cidr_list->api_version); + v1beta1_service_cidr_list->api_version = NULL; + } + if (v1beta1_service_cidr_list->items) { + list_ForEach(listEntry, v1beta1_service_cidr_list->items) { + v1beta1_service_cidr_free(listEntry->data); + } + list_freeList(v1beta1_service_cidr_list->items); + v1beta1_service_cidr_list->items = NULL; + } + if (v1beta1_service_cidr_list->kind) { + free(v1beta1_service_cidr_list->kind); + v1beta1_service_cidr_list->kind = NULL; + } + if (v1beta1_service_cidr_list->metadata) { + v1_list_meta_free(v1beta1_service_cidr_list->metadata); + v1beta1_service_cidr_list->metadata = NULL; + } + free(v1beta1_service_cidr_list); +} + +cJSON *v1beta1_service_cidr_list_convertToJSON(v1beta1_service_cidr_list_t *v1beta1_service_cidr_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_service_cidr_list->api_version + if(v1beta1_service_cidr_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_service_cidr_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_service_cidr_list->items + if (!v1beta1_service_cidr_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_service_cidr_list->items) { + list_ForEach(itemsListEntry, v1beta1_service_cidr_list->items) { + cJSON *itemLocal = v1beta1_service_cidr_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_service_cidr_list->kind + if(v1beta1_service_cidr_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_service_cidr_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_service_cidr_list->metadata + if(v1beta1_service_cidr_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_service_cidr_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_service_cidr_list_t *v1beta1_service_cidr_list_parseFromJSON(cJSON *v1beta1_service_cidr_listJSON){ + + v1beta1_service_cidr_list_t *v1beta1_service_cidr_list_local_var = NULL; + + // define the local list for v1beta1_service_cidr_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_service_cidr_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_service_cidr_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidr_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_service_cidr_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidr_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_service_cidr_t *itemsItem = v1beta1_service_cidr_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_service_cidr_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidr_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_service_cidr_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidr_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_service_cidr_list_local_var = v1beta1_service_cidr_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_service_cidr_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_service_cidr_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_service_cidr_list.h b/kubernetes/model/v1beta1_service_cidr_list.h new file mode 100644 index 00000000..2d55cf74 --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_service_cidr_list.h + * + * ServiceCIDRList contains a list of ServiceCIDR objects. + */ + +#ifndef _v1beta1_service_cidr_list_H_ +#define _v1beta1_service_cidr_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_service_cidr_list_t v1beta1_service_cidr_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_service_cidr.h" + + + +typedef struct v1beta1_service_cidr_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_service_cidr_list_t; + +__attribute__((deprecated)) v1beta1_service_cidr_list_t *v1beta1_service_cidr_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_service_cidr_list_free(v1beta1_service_cidr_list_t *v1beta1_service_cidr_list); + +v1beta1_service_cidr_list_t *v1beta1_service_cidr_list_parseFromJSON(cJSON *v1beta1_service_cidr_listJSON); + +cJSON *v1beta1_service_cidr_list_convertToJSON(v1beta1_service_cidr_list_t *v1beta1_service_cidr_list); + +#endif /* _v1beta1_service_cidr_list_H_ */ + diff --git a/kubernetes/model/v1beta1_service_cidr_spec.c b/kubernetes/model/v1beta1_service_cidr_spec.c new file mode 100644 index 00000000..b4202176 --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr_spec.c @@ -0,0 +1,122 @@ +#include +#include +#include +#include "v1beta1_service_cidr_spec.h" + + + +static v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec_create_internal( + list_t *cidrs + ) { + v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec_local_var = malloc(sizeof(v1beta1_service_cidr_spec_t)); + if (!v1beta1_service_cidr_spec_local_var) { + return NULL; + } + v1beta1_service_cidr_spec_local_var->cidrs = cidrs; + + v1beta1_service_cidr_spec_local_var->_library_owned = 1; + return v1beta1_service_cidr_spec_local_var; +} + +__attribute__((deprecated)) v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec_create( + list_t *cidrs + ) { + return v1beta1_service_cidr_spec_create_internal ( + cidrs + ); +} + +void v1beta1_service_cidr_spec_free(v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec) { + if(NULL == v1beta1_service_cidr_spec){ + return ; + } + if(v1beta1_service_cidr_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_service_cidr_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_service_cidr_spec->cidrs) { + list_ForEach(listEntry, v1beta1_service_cidr_spec->cidrs) { + free(listEntry->data); + } + list_freeList(v1beta1_service_cidr_spec->cidrs); + v1beta1_service_cidr_spec->cidrs = NULL; + } + free(v1beta1_service_cidr_spec); +} + +cJSON *v1beta1_service_cidr_spec_convertToJSON(v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_service_cidr_spec->cidrs + if(v1beta1_service_cidr_spec->cidrs) { + cJSON *cidrs = cJSON_AddArrayToObject(item, "cidrs"); + if(cidrs == NULL) { + goto fail; //primitive container + } + + listEntry_t *cidrsListEntry; + list_ForEach(cidrsListEntry, v1beta1_service_cidr_spec->cidrs) { + if(cJSON_AddStringToObject(cidrs, "", cidrsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec_parseFromJSON(cJSON *v1beta1_service_cidr_specJSON){ + + v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec_local_var = NULL; + + // define the local list for v1beta1_service_cidr_spec->cidrs + list_t *cidrsList = NULL; + + // v1beta1_service_cidr_spec->cidrs + cJSON *cidrs = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidr_specJSON, "cidrs"); + if (cJSON_IsNull(cidrs)) { + cidrs = NULL; + } + if (cidrs) { + cJSON *cidrs_local = NULL; + if(!cJSON_IsArray(cidrs)) { + goto end;//primitive container + } + cidrsList = list_createList(); + + cJSON_ArrayForEach(cidrs_local, cidrs) + { + if(!cJSON_IsString(cidrs_local)) + { + goto end; + } + list_addElement(cidrsList , strdup(cidrs_local->valuestring)); + } + } + + + v1beta1_service_cidr_spec_local_var = v1beta1_service_cidr_spec_create_internal ( + cidrs ? cidrsList : NULL + ); + + return v1beta1_service_cidr_spec_local_var; +end: + if (cidrsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, cidrsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(cidrsList); + cidrsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_service_cidr_spec.h b/kubernetes/model/v1beta1_service_cidr_spec.h new file mode 100644 index 00000000..ccabeb05 --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr_spec.h @@ -0,0 +1,38 @@ +/* + * v1beta1_service_cidr_spec.h + * + * ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. + */ + +#ifndef _v1beta1_service_cidr_spec_H_ +#define _v1beta1_service_cidr_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_service_cidr_spec_t v1beta1_service_cidr_spec_t; + + + + +typedef struct v1beta1_service_cidr_spec_t { + list_t *cidrs; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_service_cidr_spec_t; + +__attribute__((deprecated)) v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec_create( + list_t *cidrs +); + +void v1beta1_service_cidr_spec_free(v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec); + +v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec_parseFromJSON(cJSON *v1beta1_service_cidr_specJSON); + +cJSON *v1beta1_service_cidr_spec_convertToJSON(v1beta1_service_cidr_spec_t *v1beta1_service_cidr_spec); + +#endif /* _v1beta1_service_cidr_spec_H_ */ + diff --git a/kubernetes/model/v1beta1_service_cidr_status.c b/kubernetes/model/v1beta1_service_cidr_status.c new file mode 100644 index 00000000..cd7a00e4 --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr_status.c @@ -0,0 +1,127 @@ +#include +#include +#include +#include "v1beta1_service_cidr_status.h" + + + +static v1beta1_service_cidr_status_t *v1beta1_service_cidr_status_create_internal( + list_t *conditions + ) { + v1beta1_service_cidr_status_t *v1beta1_service_cidr_status_local_var = malloc(sizeof(v1beta1_service_cidr_status_t)); + if (!v1beta1_service_cidr_status_local_var) { + return NULL; + } + v1beta1_service_cidr_status_local_var->conditions = conditions; + + v1beta1_service_cidr_status_local_var->_library_owned = 1; + return v1beta1_service_cidr_status_local_var; +} + +__attribute__((deprecated)) v1beta1_service_cidr_status_t *v1beta1_service_cidr_status_create( + list_t *conditions + ) { + return v1beta1_service_cidr_status_create_internal ( + conditions + ); +} + +void v1beta1_service_cidr_status_free(v1beta1_service_cidr_status_t *v1beta1_service_cidr_status) { + if(NULL == v1beta1_service_cidr_status){ + return ; + } + if(v1beta1_service_cidr_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_service_cidr_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_service_cidr_status->conditions) { + list_ForEach(listEntry, v1beta1_service_cidr_status->conditions) { + v1_condition_free(listEntry->data); + } + list_freeList(v1beta1_service_cidr_status->conditions); + v1beta1_service_cidr_status->conditions = NULL; + } + free(v1beta1_service_cidr_status); +} + +cJSON *v1beta1_service_cidr_status_convertToJSON(v1beta1_service_cidr_status_t *v1beta1_service_cidr_status) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_service_cidr_status->conditions + if(v1beta1_service_cidr_status->conditions) { + cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); + if(conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *conditionsListEntry; + if (v1beta1_service_cidr_status->conditions) { + list_ForEach(conditionsListEntry, v1beta1_service_cidr_status->conditions) { + cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(conditions, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_service_cidr_status_t *v1beta1_service_cidr_status_parseFromJSON(cJSON *v1beta1_service_cidr_statusJSON){ + + v1beta1_service_cidr_status_t *v1beta1_service_cidr_status_local_var = NULL; + + // define the local list for v1beta1_service_cidr_status->conditions + list_t *conditionsList = NULL; + + // v1beta1_service_cidr_status->conditions + cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_service_cidr_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } + if (conditions) { + cJSON *conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(conditions)){ + goto end; //nonprimitive container + } + + conditionsList = list_createList(); + + cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) + { + if(!cJSON_IsObject(conditions_local_nonprimitive)){ + goto end; + } + v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); + + list_addElement(conditionsList, conditionsItem); + } + } + + + v1beta1_service_cidr_status_local_var = v1beta1_service_cidr_status_create_internal ( + conditions ? conditionsList : NULL + ); + + return v1beta1_service_cidr_status_local_var; +end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_service_cidr_status.h b/kubernetes/model/v1beta1_service_cidr_status.h new file mode 100644 index 00000000..f6a3293f --- /dev/null +++ b/kubernetes/model/v1beta1_service_cidr_status.h @@ -0,0 +1,39 @@ +/* + * v1beta1_service_cidr_status.h + * + * ServiceCIDRStatus describes the current state of the ServiceCIDR. + */ + +#ifndef _v1beta1_service_cidr_status_H_ +#define _v1beta1_service_cidr_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_service_cidr_status_t v1beta1_service_cidr_status_t; + +#include "v1_condition.h" + + + +typedef struct v1beta1_service_cidr_status_t { + list_t *conditions; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_service_cidr_status_t; + +__attribute__((deprecated)) v1beta1_service_cidr_status_t *v1beta1_service_cidr_status_create( + list_t *conditions +); + +void v1beta1_service_cidr_status_free(v1beta1_service_cidr_status_t *v1beta1_service_cidr_status); + +v1beta1_service_cidr_status_t *v1beta1_service_cidr_status_parseFromJSON(cJSON *v1beta1_service_cidr_statusJSON); + +cJSON *v1beta1_service_cidr_status_convertToJSON(v1beta1_service_cidr_status_t *v1beta1_service_cidr_status); + +#endif /* _v1beta1_service_cidr_status_H_ */ + diff --git a/kubernetes/model/v1beta1_type_checking.c b/kubernetes/model/v1beta1_type_checking.c deleted file mode 100644 index 3e863f51..00000000 --- a/kubernetes/model/v1beta1_type_checking.c +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include "v1beta1_type_checking.h" - - - -v1beta1_type_checking_t *v1beta1_type_checking_create( - list_t *expression_warnings - ) { - v1beta1_type_checking_t *v1beta1_type_checking_local_var = malloc(sizeof(v1beta1_type_checking_t)); - if (!v1beta1_type_checking_local_var) { - return NULL; - } - v1beta1_type_checking_local_var->expression_warnings = expression_warnings; - - return v1beta1_type_checking_local_var; -} - - -void v1beta1_type_checking_free(v1beta1_type_checking_t *v1beta1_type_checking) { - if(NULL == v1beta1_type_checking){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_type_checking->expression_warnings) { - list_ForEach(listEntry, v1beta1_type_checking->expression_warnings) { - v1beta1_expression_warning_free(listEntry->data); - } - list_freeList(v1beta1_type_checking->expression_warnings); - v1beta1_type_checking->expression_warnings = NULL; - } - free(v1beta1_type_checking); -} - -cJSON *v1beta1_type_checking_convertToJSON(v1beta1_type_checking_t *v1beta1_type_checking) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_type_checking->expression_warnings - if(v1beta1_type_checking->expression_warnings) { - cJSON *expression_warnings = cJSON_AddArrayToObject(item, "expressionWarnings"); - if(expression_warnings == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *expression_warningsListEntry; - if (v1beta1_type_checking->expression_warnings) { - list_ForEach(expression_warningsListEntry, v1beta1_type_checking->expression_warnings) { - cJSON *itemLocal = v1beta1_expression_warning_convertToJSON(expression_warningsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(expression_warnings, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_type_checking_t *v1beta1_type_checking_parseFromJSON(cJSON *v1beta1_type_checkingJSON){ - - v1beta1_type_checking_t *v1beta1_type_checking_local_var = NULL; - - // define the local list for v1beta1_type_checking->expression_warnings - list_t *expression_warningsList = NULL; - - // v1beta1_type_checking->expression_warnings - cJSON *expression_warnings = cJSON_GetObjectItemCaseSensitive(v1beta1_type_checkingJSON, "expressionWarnings"); - if (expression_warnings) { - cJSON *expression_warnings_local_nonprimitive = NULL; - if(!cJSON_IsArray(expression_warnings)){ - goto end; //nonprimitive container - } - - expression_warningsList = list_createList(); - - cJSON_ArrayForEach(expression_warnings_local_nonprimitive,expression_warnings ) - { - if(!cJSON_IsObject(expression_warnings_local_nonprimitive)){ - goto end; - } - v1beta1_expression_warning_t *expression_warningsItem = v1beta1_expression_warning_parseFromJSON(expression_warnings_local_nonprimitive); - - list_addElement(expression_warningsList, expression_warningsItem); - } - } - - - v1beta1_type_checking_local_var = v1beta1_type_checking_create ( - expression_warnings ? expression_warningsList : NULL - ); - - return v1beta1_type_checking_local_var; -end: - if (expression_warningsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, expression_warningsList) { - v1beta1_expression_warning_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(expression_warningsList); - expression_warningsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_type_checking.h b/kubernetes/model/v1beta1_type_checking.h deleted file mode 100644 index fa3dafca..00000000 --- a/kubernetes/model/v1beta1_type_checking.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1beta1_type_checking.h - * - * TypeChecking contains results of type checking the expressions in the ValidatingAdmissionPolicy - */ - -#ifndef _v1beta1_type_checking_H_ -#define _v1beta1_type_checking_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_type_checking_t v1beta1_type_checking_t; - -#include "v1beta1_expression_warning.h" - - - -typedef struct v1beta1_type_checking_t { - list_t *expression_warnings; //nonprimitive container - -} v1beta1_type_checking_t; - -v1beta1_type_checking_t *v1beta1_type_checking_create( - list_t *expression_warnings -); - -void v1beta1_type_checking_free(v1beta1_type_checking_t *v1beta1_type_checking); - -v1beta1_type_checking_t *v1beta1_type_checking_parseFromJSON(cJSON *v1beta1_type_checkingJSON); - -cJSON *v1beta1_type_checking_convertToJSON(v1beta1_type_checking_t *v1beta1_type_checking); - -#endif /* _v1beta1_type_checking_H_ */ - diff --git a/kubernetes/model/v1beta1_validating_admission_policy.c b/kubernetes/model/v1beta1_validating_admission_policy.c deleted file mode 100644 index 3984ee58..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy.c +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include -#include -#include "v1beta1_validating_admission_policy.h" - - - -v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta1_validating_admission_policy_spec_t *spec, - v1beta1_validating_admission_policy_status_t *status - ) { - v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy_local_var = malloc(sizeof(v1beta1_validating_admission_policy_t)); - if (!v1beta1_validating_admission_policy_local_var) { - return NULL; - } - v1beta1_validating_admission_policy_local_var->api_version = api_version; - v1beta1_validating_admission_policy_local_var->kind = kind; - v1beta1_validating_admission_policy_local_var->metadata = metadata; - v1beta1_validating_admission_policy_local_var->spec = spec; - v1beta1_validating_admission_policy_local_var->status = status; - - return v1beta1_validating_admission_policy_local_var; -} - - -void v1beta1_validating_admission_policy_free(v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy) { - if(NULL == v1beta1_validating_admission_policy){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validating_admission_policy->api_version) { - free(v1beta1_validating_admission_policy->api_version); - v1beta1_validating_admission_policy->api_version = NULL; - } - if (v1beta1_validating_admission_policy->kind) { - free(v1beta1_validating_admission_policy->kind); - v1beta1_validating_admission_policy->kind = NULL; - } - if (v1beta1_validating_admission_policy->metadata) { - v1_object_meta_free(v1beta1_validating_admission_policy->metadata); - v1beta1_validating_admission_policy->metadata = NULL; - } - if (v1beta1_validating_admission_policy->spec) { - v1beta1_validating_admission_policy_spec_free(v1beta1_validating_admission_policy->spec); - v1beta1_validating_admission_policy->spec = NULL; - } - if (v1beta1_validating_admission_policy->status) { - v1beta1_validating_admission_policy_status_free(v1beta1_validating_admission_policy->status); - v1beta1_validating_admission_policy->status = NULL; - } - free(v1beta1_validating_admission_policy); -} - -cJSON *v1beta1_validating_admission_policy_convertToJSON(v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validating_admission_policy->api_version - if(v1beta1_validating_admission_policy->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_validating_admission_policy->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy->kind - if(v1beta1_validating_admission_policy->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta1_validating_admission_policy->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy->metadata - if(v1beta1_validating_admission_policy->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_validating_admission_policy->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_validating_admission_policy->spec - if(v1beta1_validating_admission_policy->spec) { - cJSON *spec_local_JSON = v1beta1_validating_admission_policy_spec_convertToJSON(v1beta1_validating_admission_policy->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_validating_admission_policy->status - if(v1beta1_validating_admission_policy->status) { - cJSON *status_local_JSON = v1beta1_validating_admission_policy_status_convertToJSON(v1beta1_validating_admission_policy->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy_parseFromJSON(cJSON *v1beta1_validating_admission_policyJSON){ - - v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy_local_var = NULL; - - // define the local variable for v1beta1_validating_admission_policy->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1beta1_validating_admission_policy->spec - v1beta1_validating_admission_policy_spec_t *spec_local_nonprim = NULL; - - // define the local variable for v1beta1_validating_admission_policy->status - v1beta1_validating_admission_policy_status_t *status_local_nonprim = NULL; - - // v1beta1_validating_admission_policy->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policyJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policyJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policyJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1beta1_validating_admission_policy->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policyJSON, "spec"); - if (spec) { - spec_local_nonprim = v1beta1_validating_admission_policy_spec_parseFromJSON(spec); //nonprimitive - } - - // v1beta1_validating_admission_policy->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policyJSON, "status"); - if (status) { - status_local_nonprim = v1beta1_validating_admission_policy_status_parseFromJSON(status); //nonprimitive - } - - - v1beta1_validating_admission_policy_local_var = v1beta1_validating_admission_policy_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL, - status ? status_local_nonprim : NULL - ); - - return v1beta1_validating_admission_policy_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1beta1_validating_admission_policy_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1beta1_validating_admission_policy_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validating_admission_policy.h b/kubernetes/model/v1beta1_validating_admission_policy.h deleted file mode 100644 index 7ef115be..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * v1beta1_validating_admission_policy.h - * - * ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. - */ - -#ifndef _v1beta1_validating_admission_policy_H_ -#define _v1beta1_validating_admission_policy_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validating_admission_policy_t v1beta1_validating_admission_policy_t; - -#include "v1_object_meta.h" -#include "v1beta1_validating_admission_policy_spec.h" -#include "v1beta1_validating_admission_policy_status.h" - - - -typedef struct v1beta1_validating_admission_policy_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1beta1_validating_admission_policy_spec_t *spec; //model - struct v1beta1_validating_admission_policy_status_t *status; //model - -} v1beta1_validating_admission_policy_t; - -v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta1_validating_admission_policy_spec_t *spec, - v1beta1_validating_admission_policy_status_t *status -); - -void v1beta1_validating_admission_policy_free(v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy); - -v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy_parseFromJSON(cJSON *v1beta1_validating_admission_policyJSON); - -cJSON *v1beta1_validating_admission_policy_convertToJSON(v1beta1_validating_admission_policy_t *v1beta1_validating_admission_policy); - -#endif /* _v1beta1_validating_admission_policy_H_ */ - diff --git a/kubernetes/model/v1beta1_validating_admission_policy_binding.c b/kubernetes/model/v1beta1_validating_admission_policy_binding.c deleted file mode 100644 index 0c24bac0..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_binding.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include "v1beta1_validating_admission_policy_binding.h" - - - -v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta1_validating_admission_policy_binding_spec_t *spec - ) { - v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding_local_var = malloc(sizeof(v1beta1_validating_admission_policy_binding_t)); - if (!v1beta1_validating_admission_policy_binding_local_var) { - return NULL; - } - v1beta1_validating_admission_policy_binding_local_var->api_version = api_version; - v1beta1_validating_admission_policy_binding_local_var->kind = kind; - v1beta1_validating_admission_policy_binding_local_var->metadata = metadata; - v1beta1_validating_admission_policy_binding_local_var->spec = spec; - - return v1beta1_validating_admission_policy_binding_local_var; -} - - -void v1beta1_validating_admission_policy_binding_free(v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding) { - if(NULL == v1beta1_validating_admission_policy_binding){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validating_admission_policy_binding->api_version) { - free(v1beta1_validating_admission_policy_binding->api_version); - v1beta1_validating_admission_policy_binding->api_version = NULL; - } - if (v1beta1_validating_admission_policy_binding->kind) { - free(v1beta1_validating_admission_policy_binding->kind); - v1beta1_validating_admission_policy_binding->kind = NULL; - } - if (v1beta1_validating_admission_policy_binding->metadata) { - v1_object_meta_free(v1beta1_validating_admission_policy_binding->metadata); - v1beta1_validating_admission_policy_binding->metadata = NULL; - } - if (v1beta1_validating_admission_policy_binding->spec) { - v1beta1_validating_admission_policy_binding_spec_free(v1beta1_validating_admission_policy_binding->spec); - v1beta1_validating_admission_policy_binding->spec = NULL; - } - free(v1beta1_validating_admission_policy_binding); -} - -cJSON *v1beta1_validating_admission_policy_binding_convertToJSON(v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validating_admission_policy_binding->api_version - if(v1beta1_validating_admission_policy_binding->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_validating_admission_policy_binding->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_binding->kind - if(v1beta1_validating_admission_policy_binding->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta1_validating_admission_policy_binding->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_binding->metadata - if(v1beta1_validating_admission_policy_binding->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_validating_admission_policy_binding->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_validating_admission_policy_binding->spec - if(v1beta1_validating_admission_policy_binding->spec) { - cJSON *spec_local_JSON = v1beta1_validating_admission_policy_binding_spec_convertToJSON(v1beta1_validating_admission_policy_binding->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding_parseFromJSON(cJSON *v1beta1_validating_admission_policy_bindingJSON){ - - v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding_local_var = NULL; - - // define the local variable for v1beta1_validating_admission_policy_binding->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1beta1_validating_admission_policy_binding->spec - v1beta1_validating_admission_policy_binding_spec_t *spec_local_nonprim = NULL; - - // v1beta1_validating_admission_policy_binding->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_bindingJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_binding->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_bindingJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_binding->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_bindingJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1beta1_validating_admission_policy_binding->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_bindingJSON, "spec"); - if (spec) { - spec_local_nonprim = v1beta1_validating_admission_policy_binding_spec_parseFromJSON(spec); //nonprimitive - } - - - v1beta1_validating_admission_policy_binding_local_var = v1beta1_validating_admission_policy_binding_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL - ); - - return v1beta1_validating_admission_policy_binding_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1beta1_validating_admission_policy_binding_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validating_admission_policy_binding.h b/kubernetes/model/v1beta1_validating_admission_policy_binding.h deleted file mode 100644 index 5232e7f2..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_binding.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta1_validating_admission_policy_binding.h - * - * ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters. For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget. - */ - -#ifndef _v1beta1_validating_admission_policy_binding_H_ -#define _v1beta1_validating_admission_policy_binding_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validating_admission_policy_binding_t v1beta1_validating_admission_policy_binding_t; - -#include "v1_object_meta.h" -#include "v1beta1_validating_admission_policy_binding_spec.h" - - - -typedef struct v1beta1_validating_admission_policy_binding_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1beta1_validating_admission_policy_binding_spec_t *spec; //model - -} v1beta1_validating_admission_policy_binding_t; - -v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta1_validating_admission_policy_binding_spec_t *spec -); - -void v1beta1_validating_admission_policy_binding_free(v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding); - -v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding_parseFromJSON(cJSON *v1beta1_validating_admission_policy_bindingJSON); - -cJSON *v1beta1_validating_admission_policy_binding_convertToJSON(v1beta1_validating_admission_policy_binding_t *v1beta1_validating_admission_policy_binding); - -#endif /* _v1beta1_validating_admission_policy_binding_H_ */ - diff --git a/kubernetes/model/v1beta1_validating_admission_policy_binding_list.c b/kubernetes/model/v1beta1_validating_admission_policy_binding_list.c deleted file mode 100644 index fee8f24e..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_binding_list.c +++ /dev/null @@ -1,193 +0,0 @@ -#include -#include -#include -#include "v1beta1_validating_admission_policy_binding_list.h" - - - -v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list_local_var = malloc(sizeof(v1beta1_validating_admission_policy_binding_list_t)); - if (!v1beta1_validating_admission_policy_binding_list_local_var) { - return NULL; - } - v1beta1_validating_admission_policy_binding_list_local_var->api_version = api_version; - v1beta1_validating_admission_policy_binding_list_local_var->items = items; - v1beta1_validating_admission_policy_binding_list_local_var->kind = kind; - v1beta1_validating_admission_policy_binding_list_local_var->metadata = metadata; - - return v1beta1_validating_admission_policy_binding_list_local_var; -} - - -void v1beta1_validating_admission_policy_binding_list_free(v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list) { - if(NULL == v1beta1_validating_admission_policy_binding_list){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validating_admission_policy_binding_list->api_version) { - free(v1beta1_validating_admission_policy_binding_list->api_version); - v1beta1_validating_admission_policy_binding_list->api_version = NULL; - } - if (v1beta1_validating_admission_policy_binding_list->items) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_binding_list->items) { - v1beta1_validating_admission_policy_binding_free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_binding_list->items); - v1beta1_validating_admission_policy_binding_list->items = NULL; - } - if (v1beta1_validating_admission_policy_binding_list->kind) { - free(v1beta1_validating_admission_policy_binding_list->kind); - v1beta1_validating_admission_policy_binding_list->kind = NULL; - } - if (v1beta1_validating_admission_policy_binding_list->metadata) { - v1_list_meta_free(v1beta1_validating_admission_policy_binding_list->metadata); - v1beta1_validating_admission_policy_binding_list->metadata = NULL; - } - free(v1beta1_validating_admission_policy_binding_list); -} - -cJSON *v1beta1_validating_admission_policy_binding_list_convertToJSON(v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validating_admission_policy_binding_list->api_version - if(v1beta1_validating_admission_policy_binding_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_validating_admission_policy_binding_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_binding_list->items - if(v1beta1_validating_admission_policy_binding_list->items) { - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1beta1_validating_admission_policy_binding_list->items) { - list_ForEach(itemsListEntry, v1beta1_validating_admission_policy_binding_list->items) { - cJSON *itemLocal = v1beta1_validating_admission_policy_binding_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - } - - - // v1beta1_validating_admission_policy_binding_list->kind - if(v1beta1_validating_admission_policy_binding_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta1_validating_admission_policy_binding_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_binding_list->metadata - if(v1beta1_validating_admission_policy_binding_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_validating_admission_policy_binding_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list_parseFromJSON(cJSON *v1beta1_validating_admission_policy_binding_listJSON){ - - v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list_local_var = NULL; - - // define the local list for v1beta1_validating_admission_policy_binding_list->items - list_t *itemsList = NULL; - - // define the local variable for v1beta1_validating_admission_policy_binding_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1beta1_validating_admission_policy_binding_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_binding_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_listJSON, "items"); - if (items) { - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1beta1_validating_admission_policy_binding_t *itemsItem = v1beta1_validating_admission_policy_binding_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - } - - // v1beta1_validating_admission_policy_binding_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_binding_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1beta1_validating_admission_policy_binding_list_local_var = v1beta1_validating_admission_policy_binding_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - items ? itemsList : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1beta1_validating_admission_policy_binding_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1beta1_validating_admission_policy_binding_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validating_admission_policy_binding_list.h b/kubernetes/model/v1beta1_validating_admission_policy_binding_list.h deleted file mode 100644 index fb5cfe4c..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_binding_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta1_validating_admission_policy_binding_list.h - * - * ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding. - */ - -#ifndef _v1beta1_validating_admission_policy_binding_list_H_ -#define _v1beta1_validating_admission_policy_binding_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validating_admission_policy_binding_list_t v1beta1_validating_admission_policy_binding_list_t; - -#include "v1_list_meta.h" -#include "v1beta1_validating_admission_policy_binding.h" - - - -typedef struct v1beta1_validating_admission_policy_binding_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1beta1_validating_admission_policy_binding_list_t; - -v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1beta1_validating_admission_policy_binding_list_free(v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list); - -v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list_parseFromJSON(cJSON *v1beta1_validating_admission_policy_binding_listJSON); - -cJSON *v1beta1_validating_admission_policy_binding_list_convertToJSON(v1beta1_validating_admission_policy_binding_list_t *v1beta1_validating_admission_policy_binding_list); - -#endif /* _v1beta1_validating_admission_policy_binding_list_H_ */ - diff --git a/kubernetes/model/v1beta1_validating_admission_policy_binding_spec.c b/kubernetes/model/v1beta1_validating_admission_policy_binding_spec.c deleted file mode 100644 index ad3dd592..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_binding_spec.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1beta1_validating_admission_policy_binding_spec.h" - - - -v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec_create( - v1beta1_match_resources_t *match_resources, - v1beta1_param_ref_t *param_ref, - char *policy_name, - list_t *validation_actions - ) { - v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec_local_var = malloc(sizeof(v1beta1_validating_admission_policy_binding_spec_t)); - if (!v1beta1_validating_admission_policy_binding_spec_local_var) { - return NULL; - } - v1beta1_validating_admission_policy_binding_spec_local_var->match_resources = match_resources; - v1beta1_validating_admission_policy_binding_spec_local_var->param_ref = param_ref; - v1beta1_validating_admission_policy_binding_spec_local_var->policy_name = policy_name; - v1beta1_validating_admission_policy_binding_spec_local_var->validation_actions = validation_actions; - - return v1beta1_validating_admission_policy_binding_spec_local_var; -} - - -void v1beta1_validating_admission_policy_binding_spec_free(v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec) { - if(NULL == v1beta1_validating_admission_policy_binding_spec){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validating_admission_policy_binding_spec->match_resources) { - v1beta1_match_resources_free(v1beta1_validating_admission_policy_binding_spec->match_resources); - v1beta1_validating_admission_policy_binding_spec->match_resources = NULL; - } - if (v1beta1_validating_admission_policy_binding_spec->param_ref) { - v1beta1_param_ref_free(v1beta1_validating_admission_policy_binding_spec->param_ref); - v1beta1_validating_admission_policy_binding_spec->param_ref = NULL; - } - if (v1beta1_validating_admission_policy_binding_spec->policy_name) { - free(v1beta1_validating_admission_policy_binding_spec->policy_name); - v1beta1_validating_admission_policy_binding_spec->policy_name = NULL; - } - if (v1beta1_validating_admission_policy_binding_spec->validation_actions) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_binding_spec->validation_actions) { - free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_binding_spec->validation_actions); - v1beta1_validating_admission_policy_binding_spec->validation_actions = NULL; - } - free(v1beta1_validating_admission_policy_binding_spec); -} - -cJSON *v1beta1_validating_admission_policy_binding_spec_convertToJSON(v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validating_admission_policy_binding_spec->match_resources - if(v1beta1_validating_admission_policy_binding_spec->match_resources) { - cJSON *match_resources_local_JSON = v1beta1_match_resources_convertToJSON(v1beta1_validating_admission_policy_binding_spec->match_resources); - if(match_resources_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "matchResources", match_resources_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_validating_admission_policy_binding_spec->param_ref - if(v1beta1_validating_admission_policy_binding_spec->param_ref) { - cJSON *param_ref_local_JSON = v1beta1_param_ref_convertToJSON(v1beta1_validating_admission_policy_binding_spec->param_ref); - if(param_ref_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "paramRef", param_ref_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_validating_admission_policy_binding_spec->policy_name - if(v1beta1_validating_admission_policy_binding_spec->policy_name) { - if(cJSON_AddStringToObject(item, "policyName", v1beta1_validating_admission_policy_binding_spec->policy_name) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_binding_spec->validation_actions - if(v1beta1_validating_admission_policy_binding_spec->validation_actions) { - cJSON *validation_actions = cJSON_AddArrayToObject(item, "validationActions"); - if(validation_actions == NULL) { - goto fail; //primitive container - } - - listEntry_t *validation_actionsListEntry; - list_ForEach(validation_actionsListEntry, v1beta1_validating_admission_policy_binding_spec->validation_actions) { - if(cJSON_AddStringToObject(validation_actions, "", (char*)validation_actionsListEntry->data) == NULL) - { - goto fail; - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec_parseFromJSON(cJSON *v1beta1_validating_admission_policy_binding_specJSON){ - - v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec_local_var = NULL; - - // define the local variable for v1beta1_validating_admission_policy_binding_spec->match_resources - v1beta1_match_resources_t *match_resources_local_nonprim = NULL; - - // define the local variable for v1beta1_validating_admission_policy_binding_spec->param_ref - v1beta1_param_ref_t *param_ref_local_nonprim = NULL; - - // define the local list for v1beta1_validating_admission_policy_binding_spec->validation_actions - list_t *validation_actionsList = NULL; - - // v1beta1_validating_admission_policy_binding_spec->match_resources - cJSON *match_resources = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_specJSON, "matchResources"); - if (match_resources) { - match_resources_local_nonprim = v1beta1_match_resources_parseFromJSON(match_resources); //nonprimitive - } - - // v1beta1_validating_admission_policy_binding_spec->param_ref - cJSON *param_ref = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_specJSON, "paramRef"); - if (param_ref) { - param_ref_local_nonprim = v1beta1_param_ref_parseFromJSON(param_ref); //nonprimitive - } - - // v1beta1_validating_admission_policy_binding_spec->policy_name - cJSON *policy_name = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_specJSON, "policyName"); - if (policy_name) { - if(!cJSON_IsString(policy_name) && !cJSON_IsNull(policy_name)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_binding_spec->validation_actions - cJSON *validation_actions = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_binding_specJSON, "validationActions"); - if (validation_actions) { - cJSON *validation_actions_local = NULL; - if(!cJSON_IsArray(validation_actions)) { - goto end;//primitive container - } - validation_actionsList = list_createList(); - - cJSON_ArrayForEach(validation_actions_local, validation_actions) - { - if(!cJSON_IsString(validation_actions_local)) - { - goto end; - } - list_addElement(validation_actionsList , strdup(validation_actions_local->valuestring)); - } - } - - - v1beta1_validating_admission_policy_binding_spec_local_var = v1beta1_validating_admission_policy_binding_spec_create ( - match_resources ? match_resources_local_nonprim : NULL, - param_ref ? param_ref_local_nonprim : NULL, - policy_name && !cJSON_IsNull(policy_name) ? strdup(policy_name->valuestring) : NULL, - validation_actions ? validation_actionsList : NULL - ); - - return v1beta1_validating_admission_policy_binding_spec_local_var; -end: - if (match_resources_local_nonprim) { - v1beta1_match_resources_free(match_resources_local_nonprim); - match_resources_local_nonprim = NULL; - } - if (param_ref_local_nonprim) { - v1beta1_param_ref_free(param_ref_local_nonprim); - param_ref_local_nonprim = NULL; - } - if (validation_actionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, validation_actionsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(validation_actionsList); - validation_actionsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validating_admission_policy_binding_spec.h b/kubernetes/model/v1beta1_validating_admission_policy_binding_spec.h deleted file mode 100644 index bec27f49..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_binding_spec.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta1_validating_admission_policy_binding_spec.h - * - * ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding. - */ - -#ifndef _v1beta1_validating_admission_policy_binding_spec_H_ -#define _v1beta1_validating_admission_policy_binding_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validating_admission_policy_binding_spec_t v1beta1_validating_admission_policy_binding_spec_t; - -#include "v1beta1_match_resources.h" -#include "v1beta1_param_ref.h" - - - -typedef struct v1beta1_validating_admission_policy_binding_spec_t { - struct v1beta1_match_resources_t *match_resources; //model - struct v1beta1_param_ref_t *param_ref; //model - char *policy_name; // string - list_t *validation_actions; //primitive container - -} v1beta1_validating_admission_policy_binding_spec_t; - -v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec_create( - v1beta1_match_resources_t *match_resources, - v1beta1_param_ref_t *param_ref, - char *policy_name, - list_t *validation_actions -); - -void v1beta1_validating_admission_policy_binding_spec_free(v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec); - -v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec_parseFromJSON(cJSON *v1beta1_validating_admission_policy_binding_specJSON); - -cJSON *v1beta1_validating_admission_policy_binding_spec_convertToJSON(v1beta1_validating_admission_policy_binding_spec_t *v1beta1_validating_admission_policy_binding_spec); - -#endif /* _v1beta1_validating_admission_policy_binding_spec_H_ */ - diff --git a/kubernetes/model/v1beta1_validating_admission_policy_list.c b/kubernetes/model/v1beta1_validating_admission_policy_list.c deleted file mode 100644 index c76330b1..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_list.c +++ /dev/null @@ -1,193 +0,0 @@ -#include -#include -#include -#include "v1beta1_validating_admission_policy_list.h" - - - -v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list_local_var = malloc(sizeof(v1beta1_validating_admission_policy_list_t)); - if (!v1beta1_validating_admission_policy_list_local_var) { - return NULL; - } - v1beta1_validating_admission_policy_list_local_var->api_version = api_version; - v1beta1_validating_admission_policy_list_local_var->items = items; - v1beta1_validating_admission_policy_list_local_var->kind = kind; - v1beta1_validating_admission_policy_list_local_var->metadata = metadata; - - return v1beta1_validating_admission_policy_list_local_var; -} - - -void v1beta1_validating_admission_policy_list_free(v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list) { - if(NULL == v1beta1_validating_admission_policy_list){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validating_admission_policy_list->api_version) { - free(v1beta1_validating_admission_policy_list->api_version); - v1beta1_validating_admission_policy_list->api_version = NULL; - } - if (v1beta1_validating_admission_policy_list->items) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_list->items) { - v1beta1_validating_admission_policy_free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_list->items); - v1beta1_validating_admission_policy_list->items = NULL; - } - if (v1beta1_validating_admission_policy_list->kind) { - free(v1beta1_validating_admission_policy_list->kind); - v1beta1_validating_admission_policy_list->kind = NULL; - } - if (v1beta1_validating_admission_policy_list->metadata) { - v1_list_meta_free(v1beta1_validating_admission_policy_list->metadata); - v1beta1_validating_admission_policy_list->metadata = NULL; - } - free(v1beta1_validating_admission_policy_list); -} - -cJSON *v1beta1_validating_admission_policy_list_convertToJSON(v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validating_admission_policy_list->api_version - if(v1beta1_validating_admission_policy_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_validating_admission_policy_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_list->items - if(v1beta1_validating_admission_policy_list->items) { - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1beta1_validating_admission_policy_list->items) { - list_ForEach(itemsListEntry, v1beta1_validating_admission_policy_list->items) { - cJSON *itemLocal = v1beta1_validating_admission_policy_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - } - - - // v1beta1_validating_admission_policy_list->kind - if(v1beta1_validating_admission_policy_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta1_validating_admission_policy_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_list->metadata - if(v1beta1_validating_admission_policy_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_validating_admission_policy_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list_parseFromJSON(cJSON *v1beta1_validating_admission_policy_listJSON){ - - v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list_local_var = NULL; - - // define the local list for v1beta1_validating_admission_policy_list->items - list_t *itemsList = NULL; - - // define the local variable for v1beta1_validating_admission_policy_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1beta1_validating_admission_policy_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_listJSON, "items"); - if (items) { - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1beta1_validating_admission_policy_t *itemsItem = v1beta1_validating_admission_policy_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - } - - // v1beta1_validating_admission_policy_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1beta1_validating_admission_policy_list_local_var = v1beta1_validating_admission_policy_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - items ? itemsList : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1beta1_validating_admission_policy_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1beta1_validating_admission_policy_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validating_admission_policy_list.h b/kubernetes/model/v1beta1_validating_admission_policy_list.h deleted file mode 100644 index 62c138c5..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta1_validating_admission_policy_list.h - * - * ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy. - */ - -#ifndef _v1beta1_validating_admission_policy_list_H_ -#define _v1beta1_validating_admission_policy_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validating_admission_policy_list_t v1beta1_validating_admission_policy_list_t; - -#include "v1_list_meta.h" -#include "v1beta1_validating_admission_policy.h" - - - -typedef struct v1beta1_validating_admission_policy_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1beta1_validating_admission_policy_list_t; - -v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1beta1_validating_admission_policy_list_free(v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list); - -v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list_parseFromJSON(cJSON *v1beta1_validating_admission_policy_listJSON); - -cJSON *v1beta1_validating_admission_policy_list_convertToJSON(v1beta1_validating_admission_policy_list_t *v1beta1_validating_admission_policy_list); - -#endif /* _v1beta1_validating_admission_policy_list_H_ */ - diff --git a/kubernetes/model/v1beta1_validating_admission_policy_spec.c b/kubernetes/model/v1beta1_validating_admission_policy_spec.c deleted file mode 100644 index d2934fc0..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_spec.c +++ /dev/null @@ -1,391 +0,0 @@ -#include -#include -#include -#include "v1beta1_validating_admission_policy_spec.h" - - - -v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec_create( - list_t *audit_annotations, - char *failure_policy, - list_t *match_conditions, - v1beta1_match_resources_t *match_constraints, - v1beta1_param_kind_t *param_kind, - list_t *validations, - list_t *variables - ) { - v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec_local_var = malloc(sizeof(v1beta1_validating_admission_policy_spec_t)); - if (!v1beta1_validating_admission_policy_spec_local_var) { - return NULL; - } - v1beta1_validating_admission_policy_spec_local_var->audit_annotations = audit_annotations; - v1beta1_validating_admission_policy_spec_local_var->failure_policy = failure_policy; - v1beta1_validating_admission_policy_spec_local_var->match_conditions = match_conditions; - v1beta1_validating_admission_policy_spec_local_var->match_constraints = match_constraints; - v1beta1_validating_admission_policy_spec_local_var->param_kind = param_kind; - v1beta1_validating_admission_policy_spec_local_var->validations = validations; - v1beta1_validating_admission_policy_spec_local_var->variables = variables; - - return v1beta1_validating_admission_policy_spec_local_var; -} - - -void v1beta1_validating_admission_policy_spec_free(v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec) { - if(NULL == v1beta1_validating_admission_policy_spec){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validating_admission_policy_spec->audit_annotations) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_spec->audit_annotations) { - v1beta1_audit_annotation_free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_spec->audit_annotations); - v1beta1_validating_admission_policy_spec->audit_annotations = NULL; - } - if (v1beta1_validating_admission_policy_spec->failure_policy) { - free(v1beta1_validating_admission_policy_spec->failure_policy); - v1beta1_validating_admission_policy_spec->failure_policy = NULL; - } - if (v1beta1_validating_admission_policy_spec->match_conditions) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_spec->match_conditions) { - v1beta1_match_condition_free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_spec->match_conditions); - v1beta1_validating_admission_policy_spec->match_conditions = NULL; - } - if (v1beta1_validating_admission_policy_spec->match_constraints) { - v1beta1_match_resources_free(v1beta1_validating_admission_policy_spec->match_constraints); - v1beta1_validating_admission_policy_spec->match_constraints = NULL; - } - if (v1beta1_validating_admission_policy_spec->param_kind) { - v1beta1_param_kind_free(v1beta1_validating_admission_policy_spec->param_kind); - v1beta1_validating_admission_policy_spec->param_kind = NULL; - } - if (v1beta1_validating_admission_policy_spec->validations) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_spec->validations) { - v1beta1_validation_free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_spec->validations); - v1beta1_validating_admission_policy_spec->validations = NULL; - } - if (v1beta1_validating_admission_policy_spec->variables) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_spec->variables) { - v1beta1_variable_free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_spec->variables); - v1beta1_validating_admission_policy_spec->variables = NULL; - } - free(v1beta1_validating_admission_policy_spec); -} - -cJSON *v1beta1_validating_admission_policy_spec_convertToJSON(v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validating_admission_policy_spec->audit_annotations - if(v1beta1_validating_admission_policy_spec->audit_annotations) { - cJSON *audit_annotations = cJSON_AddArrayToObject(item, "auditAnnotations"); - if(audit_annotations == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *audit_annotationsListEntry; - if (v1beta1_validating_admission_policy_spec->audit_annotations) { - list_ForEach(audit_annotationsListEntry, v1beta1_validating_admission_policy_spec->audit_annotations) { - cJSON *itemLocal = v1beta1_audit_annotation_convertToJSON(audit_annotationsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(audit_annotations, itemLocal); - } - } - } - - - // v1beta1_validating_admission_policy_spec->failure_policy - if(v1beta1_validating_admission_policy_spec->failure_policy) { - if(cJSON_AddStringToObject(item, "failurePolicy", v1beta1_validating_admission_policy_spec->failure_policy) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validating_admission_policy_spec->match_conditions - if(v1beta1_validating_admission_policy_spec->match_conditions) { - cJSON *match_conditions = cJSON_AddArrayToObject(item, "matchConditions"); - if(match_conditions == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *match_conditionsListEntry; - if (v1beta1_validating_admission_policy_spec->match_conditions) { - list_ForEach(match_conditionsListEntry, v1beta1_validating_admission_policy_spec->match_conditions) { - cJSON *itemLocal = v1beta1_match_condition_convertToJSON(match_conditionsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(match_conditions, itemLocal); - } - } - } - - - // v1beta1_validating_admission_policy_spec->match_constraints - if(v1beta1_validating_admission_policy_spec->match_constraints) { - cJSON *match_constraints_local_JSON = v1beta1_match_resources_convertToJSON(v1beta1_validating_admission_policy_spec->match_constraints); - if(match_constraints_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "matchConstraints", match_constraints_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_validating_admission_policy_spec->param_kind - if(v1beta1_validating_admission_policy_spec->param_kind) { - cJSON *param_kind_local_JSON = v1beta1_param_kind_convertToJSON(v1beta1_validating_admission_policy_spec->param_kind); - if(param_kind_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "paramKind", param_kind_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta1_validating_admission_policy_spec->validations - if(v1beta1_validating_admission_policy_spec->validations) { - cJSON *validations = cJSON_AddArrayToObject(item, "validations"); - if(validations == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *validationsListEntry; - if (v1beta1_validating_admission_policy_spec->validations) { - list_ForEach(validationsListEntry, v1beta1_validating_admission_policy_spec->validations) { - cJSON *itemLocal = v1beta1_validation_convertToJSON(validationsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(validations, itemLocal); - } - } - } - - - // v1beta1_validating_admission_policy_spec->variables - if(v1beta1_validating_admission_policy_spec->variables) { - cJSON *variables = cJSON_AddArrayToObject(item, "variables"); - if(variables == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *variablesListEntry; - if (v1beta1_validating_admission_policy_spec->variables) { - list_ForEach(variablesListEntry, v1beta1_validating_admission_policy_spec->variables) { - cJSON *itemLocal = v1beta1_variable_convertToJSON(variablesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(variables, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec_parseFromJSON(cJSON *v1beta1_validating_admission_policy_specJSON){ - - v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec_local_var = NULL; - - // define the local list for v1beta1_validating_admission_policy_spec->audit_annotations - list_t *audit_annotationsList = NULL; - - // define the local list for v1beta1_validating_admission_policy_spec->match_conditions - list_t *match_conditionsList = NULL; - - // define the local variable for v1beta1_validating_admission_policy_spec->match_constraints - v1beta1_match_resources_t *match_constraints_local_nonprim = NULL; - - // define the local variable for v1beta1_validating_admission_policy_spec->param_kind - v1beta1_param_kind_t *param_kind_local_nonprim = NULL; - - // define the local list for v1beta1_validating_admission_policy_spec->validations - list_t *validationsList = NULL; - - // define the local list for v1beta1_validating_admission_policy_spec->variables - list_t *variablesList = NULL; - - // v1beta1_validating_admission_policy_spec->audit_annotations - cJSON *audit_annotations = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_specJSON, "auditAnnotations"); - if (audit_annotations) { - cJSON *audit_annotations_local_nonprimitive = NULL; - if(!cJSON_IsArray(audit_annotations)){ - goto end; //nonprimitive container - } - - audit_annotationsList = list_createList(); - - cJSON_ArrayForEach(audit_annotations_local_nonprimitive,audit_annotations ) - { - if(!cJSON_IsObject(audit_annotations_local_nonprimitive)){ - goto end; - } - v1beta1_audit_annotation_t *audit_annotationsItem = v1beta1_audit_annotation_parseFromJSON(audit_annotations_local_nonprimitive); - - list_addElement(audit_annotationsList, audit_annotationsItem); - } - } - - // v1beta1_validating_admission_policy_spec->failure_policy - cJSON *failure_policy = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_specJSON, "failurePolicy"); - if (failure_policy) { - if(!cJSON_IsString(failure_policy) && !cJSON_IsNull(failure_policy)) - { - goto end; //String - } - } - - // v1beta1_validating_admission_policy_spec->match_conditions - cJSON *match_conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_specJSON, "matchConditions"); - if (match_conditions) { - cJSON *match_conditions_local_nonprimitive = NULL; - if(!cJSON_IsArray(match_conditions)){ - goto end; //nonprimitive container - } - - match_conditionsList = list_createList(); - - cJSON_ArrayForEach(match_conditions_local_nonprimitive,match_conditions ) - { - if(!cJSON_IsObject(match_conditions_local_nonprimitive)){ - goto end; - } - v1beta1_match_condition_t *match_conditionsItem = v1beta1_match_condition_parseFromJSON(match_conditions_local_nonprimitive); - - list_addElement(match_conditionsList, match_conditionsItem); - } - } - - // v1beta1_validating_admission_policy_spec->match_constraints - cJSON *match_constraints = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_specJSON, "matchConstraints"); - if (match_constraints) { - match_constraints_local_nonprim = v1beta1_match_resources_parseFromJSON(match_constraints); //nonprimitive - } - - // v1beta1_validating_admission_policy_spec->param_kind - cJSON *param_kind = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_specJSON, "paramKind"); - if (param_kind) { - param_kind_local_nonprim = v1beta1_param_kind_parseFromJSON(param_kind); //nonprimitive - } - - // v1beta1_validating_admission_policy_spec->validations - cJSON *validations = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_specJSON, "validations"); - if (validations) { - cJSON *validations_local_nonprimitive = NULL; - if(!cJSON_IsArray(validations)){ - goto end; //nonprimitive container - } - - validationsList = list_createList(); - - cJSON_ArrayForEach(validations_local_nonprimitive,validations ) - { - if(!cJSON_IsObject(validations_local_nonprimitive)){ - goto end; - } - v1beta1_validation_t *validationsItem = v1beta1_validation_parseFromJSON(validations_local_nonprimitive); - - list_addElement(validationsList, validationsItem); - } - } - - // v1beta1_validating_admission_policy_spec->variables - cJSON *variables = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_specJSON, "variables"); - if (variables) { - cJSON *variables_local_nonprimitive = NULL; - if(!cJSON_IsArray(variables)){ - goto end; //nonprimitive container - } - - variablesList = list_createList(); - - cJSON_ArrayForEach(variables_local_nonprimitive,variables ) - { - if(!cJSON_IsObject(variables_local_nonprimitive)){ - goto end; - } - v1beta1_variable_t *variablesItem = v1beta1_variable_parseFromJSON(variables_local_nonprimitive); - - list_addElement(variablesList, variablesItem); - } - } - - - v1beta1_validating_admission_policy_spec_local_var = v1beta1_validating_admission_policy_spec_create ( - audit_annotations ? audit_annotationsList : NULL, - failure_policy && !cJSON_IsNull(failure_policy) ? strdup(failure_policy->valuestring) : NULL, - match_conditions ? match_conditionsList : NULL, - match_constraints ? match_constraints_local_nonprim : NULL, - param_kind ? param_kind_local_nonprim : NULL, - validations ? validationsList : NULL, - variables ? variablesList : NULL - ); - - return v1beta1_validating_admission_policy_spec_local_var; -end: - if (audit_annotationsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, audit_annotationsList) { - v1beta1_audit_annotation_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(audit_annotationsList); - audit_annotationsList = NULL; - } - if (match_conditionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, match_conditionsList) { - v1beta1_match_condition_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(match_conditionsList); - match_conditionsList = NULL; - } - if (match_constraints_local_nonprim) { - v1beta1_match_resources_free(match_constraints_local_nonprim); - match_constraints_local_nonprim = NULL; - } - if (param_kind_local_nonprim) { - v1beta1_param_kind_free(param_kind_local_nonprim); - param_kind_local_nonprim = NULL; - } - if (validationsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, validationsList) { - v1beta1_validation_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(validationsList); - validationsList = NULL; - } - if (variablesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, variablesList) { - v1beta1_variable_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(variablesList); - variablesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validating_admission_policy_spec.h b/kubernetes/model/v1beta1_validating_admission_policy_spec.h deleted file mode 100644 index 904e14d7..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_spec.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * v1beta1_validating_admission_policy_spec.h - * - * ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy. - */ - -#ifndef _v1beta1_validating_admission_policy_spec_H_ -#define _v1beta1_validating_admission_policy_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validating_admission_policy_spec_t v1beta1_validating_admission_policy_spec_t; - -#include "v1beta1_audit_annotation.h" -#include "v1beta1_match_condition.h" -#include "v1beta1_match_resources.h" -#include "v1beta1_param_kind.h" -#include "v1beta1_validation.h" -#include "v1beta1_variable.h" - - - -typedef struct v1beta1_validating_admission_policy_spec_t { - list_t *audit_annotations; //nonprimitive container - char *failure_policy; // string - list_t *match_conditions; //nonprimitive container - struct v1beta1_match_resources_t *match_constraints; //model - struct v1beta1_param_kind_t *param_kind; //model - list_t *validations; //nonprimitive container - list_t *variables; //nonprimitive container - -} v1beta1_validating_admission_policy_spec_t; - -v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec_create( - list_t *audit_annotations, - char *failure_policy, - list_t *match_conditions, - v1beta1_match_resources_t *match_constraints, - v1beta1_param_kind_t *param_kind, - list_t *validations, - list_t *variables -); - -void v1beta1_validating_admission_policy_spec_free(v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec); - -v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec_parseFromJSON(cJSON *v1beta1_validating_admission_policy_specJSON); - -cJSON *v1beta1_validating_admission_policy_spec_convertToJSON(v1beta1_validating_admission_policy_spec_t *v1beta1_validating_admission_policy_spec); - -#endif /* _v1beta1_validating_admission_policy_spec_H_ */ - diff --git a/kubernetes/model/v1beta1_validating_admission_policy_status.c b/kubernetes/model/v1beta1_validating_admission_policy_status.c deleted file mode 100644 index 2f46cb9b..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_status.c +++ /dev/null @@ -1,165 +0,0 @@ -#include -#include -#include -#include "v1beta1_validating_admission_policy_status.h" - - - -v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status_create( - list_t *conditions, - long observed_generation, - v1beta1_type_checking_t *type_checking - ) { - v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status_local_var = malloc(sizeof(v1beta1_validating_admission_policy_status_t)); - if (!v1beta1_validating_admission_policy_status_local_var) { - return NULL; - } - v1beta1_validating_admission_policy_status_local_var->conditions = conditions; - v1beta1_validating_admission_policy_status_local_var->observed_generation = observed_generation; - v1beta1_validating_admission_policy_status_local_var->type_checking = type_checking; - - return v1beta1_validating_admission_policy_status_local_var; -} - - -void v1beta1_validating_admission_policy_status_free(v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status) { - if(NULL == v1beta1_validating_admission_policy_status){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validating_admission_policy_status->conditions) { - list_ForEach(listEntry, v1beta1_validating_admission_policy_status->conditions) { - v1_condition_free(listEntry->data); - } - list_freeList(v1beta1_validating_admission_policy_status->conditions); - v1beta1_validating_admission_policy_status->conditions = NULL; - } - if (v1beta1_validating_admission_policy_status->type_checking) { - v1beta1_type_checking_free(v1beta1_validating_admission_policy_status->type_checking); - v1beta1_validating_admission_policy_status->type_checking = NULL; - } - free(v1beta1_validating_admission_policy_status); -} - -cJSON *v1beta1_validating_admission_policy_status_convertToJSON(v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validating_admission_policy_status->conditions - if(v1beta1_validating_admission_policy_status->conditions) { - cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); - if(conditions == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *conditionsListEntry; - if (v1beta1_validating_admission_policy_status->conditions) { - list_ForEach(conditionsListEntry, v1beta1_validating_admission_policy_status->conditions) { - cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(conditions, itemLocal); - } - } - } - - - // v1beta1_validating_admission_policy_status->observed_generation - if(v1beta1_validating_admission_policy_status->observed_generation) { - if(cJSON_AddNumberToObject(item, "observedGeneration", v1beta1_validating_admission_policy_status->observed_generation) == NULL) { - goto fail; //Numeric - } - } - - - // v1beta1_validating_admission_policy_status->type_checking - if(v1beta1_validating_admission_policy_status->type_checking) { - cJSON *type_checking_local_JSON = v1beta1_type_checking_convertToJSON(v1beta1_validating_admission_policy_status->type_checking); - if(type_checking_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "typeChecking", type_checking_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status_parseFromJSON(cJSON *v1beta1_validating_admission_policy_statusJSON){ - - v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status_local_var = NULL; - - // define the local list for v1beta1_validating_admission_policy_status->conditions - list_t *conditionsList = NULL; - - // define the local variable for v1beta1_validating_admission_policy_status->type_checking - v1beta1_type_checking_t *type_checking_local_nonprim = NULL; - - // v1beta1_validating_admission_policy_status->conditions - cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_statusJSON, "conditions"); - if (conditions) { - cJSON *conditions_local_nonprimitive = NULL; - if(!cJSON_IsArray(conditions)){ - goto end; //nonprimitive container - } - - conditionsList = list_createList(); - - cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) - { - if(!cJSON_IsObject(conditions_local_nonprimitive)){ - goto end; - } - v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); - - list_addElement(conditionsList, conditionsItem); - } - } - - // v1beta1_validating_admission_policy_status->observed_generation - cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_statusJSON, "observedGeneration"); - if (observed_generation) { - if(!cJSON_IsNumber(observed_generation)) - { - goto end; //Numeric - } - } - - // v1beta1_validating_admission_policy_status->type_checking - cJSON *type_checking = cJSON_GetObjectItemCaseSensitive(v1beta1_validating_admission_policy_statusJSON, "typeChecking"); - if (type_checking) { - type_checking_local_nonprim = v1beta1_type_checking_parseFromJSON(type_checking); //nonprimitive - } - - - v1beta1_validating_admission_policy_status_local_var = v1beta1_validating_admission_policy_status_create ( - conditions ? conditionsList : NULL, - observed_generation ? observed_generation->valuedouble : 0, - type_checking ? type_checking_local_nonprim : NULL - ); - - return v1beta1_validating_admission_policy_status_local_var; -end: - if (conditionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, conditionsList) { - v1_condition_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(conditionsList); - conditionsList = NULL; - } - if (type_checking_local_nonprim) { - v1beta1_type_checking_free(type_checking_local_nonprim); - type_checking_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validating_admission_policy_status.h b/kubernetes/model/v1beta1_validating_admission_policy_status.h deleted file mode 100644 index 599446f9..00000000 --- a/kubernetes/model/v1beta1_validating_admission_policy_status.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1beta1_validating_admission_policy_status.h - * - * ValidatingAdmissionPolicyStatus represents the status of an admission validation policy. - */ - -#ifndef _v1beta1_validating_admission_policy_status_H_ -#define _v1beta1_validating_admission_policy_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validating_admission_policy_status_t v1beta1_validating_admission_policy_status_t; - -#include "v1_condition.h" -#include "v1beta1_type_checking.h" - - - -typedef struct v1beta1_validating_admission_policy_status_t { - list_t *conditions; //nonprimitive container - long observed_generation; //numeric - struct v1beta1_type_checking_t *type_checking; //model - -} v1beta1_validating_admission_policy_status_t; - -v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status_create( - list_t *conditions, - long observed_generation, - v1beta1_type_checking_t *type_checking -); - -void v1beta1_validating_admission_policy_status_free(v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status); - -v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status_parseFromJSON(cJSON *v1beta1_validating_admission_policy_statusJSON); - -cJSON *v1beta1_validating_admission_policy_status_convertToJSON(v1beta1_validating_admission_policy_status_t *v1beta1_validating_admission_policy_status); - -#endif /* _v1beta1_validating_admission_policy_status_H_ */ - diff --git a/kubernetes/model/v1beta1_validation.c b/kubernetes/model/v1beta1_validation.c deleted file mode 100644 index aa0353cb..00000000 --- a/kubernetes/model/v1beta1_validation.c +++ /dev/null @@ -1,149 +0,0 @@ -#include -#include -#include -#include "v1beta1_validation.h" - - - -v1beta1_validation_t *v1beta1_validation_create( - char *expression, - char *message, - char *message_expression, - char *reason - ) { - v1beta1_validation_t *v1beta1_validation_local_var = malloc(sizeof(v1beta1_validation_t)); - if (!v1beta1_validation_local_var) { - return NULL; - } - v1beta1_validation_local_var->expression = expression; - v1beta1_validation_local_var->message = message; - v1beta1_validation_local_var->message_expression = message_expression; - v1beta1_validation_local_var->reason = reason; - - return v1beta1_validation_local_var; -} - - -void v1beta1_validation_free(v1beta1_validation_t *v1beta1_validation) { - if(NULL == v1beta1_validation){ - return ; - } - listEntry_t *listEntry; - if (v1beta1_validation->expression) { - free(v1beta1_validation->expression); - v1beta1_validation->expression = NULL; - } - if (v1beta1_validation->message) { - free(v1beta1_validation->message); - v1beta1_validation->message = NULL; - } - if (v1beta1_validation->message_expression) { - free(v1beta1_validation->message_expression); - v1beta1_validation->message_expression = NULL; - } - if (v1beta1_validation->reason) { - free(v1beta1_validation->reason); - v1beta1_validation->reason = NULL; - } - free(v1beta1_validation); -} - -cJSON *v1beta1_validation_convertToJSON(v1beta1_validation_t *v1beta1_validation) { - cJSON *item = cJSON_CreateObject(); - - // v1beta1_validation->expression - if (!v1beta1_validation->expression) { - goto fail; - } - if(cJSON_AddStringToObject(item, "expression", v1beta1_validation->expression) == NULL) { - goto fail; //String - } - - - // v1beta1_validation->message - if(v1beta1_validation->message) { - if(cJSON_AddStringToObject(item, "message", v1beta1_validation->message) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validation->message_expression - if(v1beta1_validation->message_expression) { - if(cJSON_AddStringToObject(item, "messageExpression", v1beta1_validation->message_expression) == NULL) { - goto fail; //String - } - } - - - // v1beta1_validation->reason - if(v1beta1_validation->reason) { - if(cJSON_AddStringToObject(item, "reason", v1beta1_validation->reason) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta1_validation_t *v1beta1_validation_parseFromJSON(cJSON *v1beta1_validationJSON){ - - v1beta1_validation_t *v1beta1_validation_local_var = NULL; - - // v1beta1_validation->expression - cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1beta1_validationJSON, "expression"); - if (!expression) { - goto end; - } - - - if(!cJSON_IsString(expression)) - { - goto end; //String - } - - // v1beta1_validation->message - cJSON *message = cJSON_GetObjectItemCaseSensitive(v1beta1_validationJSON, "message"); - if (message) { - if(!cJSON_IsString(message) && !cJSON_IsNull(message)) - { - goto end; //String - } - } - - // v1beta1_validation->message_expression - cJSON *message_expression = cJSON_GetObjectItemCaseSensitive(v1beta1_validationJSON, "messageExpression"); - if (message_expression) { - if(!cJSON_IsString(message_expression) && !cJSON_IsNull(message_expression)) - { - goto end; //String - } - } - - // v1beta1_validation->reason - cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1beta1_validationJSON, "reason"); - if (reason) { - if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) - { - goto end; //String - } - } - - - v1beta1_validation_local_var = v1beta1_validation_create ( - strdup(expression->valuestring), - message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, - message_expression && !cJSON_IsNull(message_expression) ? strdup(message_expression->valuestring) : NULL, - reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL - ); - - return v1beta1_validation_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta1_validation.h b/kubernetes/model/v1beta1_validation.h deleted file mode 100644 index 1b4a3b70..00000000 --- a/kubernetes/model/v1beta1_validation.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1beta1_validation.h - * - * Validation specifies the CEL expression which is used to apply the validation. - */ - -#ifndef _v1beta1_validation_H_ -#define _v1beta1_validation_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta1_validation_t v1beta1_validation_t; - - - - -typedef struct v1beta1_validation_t { - char *expression; // string - char *message; // string - char *message_expression; // string - char *reason; // string - -} v1beta1_validation_t; - -v1beta1_validation_t *v1beta1_validation_create( - char *expression, - char *message, - char *message_expression, - char *reason -); - -void v1beta1_validation_free(v1beta1_validation_t *v1beta1_validation); - -v1beta1_validation_t *v1beta1_validation_parseFromJSON(cJSON *v1beta1_validationJSON); - -cJSON *v1beta1_validation_convertToJSON(v1beta1_validation_t *v1beta1_validation); - -#endif /* _v1beta1_validation_H_ */ - diff --git a/kubernetes/model/v1beta1_variable.c b/kubernetes/model/v1beta1_variable.c index 6c9bca74..3176f446 100644 --- a/kubernetes/model/v1beta1_variable.c +++ b/kubernetes/model/v1beta1_variable.c @@ -5,7 +5,7 @@ -v1beta1_variable_t *v1beta1_variable_create( +static v1beta1_variable_t *v1beta1_variable_create_internal( char *expression, char *name ) { @@ -16,14 +16,28 @@ v1beta1_variable_t *v1beta1_variable_create( v1beta1_variable_local_var->expression = expression; v1beta1_variable_local_var->name = name; + v1beta1_variable_local_var->_library_owned = 1; return v1beta1_variable_local_var; } +__attribute__((deprecated)) v1beta1_variable_t *v1beta1_variable_create( + char *expression, + char *name + ) { + return v1beta1_variable_create_internal ( + expression, + name + ); +} void v1beta1_variable_free(v1beta1_variable_t *v1beta1_variable) { if(NULL == v1beta1_variable){ return ; } + if(v1beta1_variable->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_variable_free"); + return ; + } listEntry_t *listEntry; if (v1beta1_variable->expression) { free(v1beta1_variable->expression); @@ -70,6 +84,9 @@ v1beta1_variable_t *v1beta1_variable_parseFromJSON(cJSON *v1beta1_variableJSON){ // v1beta1_variable->expression cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1beta1_variableJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } if (!expression) { goto end; } @@ -82,6 +99,9 @@ v1beta1_variable_t *v1beta1_variable_parseFromJSON(cJSON *v1beta1_variableJSON){ // v1beta1_variable->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta1_variableJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -93,7 +113,7 @@ v1beta1_variable_t *v1beta1_variable_parseFromJSON(cJSON *v1beta1_variableJSON){ } - v1beta1_variable_local_var = v1beta1_variable_create ( + v1beta1_variable_local_var = v1beta1_variable_create_internal ( strdup(expression->valuestring), strdup(name->valuestring) ); diff --git a/kubernetes/model/v1beta1_variable.h b/kubernetes/model/v1beta1_variable.h index 8e5c993f..a4c8821f 100644 --- a/kubernetes/model/v1beta1_variable.h +++ b/kubernetes/model/v1beta1_variable.h @@ -22,9 +22,10 @@ typedef struct v1beta1_variable_t { char *expression; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v1beta1_variable_t; -v1beta1_variable_t *v1beta1_variable_create( +__attribute__((deprecated)) v1beta1_variable_t *v1beta1_variable_create( char *expression, char *name ); diff --git a/kubernetes/model/v1beta1_volume_attributes_class.c b/kubernetes/model/v1beta1_volume_attributes_class.c new file mode 100644 index 00000000..e6884004 --- /dev/null +++ b/kubernetes/model/v1beta1_volume_attributes_class.c @@ -0,0 +1,268 @@ +#include +#include +#include +#include "v1beta1_volume_attributes_class.h" + + + +static v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class_create_internal( + char *api_version, + char *driver_name, + char *kind, + v1_object_meta_t *metadata, + list_t* parameters + ) { + v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class_local_var = malloc(sizeof(v1beta1_volume_attributes_class_t)); + if (!v1beta1_volume_attributes_class_local_var) { + return NULL; + } + v1beta1_volume_attributes_class_local_var->api_version = api_version; + v1beta1_volume_attributes_class_local_var->driver_name = driver_name; + v1beta1_volume_attributes_class_local_var->kind = kind; + v1beta1_volume_attributes_class_local_var->metadata = metadata; + v1beta1_volume_attributes_class_local_var->parameters = parameters; + + v1beta1_volume_attributes_class_local_var->_library_owned = 1; + return v1beta1_volume_attributes_class_local_var; +} + +__attribute__((deprecated)) v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class_create( + char *api_version, + char *driver_name, + char *kind, + v1_object_meta_t *metadata, + list_t* parameters + ) { + return v1beta1_volume_attributes_class_create_internal ( + api_version, + driver_name, + kind, + metadata, + parameters + ); +} + +void v1beta1_volume_attributes_class_free(v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class) { + if(NULL == v1beta1_volume_attributes_class){ + return ; + } + if(v1beta1_volume_attributes_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_volume_attributes_class_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_volume_attributes_class->api_version) { + free(v1beta1_volume_attributes_class->api_version); + v1beta1_volume_attributes_class->api_version = NULL; + } + if (v1beta1_volume_attributes_class->driver_name) { + free(v1beta1_volume_attributes_class->driver_name); + v1beta1_volume_attributes_class->driver_name = NULL; + } + if (v1beta1_volume_attributes_class->kind) { + free(v1beta1_volume_attributes_class->kind); + v1beta1_volume_attributes_class->kind = NULL; + } + if (v1beta1_volume_attributes_class->metadata) { + v1_object_meta_free(v1beta1_volume_attributes_class->metadata); + v1beta1_volume_attributes_class->metadata = NULL; + } + if (v1beta1_volume_attributes_class->parameters) { + list_ForEach(listEntry, v1beta1_volume_attributes_class->parameters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta1_volume_attributes_class->parameters); + v1beta1_volume_attributes_class->parameters = NULL; + } + free(v1beta1_volume_attributes_class); +} + +cJSON *v1beta1_volume_attributes_class_convertToJSON(v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_volume_attributes_class->api_version + if(v1beta1_volume_attributes_class->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_volume_attributes_class->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_volume_attributes_class->driver_name + if (!v1beta1_volume_attributes_class->driver_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driverName", v1beta1_volume_attributes_class->driver_name) == NULL) { + goto fail; //String + } + + + // v1beta1_volume_attributes_class->kind + if(v1beta1_volume_attributes_class->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_volume_attributes_class->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_volume_attributes_class->metadata + if(v1beta1_volume_attributes_class->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta1_volume_attributes_class->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta1_volume_attributes_class->parameters + if(v1beta1_volume_attributes_class->parameters) { + cJSON *parameters = cJSON_AddObjectToObject(item, "parameters"); + if(parameters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = parameters; + listEntry_t *parametersListEntry; + if (v1beta1_volume_attributes_class->parameters) { + list_ForEach(parametersListEntry, v1beta1_volume_attributes_class->parameters) { + keyValuePair_t *localKeyValue = parametersListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class_parseFromJSON(cJSON *v1beta1_volume_attributes_classJSON){ + + v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class_local_var = NULL; + + // define the local variable for v1beta1_volume_attributes_class->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local map for v1beta1_volume_attributes_class->parameters + list_t *parametersList = NULL; + + // v1beta1_volume_attributes_class->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_volume_attributes_class->driver_name + cJSON *driver_name = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_classJSON, "driverName"); + if (cJSON_IsNull(driver_name)) { + driver_name = NULL; + } + if (!driver_name) { + goto end; + } + + + if(!cJSON_IsString(driver_name)) + { + goto end; //String + } + + // v1beta1_volume_attributes_class->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_volume_attributes_class->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta1_volume_attributes_class->parameters + cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_classJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } + if (parameters) { + cJSON *parameters_local_map = NULL; + if(!cJSON_IsObject(parameters) && !cJSON_IsNull(parameters)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(parameters)) + { + parametersList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(parameters_local_map, parameters) + { + cJSON *localMapObject = parameters_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(parametersList , localMapKeyPair); + } + } + } + + + v1beta1_volume_attributes_class_local_var = v1beta1_volume_attributes_class_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + strdup(driver_name->valuestring), + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + parameters ? parametersList : NULL + ); + + return v1beta1_volume_attributes_class_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (parametersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, parametersList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(parametersList); + parametersList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_volume_attributes_class.h b/kubernetes/model/v1beta1_volume_attributes_class.h new file mode 100644 index 00000000..145b0daa --- /dev/null +++ b/kubernetes/model/v1beta1_volume_attributes_class.h @@ -0,0 +1,47 @@ +/* + * v1beta1_volume_attributes_class.h + * + * VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. + */ + +#ifndef _v1beta1_volume_attributes_class_H_ +#define _v1beta1_volume_attributes_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_volume_attributes_class_t v1beta1_volume_attributes_class_t; + +#include "v1_object_meta.h" + + + +typedef struct v1beta1_volume_attributes_class_t { + char *api_version; // string + char *driver_name; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + list_t* parameters; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_volume_attributes_class_t; + +__attribute__((deprecated)) v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class_create( + char *api_version, + char *driver_name, + char *kind, + v1_object_meta_t *metadata, + list_t* parameters +); + +void v1beta1_volume_attributes_class_free(v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class); + +v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class_parseFromJSON(cJSON *v1beta1_volume_attributes_classJSON); + +cJSON *v1beta1_volume_attributes_class_convertToJSON(v1beta1_volume_attributes_class_t *v1beta1_volume_attributes_class); + +#endif /* _v1beta1_volume_attributes_class_H_ */ + diff --git a/kubernetes/model/v1beta1_volume_attributes_class_list.c b/kubernetes/model/v1beta1_volume_attributes_class_list.c new file mode 100644 index 00000000..1f8f2b9a --- /dev/null +++ b/kubernetes/model/v1beta1_volume_attributes_class_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta1_volume_attributes_class_list.h" + + + +static v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list_local_var = malloc(sizeof(v1beta1_volume_attributes_class_list_t)); + if (!v1beta1_volume_attributes_class_list_local_var) { + return NULL; + } + v1beta1_volume_attributes_class_list_local_var->api_version = api_version; + v1beta1_volume_attributes_class_list_local_var->items = items; + v1beta1_volume_attributes_class_list_local_var->kind = kind; + v1beta1_volume_attributes_class_list_local_var->metadata = metadata; + + v1beta1_volume_attributes_class_list_local_var->_library_owned = 1; + return v1beta1_volume_attributes_class_list_local_var; +} + +__attribute__((deprecated)) v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta1_volume_attributes_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta1_volume_attributes_class_list_free(v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list) { + if(NULL == v1beta1_volume_attributes_class_list){ + return ; + } + if(v1beta1_volume_attributes_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_volume_attributes_class_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta1_volume_attributes_class_list->api_version) { + free(v1beta1_volume_attributes_class_list->api_version); + v1beta1_volume_attributes_class_list->api_version = NULL; + } + if (v1beta1_volume_attributes_class_list->items) { + list_ForEach(listEntry, v1beta1_volume_attributes_class_list->items) { + v1beta1_volume_attributes_class_free(listEntry->data); + } + list_freeList(v1beta1_volume_attributes_class_list->items); + v1beta1_volume_attributes_class_list->items = NULL; + } + if (v1beta1_volume_attributes_class_list->kind) { + free(v1beta1_volume_attributes_class_list->kind); + v1beta1_volume_attributes_class_list->kind = NULL; + } + if (v1beta1_volume_attributes_class_list->metadata) { + v1_list_meta_free(v1beta1_volume_attributes_class_list->metadata); + v1beta1_volume_attributes_class_list->metadata = NULL; + } + free(v1beta1_volume_attributes_class_list); +} + +cJSON *v1beta1_volume_attributes_class_list_convertToJSON(v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta1_volume_attributes_class_list->api_version + if(v1beta1_volume_attributes_class_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta1_volume_attributes_class_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta1_volume_attributes_class_list->items + if (!v1beta1_volume_attributes_class_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta1_volume_attributes_class_list->items) { + list_ForEach(itemsListEntry, v1beta1_volume_attributes_class_list->items) { + cJSON *itemLocal = v1beta1_volume_attributes_class_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta1_volume_attributes_class_list->kind + if(v1beta1_volume_attributes_class_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta1_volume_attributes_class_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta1_volume_attributes_class_list->metadata + if(v1beta1_volume_attributes_class_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta1_volume_attributes_class_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list_parseFromJSON(cJSON *v1beta1_volume_attributes_class_listJSON){ + + v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list_local_var = NULL; + + // define the local list for v1beta1_volume_attributes_class_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta1_volume_attributes_class_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta1_volume_attributes_class_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta1_volume_attributes_class_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta1_volume_attributes_class_t *itemsItem = v1beta1_volume_attributes_class_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta1_volume_attributes_class_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta1_volume_attributes_class_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta1_volume_attributes_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta1_volume_attributes_class_list_local_var = v1beta1_volume_attributes_class_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta1_volume_attributes_class_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_volume_attributes_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta1_volume_attributes_class_list.h b/kubernetes/model/v1beta1_volume_attributes_class_list.h new file mode 100644 index 00000000..11f6459c --- /dev/null +++ b/kubernetes/model/v1beta1_volume_attributes_class_list.h @@ -0,0 +1,46 @@ +/* + * v1beta1_volume_attributes_class_list.h + * + * VolumeAttributesClassList is a collection of VolumeAttributesClass objects. + */ + +#ifndef _v1beta1_volume_attributes_class_list_H_ +#define _v1beta1_volume_attributes_class_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta1_volume_attributes_class_list_t v1beta1_volume_attributes_class_list_t; + +#include "v1_list_meta.h" +#include "v1beta1_volume_attributes_class.h" + + + +typedef struct v1beta1_volume_attributes_class_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta1_volume_attributes_class_list_t; + +__attribute__((deprecated)) v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta1_volume_attributes_class_list_free(v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list); + +v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list_parseFromJSON(cJSON *v1beta1_volume_attributes_class_listJSON); + +cJSON *v1beta1_volume_attributes_class_list_convertToJSON(v1beta1_volume_attributes_class_list_t *v1beta1_volume_attributes_class_list); + +#endif /* _v1beta1_volume_attributes_class_list_H_ */ + diff --git a/kubernetes/model/v1beta2_allocated_device_status.c b/kubernetes/model/v1beta2_allocated_device_status.c new file mode 100644 index 00000000..8a973ee4 --- /dev/null +++ b/kubernetes/model/v1beta2_allocated_device_status.c @@ -0,0 +1,325 @@ +#include +#include +#include +#include "v1beta2_allocated_device_status.h" + + + +static v1beta2_allocated_device_status_t *v1beta2_allocated_device_status_create_internal( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1beta2_network_device_data_t *network_data, + char *pool, + char *share_id + ) { + v1beta2_allocated_device_status_t *v1beta2_allocated_device_status_local_var = malloc(sizeof(v1beta2_allocated_device_status_t)); + if (!v1beta2_allocated_device_status_local_var) { + return NULL; + } + v1beta2_allocated_device_status_local_var->conditions = conditions; + v1beta2_allocated_device_status_local_var->data = data; + v1beta2_allocated_device_status_local_var->device = device; + v1beta2_allocated_device_status_local_var->driver = driver; + v1beta2_allocated_device_status_local_var->network_data = network_data; + v1beta2_allocated_device_status_local_var->pool = pool; + v1beta2_allocated_device_status_local_var->share_id = share_id; + + v1beta2_allocated_device_status_local_var->_library_owned = 1; + return v1beta2_allocated_device_status_local_var; +} + +__attribute__((deprecated)) v1beta2_allocated_device_status_t *v1beta2_allocated_device_status_create( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1beta2_network_device_data_t *network_data, + char *pool, + char *share_id + ) { + return v1beta2_allocated_device_status_create_internal ( + conditions, + data, + device, + driver, + network_data, + pool, + share_id + ); +} + +void v1beta2_allocated_device_status_free(v1beta2_allocated_device_status_t *v1beta2_allocated_device_status) { + if(NULL == v1beta2_allocated_device_status){ + return ; + } + if(v1beta2_allocated_device_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_allocated_device_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_allocated_device_status->conditions) { + list_ForEach(listEntry, v1beta2_allocated_device_status->conditions) { + v1_condition_free(listEntry->data); + } + list_freeList(v1beta2_allocated_device_status->conditions); + v1beta2_allocated_device_status->conditions = NULL; + } + if (v1beta2_allocated_device_status->data) { + object_free(v1beta2_allocated_device_status->data); + v1beta2_allocated_device_status->data = NULL; + } + if (v1beta2_allocated_device_status->device) { + free(v1beta2_allocated_device_status->device); + v1beta2_allocated_device_status->device = NULL; + } + if (v1beta2_allocated_device_status->driver) { + free(v1beta2_allocated_device_status->driver); + v1beta2_allocated_device_status->driver = NULL; + } + if (v1beta2_allocated_device_status->network_data) { + v1beta2_network_device_data_free(v1beta2_allocated_device_status->network_data); + v1beta2_allocated_device_status->network_data = NULL; + } + if (v1beta2_allocated_device_status->pool) { + free(v1beta2_allocated_device_status->pool); + v1beta2_allocated_device_status->pool = NULL; + } + if (v1beta2_allocated_device_status->share_id) { + free(v1beta2_allocated_device_status->share_id); + v1beta2_allocated_device_status->share_id = NULL; + } + free(v1beta2_allocated_device_status); +} + +cJSON *v1beta2_allocated_device_status_convertToJSON(v1beta2_allocated_device_status_t *v1beta2_allocated_device_status) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_allocated_device_status->conditions + if(v1beta2_allocated_device_status->conditions) { + cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); + if(conditions == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *conditionsListEntry; + if (v1beta2_allocated_device_status->conditions) { + list_ForEach(conditionsListEntry, v1beta2_allocated_device_status->conditions) { + cJSON *itemLocal = v1_condition_convertToJSON(conditionsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(conditions, itemLocal); + } + } + } + + + // v1beta2_allocated_device_status->data + if(v1beta2_allocated_device_status->data) { + cJSON *data_object = object_convertToJSON(v1beta2_allocated_device_status->data); + if(data_object == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "data", data_object); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_allocated_device_status->device + if (!v1beta2_allocated_device_status->device) { + goto fail; + } + if(cJSON_AddStringToObject(item, "device", v1beta2_allocated_device_status->device) == NULL) { + goto fail; //String + } + + + // v1beta2_allocated_device_status->driver + if (!v1beta2_allocated_device_status->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta2_allocated_device_status->driver) == NULL) { + goto fail; //String + } + + + // v1beta2_allocated_device_status->network_data + if(v1beta2_allocated_device_status->network_data) { + cJSON *network_data_local_JSON = v1beta2_network_device_data_convertToJSON(v1beta2_allocated_device_status->network_data); + if(network_data_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "networkData", network_data_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_allocated_device_status->pool + if (!v1beta2_allocated_device_status->pool) { + goto fail; + } + if(cJSON_AddStringToObject(item, "pool", v1beta2_allocated_device_status->pool) == NULL) { + goto fail; //String + } + + + // v1beta2_allocated_device_status->share_id + if(v1beta2_allocated_device_status->share_id) { + if(cJSON_AddStringToObject(item, "shareID", v1beta2_allocated_device_status->share_id) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_allocated_device_status_t *v1beta2_allocated_device_status_parseFromJSON(cJSON *v1beta2_allocated_device_statusJSON){ + + v1beta2_allocated_device_status_t *v1beta2_allocated_device_status_local_var = NULL; + + // define the local list for v1beta2_allocated_device_status->conditions + list_t *conditionsList = NULL; + + // define the local variable for v1beta2_allocated_device_status->network_data + v1beta2_network_device_data_t *network_data_local_nonprim = NULL; + + // v1beta2_allocated_device_status->conditions + cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta2_allocated_device_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } + if (conditions) { + cJSON *conditions_local_nonprimitive = NULL; + if(!cJSON_IsArray(conditions)){ + goto end; //nonprimitive container + } + + conditionsList = list_createList(); + + cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) + { + if(!cJSON_IsObject(conditions_local_nonprimitive)){ + goto end; + } + v1_condition_t *conditionsItem = v1_condition_parseFromJSON(conditions_local_nonprimitive); + + list_addElement(conditionsList, conditionsItem); + } + } + + // v1beta2_allocated_device_status->data + cJSON *data = cJSON_GetObjectItemCaseSensitive(v1beta2_allocated_device_statusJSON, "data"); + if (cJSON_IsNull(data)) { + data = NULL; + } + object_t *data_local_object = NULL; + if (data) { + data_local_object = object_parseFromJSON(data); //object + } + + // v1beta2_allocated_device_status->device + cJSON *device = cJSON_GetObjectItemCaseSensitive(v1beta2_allocated_device_statusJSON, "device"); + if (cJSON_IsNull(device)) { + device = NULL; + } + if (!device) { + goto end; + } + + + if(!cJSON_IsString(device)) + { + goto end; //String + } + + // v1beta2_allocated_device_status->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta2_allocated_device_statusJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta2_allocated_device_status->network_data + cJSON *network_data = cJSON_GetObjectItemCaseSensitive(v1beta2_allocated_device_statusJSON, "networkData"); + if (cJSON_IsNull(network_data)) { + network_data = NULL; + } + if (network_data) { + network_data_local_nonprim = v1beta2_network_device_data_parseFromJSON(network_data); //nonprimitive + } + + // v1beta2_allocated_device_status->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1beta2_allocated_device_statusJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + if(!cJSON_IsString(pool)) + { + goto end; //String + } + + // v1beta2_allocated_device_status->share_id + cJSON *share_id = cJSON_GetObjectItemCaseSensitive(v1beta2_allocated_device_statusJSON, "shareID"); + if (cJSON_IsNull(share_id)) { + share_id = NULL; + } + if (share_id) { + if(!cJSON_IsString(share_id) && !cJSON_IsNull(share_id)) + { + goto end; //String + } + } + + + v1beta2_allocated_device_status_local_var = v1beta2_allocated_device_status_create_internal ( + conditions ? conditionsList : NULL, + data ? data_local_object : NULL, + strdup(device->valuestring), + strdup(driver->valuestring), + network_data ? network_data_local_nonprim : NULL, + strdup(pool->valuestring), + share_id && !cJSON_IsNull(share_id) ? strdup(share_id->valuestring) : NULL + ); + + return v1beta2_allocated_device_status_local_var; +end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (network_data_local_nonprim) { + v1beta2_network_device_data_free(network_data_local_nonprim); + network_data_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_allocated_device_status.h b/kubernetes/model/v1beta2_allocated_device_status.h new file mode 100644 index 00000000..104ddcc4 --- /dev/null +++ b/kubernetes/model/v1beta2_allocated_device_status.h @@ -0,0 +1,53 @@ +/* + * v1beta2_allocated_device_status.h + * + * AllocatedDeviceStatus contains the status of an allocated device, if the driver chooses to report it. This may include driver-specific information. The combination of Driver, Pool, Device, and ShareID must match the corresponding key in Status.Allocation.Devices. + */ + +#ifndef _v1beta2_allocated_device_status_H_ +#define _v1beta2_allocated_device_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_allocated_device_status_t v1beta2_allocated_device_status_t; + +#include "object.h" +#include "v1_condition.h" +#include "v1beta2_network_device_data.h" + + + +typedef struct v1beta2_allocated_device_status_t { + list_t *conditions; //nonprimitive container + object_t *data; //object + char *device; // string + char *driver; // string + struct v1beta2_network_device_data_t *network_data; //model + char *pool; // string + char *share_id; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_allocated_device_status_t; + +__attribute__((deprecated)) v1beta2_allocated_device_status_t *v1beta2_allocated_device_status_create( + list_t *conditions, + object_t *data, + char *device, + char *driver, + v1beta2_network_device_data_t *network_data, + char *pool, + char *share_id +); + +void v1beta2_allocated_device_status_free(v1beta2_allocated_device_status_t *v1beta2_allocated_device_status); + +v1beta2_allocated_device_status_t *v1beta2_allocated_device_status_parseFromJSON(cJSON *v1beta2_allocated_device_statusJSON); + +cJSON *v1beta2_allocated_device_status_convertToJSON(v1beta2_allocated_device_status_t *v1beta2_allocated_device_status); + +#endif /* _v1beta2_allocated_device_status_H_ */ + diff --git a/kubernetes/model/v1beta2_allocation_result.c b/kubernetes/model/v1beta2_allocation_result.c new file mode 100644 index 00000000..47096623 --- /dev/null +++ b/kubernetes/model/v1beta2_allocation_result.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include "v1beta2_allocation_result.h" + + + +static v1beta2_allocation_result_t *v1beta2_allocation_result_create_internal( + char *allocation_timestamp, + v1beta2_device_allocation_result_t *devices, + v1_node_selector_t *node_selector + ) { + v1beta2_allocation_result_t *v1beta2_allocation_result_local_var = malloc(sizeof(v1beta2_allocation_result_t)); + if (!v1beta2_allocation_result_local_var) { + return NULL; + } + v1beta2_allocation_result_local_var->allocation_timestamp = allocation_timestamp; + v1beta2_allocation_result_local_var->devices = devices; + v1beta2_allocation_result_local_var->node_selector = node_selector; + + v1beta2_allocation_result_local_var->_library_owned = 1; + return v1beta2_allocation_result_local_var; +} + +__attribute__((deprecated)) v1beta2_allocation_result_t *v1beta2_allocation_result_create( + char *allocation_timestamp, + v1beta2_device_allocation_result_t *devices, + v1_node_selector_t *node_selector + ) { + return v1beta2_allocation_result_create_internal ( + allocation_timestamp, + devices, + node_selector + ); +} + +void v1beta2_allocation_result_free(v1beta2_allocation_result_t *v1beta2_allocation_result) { + if(NULL == v1beta2_allocation_result){ + return ; + } + if(v1beta2_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_allocation_result->allocation_timestamp) { + free(v1beta2_allocation_result->allocation_timestamp); + v1beta2_allocation_result->allocation_timestamp = NULL; + } + if (v1beta2_allocation_result->devices) { + v1beta2_device_allocation_result_free(v1beta2_allocation_result->devices); + v1beta2_allocation_result->devices = NULL; + } + if (v1beta2_allocation_result->node_selector) { + v1_node_selector_free(v1beta2_allocation_result->node_selector); + v1beta2_allocation_result->node_selector = NULL; + } + free(v1beta2_allocation_result); +} + +cJSON *v1beta2_allocation_result_convertToJSON(v1beta2_allocation_result_t *v1beta2_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_allocation_result->allocation_timestamp + if(v1beta2_allocation_result->allocation_timestamp) { + if(cJSON_AddStringToObject(item, "allocationTimestamp", v1beta2_allocation_result->allocation_timestamp) == NULL) { + goto fail; //Date-Time + } + } + + + // v1beta2_allocation_result->devices + if(v1beta2_allocation_result->devices) { + cJSON *devices_local_JSON = v1beta2_device_allocation_result_convertToJSON(v1beta2_allocation_result->devices); + if(devices_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "devices", devices_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_allocation_result->node_selector + if(v1beta2_allocation_result->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1beta2_allocation_result->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_allocation_result_t *v1beta2_allocation_result_parseFromJSON(cJSON *v1beta2_allocation_resultJSON){ + + v1beta2_allocation_result_t *v1beta2_allocation_result_local_var = NULL; + + // define the local variable for v1beta2_allocation_result->devices + v1beta2_device_allocation_result_t *devices_local_nonprim = NULL; + + // define the local variable for v1beta2_allocation_result->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // v1beta2_allocation_result->allocation_timestamp + cJSON *allocation_timestamp = cJSON_GetObjectItemCaseSensitive(v1beta2_allocation_resultJSON, "allocationTimestamp"); + if (cJSON_IsNull(allocation_timestamp)) { + allocation_timestamp = NULL; + } + if (allocation_timestamp) { + if(!cJSON_IsString(allocation_timestamp) && !cJSON_IsNull(allocation_timestamp)) + { + goto end; //DateTime + } + } + + // v1beta2_allocation_result->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta2_allocation_resultJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + devices_local_nonprim = v1beta2_device_allocation_result_parseFromJSON(devices); //nonprimitive + } + + // v1beta2_allocation_result->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta2_allocation_resultJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + + v1beta2_allocation_result_local_var = v1beta2_allocation_result_create_internal ( + allocation_timestamp && !cJSON_IsNull(allocation_timestamp) ? strdup(allocation_timestamp->valuestring) : NULL, + devices ? devices_local_nonprim : NULL, + node_selector ? node_selector_local_nonprim : NULL + ); + + return v1beta2_allocation_result_local_var; +end: + if (devices_local_nonprim) { + v1beta2_device_allocation_result_free(devices_local_nonprim); + devices_local_nonprim = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_allocation_result.h b/kubernetes/model/v1beta2_allocation_result.h new file mode 100644 index 00000000..eebaa638 --- /dev/null +++ b/kubernetes/model/v1beta2_allocation_result.h @@ -0,0 +1,44 @@ +/* + * v1beta2_allocation_result.h + * + * AllocationResult contains attributes of an allocated resource. + */ + +#ifndef _v1beta2_allocation_result_H_ +#define _v1beta2_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_allocation_result_t v1beta2_allocation_result_t; + +#include "v1_node_selector.h" +#include "v1beta2_device_allocation_result.h" + + + +typedef struct v1beta2_allocation_result_t { + char *allocation_timestamp; //date time + struct v1beta2_device_allocation_result_t *devices; //model + struct v1_node_selector_t *node_selector; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_allocation_result_t; + +__attribute__((deprecated)) v1beta2_allocation_result_t *v1beta2_allocation_result_create( + char *allocation_timestamp, + v1beta2_device_allocation_result_t *devices, + v1_node_selector_t *node_selector +); + +void v1beta2_allocation_result_free(v1beta2_allocation_result_t *v1beta2_allocation_result); + +v1beta2_allocation_result_t *v1beta2_allocation_result_parseFromJSON(cJSON *v1beta2_allocation_resultJSON); + +cJSON *v1beta2_allocation_result_convertToJSON(v1beta2_allocation_result_t *v1beta2_allocation_result); + +#endif /* _v1beta2_allocation_result_H_ */ + diff --git a/kubernetes/model/v1beta2_capacity_request_policy.c b/kubernetes/model/v1beta2_capacity_request_policy.c new file mode 100644 index 00000000..b3cf6bbb --- /dev/null +++ b/kubernetes/model/v1beta2_capacity_request_policy.c @@ -0,0 +1,189 @@ +#include +#include +#include +#include "v1beta2_capacity_request_policy.h" + + + +static v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy_create_internal( + char *_default, + v1beta2_capacity_request_policy_range_t *valid_range, + list_t *valid_values + ) { + v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy_local_var = malloc(sizeof(v1beta2_capacity_request_policy_t)); + if (!v1beta2_capacity_request_policy_local_var) { + return NULL; + } + v1beta2_capacity_request_policy_local_var->_default = _default; + v1beta2_capacity_request_policy_local_var->valid_range = valid_range; + v1beta2_capacity_request_policy_local_var->valid_values = valid_values; + + v1beta2_capacity_request_policy_local_var->_library_owned = 1; + return v1beta2_capacity_request_policy_local_var; +} + +__attribute__((deprecated)) v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy_create( + char *_default, + v1beta2_capacity_request_policy_range_t *valid_range, + list_t *valid_values + ) { + return v1beta2_capacity_request_policy_create_internal ( + _default, + valid_range, + valid_values + ); +} + +void v1beta2_capacity_request_policy_free(v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy) { + if(NULL == v1beta2_capacity_request_policy){ + return ; + } + if(v1beta2_capacity_request_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_capacity_request_policy_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_capacity_request_policy->_default) { + free(v1beta2_capacity_request_policy->_default); + v1beta2_capacity_request_policy->_default = NULL; + } + if (v1beta2_capacity_request_policy->valid_range) { + v1beta2_capacity_request_policy_range_free(v1beta2_capacity_request_policy->valid_range); + v1beta2_capacity_request_policy->valid_range = NULL; + } + if (v1beta2_capacity_request_policy->valid_values) { + list_ForEach(listEntry, v1beta2_capacity_request_policy->valid_values) { + free(listEntry->data); + } + list_freeList(v1beta2_capacity_request_policy->valid_values); + v1beta2_capacity_request_policy->valid_values = NULL; + } + free(v1beta2_capacity_request_policy); +} + +cJSON *v1beta2_capacity_request_policy_convertToJSON(v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_capacity_request_policy->_default + if(v1beta2_capacity_request_policy->_default) { + if(cJSON_AddStringToObject(item, "default", v1beta2_capacity_request_policy->_default) == NULL) { + goto fail; //String + } + } + + + // v1beta2_capacity_request_policy->valid_range + if(v1beta2_capacity_request_policy->valid_range) { + cJSON *valid_range_local_JSON = v1beta2_capacity_request_policy_range_convertToJSON(v1beta2_capacity_request_policy->valid_range); + if(valid_range_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "validRange", valid_range_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_capacity_request_policy->valid_values + if(v1beta2_capacity_request_policy->valid_values) { + cJSON *valid_values = cJSON_AddArrayToObject(item, "validValues"); + if(valid_values == NULL) { + goto fail; //primitive container + } + + listEntry_t *valid_valuesListEntry; + list_ForEach(valid_valuesListEntry, v1beta2_capacity_request_policy->valid_values) { + if(cJSON_AddStringToObject(valid_values, "", valid_valuesListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy_parseFromJSON(cJSON *v1beta2_capacity_request_policyJSON){ + + v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy_local_var = NULL; + + // define the local variable for v1beta2_capacity_request_policy->valid_range + v1beta2_capacity_request_policy_range_t *valid_range_local_nonprim = NULL; + + // define the local list for v1beta2_capacity_request_policy->valid_values + list_t *valid_valuesList = NULL; + + // v1beta2_capacity_request_policy->_default + cJSON *_default = cJSON_GetObjectItemCaseSensitive(v1beta2_capacity_request_policyJSON, "default"); + if (cJSON_IsNull(_default)) { + _default = NULL; + } + if (_default) { + if(!cJSON_IsString(_default) && !cJSON_IsNull(_default)) + { + goto end; //String + } + } + + // v1beta2_capacity_request_policy->valid_range + cJSON *valid_range = cJSON_GetObjectItemCaseSensitive(v1beta2_capacity_request_policyJSON, "validRange"); + if (cJSON_IsNull(valid_range)) { + valid_range = NULL; + } + if (valid_range) { + valid_range_local_nonprim = v1beta2_capacity_request_policy_range_parseFromJSON(valid_range); //nonprimitive + } + + // v1beta2_capacity_request_policy->valid_values + cJSON *valid_values = cJSON_GetObjectItemCaseSensitive(v1beta2_capacity_request_policyJSON, "validValues"); + if (cJSON_IsNull(valid_values)) { + valid_values = NULL; + } + if (valid_values) { + cJSON *valid_values_local = NULL; + if(!cJSON_IsArray(valid_values)) { + goto end;//primitive container + } + valid_valuesList = list_createList(); + + cJSON_ArrayForEach(valid_values_local, valid_values) + { + if(!cJSON_IsString(valid_values_local)) + { + goto end; + } + list_addElement(valid_valuesList , strdup(valid_values_local->valuestring)); + } + } + + + v1beta2_capacity_request_policy_local_var = v1beta2_capacity_request_policy_create_internal ( + _default && !cJSON_IsNull(_default) ? strdup(_default->valuestring) : NULL, + valid_range ? valid_range_local_nonprim : NULL, + valid_values ? valid_valuesList : NULL + ); + + return v1beta2_capacity_request_policy_local_var; +end: + if (valid_range_local_nonprim) { + v1beta2_capacity_request_policy_range_free(valid_range_local_nonprim); + valid_range_local_nonprim = NULL; + } + if (valid_valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valid_valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valid_valuesList); + valid_valuesList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_capacity_request_policy.h b/kubernetes/model/v1beta2_capacity_request_policy.h new file mode 100644 index 00000000..50cd2531 --- /dev/null +++ b/kubernetes/model/v1beta2_capacity_request_policy.h @@ -0,0 +1,43 @@ +/* + * v1beta2_capacity_request_policy.h + * + * CapacityRequestPolicy defines how requests consume device capacity. Must not set more than one ValidRequestValues. + */ + +#ifndef _v1beta2_capacity_request_policy_H_ +#define _v1beta2_capacity_request_policy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_capacity_request_policy_t v1beta2_capacity_request_policy_t; + +#include "v1beta2_capacity_request_policy_range.h" + + + +typedef struct v1beta2_capacity_request_policy_t { + char *_default; // string + struct v1beta2_capacity_request_policy_range_t *valid_range; //model + list_t *valid_values; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_capacity_request_policy_t; + +__attribute__((deprecated)) v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy_create( + char *_default, + v1beta2_capacity_request_policy_range_t *valid_range, + list_t *valid_values +); + +void v1beta2_capacity_request_policy_free(v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy); + +v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy_parseFromJSON(cJSON *v1beta2_capacity_request_policyJSON); + +cJSON *v1beta2_capacity_request_policy_convertToJSON(v1beta2_capacity_request_policy_t *v1beta2_capacity_request_policy); + +#endif /* _v1beta2_capacity_request_policy_H_ */ + diff --git a/kubernetes/model/v1beta2_capacity_request_policy_range.c b/kubernetes/model/v1beta2_capacity_request_policy_range.c new file mode 100644 index 00000000..a1646627 --- /dev/null +++ b/kubernetes/model/v1beta2_capacity_request_policy_range.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include "v1beta2_capacity_request_policy_range.h" + + + +static v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range_create_internal( + char *max, + char *min, + char *step + ) { + v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range_local_var = malloc(sizeof(v1beta2_capacity_request_policy_range_t)); + if (!v1beta2_capacity_request_policy_range_local_var) { + return NULL; + } + v1beta2_capacity_request_policy_range_local_var->max = max; + v1beta2_capacity_request_policy_range_local_var->min = min; + v1beta2_capacity_request_policy_range_local_var->step = step; + + v1beta2_capacity_request_policy_range_local_var->_library_owned = 1; + return v1beta2_capacity_request_policy_range_local_var; +} + +__attribute__((deprecated)) v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range_create( + char *max, + char *min, + char *step + ) { + return v1beta2_capacity_request_policy_range_create_internal ( + max, + min, + step + ); +} + +void v1beta2_capacity_request_policy_range_free(v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range) { + if(NULL == v1beta2_capacity_request_policy_range){ + return ; + } + if(v1beta2_capacity_request_policy_range->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_capacity_request_policy_range_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_capacity_request_policy_range->max) { + free(v1beta2_capacity_request_policy_range->max); + v1beta2_capacity_request_policy_range->max = NULL; + } + if (v1beta2_capacity_request_policy_range->min) { + free(v1beta2_capacity_request_policy_range->min); + v1beta2_capacity_request_policy_range->min = NULL; + } + if (v1beta2_capacity_request_policy_range->step) { + free(v1beta2_capacity_request_policy_range->step); + v1beta2_capacity_request_policy_range->step = NULL; + } + free(v1beta2_capacity_request_policy_range); +} + +cJSON *v1beta2_capacity_request_policy_range_convertToJSON(v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_capacity_request_policy_range->max + if(v1beta2_capacity_request_policy_range->max) { + if(cJSON_AddStringToObject(item, "max", v1beta2_capacity_request_policy_range->max) == NULL) { + goto fail; //String + } + } + + + // v1beta2_capacity_request_policy_range->min + if (!v1beta2_capacity_request_policy_range->min) { + goto fail; + } + if(cJSON_AddStringToObject(item, "min", v1beta2_capacity_request_policy_range->min) == NULL) { + goto fail; //String + } + + + // v1beta2_capacity_request_policy_range->step + if(v1beta2_capacity_request_policy_range->step) { + if(cJSON_AddStringToObject(item, "step", v1beta2_capacity_request_policy_range->step) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range_parseFromJSON(cJSON *v1beta2_capacity_request_policy_rangeJSON){ + + v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range_local_var = NULL; + + // v1beta2_capacity_request_policy_range->max + cJSON *max = cJSON_GetObjectItemCaseSensitive(v1beta2_capacity_request_policy_rangeJSON, "max"); + if (cJSON_IsNull(max)) { + max = NULL; + } + if (max) { + if(!cJSON_IsString(max) && !cJSON_IsNull(max)) + { + goto end; //String + } + } + + // v1beta2_capacity_request_policy_range->min + cJSON *min = cJSON_GetObjectItemCaseSensitive(v1beta2_capacity_request_policy_rangeJSON, "min"); + if (cJSON_IsNull(min)) { + min = NULL; + } + if (!min) { + goto end; + } + + + if(!cJSON_IsString(min)) + { + goto end; //String + } + + // v1beta2_capacity_request_policy_range->step + cJSON *step = cJSON_GetObjectItemCaseSensitive(v1beta2_capacity_request_policy_rangeJSON, "step"); + if (cJSON_IsNull(step)) { + step = NULL; + } + if (step) { + if(!cJSON_IsString(step) && !cJSON_IsNull(step)) + { + goto end; //String + } + } + + + v1beta2_capacity_request_policy_range_local_var = v1beta2_capacity_request_policy_range_create_internal ( + max && !cJSON_IsNull(max) ? strdup(max->valuestring) : NULL, + strdup(min->valuestring), + step && !cJSON_IsNull(step) ? strdup(step->valuestring) : NULL + ); + + return v1beta2_capacity_request_policy_range_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_capacity_request_policy_range.h b/kubernetes/model/v1beta2_capacity_request_policy_range.h new file mode 100644 index 00000000..b2ff1d88 --- /dev/null +++ b/kubernetes/model/v1beta2_capacity_request_policy_range.h @@ -0,0 +1,42 @@ +/* + * v1beta2_capacity_request_policy_range.h + * + * CapacityRequestPolicyRange defines a valid range for consumable capacity values. - If the requested amount is less than Min, it is rounded up to the Min value. - If Step is set and the requested amount is between Min and Max but not aligned with Step, it will be rounded up to the next value equal to Min + (n * Step). - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set). - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy, and the device cannot be allocated. + */ + +#ifndef _v1beta2_capacity_request_policy_range_H_ +#define _v1beta2_capacity_request_policy_range_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_capacity_request_policy_range_t v1beta2_capacity_request_policy_range_t; + + + + +typedef struct v1beta2_capacity_request_policy_range_t { + char *max; // string + char *min; // string + char *step; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_capacity_request_policy_range_t; + +__attribute__((deprecated)) v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range_create( + char *max, + char *min, + char *step +); + +void v1beta2_capacity_request_policy_range_free(v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range); + +v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range_parseFromJSON(cJSON *v1beta2_capacity_request_policy_rangeJSON); + +cJSON *v1beta2_capacity_request_policy_range_convertToJSON(v1beta2_capacity_request_policy_range_t *v1beta2_capacity_request_policy_range); + +#endif /* _v1beta2_capacity_request_policy_range_H_ */ + diff --git a/kubernetes/model/v1beta2_capacity_requirements.c b/kubernetes/model/v1beta2_capacity_requirements.c new file mode 100644 index 00000000..acd2e401 --- /dev/null +++ b/kubernetes/model/v1beta2_capacity_requirements.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include "v1beta2_capacity_requirements.h" + + + +static v1beta2_capacity_requirements_t *v1beta2_capacity_requirements_create_internal( + list_t* requests + ) { + v1beta2_capacity_requirements_t *v1beta2_capacity_requirements_local_var = malloc(sizeof(v1beta2_capacity_requirements_t)); + if (!v1beta2_capacity_requirements_local_var) { + return NULL; + } + v1beta2_capacity_requirements_local_var->requests = requests; + + v1beta2_capacity_requirements_local_var->_library_owned = 1; + return v1beta2_capacity_requirements_local_var; +} + +__attribute__((deprecated)) v1beta2_capacity_requirements_t *v1beta2_capacity_requirements_create( + list_t* requests + ) { + return v1beta2_capacity_requirements_create_internal ( + requests + ); +} + +void v1beta2_capacity_requirements_free(v1beta2_capacity_requirements_t *v1beta2_capacity_requirements) { + if(NULL == v1beta2_capacity_requirements){ + return ; + } + if(v1beta2_capacity_requirements->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_capacity_requirements_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_capacity_requirements->requests) { + list_ForEach(listEntry, v1beta2_capacity_requirements->requests) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta2_capacity_requirements->requests); + v1beta2_capacity_requirements->requests = NULL; + } + free(v1beta2_capacity_requirements); +} + +cJSON *v1beta2_capacity_requirements_convertToJSON(v1beta2_capacity_requirements_t *v1beta2_capacity_requirements) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_capacity_requirements->requests + if(v1beta2_capacity_requirements->requests) { + cJSON *requests = cJSON_AddObjectToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = requests; + listEntry_t *requestsListEntry; + if (v1beta2_capacity_requirements->requests) { + list_ForEach(requestsListEntry, v1beta2_capacity_requirements->requests) { + keyValuePair_t *localKeyValue = requestsListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_capacity_requirements_t *v1beta2_capacity_requirements_parseFromJSON(cJSON *v1beta2_capacity_requirementsJSON){ + + v1beta2_capacity_requirements_t *v1beta2_capacity_requirements_local_var = NULL; + + // define the local map for v1beta2_capacity_requirements->requests + list_t *requestsList = NULL; + + // v1beta2_capacity_requirements->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta2_capacity_requirementsJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local_map = NULL; + if(!cJSON_IsObject(requests) && !cJSON_IsNull(requests)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(requests)) + { + requestsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(requests_local_map, requests) + { + cJSON *localMapObject = requests_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(requestsList , localMapKeyPair); + } + } + } + + + v1beta2_capacity_requirements_local_var = v1beta2_capacity_requirements_create_internal ( + requests ? requestsList : NULL + ); + + return v1beta2_capacity_requirements_local_var; +end: + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_capacity_requirements.h b/kubernetes/model/v1beta2_capacity_requirements.h new file mode 100644 index 00000000..340e3eb8 --- /dev/null +++ b/kubernetes/model/v1beta2_capacity_requirements.h @@ -0,0 +1,38 @@ +/* + * v1beta2_capacity_requirements.h + * + * CapacityRequirements defines the capacity requirements for a specific device request. + */ + +#ifndef _v1beta2_capacity_requirements_H_ +#define _v1beta2_capacity_requirements_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_capacity_requirements_t v1beta2_capacity_requirements_t; + + + + +typedef struct v1beta2_capacity_requirements_t { + list_t* requests; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_capacity_requirements_t; + +__attribute__((deprecated)) v1beta2_capacity_requirements_t *v1beta2_capacity_requirements_create( + list_t* requests +); + +void v1beta2_capacity_requirements_free(v1beta2_capacity_requirements_t *v1beta2_capacity_requirements); + +v1beta2_capacity_requirements_t *v1beta2_capacity_requirements_parseFromJSON(cJSON *v1beta2_capacity_requirementsJSON); + +cJSON *v1beta2_capacity_requirements_convertToJSON(v1beta2_capacity_requirements_t *v1beta2_capacity_requirements); + +#endif /* _v1beta2_capacity_requirements_H_ */ + diff --git a/kubernetes/model/v1beta2_cel_device_selector.c b/kubernetes/model/v1beta2_cel_device_selector.c new file mode 100644 index 00000000..703cbc31 --- /dev/null +++ b/kubernetes/model/v1beta2_cel_device_selector.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1beta2_cel_device_selector.h" + + + +static v1beta2_cel_device_selector_t *v1beta2_cel_device_selector_create_internal( + char *expression + ) { + v1beta2_cel_device_selector_t *v1beta2_cel_device_selector_local_var = malloc(sizeof(v1beta2_cel_device_selector_t)); + if (!v1beta2_cel_device_selector_local_var) { + return NULL; + } + v1beta2_cel_device_selector_local_var->expression = expression; + + v1beta2_cel_device_selector_local_var->_library_owned = 1; + return v1beta2_cel_device_selector_local_var; +} + +__attribute__((deprecated)) v1beta2_cel_device_selector_t *v1beta2_cel_device_selector_create( + char *expression + ) { + return v1beta2_cel_device_selector_create_internal ( + expression + ); +} + +void v1beta2_cel_device_selector_free(v1beta2_cel_device_selector_t *v1beta2_cel_device_selector) { + if(NULL == v1beta2_cel_device_selector){ + return ; + } + if(v1beta2_cel_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_cel_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_cel_device_selector->expression) { + free(v1beta2_cel_device_selector->expression); + v1beta2_cel_device_selector->expression = NULL; + } + free(v1beta2_cel_device_selector); +} + +cJSON *v1beta2_cel_device_selector_convertToJSON(v1beta2_cel_device_selector_t *v1beta2_cel_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_cel_device_selector->expression + if (!v1beta2_cel_device_selector->expression) { + goto fail; + } + if(cJSON_AddStringToObject(item, "expression", v1beta2_cel_device_selector->expression) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_cel_device_selector_t *v1beta2_cel_device_selector_parseFromJSON(cJSON *v1beta2_cel_device_selectorJSON){ + + v1beta2_cel_device_selector_t *v1beta2_cel_device_selector_local_var = NULL; + + // v1beta2_cel_device_selector->expression + cJSON *expression = cJSON_GetObjectItemCaseSensitive(v1beta2_cel_device_selectorJSON, "expression"); + if (cJSON_IsNull(expression)) { + expression = NULL; + } + if (!expression) { + goto end; + } + + + if(!cJSON_IsString(expression)) + { + goto end; //String + } + + + v1beta2_cel_device_selector_local_var = v1beta2_cel_device_selector_create_internal ( + strdup(expression->valuestring) + ); + + return v1beta2_cel_device_selector_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_cel_device_selector.h b/kubernetes/model/v1beta2_cel_device_selector.h new file mode 100644 index 00000000..0d9c2fd0 --- /dev/null +++ b/kubernetes/model/v1beta2_cel_device_selector.h @@ -0,0 +1,38 @@ +/* + * v1beta2_cel_device_selector.h + * + * CELDeviceSelector contains a CEL expression for selecting a device. + */ + +#ifndef _v1beta2_cel_device_selector_H_ +#define _v1beta2_cel_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_cel_device_selector_t v1beta2_cel_device_selector_t; + + + + +typedef struct v1beta2_cel_device_selector_t { + char *expression; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_cel_device_selector_t; + +__attribute__((deprecated)) v1beta2_cel_device_selector_t *v1beta2_cel_device_selector_create( + char *expression +); + +void v1beta2_cel_device_selector_free(v1beta2_cel_device_selector_t *v1beta2_cel_device_selector); + +v1beta2_cel_device_selector_t *v1beta2_cel_device_selector_parseFromJSON(cJSON *v1beta2_cel_device_selectorJSON); + +cJSON *v1beta2_cel_device_selector_convertToJSON(v1beta2_cel_device_selector_t *v1beta2_cel_device_selector); + +#endif /* _v1beta2_cel_device_selector_H_ */ + diff --git a/kubernetes/model/v1beta2_counter.c b/kubernetes/model/v1beta2_counter.c new file mode 100644 index 00000000..a91125a5 --- /dev/null +++ b/kubernetes/model/v1beta2_counter.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1beta2_counter.h" + + + +static v1beta2_counter_t *v1beta2_counter_create_internal( + char *value + ) { + v1beta2_counter_t *v1beta2_counter_local_var = malloc(sizeof(v1beta2_counter_t)); + if (!v1beta2_counter_local_var) { + return NULL; + } + v1beta2_counter_local_var->value = value; + + v1beta2_counter_local_var->_library_owned = 1; + return v1beta2_counter_local_var; +} + +__attribute__((deprecated)) v1beta2_counter_t *v1beta2_counter_create( + char *value + ) { + return v1beta2_counter_create_internal ( + value + ); +} + +void v1beta2_counter_free(v1beta2_counter_t *v1beta2_counter) { + if(NULL == v1beta2_counter){ + return ; + } + if(v1beta2_counter->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_counter_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_counter->value) { + free(v1beta2_counter->value); + v1beta2_counter->value = NULL; + } + free(v1beta2_counter); +} + +cJSON *v1beta2_counter_convertToJSON(v1beta2_counter_t *v1beta2_counter) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_counter->value + if (!v1beta2_counter->value) { + goto fail; + } + if(cJSON_AddStringToObject(item, "value", v1beta2_counter->value) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_counter_t *v1beta2_counter_parseFromJSON(cJSON *v1beta2_counterJSON){ + + v1beta2_counter_t *v1beta2_counter_local_var = NULL; + + // v1beta2_counter->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta2_counterJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (!value) { + goto end; + } + + + if(!cJSON_IsString(value)) + { + goto end; //String + } + + + v1beta2_counter_local_var = v1beta2_counter_create_internal ( + strdup(value->valuestring) + ); + + return v1beta2_counter_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_counter.h b/kubernetes/model/v1beta2_counter.h new file mode 100644 index 00000000..29d1836b --- /dev/null +++ b/kubernetes/model/v1beta2_counter.h @@ -0,0 +1,38 @@ +/* + * v1beta2_counter.h + * + * Counter describes a quantity associated with a device. + */ + +#ifndef _v1beta2_counter_H_ +#define _v1beta2_counter_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_counter_t v1beta2_counter_t; + + + + +typedef struct v1beta2_counter_t { + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_counter_t; + +__attribute__((deprecated)) v1beta2_counter_t *v1beta2_counter_create( + char *value +); + +void v1beta2_counter_free(v1beta2_counter_t *v1beta2_counter); + +v1beta2_counter_t *v1beta2_counter_parseFromJSON(cJSON *v1beta2_counterJSON); + +cJSON *v1beta2_counter_convertToJSON(v1beta2_counter_t *v1beta2_counter); + +#endif /* _v1beta2_counter_H_ */ + diff --git a/kubernetes/model/v1beta2_counter_set.c b/kubernetes/model/v1beta2_counter_set.c new file mode 100644 index 00000000..41b1ecbc --- /dev/null +++ b/kubernetes/model/v1beta2_counter_set.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1beta2_counter_set.h" + + + +static v1beta2_counter_set_t *v1beta2_counter_set_create_internal( + list_t* counters, + char *name + ) { + v1beta2_counter_set_t *v1beta2_counter_set_local_var = malloc(sizeof(v1beta2_counter_set_t)); + if (!v1beta2_counter_set_local_var) { + return NULL; + } + v1beta2_counter_set_local_var->counters = counters; + v1beta2_counter_set_local_var->name = name; + + v1beta2_counter_set_local_var->_library_owned = 1; + return v1beta2_counter_set_local_var; +} + +__attribute__((deprecated)) v1beta2_counter_set_t *v1beta2_counter_set_create( + list_t* counters, + char *name + ) { + return v1beta2_counter_set_create_internal ( + counters, + name + ); +} + +void v1beta2_counter_set_free(v1beta2_counter_set_t *v1beta2_counter_set) { + if(NULL == v1beta2_counter_set){ + return ; + } + if(v1beta2_counter_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_counter_set_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_counter_set->counters) { + list_ForEach(listEntry, v1beta2_counter_set->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta2_counter_set->counters); + v1beta2_counter_set->counters = NULL; + } + if (v1beta2_counter_set->name) { + free(v1beta2_counter_set->name); + v1beta2_counter_set->name = NULL; + } + free(v1beta2_counter_set); +} + +cJSON *v1beta2_counter_set_convertToJSON(v1beta2_counter_set_t *v1beta2_counter_set) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_counter_set->counters + if (!v1beta2_counter_set->counters) { + goto fail; + } + cJSON *counters = cJSON_AddObjectToObject(item, "counters"); + if(counters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = counters; + listEntry_t *countersListEntry; + if (v1beta2_counter_set->counters) { + list_ForEach(countersListEntry, v1beta2_counter_set->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + + // v1beta2_counter_set->name + if (!v1beta2_counter_set->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta2_counter_set->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_counter_set_t *v1beta2_counter_set_parseFromJSON(cJSON *v1beta2_counter_setJSON){ + + v1beta2_counter_set_t *v1beta2_counter_set_local_var = NULL; + + // define the local map for v1beta2_counter_set->counters + list_t *countersList = NULL; + + // v1beta2_counter_set->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1beta2_counter_setJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1beta2_counter_set->counters is currently not supported. + + + // v1beta2_counter_set->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta2_counter_setJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1beta2_counter_set_local_var = v1beta2_counter_set_create_internal ( + countersList, + strdup(name->valuestring) + ); + + return v1beta2_counter_set_local_var; +end: + + // The data type of the elements in v1beta2_counter_set->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1beta2_counter_set.h b/kubernetes/model/v1beta2_counter_set.h new file mode 100644 index 00000000..4951b7de --- /dev/null +++ b/kubernetes/model/v1beta2_counter_set.h @@ -0,0 +1,41 @@ +/* + * v1beta2_counter_set.h + * + * CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice. The counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices. + */ + +#ifndef _v1beta2_counter_set_H_ +#define _v1beta2_counter_set_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_counter_set_t v1beta2_counter_set_t; + +#include "v1beta2_counter.h" + + + +typedef struct v1beta2_counter_set_t { + list_t* counters; //map + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_counter_set_t; + +__attribute__((deprecated)) v1beta2_counter_set_t *v1beta2_counter_set_create( + list_t* counters, + char *name +); + +void v1beta2_counter_set_free(v1beta2_counter_set_t *v1beta2_counter_set); + +v1beta2_counter_set_t *v1beta2_counter_set_parseFromJSON(cJSON *v1beta2_counter_setJSON); + +cJSON *v1beta2_counter_set_convertToJSON(v1beta2_counter_set_t *v1beta2_counter_set); + +#endif /* _v1beta2_counter_set_H_ */ + diff --git a/kubernetes/model/v1beta2_device.c b/kubernetes/model/v1beta2_device.c new file mode 100644 index 00000000..5eb40cd3 --- /dev/null +++ b/kubernetes/model/v1beta2_device.c @@ -0,0 +1,592 @@ +#include +#include +#include +#include "v1beta2_device.h" + + + +static v1beta2_device_t *v1beta2_device_create_internal( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *name, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints + ) { + v1beta2_device_t *v1beta2_device_local_var = malloc(sizeof(v1beta2_device_t)); + if (!v1beta2_device_local_var) { + return NULL; + } + v1beta2_device_local_var->all_nodes = all_nodes; + v1beta2_device_local_var->allow_multiple_allocations = allow_multiple_allocations; + v1beta2_device_local_var->attributes = attributes; + v1beta2_device_local_var->binding_conditions = binding_conditions; + v1beta2_device_local_var->binding_failure_conditions = binding_failure_conditions; + v1beta2_device_local_var->binds_to_node = binds_to_node; + v1beta2_device_local_var->capacity = capacity; + v1beta2_device_local_var->consumes_counters = consumes_counters; + v1beta2_device_local_var->name = name; + v1beta2_device_local_var->node_name = node_name; + v1beta2_device_local_var->node_selector = node_selector; + v1beta2_device_local_var->taints = taints; + + v1beta2_device_local_var->_library_owned = 1; + return v1beta2_device_local_var; +} + +__attribute__((deprecated)) v1beta2_device_t *v1beta2_device_create( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *name, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints + ) { + return v1beta2_device_create_internal ( + all_nodes, + allow_multiple_allocations, + attributes, + binding_conditions, + binding_failure_conditions, + binds_to_node, + capacity, + consumes_counters, + name, + node_name, + node_selector, + taints + ); +} + +void v1beta2_device_free(v1beta2_device_t *v1beta2_device) { + if(NULL == v1beta2_device){ + return ; + } + if(v1beta2_device->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device->attributes) { + list_ForEach(listEntry, v1beta2_device->attributes) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta2_device->attributes); + v1beta2_device->attributes = NULL; + } + if (v1beta2_device->binding_conditions) { + list_ForEach(listEntry, v1beta2_device->binding_conditions) { + free(listEntry->data); + } + list_freeList(v1beta2_device->binding_conditions); + v1beta2_device->binding_conditions = NULL; + } + if (v1beta2_device->binding_failure_conditions) { + list_ForEach(listEntry, v1beta2_device->binding_failure_conditions) { + free(listEntry->data); + } + list_freeList(v1beta2_device->binding_failure_conditions); + v1beta2_device->binding_failure_conditions = NULL; + } + if (v1beta2_device->capacity) { + list_ForEach(listEntry, v1beta2_device->capacity) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta2_device->capacity); + v1beta2_device->capacity = NULL; + } + if (v1beta2_device->consumes_counters) { + list_ForEach(listEntry, v1beta2_device->consumes_counters) { + v1beta2_device_counter_consumption_free(listEntry->data); + } + list_freeList(v1beta2_device->consumes_counters); + v1beta2_device->consumes_counters = NULL; + } + if (v1beta2_device->name) { + free(v1beta2_device->name); + v1beta2_device->name = NULL; + } + if (v1beta2_device->node_name) { + free(v1beta2_device->node_name); + v1beta2_device->node_name = NULL; + } + if (v1beta2_device->node_selector) { + v1_node_selector_free(v1beta2_device->node_selector); + v1beta2_device->node_selector = NULL; + } + if (v1beta2_device->taints) { + list_ForEach(listEntry, v1beta2_device->taints) { + v1beta2_device_taint_free(listEntry->data); + } + list_freeList(v1beta2_device->taints); + v1beta2_device->taints = NULL; + } + free(v1beta2_device); +} + +cJSON *v1beta2_device_convertToJSON(v1beta2_device_t *v1beta2_device) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device->all_nodes + if(v1beta2_device->all_nodes) { + if(cJSON_AddBoolToObject(item, "allNodes", v1beta2_device->all_nodes) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_device->allow_multiple_allocations + if(v1beta2_device->allow_multiple_allocations) { + if(cJSON_AddBoolToObject(item, "allowMultipleAllocations", v1beta2_device->allow_multiple_allocations) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_device->attributes + if(v1beta2_device->attributes) { + cJSON *attributes = cJSON_AddObjectToObject(item, "attributes"); + if(attributes == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = attributes; + listEntry_t *attributesListEntry; + if (v1beta2_device->attributes) { + list_ForEach(attributesListEntry, v1beta2_device->attributes) { + keyValuePair_t *localKeyValue = attributesListEntry->data; + } + } + } + + + // v1beta2_device->binding_conditions + if(v1beta2_device->binding_conditions) { + cJSON *binding_conditions = cJSON_AddArrayToObject(item, "bindingConditions"); + if(binding_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_conditionsListEntry; + list_ForEach(binding_conditionsListEntry, v1beta2_device->binding_conditions) { + if(cJSON_AddStringToObject(binding_conditions, "", binding_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta2_device->binding_failure_conditions + if(v1beta2_device->binding_failure_conditions) { + cJSON *binding_failure_conditions = cJSON_AddArrayToObject(item, "bindingFailureConditions"); + if(binding_failure_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_failure_conditionsListEntry; + list_ForEach(binding_failure_conditionsListEntry, v1beta2_device->binding_failure_conditions) { + if(cJSON_AddStringToObject(binding_failure_conditions, "", binding_failure_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta2_device->binds_to_node + if(v1beta2_device->binds_to_node) { + if(cJSON_AddBoolToObject(item, "bindsToNode", v1beta2_device->binds_to_node) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_device->capacity + if(v1beta2_device->capacity) { + cJSON *capacity = cJSON_AddObjectToObject(item, "capacity"); + if(capacity == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = capacity; + listEntry_t *capacityListEntry; + if (v1beta2_device->capacity) { + list_ForEach(capacityListEntry, v1beta2_device->capacity) { + keyValuePair_t *localKeyValue = capacityListEntry->data; + } + } + } + + + // v1beta2_device->consumes_counters + if(v1beta2_device->consumes_counters) { + cJSON *consumes_counters = cJSON_AddArrayToObject(item, "consumesCounters"); + if(consumes_counters == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *consumes_countersListEntry; + if (v1beta2_device->consumes_counters) { + list_ForEach(consumes_countersListEntry, v1beta2_device->consumes_counters) { + cJSON *itemLocal = v1beta2_device_counter_consumption_convertToJSON(consumes_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(consumes_counters, itemLocal); + } + } + } + + + // v1beta2_device->name + if (!v1beta2_device->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta2_device->name) == NULL) { + goto fail; //String + } + + + // v1beta2_device->node_name + if(v1beta2_device->node_name) { + if(cJSON_AddStringToObject(item, "nodeName", v1beta2_device->node_name) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device->node_selector + if(v1beta2_device->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1beta2_device->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_device->taints + if(v1beta2_device->taints) { + cJSON *taints = cJSON_AddArrayToObject(item, "taints"); + if(taints == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *taintsListEntry; + if (v1beta2_device->taints) { + list_ForEach(taintsListEntry, v1beta2_device->taints) { + cJSON *itemLocal = v1beta2_device_taint_convertToJSON(taintsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(taints, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_t *v1beta2_device_parseFromJSON(cJSON *v1beta2_deviceJSON){ + + v1beta2_device_t *v1beta2_device_local_var = NULL; + + // define the local map for v1beta2_device->attributes + list_t *attributesList = NULL; + + // define the local list for v1beta2_device->binding_conditions + list_t *binding_conditionsList = NULL; + + // define the local list for v1beta2_device->binding_failure_conditions + list_t *binding_failure_conditionsList = NULL; + + // define the local map for v1beta2_device->capacity + list_t *capacityList = NULL; + + // define the local list for v1beta2_device->consumes_counters + list_t *consumes_countersList = NULL; + + // define the local variable for v1beta2_device->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // define the local list for v1beta2_device->taints + list_t *taintsList = NULL; + + // v1beta2_device->all_nodes + cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "allNodes"); + if (cJSON_IsNull(all_nodes)) { + all_nodes = NULL; + } + if (all_nodes) { + if(!cJSON_IsBool(all_nodes)) + { + goto end; //Bool + } + } + + // v1beta2_device->allow_multiple_allocations + cJSON *allow_multiple_allocations = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "allowMultipleAllocations"); + if (cJSON_IsNull(allow_multiple_allocations)) { + allow_multiple_allocations = NULL; + } + if (allow_multiple_allocations) { + if(!cJSON_IsBool(allow_multiple_allocations)) + { + goto end; //Bool + } + } + + // v1beta2_device->attributes + cJSON *attributes = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "attributes"); + if (cJSON_IsNull(attributes)) { + attributes = NULL; + } + if (attributes) { + + // The data type of the elements in v1beta2_device->attributes is currently not supported. + + } + + // v1beta2_device->binding_conditions + cJSON *binding_conditions = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "bindingConditions"); + if (cJSON_IsNull(binding_conditions)) { + binding_conditions = NULL; + } + if (binding_conditions) { + cJSON *binding_conditions_local = NULL; + if(!cJSON_IsArray(binding_conditions)) { + goto end;//primitive container + } + binding_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_conditions_local, binding_conditions) + { + if(!cJSON_IsString(binding_conditions_local)) + { + goto end; + } + list_addElement(binding_conditionsList , strdup(binding_conditions_local->valuestring)); + } + } + + // v1beta2_device->binding_failure_conditions + cJSON *binding_failure_conditions = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "bindingFailureConditions"); + if (cJSON_IsNull(binding_failure_conditions)) { + binding_failure_conditions = NULL; + } + if (binding_failure_conditions) { + cJSON *binding_failure_conditions_local = NULL; + if(!cJSON_IsArray(binding_failure_conditions)) { + goto end;//primitive container + } + binding_failure_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_failure_conditions_local, binding_failure_conditions) + { + if(!cJSON_IsString(binding_failure_conditions_local)) + { + goto end; + } + list_addElement(binding_failure_conditionsList , strdup(binding_failure_conditions_local->valuestring)); + } + } + + // v1beta2_device->binds_to_node + cJSON *binds_to_node = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "bindsToNode"); + if (cJSON_IsNull(binds_to_node)) { + binds_to_node = NULL; + } + if (binds_to_node) { + if(!cJSON_IsBool(binds_to_node)) + { + goto end; //Bool + } + } + + // v1beta2_device->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + + // The data type of the elements in v1beta2_device->capacity is currently not supported. + + } + + // v1beta2_device->consumes_counters + cJSON *consumes_counters = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "consumesCounters"); + if (cJSON_IsNull(consumes_counters)) { + consumes_counters = NULL; + } + if (consumes_counters) { + cJSON *consumes_counters_local_nonprimitive = NULL; + if(!cJSON_IsArray(consumes_counters)){ + goto end; //nonprimitive container + } + + consumes_countersList = list_createList(); + + cJSON_ArrayForEach(consumes_counters_local_nonprimitive,consumes_counters ) + { + if(!cJSON_IsObject(consumes_counters_local_nonprimitive)){ + goto end; + } + v1beta2_device_counter_consumption_t *consumes_countersItem = v1beta2_device_counter_consumption_parseFromJSON(consumes_counters_local_nonprimitive); + + list_addElement(consumes_countersList, consumes_countersItem); + } + } + + // v1beta2_device->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta2_device->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } + if (node_name) { + if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) + { + goto end; //String + } + } + + // v1beta2_device->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + // v1beta2_device->taints + cJSON *taints = cJSON_GetObjectItemCaseSensitive(v1beta2_deviceJSON, "taints"); + if (cJSON_IsNull(taints)) { + taints = NULL; + } + if (taints) { + cJSON *taints_local_nonprimitive = NULL; + if(!cJSON_IsArray(taints)){ + goto end; //nonprimitive container + } + + taintsList = list_createList(); + + cJSON_ArrayForEach(taints_local_nonprimitive,taints ) + { + if(!cJSON_IsObject(taints_local_nonprimitive)){ + goto end; + } + v1beta2_device_taint_t *taintsItem = v1beta2_device_taint_parseFromJSON(taints_local_nonprimitive); + + list_addElement(taintsList, taintsItem); + } + } + + + v1beta2_device_local_var = v1beta2_device_create_internal ( + all_nodes ? all_nodes->valueint : 0, + allow_multiple_allocations ? allow_multiple_allocations->valueint : 0, + attributes ? attributesList : NULL, + binding_conditions ? binding_conditionsList : NULL, + binding_failure_conditions ? binding_failure_conditionsList : NULL, + binds_to_node ? binds_to_node->valueint : 0, + capacity ? capacityList : NULL, + consumes_counters ? consumes_countersList : NULL, + strdup(name->valuestring), + node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, + node_selector ? node_selector_local_nonprim : NULL, + taints ? taintsList : NULL + ); + + return v1beta2_device_local_var; +end: + + // The data type of the elements in v1beta2_device->attributes is currently not supported. + + if (binding_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_conditionsList); + binding_conditionsList = NULL; + } + if (binding_failure_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_failure_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_failure_conditionsList); + binding_failure_conditionsList = NULL; + } + + // The data type of the elements in v1beta2_device->capacity is currently not supported. + + if (consumes_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, consumes_countersList) { + v1beta2_device_counter_consumption_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(consumes_countersList); + consumes_countersList = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + if (taintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, taintsList) { + v1beta2_device_taint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(taintsList); + taintsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device.h b/kubernetes/model/v1beta2_device.h new file mode 100644 index 00000000..ece7602f --- /dev/null +++ b/kubernetes/model/v1beta2_device.h @@ -0,0 +1,65 @@ +/* + * v1beta2_device.h + * + * Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set. + */ + +#ifndef _v1beta2_device_H_ +#define _v1beta2_device_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_t v1beta2_device_t; + +#include "v1_node_selector.h" +#include "v1beta2_device_attribute.h" +#include "v1beta2_device_capacity.h" +#include "v1beta2_device_counter_consumption.h" +#include "v1beta2_device_taint.h" + + + +typedef struct v1beta2_device_t { + int all_nodes; //boolean + int allow_multiple_allocations; //boolean + list_t* attributes; //map + list_t *binding_conditions; //primitive container + list_t *binding_failure_conditions; //primitive container + int binds_to_node; //boolean + list_t* capacity; //map + list_t *consumes_counters; //nonprimitive container + char *name; // string + char *node_name; // string + struct v1_node_selector_t *node_selector; //model + list_t *taints; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_t; + +__attribute__((deprecated)) v1beta2_device_t *v1beta2_device_create( + int all_nodes, + int allow_multiple_allocations, + list_t* attributes, + list_t *binding_conditions, + list_t *binding_failure_conditions, + int binds_to_node, + list_t* capacity, + list_t *consumes_counters, + char *name, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints +); + +void v1beta2_device_free(v1beta2_device_t *v1beta2_device); + +v1beta2_device_t *v1beta2_device_parseFromJSON(cJSON *v1beta2_deviceJSON); + +cJSON *v1beta2_device_convertToJSON(v1beta2_device_t *v1beta2_device); + +#endif /* _v1beta2_device_H_ */ + diff --git a/kubernetes/model/v1beta2_device_allocation_configuration.c b/kubernetes/model/v1beta2_device_allocation_configuration.c new file mode 100644 index 00000000..16ca6c74 --- /dev/null +++ b/kubernetes/model/v1beta2_device_allocation_configuration.c @@ -0,0 +1,193 @@ +#include +#include +#include +#include "v1beta2_device_allocation_configuration.h" + + + +static v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration_create_internal( + v1beta2_opaque_device_configuration_t *opaque, + list_t *requests, + char *source + ) { + v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration_local_var = malloc(sizeof(v1beta2_device_allocation_configuration_t)); + if (!v1beta2_device_allocation_configuration_local_var) { + return NULL; + } + v1beta2_device_allocation_configuration_local_var->opaque = opaque; + v1beta2_device_allocation_configuration_local_var->requests = requests; + v1beta2_device_allocation_configuration_local_var->source = source; + + v1beta2_device_allocation_configuration_local_var->_library_owned = 1; + return v1beta2_device_allocation_configuration_local_var; +} + +__attribute__((deprecated)) v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration_create( + v1beta2_opaque_device_configuration_t *opaque, + list_t *requests, + char *source + ) { + return v1beta2_device_allocation_configuration_create_internal ( + opaque, + requests, + source + ); +} + +void v1beta2_device_allocation_configuration_free(v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration) { + if(NULL == v1beta2_device_allocation_configuration){ + return ; + } + if(v1beta2_device_allocation_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_allocation_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_allocation_configuration->opaque) { + v1beta2_opaque_device_configuration_free(v1beta2_device_allocation_configuration->opaque); + v1beta2_device_allocation_configuration->opaque = NULL; + } + if (v1beta2_device_allocation_configuration->requests) { + list_ForEach(listEntry, v1beta2_device_allocation_configuration->requests) { + free(listEntry->data); + } + list_freeList(v1beta2_device_allocation_configuration->requests); + v1beta2_device_allocation_configuration->requests = NULL; + } + if (v1beta2_device_allocation_configuration->source) { + free(v1beta2_device_allocation_configuration->source); + v1beta2_device_allocation_configuration->source = NULL; + } + free(v1beta2_device_allocation_configuration); +} + +cJSON *v1beta2_device_allocation_configuration_convertToJSON(v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_allocation_configuration->opaque + if(v1beta2_device_allocation_configuration->opaque) { + cJSON *opaque_local_JSON = v1beta2_opaque_device_configuration_convertToJSON(v1beta2_device_allocation_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_device_allocation_configuration->requests + if(v1beta2_device_allocation_configuration->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1beta2_device_allocation_configuration->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta2_device_allocation_configuration->source + if (!v1beta2_device_allocation_configuration->source) { + goto fail; + } + if(cJSON_AddStringToObject(item, "source", v1beta2_device_allocation_configuration->source) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration_parseFromJSON(cJSON *v1beta2_device_allocation_configurationJSON){ + + v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration_local_var = NULL; + + // define the local variable for v1beta2_device_allocation_configuration->opaque + v1beta2_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // define the local list for v1beta2_device_allocation_configuration->requests + list_t *requestsList = NULL; + + // v1beta2_device_allocation_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1beta2_device_allocation_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1beta2_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + // v1beta2_device_allocation_configuration->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta2_device_allocation_configurationJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + // v1beta2_device_allocation_configuration->source + cJSON *source = cJSON_GetObjectItemCaseSensitive(v1beta2_device_allocation_configurationJSON, "source"); + if (cJSON_IsNull(source)) { + source = NULL; + } + if (!source) { + goto end; + } + + + if(!cJSON_IsString(source)) + { + goto end; //String + } + + + v1beta2_device_allocation_configuration_local_var = v1beta2_device_allocation_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL, + requests ? requestsList : NULL, + strdup(source->valuestring) + ); + + return v1beta2_device_allocation_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1beta2_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_allocation_configuration.h b/kubernetes/model/v1beta2_device_allocation_configuration.h new file mode 100644 index 00000000..4ab8e028 --- /dev/null +++ b/kubernetes/model/v1beta2_device_allocation_configuration.h @@ -0,0 +1,43 @@ +/* + * v1beta2_device_allocation_configuration.h + * + * DeviceAllocationConfiguration gets embedded in an AllocationResult. + */ + +#ifndef _v1beta2_device_allocation_configuration_H_ +#define _v1beta2_device_allocation_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_allocation_configuration_t v1beta2_device_allocation_configuration_t; + +#include "v1beta2_opaque_device_configuration.h" + + + +typedef struct v1beta2_device_allocation_configuration_t { + struct v1beta2_opaque_device_configuration_t *opaque; //model + list_t *requests; //primitive container + char *source; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_allocation_configuration_t; + +__attribute__((deprecated)) v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration_create( + v1beta2_opaque_device_configuration_t *opaque, + list_t *requests, + char *source +); + +void v1beta2_device_allocation_configuration_free(v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration); + +v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration_parseFromJSON(cJSON *v1beta2_device_allocation_configurationJSON); + +cJSON *v1beta2_device_allocation_configuration_convertToJSON(v1beta2_device_allocation_configuration_t *v1beta2_device_allocation_configuration); + +#endif /* _v1beta2_device_allocation_configuration_H_ */ + diff --git a/kubernetes/model/v1beta2_device_allocation_result.c b/kubernetes/model/v1beta2_device_allocation_result.c new file mode 100644 index 00000000..70f690eb --- /dev/null +++ b/kubernetes/model/v1beta2_device_allocation_result.c @@ -0,0 +1,195 @@ +#include +#include +#include +#include "v1beta2_device_allocation_result.h" + + + +static v1beta2_device_allocation_result_t *v1beta2_device_allocation_result_create_internal( + list_t *config, + list_t *results + ) { + v1beta2_device_allocation_result_t *v1beta2_device_allocation_result_local_var = malloc(sizeof(v1beta2_device_allocation_result_t)); + if (!v1beta2_device_allocation_result_local_var) { + return NULL; + } + v1beta2_device_allocation_result_local_var->config = config; + v1beta2_device_allocation_result_local_var->results = results; + + v1beta2_device_allocation_result_local_var->_library_owned = 1; + return v1beta2_device_allocation_result_local_var; +} + +__attribute__((deprecated)) v1beta2_device_allocation_result_t *v1beta2_device_allocation_result_create( + list_t *config, + list_t *results + ) { + return v1beta2_device_allocation_result_create_internal ( + config, + results + ); +} + +void v1beta2_device_allocation_result_free(v1beta2_device_allocation_result_t *v1beta2_device_allocation_result) { + if(NULL == v1beta2_device_allocation_result){ + return ; + } + if(v1beta2_device_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_allocation_result->config) { + list_ForEach(listEntry, v1beta2_device_allocation_result->config) { + v1beta2_device_allocation_configuration_free(listEntry->data); + } + list_freeList(v1beta2_device_allocation_result->config); + v1beta2_device_allocation_result->config = NULL; + } + if (v1beta2_device_allocation_result->results) { + list_ForEach(listEntry, v1beta2_device_allocation_result->results) { + v1beta2_device_request_allocation_result_free(listEntry->data); + } + list_freeList(v1beta2_device_allocation_result->results); + v1beta2_device_allocation_result->results = NULL; + } + free(v1beta2_device_allocation_result); +} + +cJSON *v1beta2_device_allocation_result_convertToJSON(v1beta2_device_allocation_result_t *v1beta2_device_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_allocation_result->config + if(v1beta2_device_allocation_result->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1beta2_device_allocation_result->config) { + list_ForEach(configListEntry, v1beta2_device_allocation_result->config) { + cJSON *itemLocal = v1beta2_device_allocation_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1beta2_device_allocation_result->results + if(v1beta2_device_allocation_result->results) { + cJSON *results = cJSON_AddArrayToObject(item, "results"); + if(results == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *resultsListEntry; + if (v1beta2_device_allocation_result->results) { + list_ForEach(resultsListEntry, v1beta2_device_allocation_result->results) { + cJSON *itemLocal = v1beta2_device_request_allocation_result_convertToJSON(resultsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(results, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_allocation_result_t *v1beta2_device_allocation_result_parseFromJSON(cJSON *v1beta2_device_allocation_resultJSON){ + + v1beta2_device_allocation_result_t *v1beta2_device_allocation_result_local_var = NULL; + + // define the local list for v1beta2_device_allocation_result->config + list_t *configList = NULL; + + // define the local list for v1beta2_device_allocation_result->results + list_t *resultsList = NULL; + + // v1beta2_device_allocation_result->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1beta2_device_allocation_resultJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1beta2_device_allocation_configuration_t *configItem = v1beta2_device_allocation_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1beta2_device_allocation_result->results + cJSON *results = cJSON_GetObjectItemCaseSensitive(v1beta2_device_allocation_resultJSON, "results"); + if (cJSON_IsNull(results)) { + results = NULL; + } + if (results) { + cJSON *results_local_nonprimitive = NULL; + if(!cJSON_IsArray(results)){ + goto end; //nonprimitive container + } + + resultsList = list_createList(); + + cJSON_ArrayForEach(results_local_nonprimitive,results ) + { + if(!cJSON_IsObject(results_local_nonprimitive)){ + goto end; + } + v1beta2_device_request_allocation_result_t *resultsItem = v1beta2_device_request_allocation_result_parseFromJSON(results_local_nonprimitive); + + list_addElement(resultsList, resultsItem); + } + } + + + v1beta2_device_allocation_result_local_var = v1beta2_device_allocation_result_create_internal ( + config ? configList : NULL, + results ? resultsList : NULL + ); + + return v1beta2_device_allocation_result_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1beta2_device_allocation_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (resultsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resultsList) { + v1beta2_device_request_allocation_result_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resultsList); + resultsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_allocation_result.h b/kubernetes/model/v1beta2_device_allocation_result.h new file mode 100644 index 00000000..4e896641 --- /dev/null +++ b/kubernetes/model/v1beta2_device_allocation_result.h @@ -0,0 +1,42 @@ +/* + * v1beta2_device_allocation_result.h + * + * DeviceAllocationResult is the result of allocating devices. + */ + +#ifndef _v1beta2_device_allocation_result_H_ +#define _v1beta2_device_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_allocation_result_t v1beta2_device_allocation_result_t; + +#include "v1beta2_device_allocation_configuration.h" +#include "v1beta2_device_request_allocation_result.h" + + + +typedef struct v1beta2_device_allocation_result_t { + list_t *config; //nonprimitive container + list_t *results; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_allocation_result_t; + +__attribute__((deprecated)) v1beta2_device_allocation_result_t *v1beta2_device_allocation_result_create( + list_t *config, + list_t *results +); + +void v1beta2_device_allocation_result_free(v1beta2_device_allocation_result_t *v1beta2_device_allocation_result); + +v1beta2_device_allocation_result_t *v1beta2_device_allocation_result_parseFromJSON(cJSON *v1beta2_device_allocation_resultJSON); + +cJSON *v1beta2_device_allocation_result_convertToJSON(v1beta2_device_allocation_result_t *v1beta2_device_allocation_result); + +#endif /* _v1beta2_device_allocation_result_H_ */ + diff --git a/kubernetes/model/v1beta2_device_attribute.c b/kubernetes/model/v1beta2_device_attribute.c new file mode 100644 index 00000000..b192a1f7 --- /dev/null +++ b/kubernetes/model/v1beta2_device_attribute.c @@ -0,0 +1,167 @@ +#include +#include +#include +#include "v1beta2_device_attribute.h" + + + +static v1beta2_device_attribute_t *v1beta2_device_attribute_create_internal( + int _bool, + long _int, + char *string, + char *version + ) { + v1beta2_device_attribute_t *v1beta2_device_attribute_local_var = malloc(sizeof(v1beta2_device_attribute_t)); + if (!v1beta2_device_attribute_local_var) { + return NULL; + } + v1beta2_device_attribute_local_var->_bool = _bool; + v1beta2_device_attribute_local_var->_int = _int; + v1beta2_device_attribute_local_var->string = string; + v1beta2_device_attribute_local_var->version = version; + + v1beta2_device_attribute_local_var->_library_owned = 1; + return v1beta2_device_attribute_local_var; +} + +__attribute__((deprecated)) v1beta2_device_attribute_t *v1beta2_device_attribute_create( + int _bool, + long _int, + char *string, + char *version + ) { + return v1beta2_device_attribute_create_internal ( + _bool, + _int, + string, + version + ); +} + +void v1beta2_device_attribute_free(v1beta2_device_attribute_t *v1beta2_device_attribute) { + if(NULL == v1beta2_device_attribute){ + return ; + } + if(v1beta2_device_attribute->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_attribute_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_attribute->string) { + free(v1beta2_device_attribute->string); + v1beta2_device_attribute->string = NULL; + } + if (v1beta2_device_attribute->version) { + free(v1beta2_device_attribute->version); + v1beta2_device_attribute->version = NULL; + } + free(v1beta2_device_attribute); +} + +cJSON *v1beta2_device_attribute_convertToJSON(v1beta2_device_attribute_t *v1beta2_device_attribute) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_attribute->_bool + if(v1beta2_device_attribute->_bool) { + if(cJSON_AddBoolToObject(item, "bool", v1beta2_device_attribute->_bool) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_device_attribute->_int + if(v1beta2_device_attribute->_int) { + if(cJSON_AddNumberToObject(item, "int", v1beta2_device_attribute->_int) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta2_device_attribute->string + if(v1beta2_device_attribute->string) { + if(cJSON_AddStringToObject(item, "string", v1beta2_device_attribute->string) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_attribute->version + if(v1beta2_device_attribute->version) { + if(cJSON_AddStringToObject(item, "version", v1beta2_device_attribute->version) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_attribute_t *v1beta2_device_attribute_parseFromJSON(cJSON *v1beta2_device_attributeJSON){ + + v1beta2_device_attribute_t *v1beta2_device_attribute_local_var = NULL; + + // v1beta2_device_attribute->_bool + cJSON *_bool = cJSON_GetObjectItemCaseSensitive(v1beta2_device_attributeJSON, "bool"); + if (cJSON_IsNull(_bool)) { + _bool = NULL; + } + if (_bool) { + if(!cJSON_IsBool(_bool)) + { + goto end; //Bool + } + } + + // v1beta2_device_attribute->_int + cJSON *_int = cJSON_GetObjectItemCaseSensitive(v1beta2_device_attributeJSON, "int"); + if (cJSON_IsNull(_int)) { + _int = NULL; + } + if (_int) { + if(!cJSON_IsNumber(_int)) + { + goto end; //Numeric + } + } + + // v1beta2_device_attribute->string + cJSON *string = cJSON_GetObjectItemCaseSensitive(v1beta2_device_attributeJSON, "string"); + if (cJSON_IsNull(string)) { + string = NULL; + } + if (string) { + if(!cJSON_IsString(string) && !cJSON_IsNull(string)) + { + goto end; //String + } + } + + // v1beta2_device_attribute->version + cJSON *version = cJSON_GetObjectItemCaseSensitive(v1beta2_device_attributeJSON, "version"); + if (cJSON_IsNull(version)) { + version = NULL; + } + if (version) { + if(!cJSON_IsString(version) && !cJSON_IsNull(version)) + { + goto end; //String + } + } + + + v1beta2_device_attribute_local_var = v1beta2_device_attribute_create_internal ( + _bool ? _bool->valueint : 0, + _int ? _int->valuedouble : 0, + string && !cJSON_IsNull(string) ? strdup(string->valuestring) : NULL, + version && !cJSON_IsNull(version) ? strdup(version->valuestring) : NULL + ); + + return v1beta2_device_attribute_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_attribute.h b/kubernetes/model/v1beta2_device_attribute.h new file mode 100644 index 00000000..0b6aa2a0 --- /dev/null +++ b/kubernetes/model/v1beta2_device_attribute.h @@ -0,0 +1,44 @@ +/* + * v1beta2_device_attribute.h + * + * DeviceAttribute must have exactly one field set. + */ + +#ifndef _v1beta2_device_attribute_H_ +#define _v1beta2_device_attribute_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_attribute_t v1beta2_device_attribute_t; + + + + +typedef struct v1beta2_device_attribute_t { + int _bool; //boolean + long _int; //numeric + char *string; // string + char *version; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_attribute_t; + +__attribute__((deprecated)) v1beta2_device_attribute_t *v1beta2_device_attribute_create( + int _bool, + long _int, + char *string, + char *version +); + +void v1beta2_device_attribute_free(v1beta2_device_attribute_t *v1beta2_device_attribute); + +v1beta2_device_attribute_t *v1beta2_device_attribute_parseFromJSON(cJSON *v1beta2_device_attributeJSON); + +cJSON *v1beta2_device_attribute_convertToJSON(v1beta2_device_attribute_t *v1beta2_device_attribute); + +#endif /* _v1beta2_device_attribute_H_ */ + diff --git a/kubernetes/model/v1beta2_device_capacity.c b/kubernetes/model/v1beta2_device_capacity.c new file mode 100644 index 00000000..d7241463 --- /dev/null +++ b/kubernetes/model/v1beta2_device_capacity.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include "v1beta2_device_capacity.h" + + + +static v1beta2_device_capacity_t *v1beta2_device_capacity_create_internal( + v1beta2_capacity_request_policy_t *request_policy, + char *value + ) { + v1beta2_device_capacity_t *v1beta2_device_capacity_local_var = malloc(sizeof(v1beta2_device_capacity_t)); + if (!v1beta2_device_capacity_local_var) { + return NULL; + } + v1beta2_device_capacity_local_var->request_policy = request_policy; + v1beta2_device_capacity_local_var->value = value; + + v1beta2_device_capacity_local_var->_library_owned = 1; + return v1beta2_device_capacity_local_var; +} + +__attribute__((deprecated)) v1beta2_device_capacity_t *v1beta2_device_capacity_create( + v1beta2_capacity_request_policy_t *request_policy, + char *value + ) { + return v1beta2_device_capacity_create_internal ( + request_policy, + value + ); +} + +void v1beta2_device_capacity_free(v1beta2_device_capacity_t *v1beta2_device_capacity) { + if(NULL == v1beta2_device_capacity){ + return ; + } + if(v1beta2_device_capacity->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_capacity_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_capacity->request_policy) { + v1beta2_capacity_request_policy_free(v1beta2_device_capacity->request_policy); + v1beta2_device_capacity->request_policy = NULL; + } + if (v1beta2_device_capacity->value) { + free(v1beta2_device_capacity->value); + v1beta2_device_capacity->value = NULL; + } + free(v1beta2_device_capacity); +} + +cJSON *v1beta2_device_capacity_convertToJSON(v1beta2_device_capacity_t *v1beta2_device_capacity) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_capacity->request_policy + if(v1beta2_device_capacity->request_policy) { + cJSON *request_policy_local_JSON = v1beta2_capacity_request_policy_convertToJSON(v1beta2_device_capacity->request_policy); + if(request_policy_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "requestPolicy", request_policy_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_device_capacity->value + if (!v1beta2_device_capacity->value) { + goto fail; + } + if(cJSON_AddStringToObject(item, "value", v1beta2_device_capacity->value) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_capacity_t *v1beta2_device_capacity_parseFromJSON(cJSON *v1beta2_device_capacityJSON){ + + v1beta2_device_capacity_t *v1beta2_device_capacity_local_var = NULL; + + // define the local variable for v1beta2_device_capacity->request_policy + v1beta2_capacity_request_policy_t *request_policy_local_nonprim = NULL; + + // v1beta2_device_capacity->request_policy + cJSON *request_policy = cJSON_GetObjectItemCaseSensitive(v1beta2_device_capacityJSON, "requestPolicy"); + if (cJSON_IsNull(request_policy)) { + request_policy = NULL; + } + if (request_policy) { + request_policy_local_nonprim = v1beta2_capacity_request_policy_parseFromJSON(request_policy); //nonprimitive + } + + // v1beta2_device_capacity->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta2_device_capacityJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (!value) { + goto end; + } + + + if(!cJSON_IsString(value)) + { + goto end; //String + } + + + v1beta2_device_capacity_local_var = v1beta2_device_capacity_create_internal ( + request_policy ? request_policy_local_nonprim : NULL, + strdup(value->valuestring) + ); + + return v1beta2_device_capacity_local_var; +end: + if (request_policy_local_nonprim) { + v1beta2_capacity_request_policy_free(request_policy_local_nonprim); + request_policy_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_capacity.h b/kubernetes/model/v1beta2_device_capacity.h new file mode 100644 index 00000000..9723c664 --- /dev/null +++ b/kubernetes/model/v1beta2_device_capacity.h @@ -0,0 +1,41 @@ +/* + * v1beta2_device_capacity.h + * + * DeviceCapacity describes a quantity associated with a device. + */ + +#ifndef _v1beta2_device_capacity_H_ +#define _v1beta2_device_capacity_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_capacity_t v1beta2_device_capacity_t; + +#include "v1beta2_capacity_request_policy.h" + + + +typedef struct v1beta2_device_capacity_t { + struct v1beta2_capacity_request_policy_t *request_policy; //model + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_capacity_t; + +__attribute__((deprecated)) v1beta2_device_capacity_t *v1beta2_device_capacity_create( + v1beta2_capacity_request_policy_t *request_policy, + char *value +); + +void v1beta2_device_capacity_free(v1beta2_device_capacity_t *v1beta2_device_capacity); + +v1beta2_device_capacity_t *v1beta2_device_capacity_parseFromJSON(cJSON *v1beta2_device_capacityJSON); + +cJSON *v1beta2_device_capacity_convertToJSON(v1beta2_device_capacity_t *v1beta2_device_capacity); + +#endif /* _v1beta2_device_capacity_H_ */ + diff --git a/kubernetes/model/v1beta2_device_claim.c b/kubernetes/model/v1beta2_device_claim.c new file mode 100644 index 00000000..f60fc8fa --- /dev/null +++ b/kubernetes/model/v1beta2_device_claim.c @@ -0,0 +1,263 @@ +#include +#include +#include +#include "v1beta2_device_claim.h" + + + +static v1beta2_device_claim_t *v1beta2_device_claim_create_internal( + list_t *config, + list_t *constraints, + list_t *requests + ) { + v1beta2_device_claim_t *v1beta2_device_claim_local_var = malloc(sizeof(v1beta2_device_claim_t)); + if (!v1beta2_device_claim_local_var) { + return NULL; + } + v1beta2_device_claim_local_var->config = config; + v1beta2_device_claim_local_var->constraints = constraints; + v1beta2_device_claim_local_var->requests = requests; + + v1beta2_device_claim_local_var->_library_owned = 1; + return v1beta2_device_claim_local_var; +} + +__attribute__((deprecated)) v1beta2_device_claim_t *v1beta2_device_claim_create( + list_t *config, + list_t *constraints, + list_t *requests + ) { + return v1beta2_device_claim_create_internal ( + config, + constraints, + requests + ); +} + +void v1beta2_device_claim_free(v1beta2_device_claim_t *v1beta2_device_claim) { + if(NULL == v1beta2_device_claim){ + return ; + } + if(v1beta2_device_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_claim_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_claim->config) { + list_ForEach(listEntry, v1beta2_device_claim->config) { + v1beta2_device_claim_configuration_free(listEntry->data); + } + list_freeList(v1beta2_device_claim->config); + v1beta2_device_claim->config = NULL; + } + if (v1beta2_device_claim->constraints) { + list_ForEach(listEntry, v1beta2_device_claim->constraints) { + v1beta2_device_constraint_free(listEntry->data); + } + list_freeList(v1beta2_device_claim->constraints); + v1beta2_device_claim->constraints = NULL; + } + if (v1beta2_device_claim->requests) { + list_ForEach(listEntry, v1beta2_device_claim->requests) { + v1beta2_device_request_free(listEntry->data); + } + list_freeList(v1beta2_device_claim->requests); + v1beta2_device_claim->requests = NULL; + } + free(v1beta2_device_claim); +} + +cJSON *v1beta2_device_claim_convertToJSON(v1beta2_device_claim_t *v1beta2_device_claim) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_claim->config + if(v1beta2_device_claim->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1beta2_device_claim->config) { + list_ForEach(configListEntry, v1beta2_device_claim->config) { + cJSON *itemLocal = v1beta2_device_claim_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1beta2_device_claim->constraints + if(v1beta2_device_claim->constraints) { + cJSON *constraints = cJSON_AddArrayToObject(item, "constraints"); + if(constraints == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *constraintsListEntry; + if (v1beta2_device_claim->constraints) { + list_ForEach(constraintsListEntry, v1beta2_device_claim->constraints) { + cJSON *itemLocal = v1beta2_device_constraint_convertToJSON(constraintsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(constraints, itemLocal); + } + } + } + + + // v1beta2_device_claim->requests + if(v1beta2_device_claim->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *requestsListEntry; + if (v1beta2_device_claim->requests) { + list_ForEach(requestsListEntry, v1beta2_device_claim->requests) { + cJSON *itemLocal = v1beta2_device_request_convertToJSON(requestsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(requests, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_claim_t *v1beta2_device_claim_parseFromJSON(cJSON *v1beta2_device_claimJSON){ + + v1beta2_device_claim_t *v1beta2_device_claim_local_var = NULL; + + // define the local list for v1beta2_device_claim->config + list_t *configList = NULL; + + // define the local list for v1beta2_device_claim->constraints + list_t *constraintsList = NULL; + + // define the local list for v1beta2_device_claim->requests + list_t *requestsList = NULL; + + // v1beta2_device_claim->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1beta2_device_claimJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1beta2_device_claim_configuration_t *configItem = v1beta2_device_claim_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1beta2_device_claim->constraints + cJSON *constraints = cJSON_GetObjectItemCaseSensitive(v1beta2_device_claimJSON, "constraints"); + if (cJSON_IsNull(constraints)) { + constraints = NULL; + } + if (constraints) { + cJSON *constraints_local_nonprimitive = NULL; + if(!cJSON_IsArray(constraints)){ + goto end; //nonprimitive container + } + + constraintsList = list_createList(); + + cJSON_ArrayForEach(constraints_local_nonprimitive,constraints ) + { + if(!cJSON_IsObject(constraints_local_nonprimitive)){ + goto end; + } + v1beta2_device_constraint_t *constraintsItem = v1beta2_device_constraint_parseFromJSON(constraints_local_nonprimitive); + + list_addElement(constraintsList, constraintsItem); + } + } + + // v1beta2_device_claim->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta2_device_claimJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local_nonprimitive = NULL; + if(!cJSON_IsArray(requests)){ + goto end; //nonprimitive container + } + + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local_nonprimitive,requests ) + { + if(!cJSON_IsObject(requests_local_nonprimitive)){ + goto end; + } + v1beta2_device_request_t *requestsItem = v1beta2_device_request_parseFromJSON(requests_local_nonprimitive); + + list_addElement(requestsList, requestsItem); + } + } + + + v1beta2_device_claim_local_var = v1beta2_device_claim_create_internal ( + config ? configList : NULL, + constraints ? constraintsList : NULL, + requests ? requestsList : NULL + ); + + return v1beta2_device_claim_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1beta2_device_claim_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (constraintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, constraintsList) { + v1beta2_device_constraint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(constraintsList); + constraintsList = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + v1beta2_device_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_claim.h b/kubernetes/model/v1beta2_device_claim.h new file mode 100644 index 00000000..20ac4c1b --- /dev/null +++ b/kubernetes/model/v1beta2_device_claim.h @@ -0,0 +1,45 @@ +/* + * v1beta2_device_claim.h + * + * DeviceClaim defines how to request devices with a ResourceClaim. + */ + +#ifndef _v1beta2_device_claim_H_ +#define _v1beta2_device_claim_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_claim_t v1beta2_device_claim_t; + +#include "v1beta2_device_claim_configuration.h" +#include "v1beta2_device_constraint.h" +#include "v1beta2_device_request.h" + + + +typedef struct v1beta2_device_claim_t { + list_t *config; //nonprimitive container + list_t *constraints; //nonprimitive container + list_t *requests; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_claim_t; + +__attribute__((deprecated)) v1beta2_device_claim_t *v1beta2_device_claim_create( + list_t *config, + list_t *constraints, + list_t *requests +); + +void v1beta2_device_claim_free(v1beta2_device_claim_t *v1beta2_device_claim); + +v1beta2_device_claim_t *v1beta2_device_claim_parseFromJSON(cJSON *v1beta2_device_claimJSON); + +cJSON *v1beta2_device_claim_convertToJSON(v1beta2_device_claim_t *v1beta2_device_claim); + +#endif /* _v1beta2_device_claim_H_ */ + diff --git a/kubernetes/model/v1beta2_device_claim_configuration.c b/kubernetes/model/v1beta2_device_claim_configuration.c new file mode 100644 index 00000000..025e8bd7 --- /dev/null +++ b/kubernetes/model/v1beta2_device_claim_configuration.c @@ -0,0 +1,160 @@ +#include +#include +#include +#include "v1beta2_device_claim_configuration.h" + + + +static v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration_create_internal( + v1beta2_opaque_device_configuration_t *opaque, + list_t *requests + ) { + v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration_local_var = malloc(sizeof(v1beta2_device_claim_configuration_t)); + if (!v1beta2_device_claim_configuration_local_var) { + return NULL; + } + v1beta2_device_claim_configuration_local_var->opaque = opaque; + v1beta2_device_claim_configuration_local_var->requests = requests; + + v1beta2_device_claim_configuration_local_var->_library_owned = 1; + return v1beta2_device_claim_configuration_local_var; +} + +__attribute__((deprecated)) v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration_create( + v1beta2_opaque_device_configuration_t *opaque, + list_t *requests + ) { + return v1beta2_device_claim_configuration_create_internal ( + opaque, + requests + ); +} + +void v1beta2_device_claim_configuration_free(v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration) { + if(NULL == v1beta2_device_claim_configuration){ + return ; + } + if(v1beta2_device_claim_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_claim_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_claim_configuration->opaque) { + v1beta2_opaque_device_configuration_free(v1beta2_device_claim_configuration->opaque); + v1beta2_device_claim_configuration->opaque = NULL; + } + if (v1beta2_device_claim_configuration->requests) { + list_ForEach(listEntry, v1beta2_device_claim_configuration->requests) { + free(listEntry->data); + } + list_freeList(v1beta2_device_claim_configuration->requests); + v1beta2_device_claim_configuration->requests = NULL; + } + free(v1beta2_device_claim_configuration); +} + +cJSON *v1beta2_device_claim_configuration_convertToJSON(v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_claim_configuration->opaque + if(v1beta2_device_claim_configuration->opaque) { + cJSON *opaque_local_JSON = v1beta2_opaque_device_configuration_convertToJSON(v1beta2_device_claim_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_device_claim_configuration->requests + if(v1beta2_device_claim_configuration->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1beta2_device_claim_configuration->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration_parseFromJSON(cJSON *v1beta2_device_claim_configurationJSON){ + + v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration_local_var = NULL; + + // define the local variable for v1beta2_device_claim_configuration->opaque + v1beta2_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // define the local list for v1beta2_device_claim_configuration->requests + list_t *requestsList = NULL; + + // v1beta2_device_claim_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1beta2_device_claim_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1beta2_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + // v1beta2_device_claim_configuration->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta2_device_claim_configurationJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + + v1beta2_device_claim_configuration_local_var = v1beta2_device_claim_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL, + requests ? requestsList : NULL + ); + + return v1beta2_device_claim_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1beta2_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_claim_configuration.h b/kubernetes/model/v1beta2_device_claim_configuration.h new file mode 100644 index 00000000..37ffbfac --- /dev/null +++ b/kubernetes/model/v1beta2_device_claim_configuration.h @@ -0,0 +1,41 @@ +/* + * v1beta2_device_claim_configuration.h + * + * DeviceClaimConfiguration is used for configuration parameters in DeviceClaim. + */ + +#ifndef _v1beta2_device_claim_configuration_H_ +#define _v1beta2_device_claim_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_claim_configuration_t v1beta2_device_claim_configuration_t; + +#include "v1beta2_opaque_device_configuration.h" + + + +typedef struct v1beta2_device_claim_configuration_t { + struct v1beta2_opaque_device_configuration_t *opaque; //model + list_t *requests; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_claim_configuration_t; + +__attribute__((deprecated)) v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration_create( + v1beta2_opaque_device_configuration_t *opaque, + list_t *requests +); + +void v1beta2_device_claim_configuration_free(v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration); + +v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration_parseFromJSON(cJSON *v1beta2_device_claim_configurationJSON); + +cJSON *v1beta2_device_claim_configuration_convertToJSON(v1beta2_device_claim_configuration_t *v1beta2_device_claim_configuration); + +#endif /* _v1beta2_device_claim_configuration_H_ */ + diff --git a/kubernetes/model/v1beta2_device_class.c b/kubernetes/model/v1beta2_device_class.c new file mode 100644 index 00000000..600b735a --- /dev/null +++ b/kubernetes/model/v1beta2_device_class.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1beta2_device_class.h" + + + +static v1beta2_device_class_t *v1beta2_device_class_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_device_class_spec_t *spec + ) { + v1beta2_device_class_t *v1beta2_device_class_local_var = malloc(sizeof(v1beta2_device_class_t)); + if (!v1beta2_device_class_local_var) { + return NULL; + } + v1beta2_device_class_local_var->api_version = api_version; + v1beta2_device_class_local_var->kind = kind; + v1beta2_device_class_local_var->metadata = metadata; + v1beta2_device_class_local_var->spec = spec; + + v1beta2_device_class_local_var->_library_owned = 1; + return v1beta2_device_class_local_var; +} + +__attribute__((deprecated)) v1beta2_device_class_t *v1beta2_device_class_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_device_class_spec_t *spec + ) { + return v1beta2_device_class_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta2_device_class_free(v1beta2_device_class_t *v1beta2_device_class) { + if(NULL == v1beta2_device_class){ + return ; + } + if(v1beta2_device_class->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_class_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_class->api_version) { + free(v1beta2_device_class->api_version); + v1beta2_device_class->api_version = NULL; + } + if (v1beta2_device_class->kind) { + free(v1beta2_device_class->kind); + v1beta2_device_class->kind = NULL; + } + if (v1beta2_device_class->metadata) { + v1_object_meta_free(v1beta2_device_class->metadata); + v1beta2_device_class->metadata = NULL; + } + if (v1beta2_device_class->spec) { + v1beta2_device_class_spec_free(v1beta2_device_class->spec); + v1beta2_device_class->spec = NULL; + } + free(v1beta2_device_class); +} + +cJSON *v1beta2_device_class_convertToJSON(v1beta2_device_class_t *v1beta2_device_class) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_class->api_version + if(v1beta2_device_class->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_device_class->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_class->kind + if(v1beta2_device_class->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_device_class->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_class->metadata + if(v1beta2_device_class->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta2_device_class->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_device_class->spec + if (!v1beta2_device_class->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta2_device_class_spec_convertToJSON(v1beta2_device_class->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_class_t *v1beta2_device_class_parseFromJSON(cJSON *v1beta2_device_classJSON){ + + v1beta2_device_class_t *v1beta2_device_class_local_var = NULL; + + // define the local variable for v1beta2_device_class->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta2_device_class->spec + v1beta2_device_class_spec_t *spec_local_nonprim = NULL; + + // v1beta2_device_class->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_device_classJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_device_class->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_device_classJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_device_class->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_device_classJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta2_device_class->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta2_device_classJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta2_device_class_spec_parseFromJSON(spec); //nonprimitive + + + v1beta2_device_class_local_var = v1beta2_device_class_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta2_device_class_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta2_device_class_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_class.h b/kubernetes/model/v1beta2_device_class.h new file mode 100644 index 00000000..7841aa32 --- /dev/null +++ b/kubernetes/model/v1beta2_device_class.h @@ -0,0 +1,46 @@ +/* + * v1beta2_device_class.h + * + * DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta2_device_class_H_ +#define _v1beta2_device_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_class_t v1beta2_device_class_t; + +#include "v1_object_meta.h" +#include "v1beta2_device_class_spec.h" + + + +typedef struct v1beta2_device_class_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta2_device_class_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_class_t; + +__attribute__((deprecated)) v1beta2_device_class_t *v1beta2_device_class_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_device_class_spec_t *spec +); + +void v1beta2_device_class_free(v1beta2_device_class_t *v1beta2_device_class); + +v1beta2_device_class_t *v1beta2_device_class_parseFromJSON(cJSON *v1beta2_device_classJSON); + +cJSON *v1beta2_device_class_convertToJSON(v1beta2_device_class_t *v1beta2_device_class); + +#endif /* _v1beta2_device_class_H_ */ + diff --git a/kubernetes/model/v1beta2_device_class_configuration.c b/kubernetes/model/v1beta2_device_class_configuration.c new file mode 100644 index 00000000..bb86f4e8 --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_configuration.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1beta2_device_class_configuration.h" + + + +static v1beta2_device_class_configuration_t *v1beta2_device_class_configuration_create_internal( + v1beta2_opaque_device_configuration_t *opaque + ) { + v1beta2_device_class_configuration_t *v1beta2_device_class_configuration_local_var = malloc(sizeof(v1beta2_device_class_configuration_t)); + if (!v1beta2_device_class_configuration_local_var) { + return NULL; + } + v1beta2_device_class_configuration_local_var->opaque = opaque; + + v1beta2_device_class_configuration_local_var->_library_owned = 1; + return v1beta2_device_class_configuration_local_var; +} + +__attribute__((deprecated)) v1beta2_device_class_configuration_t *v1beta2_device_class_configuration_create( + v1beta2_opaque_device_configuration_t *opaque + ) { + return v1beta2_device_class_configuration_create_internal ( + opaque + ); +} + +void v1beta2_device_class_configuration_free(v1beta2_device_class_configuration_t *v1beta2_device_class_configuration) { + if(NULL == v1beta2_device_class_configuration){ + return ; + } + if(v1beta2_device_class_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_class_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_class_configuration->opaque) { + v1beta2_opaque_device_configuration_free(v1beta2_device_class_configuration->opaque); + v1beta2_device_class_configuration->opaque = NULL; + } + free(v1beta2_device_class_configuration); +} + +cJSON *v1beta2_device_class_configuration_convertToJSON(v1beta2_device_class_configuration_t *v1beta2_device_class_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_class_configuration->opaque + if(v1beta2_device_class_configuration->opaque) { + cJSON *opaque_local_JSON = v1beta2_opaque_device_configuration_convertToJSON(v1beta2_device_class_configuration->opaque); + if(opaque_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "opaque", opaque_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_class_configuration_t *v1beta2_device_class_configuration_parseFromJSON(cJSON *v1beta2_device_class_configurationJSON){ + + v1beta2_device_class_configuration_t *v1beta2_device_class_configuration_local_var = NULL; + + // define the local variable for v1beta2_device_class_configuration->opaque + v1beta2_opaque_device_configuration_t *opaque_local_nonprim = NULL; + + // v1beta2_device_class_configuration->opaque + cJSON *opaque = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_configurationJSON, "opaque"); + if (cJSON_IsNull(opaque)) { + opaque = NULL; + } + if (opaque) { + opaque_local_nonprim = v1beta2_opaque_device_configuration_parseFromJSON(opaque); //nonprimitive + } + + + v1beta2_device_class_configuration_local_var = v1beta2_device_class_configuration_create_internal ( + opaque ? opaque_local_nonprim : NULL + ); + + return v1beta2_device_class_configuration_local_var; +end: + if (opaque_local_nonprim) { + v1beta2_opaque_device_configuration_free(opaque_local_nonprim); + opaque_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_class_configuration.h b/kubernetes/model/v1beta2_device_class_configuration.h new file mode 100644 index 00000000..25359948 --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_configuration.h @@ -0,0 +1,39 @@ +/* + * v1beta2_device_class_configuration.h + * + * DeviceClassConfiguration is used in DeviceClass. + */ + +#ifndef _v1beta2_device_class_configuration_H_ +#define _v1beta2_device_class_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_class_configuration_t v1beta2_device_class_configuration_t; + +#include "v1beta2_opaque_device_configuration.h" + + + +typedef struct v1beta2_device_class_configuration_t { + struct v1beta2_opaque_device_configuration_t *opaque; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_class_configuration_t; + +__attribute__((deprecated)) v1beta2_device_class_configuration_t *v1beta2_device_class_configuration_create( + v1beta2_opaque_device_configuration_t *opaque +); + +void v1beta2_device_class_configuration_free(v1beta2_device_class_configuration_t *v1beta2_device_class_configuration); + +v1beta2_device_class_configuration_t *v1beta2_device_class_configuration_parseFromJSON(cJSON *v1beta2_device_class_configurationJSON); + +cJSON *v1beta2_device_class_configuration_convertToJSON(v1beta2_device_class_configuration_t *v1beta2_device_class_configuration); + +#endif /* _v1beta2_device_class_configuration_H_ */ + diff --git a/kubernetes/model/v1beta2_device_class_list.c b/kubernetes/model/v1beta2_device_class_list.c new file mode 100644 index 00000000..8cba54d4 --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta2_device_class_list.h" + + + +static v1beta2_device_class_list_t *v1beta2_device_class_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta2_device_class_list_t *v1beta2_device_class_list_local_var = malloc(sizeof(v1beta2_device_class_list_t)); + if (!v1beta2_device_class_list_local_var) { + return NULL; + } + v1beta2_device_class_list_local_var->api_version = api_version; + v1beta2_device_class_list_local_var->items = items; + v1beta2_device_class_list_local_var->kind = kind; + v1beta2_device_class_list_local_var->metadata = metadata; + + v1beta2_device_class_list_local_var->_library_owned = 1; + return v1beta2_device_class_list_local_var; +} + +__attribute__((deprecated)) v1beta2_device_class_list_t *v1beta2_device_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta2_device_class_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta2_device_class_list_free(v1beta2_device_class_list_t *v1beta2_device_class_list) { + if(NULL == v1beta2_device_class_list){ + return ; + } + if(v1beta2_device_class_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_class_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_class_list->api_version) { + free(v1beta2_device_class_list->api_version); + v1beta2_device_class_list->api_version = NULL; + } + if (v1beta2_device_class_list->items) { + list_ForEach(listEntry, v1beta2_device_class_list->items) { + v1beta2_device_class_free(listEntry->data); + } + list_freeList(v1beta2_device_class_list->items); + v1beta2_device_class_list->items = NULL; + } + if (v1beta2_device_class_list->kind) { + free(v1beta2_device_class_list->kind); + v1beta2_device_class_list->kind = NULL; + } + if (v1beta2_device_class_list->metadata) { + v1_list_meta_free(v1beta2_device_class_list->metadata); + v1beta2_device_class_list->metadata = NULL; + } + free(v1beta2_device_class_list); +} + +cJSON *v1beta2_device_class_list_convertToJSON(v1beta2_device_class_list_t *v1beta2_device_class_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_class_list->api_version + if(v1beta2_device_class_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_device_class_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_class_list->items + if (!v1beta2_device_class_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta2_device_class_list->items) { + list_ForEach(itemsListEntry, v1beta2_device_class_list->items) { + cJSON *itemLocal = v1beta2_device_class_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta2_device_class_list->kind + if(v1beta2_device_class_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_device_class_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_class_list->metadata + if(v1beta2_device_class_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta2_device_class_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_class_list_t *v1beta2_device_class_list_parseFromJSON(cJSON *v1beta2_device_class_listJSON){ + + v1beta2_device_class_list_t *v1beta2_device_class_list_local_var = NULL; + + // define the local list for v1beta2_device_class_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta2_device_class_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta2_device_class_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_device_class_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta2_device_class_t *itemsItem = v1beta2_device_class_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta2_device_class_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_device_class_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta2_device_class_list_local_var = v1beta2_device_class_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta2_device_class_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta2_device_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_class_list.h b/kubernetes/model/v1beta2_device_class_list.h new file mode 100644 index 00000000..55ade03f --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_list.h @@ -0,0 +1,46 @@ +/* + * v1beta2_device_class_list.h + * + * DeviceClassList is a collection of classes. + */ + +#ifndef _v1beta2_device_class_list_H_ +#define _v1beta2_device_class_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_class_list_t v1beta2_device_class_list_t; + +#include "v1_list_meta.h" +#include "v1beta2_device_class.h" + + + +typedef struct v1beta2_device_class_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_class_list_t; + +__attribute__((deprecated)) v1beta2_device_class_list_t *v1beta2_device_class_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta2_device_class_list_free(v1beta2_device_class_list_t *v1beta2_device_class_list); + +v1beta2_device_class_list_t *v1beta2_device_class_list_parseFromJSON(cJSON *v1beta2_device_class_listJSON); + +cJSON *v1beta2_device_class_list_convertToJSON(v1beta2_device_class_list_t *v1beta2_device_class_list); + +#endif /* _v1beta2_device_class_list_H_ */ + diff --git a/kubernetes/model/v1beta2_device_class_spec.c b/kubernetes/model/v1beta2_device_class_spec.c new file mode 100644 index 00000000..e17d4e54 --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_spec.c @@ -0,0 +1,224 @@ +#include +#include +#include +#include "v1beta2_device_class_spec.h" + + + +static v1beta2_device_class_spec_t *v1beta2_device_class_spec_create_internal( + list_t *config, + char *extended_resource_name, + list_t *selectors + ) { + v1beta2_device_class_spec_t *v1beta2_device_class_spec_local_var = malloc(sizeof(v1beta2_device_class_spec_t)); + if (!v1beta2_device_class_spec_local_var) { + return NULL; + } + v1beta2_device_class_spec_local_var->config = config; + v1beta2_device_class_spec_local_var->extended_resource_name = extended_resource_name; + v1beta2_device_class_spec_local_var->selectors = selectors; + + v1beta2_device_class_spec_local_var->_library_owned = 1; + return v1beta2_device_class_spec_local_var; +} + +__attribute__((deprecated)) v1beta2_device_class_spec_t *v1beta2_device_class_spec_create( + list_t *config, + char *extended_resource_name, + list_t *selectors + ) { + return v1beta2_device_class_spec_create_internal ( + config, + extended_resource_name, + selectors + ); +} + +void v1beta2_device_class_spec_free(v1beta2_device_class_spec_t *v1beta2_device_class_spec) { + if(NULL == v1beta2_device_class_spec){ + return ; + } + if(v1beta2_device_class_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_class_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_class_spec->config) { + list_ForEach(listEntry, v1beta2_device_class_spec->config) { + v1beta2_device_class_configuration_free(listEntry->data); + } + list_freeList(v1beta2_device_class_spec->config); + v1beta2_device_class_spec->config = NULL; + } + if (v1beta2_device_class_spec->extended_resource_name) { + free(v1beta2_device_class_spec->extended_resource_name); + v1beta2_device_class_spec->extended_resource_name = NULL; + } + if (v1beta2_device_class_spec->selectors) { + list_ForEach(listEntry, v1beta2_device_class_spec->selectors) { + v1beta2_device_selector_free(listEntry->data); + } + list_freeList(v1beta2_device_class_spec->selectors); + v1beta2_device_class_spec->selectors = NULL; + } + free(v1beta2_device_class_spec); +} + +cJSON *v1beta2_device_class_spec_convertToJSON(v1beta2_device_class_spec_t *v1beta2_device_class_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_class_spec->config + if(v1beta2_device_class_spec->config) { + cJSON *config = cJSON_AddArrayToObject(item, "config"); + if(config == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *configListEntry; + if (v1beta2_device_class_spec->config) { + list_ForEach(configListEntry, v1beta2_device_class_spec->config) { + cJSON *itemLocal = v1beta2_device_class_configuration_convertToJSON(configListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(config, itemLocal); + } + } + } + + + // v1beta2_device_class_spec->extended_resource_name + if(v1beta2_device_class_spec->extended_resource_name) { + if(cJSON_AddStringToObject(item, "extendedResourceName", v1beta2_device_class_spec->extended_resource_name) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_class_spec->selectors + if(v1beta2_device_class_spec->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1beta2_device_class_spec->selectors) { + list_ForEach(selectorsListEntry, v1beta2_device_class_spec->selectors) { + cJSON *itemLocal = v1beta2_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_class_spec_t *v1beta2_device_class_spec_parseFromJSON(cJSON *v1beta2_device_class_specJSON){ + + v1beta2_device_class_spec_t *v1beta2_device_class_spec_local_var = NULL; + + // define the local list for v1beta2_device_class_spec->config + list_t *configList = NULL; + + // define the local list for v1beta2_device_class_spec->selectors + list_t *selectorsList = NULL; + + // v1beta2_device_class_spec->config + cJSON *config = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_specJSON, "config"); + if (cJSON_IsNull(config)) { + config = NULL; + } + if (config) { + cJSON *config_local_nonprimitive = NULL; + if(!cJSON_IsArray(config)){ + goto end; //nonprimitive container + } + + configList = list_createList(); + + cJSON_ArrayForEach(config_local_nonprimitive,config ) + { + if(!cJSON_IsObject(config_local_nonprimitive)){ + goto end; + } + v1beta2_device_class_configuration_t *configItem = v1beta2_device_class_configuration_parseFromJSON(config_local_nonprimitive); + + list_addElement(configList, configItem); + } + } + + // v1beta2_device_class_spec->extended_resource_name + cJSON *extended_resource_name = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_specJSON, "extendedResourceName"); + if (cJSON_IsNull(extended_resource_name)) { + extended_resource_name = NULL; + } + if (extended_resource_name) { + if(!cJSON_IsString(extended_resource_name) && !cJSON_IsNull(extended_resource_name)) + { + goto end; //String + } + } + + // v1beta2_device_class_spec->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1beta2_device_class_specJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1beta2_device_selector_t *selectorsItem = v1beta2_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + + v1beta2_device_class_spec_local_var = v1beta2_device_class_spec_create_internal ( + config ? configList : NULL, + extended_resource_name && !cJSON_IsNull(extended_resource_name) ? strdup(extended_resource_name->valuestring) : NULL, + selectors ? selectorsList : NULL + ); + + return v1beta2_device_class_spec_local_var; +end: + if (configList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, configList) { + v1beta2_device_class_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(configList); + configList = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1beta2_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_class_spec.h b/kubernetes/model/v1beta2_device_class_spec.h new file mode 100644 index 00000000..c8933c67 --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_spec.h @@ -0,0 +1,44 @@ +/* + * v1beta2_device_class_spec.h + * + * DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it. + */ + +#ifndef _v1beta2_device_class_spec_H_ +#define _v1beta2_device_class_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_class_spec_t v1beta2_device_class_spec_t; + +#include "v1beta2_device_class_configuration.h" +#include "v1beta2_device_selector.h" + + + +typedef struct v1beta2_device_class_spec_t { + list_t *config; //nonprimitive container + char *extended_resource_name; // string + list_t *selectors; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_class_spec_t; + +__attribute__((deprecated)) v1beta2_device_class_spec_t *v1beta2_device_class_spec_create( + list_t *config, + char *extended_resource_name, + list_t *selectors +); + +void v1beta2_device_class_spec_free(v1beta2_device_class_spec_t *v1beta2_device_class_spec); + +v1beta2_device_class_spec_t *v1beta2_device_class_spec_parseFromJSON(cJSON *v1beta2_device_class_specJSON); + +cJSON *v1beta2_device_class_spec_convertToJSON(v1beta2_device_class_spec_t *v1beta2_device_class_spec); + +#endif /* _v1beta2_device_class_spec_H_ */ + diff --git a/kubernetes/model/v1beta2_device_constraint.c b/kubernetes/model/v1beta2_device_constraint.c new file mode 100644 index 00000000..f6071303 --- /dev/null +++ b/kubernetes/model/v1beta2_device_constraint.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include "v1beta2_device_constraint.h" + + + +static v1beta2_device_constraint_t *v1beta2_device_constraint_create_internal( + char *distinct_attribute, + char *match_attribute, + list_t *requests + ) { + v1beta2_device_constraint_t *v1beta2_device_constraint_local_var = malloc(sizeof(v1beta2_device_constraint_t)); + if (!v1beta2_device_constraint_local_var) { + return NULL; + } + v1beta2_device_constraint_local_var->distinct_attribute = distinct_attribute; + v1beta2_device_constraint_local_var->match_attribute = match_attribute; + v1beta2_device_constraint_local_var->requests = requests; + + v1beta2_device_constraint_local_var->_library_owned = 1; + return v1beta2_device_constraint_local_var; +} + +__attribute__((deprecated)) v1beta2_device_constraint_t *v1beta2_device_constraint_create( + char *distinct_attribute, + char *match_attribute, + list_t *requests + ) { + return v1beta2_device_constraint_create_internal ( + distinct_attribute, + match_attribute, + requests + ); +} + +void v1beta2_device_constraint_free(v1beta2_device_constraint_t *v1beta2_device_constraint) { + if(NULL == v1beta2_device_constraint){ + return ; + } + if(v1beta2_device_constraint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_constraint_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_constraint->distinct_attribute) { + free(v1beta2_device_constraint->distinct_attribute); + v1beta2_device_constraint->distinct_attribute = NULL; + } + if (v1beta2_device_constraint->match_attribute) { + free(v1beta2_device_constraint->match_attribute); + v1beta2_device_constraint->match_attribute = NULL; + } + if (v1beta2_device_constraint->requests) { + list_ForEach(listEntry, v1beta2_device_constraint->requests) { + free(listEntry->data); + } + list_freeList(v1beta2_device_constraint->requests); + v1beta2_device_constraint->requests = NULL; + } + free(v1beta2_device_constraint); +} + +cJSON *v1beta2_device_constraint_convertToJSON(v1beta2_device_constraint_t *v1beta2_device_constraint) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_constraint->distinct_attribute + if(v1beta2_device_constraint->distinct_attribute) { + if(cJSON_AddStringToObject(item, "distinctAttribute", v1beta2_device_constraint->distinct_attribute) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_constraint->match_attribute + if(v1beta2_device_constraint->match_attribute) { + if(cJSON_AddStringToObject(item, "matchAttribute", v1beta2_device_constraint->match_attribute) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_constraint->requests + if(v1beta2_device_constraint->requests) { + cJSON *requests = cJSON_AddArrayToObject(item, "requests"); + if(requests == NULL) { + goto fail; //primitive container + } + + listEntry_t *requestsListEntry; + list_ForEach(requestsListEntry, v1beta2_device_constraint->requests) { + if(cJSON_AddStringToObject(requests, "", requestsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_constraint_t *v1beta2_device_constraint_parseFromJSON(cJSON *v1beta2_device_constraintJSON){ + + v1beta2_device_constraint_t *v1beta2_device_constraint_local_var = NULL; + + // define the local list for v1beta2_device_constraint->requests + list_t *requestsList = NULL; + + // v1beta2_device_constraint->distinct_attribute + cJSON *distinct_attribute = cJSON_GetObjectItemCaseSensitive(v1beta2_device_constraintJSON, "distinctAttribute"); + if (cJSON_IsNull(distinct_attribute)) { + distinct_attribute = NULL; + } + if (distinct_attribute) { + if(!cJSON_IsString(distinct_attribute) && !cJSON_IsNull(distinct_attribute)) + { + goto end; //String + } + } + + // v1beta2_device_constraint->match_attribute + cJSON *match_attribute = cJSON_GetObjectItemCaseSensitive(v1beta2_device_constraintJSON, "matchAttribute"); + if (cJSON_IsNull(match_attribute)) { + match_attribute = NULL; + } + if (match_attribute) { + if(!cJSON_IsString(match_attribute) && !cJSON_IsNull(match_attribute)) + { + goto end; //String + } + } + + // v1beta2_device_constraint->requests + cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1beta2_device_constraintJSON, "requests"); + if (cJSON_IsNull(requests)) { + requests = NULL; + } + if (requests) { + cJSON *requests_local = NULL; + if(!cJSON_IsArray(requests)) { + goto end;//primitive container + } + requestsList = list_createList(); + + cJSON_ArrayForEach(requests_local, requests) + { + if(!cJSON_IsString(requests_local)) + { + goto end; + } + list_addElement(requestsList , strdup(requests_local->valuestring)); + } + } + + + v1beta2_device_constraint_local_var = v1beta2_device_constraint_create_internal ( + distinct_attribute && !cJSON_IsNull(distinct_attribute) ? strdup(distinct_attribute->valuestring) : NULL, + match_attribute && !cJSON_IsNull(match_attribute) ? strdup(match_attribute->valuestring) : NULL, + requests ? requestsList : NULL + ); + + return v1beta2_device_constraint_local_var; +end: + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_constraint.h b/kubernetes/model/v1beta2_device_constraint.h new file mode 100644 index 00000000..d85b7e06 --- /dev/null +++ b/kubernetes/model/v1beta2_device_constraint.h @@ -0,0 +1,42 @@ +/* + * v1beta2_device_constraint.h + * + * DeviceConstraint must have exactly one field set besides Requests. + */ + +#ifndef _v1beta2_device_constraint_H_ +#define _v1beta2_device_constraint_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_constraint_t v1beta2_device_constraint_t; + + + + +typedef struct v1beta2_device_constraint_t { + char *distinct_attribute; // string + char *match_attribute; // string + list_t *requests; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_constraint_t; + +__attribute__((deprecated)) v1beta2_device_constraint_t *v1beta2_device_constraint_create( + char *distinct_attribute, + char *match_attribute, + list_t *requests +); + +void v1beta2_device_constraint_free(v1beta2_device_constraint_t *v1beta2_device_constraint); + +v1beta2_device_constraint_t *v1beta2_device_constraint_parseFromJSON(cJSON *v1beta2_device_constraintJSON); + +cJSON *v1beta2_device_constraint_convertToJSON(v1beta2_device_constraint_t *v1beta2_device_constraint); + +#endif /* _v1beta2_device_constraint_H_ */ + diff --git a/kubernetes/model/v1beta2_device_counter_consumption.c b/kubernetes/model/v1beta2_device_counter_consumption.c new file mode 100644 index 00000000..fbd813d2 --- /dev/null +++ b/kubernetes/model/v1beta2_device_counter_consumption.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1beta2_device_counter_consumption.h" + + + +static v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption_create_internal( + char *counter_set, + list_t* counters + ) { + v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption_local_var = malloc(sizeof(v1beta2_device_counter_consumption_t)); + if (!v1beta2_device_counter_consumption_local_var) { + return NULL; + } + v1beta2_device_counter_consumption_local_var->counter_set = counter_set; + v1beta2_device_counter_consumption_local_var->counters = counters; + + v1beta2_device_counter_consumption_local_var->_library_owned = 1; + return v1beta2_device_counter_consumption_local_var; +} + +__attribute__((deprecated)) v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption_create( + char *counter_set, + list_t* counters + ) { + return v1beta2_device_counter_consumption_create_internal ( + counter_set, + counters + ); +} + +void v1beta2_device_counter_consumption_free(v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption) { + if(NULL == v1beta2_device_counter_consumption){ + return ; + } + if(v1beta2_device_counter_consumption->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_counter_consumption_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_counter_consumption->counter_set) { + free(v1beta2_device_counter_consumption->counter_set); + v1beta2_device_counter_consumption->counter_set = NULL; + } + if (v1beta2_device_counter_consumption->counters) { + list_ForEach(listEntry, v1beta2_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta2_device_counter_consumption->counters); + v1beta2_device_counter_consumption->counters = NULL; + } + free(v1beta2_device_counter_consumption); +} + +cJSON *v1beta2_device_counter_consumption_convertToJSON(v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_counter_consumption->counter_set + if (!v1beta2_device_counter_consumption->counter_set) { + goto fail; + } + if(cJSON_AddStringToObject(item, "counterSet", v1beta2_device_counter_consumption->counter_set) == NULL) { + goto fail; //String + } + + + // v1beta2_device_counter_consumption->counters + if (!v1beta2_device_counter_consumption->counters) { + goto fail; + } + cJSON *counters = cJSON_AddObjectToObject(item, "counters"); + if(counters == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = counters; + listEntry_t *countersListEntry; + if (v1beta2_device_counter_consumption->counters) { + list_ForEach(countersListEntry, v1beta2_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption_parseFromJSON(cJSON *v1beta2_device_counter_consumptionJSON){ + + v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption_local_var = NULL; + + // define the local map for v1beta2_device_counter_consumption->counters + list_t *countersList = NULL; + + // v1beta2_device_counter_consumption->counter_set + cJSON *counter_set = cJSON_GetObjectItemCaseSensitive(v1beta2_device_counter_consumptionJSON, "counterSet"); + if (cJSON_IsNull(counter_set)) { + counter_set = NULL; + } + if (!counter_set) { + goto end; + } + + + if(!cJSON_IsString(counter_set)) + { + goto end; //String + } + + // v1beta2_device_counter_consumption->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1beta2_device_counter_consumptionJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1beta2_device_counter_consumption->counters is currently not supported. + + + + v1beta2_device_counter_consumption_local_var = v1beta2_device_counter_consumption_create_internal ( + strdup(counter_set->valuestring), + countersList + ); + + return v1beta2_device_counter_consumption_local_var; +end: + + // The data type of the elements in v1beta2_device_counter_consumption->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_counter_consumption.h b/kubernetes/model/v1beta2_device_counter_consumption.h new file mode 100644 index 00000000..4ab736cb --- /dev/null +++ b/kubernetes/model/v1beta2_device_counter_consumption.h @@ -0,0 +1,41 @@ +/* + * v1beta2_device_counter_consumption.h + * + * DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet. + */ + +#ifndef _v1beta2_device_counter_consumption_H_ +#define _v1beta2_device_counter_consumption_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_counter_consumption_t v1beta2_device_counter_consumption_t; + +#include "v1beta2_counter.h" + + + +typedef struct v1beta2_device_counter_consumption_t { + char *counter_set; // string + list_t* counters; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_counter_consumption_t; + +__attribute__((deprecated)) v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption_create( + char *counter_set, + list_t* counters +); + +void v1beta2_device_counter_consumption_free(v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption); + +v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption_parseFromJSON(cJSON *v1beta2_device_counter_consumptionJSON); + +cJSON *v1beta2_device_counter_consumption_convertToJSON(v1beta2_device_counter_consumption_t *v1beta2_device_counter_consumption); + +#endif /* _v1beta2_device_counter_consumption_H_ */ + diff --git a/kubernetes/model/v1beta2_device_request.c b/kubernetes/model/v1beta2_device_request.c new file mode 100644 index 00000000..f5810cd6 --- /dev/null +++ b/kubernetes/model/v1beta2_device_request.c @@ -0,0 +1,198 @@ +#include +#include +#include +#include "v1beta2_device_request.h" + + + +static v1beta2_device_request_t *v1beta2_device_request_create_internal( + v1beta2_exact_device_request_t *exactly, + list_t *first_available, + char *name + ) { + v1beta2_device_request_t *v1beta2_device_request_local_var = malloc(sizeof(v1beta2_device_request_t)); + if (!v1beta2_device_request_local_var) { + return NULL; + } + v1beta2_device_request_local_var->exactly = exactly; + v1beta2_device_request_local_var->first_available = first_available; + v1beta2_device_request_local_var->name = name; + + v1beta2_device_request_local_var->_library_owned = 1; + return v1beta2_device_request_local_var; +} + +__attribute__((deprecated)) v1beta2_device_request_t *v1beta2_device_request_create( + v1beta2_exact_device_request_t *exactly, + list_t *first_available, + char *name + ) { + return v1beta2_device_request_create_internal ( + exactly, + first_available, + name + ); +} + +void v1beta2_device_request_free(v1beta2_device_request_t *v1beta2_device_request) { + if(NULL == v1beta2_device_request){ + return ; + } + if(v1beta2_device_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_request->exactly) { + v1beta2_exact_device_request_free(v1beta2_device_request->exactly); + v1beta2_device_request->exactly = NULL; + } + if (v1beta2_device_request->first_available) { + list_ForEach(listEntry, v1beta2_device_request->first_available) { + v1beta2_device_sub_request_free(listEntry->data); + } + list_freeList(v1beta2_device_request->first_available); + v1beta2_device_request->first_available = NULL; + } + if (v1beta2_device_request->name) { + free(v1beta2_device_request->name); + v1beta2_device_request->name = NULL; + } + free(v1beta2_device_request); +} + +cJSON *v1beta2_device_request_convertToJSON(v1beta2_device_request_t *v1beta2_device_request) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_request->exactly + if(v1beta2_device_request->exactly) { + cJSON *exactly_local_JSON = v1beta2_exact_device_request_convertToJSON(v1beta2_device_request->exactly); + if(exactly_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "exactly", exactly_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_device_request->first_available + if(v1beta2_device_request->first_available) { + cJSON *first_available = cJSON_AddArrayToObject(item, "firstAvailable"); + if(first_available == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *first_availableListEntry; + if (v1beta2_device_request->first_available) { + list_ForEach(first_availableListEntry, v1beta2_device_request->first_available) { + cJSON *itemLocal = v1beta2_device_sub_request_convertToJSON(first_availableListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(first_available, itemLocal); + } + } + } + + + // v1beta2_device_request->name + if (!v1beta2_device_request->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta2_device_request->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_request_t *v1beta2_device_request_parseFromJSON(cJSON *v1beta2_device_requestJSON){ + + v1beta2_device_request_t *v1beta2_device_request_local_var = NULL; + + // define the local variable for v1beta2_device_request->exactly + v1beta2_exact_device_request_t *exactly_local_nonprim = NULL; + + // define the local list for v1beta2_device_request->first_available + list_t *first_availableList = NULL; + + // v1beta2_device_request->exactly + cJSON *exactly = cJSON_GetObjectItemCaseSensitive(v1beta2_device_requestJSON, "exactly"); + if (cJSON_IsNull(exactly)) { + exactly = NULL; + } + if (exactly) { + exactly_local_nonprim = v1beta2_exact_device_request_parseFromJSON(exactly); //nonprimitive + } + + // v1beta2_device_request->first_available + cJSON *first_available = cJSON_GetObjectItemCaseSensitive(v1beta2_device_requestJSON, "firstAvailable"); + if (cJSON_IsNull(first_available)) { + first_available = NULL; + } + if (first_available) { + cJSON *first_available_local_nonprimitive = NULL; + if(!cJSON_IsArray(first_available)){ + goto end; //nonprimitive container + } + + first_availableList = list_createList(); + + cJSON_ArrayForEach(first_available_local_nonprimitive,first_available ) + { + if(!cJSON_IsObject(first_available_local_nonprimitive)){ + goto end; + } + v1beta2_device_sub_request_t *first_availableItem = v1beta2_device_sub_request_parseFromJSON(first_available_local_nonprimitive); + + list_addElement(first_availableList, first_availableItem); + } + } + + // v1beta2_device_request->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta2_device_requestJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1beta2_device_request_local_var = v1beta2_device_request_create_internal ( + exactly ? exactly_local_nonprim : NULL, + first_available ? first_availableList : NULL, + strdup(name->valuestring) + ); + + return v1beta2_device_request_local_var; +end: + if (exactly_local_nonprim) { + v1beta2_exact_device_request_free(exactly_local_nonprim); + exactly_local_nonprim = NULL; + } + if (first_availableList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, first_availableList) { + v1beta2_device_sub_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(first_availableList); + first_availableList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_request.h b/kubernetes/model/v1beta2_device_request.h new file mode 100644 index 00000000..b304d8bb --- /dev/null +++ b/kubernetes/model/v1beta2_device_request.h @@ -0,0 +1,44 @@ +/* + * v1beta2_device_request.h + * + * DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices. With FirstAvailable it is also possible to provide a prioritized list of requests. + */ + +#ifndef _v1beta2_device_request_H_ +#define _v1beta2_device_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_request_t v1beta2_device_request_t; + +#include "v1beta2_device_sub_request.h" +#include "v1beta2_exact_device_request.h" + + + +typedef struct v1beta2_device_request_t { + struct v1beta2_exact_device_request_t *exactly; //model + list_t *first_available; //nonprimitive container + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_request_t; + +__attribute__((deprecated)) v1beta2_device_request_t *v1beta2_device_request_create( + v1beta2_exact_device_request_t *exactly, + list_t *first_available, + char *name +); + +void v1beta2_device_request_free(v1beta2_device_request_t *v1beta2_device_request); + +v1beta2_device_request_t *v1beta2_device_request_parseFromJSON(cJSON *v1beta2_device_requestJSON); + +cJSON *v1beta2_device_request_convertToJSON(v1beta2_device_request_t *v1beta2_device_request); + +#endif /* _v1beta2_device_request_H_ */ + diff --git a/kubernetes/model/v1beta2_device_request_allocation_result.c b/kubernetes/model/v1beta2_device_request_allocation_result.c new file mode 100644 index 00000000..01930c16 --- /dev/null +++ b/kubernetes/model/v1beta2_device_request_allocation_result.c @@ -0,0 +1,519 @@ +#include +#include +#include +#include "v1beta2_device_request_allocation_result.h" + + + +static v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result_create_internal( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations + ) { + v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result_local_var = malloc(sizeof(v1beta2_device_request_allocation_result_t)); + if (!v1beta2_device_request_allocation_result_local_var) { + return NULL; + } + v1beta2_device_request_allocation_result_local_var->admin_access = admin_access; + v1beta2_device_request_allocation_result_local_var->binding_conditions = binding_conditions; + v1beta2_device_request_allocation_result_local_var->binding_failure_conditions = binding_failure_conditions; + v1beta2_device_request_allocation_result_local_var->consumed_capacity = consumed_capacity; + v1beta2_device_request_allocation_result_local_var->device = device; + v1beta2_device_request_allocation_result_local_var->driver = driver; + v1beta2_device_request_allocation_result_local_var->pool = pool; + v1beta2_device_request_allocation_result_local_var->request = request; + v1beta2_device_request_allocation_result_local_var->share_id = share_id; + v1beta2_device_request_allocation_result_local_var->tolerations = tolerations; + + v1beta2_device_request_allocation_result_local_var->_library_owned = 1; + return v1beta2_device_request_allocation_result_local_var; +} + +__attribute__((deprecated)) v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result_create( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations + ) { + return v1beta2_device_request_allocation_result_create_internal ( + admin_access, + binding_conditions, + binding_failure_conditions, + consumed_capacity, + device, + driver, + pool, + request, + share_id, + tolerations + ); +} + +void v1beta2_device_request_allocation_result_free(v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result) { + if(NULL == v1beta2_device_request_allocation_result){ + return ; + } + if(v1beta2_device_request_allocation_result->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_request_allocation_result_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_request_allocation_result->binding_conditions) { + list_ForEach(listEntry, v1beta2_device_request_allocation_result->binding_conditions) { + free(listEntry->data); + } + list_freeList(v1beta2_device_request_allocation_result->binding_conditions); + v1beta2_device_request_allocation_result->binding_conditions = NULL; + } + if (v1beta2_device_request_allocation_result->binding_failure_conditions) { + list_ForEach(listEntry, v1beta2_device_request_allocation_result->binding_failure_conditions) { + free(listEntry->data); + } + list_freeList(v1beta2_device_request_allocation_result->binding_failure_conditions); + v1beta2_device_request_allocation_result->binding_failure_conditions = NULL; + } + if (v1beta2_device_request_allocation_result->consumed_capacity) { + list_ForEach(listEntry, v1beta2_device_request_allocation_result->consumed_capacity) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1beta2_device_request_allocation_result->consumed_capacity); + v1beta2_device_request_allocation_result->consumed_capacity = NULL; + } + if (v1beta2_device_request_allocation_result->device) { + free(v1beta2_device_request_allocation_result->device); + v1beta2_device_request_allocation_result->device = NULL; + } + if (v1beta2_device_request_allocation_result->driver) { + free(v1beta2_device_request_allocation_result->driver); + v1beta2_device_request_allocation_result->driver = NULL; + } + if (v1beta2_device_request_allocation_result->pool) { + free(v1beta2_device_request_allocation_result->pool); + v1beta2_device_request_allocation_result->pool = NULL; + } + if (v1beta2_device_request_allocation_result->request) { + free(v1beta2_device_request_allocation_result->request); + v1beta2_device_request_allocation_result->request = NULL; + } + if (v1beta2_device_request_allocation_result->share_id) { + free(v1beta2_device_request_allocation_result->share_id); + v1beta2_device_request_allocation_result->share_id = NULL; + } + if (v1beta2_device_request_allocation_result->tolerations) { + list_ForEach(listEntry, v1beta2_device_request_allocation_result->tolerations) { + v1beta2_device_toleration_free(listEntry->data); + } + list_freeList(v1beta2_device_request_allocation_result->tolerations); + v1beta2_device_request_allocation_result->tolerations = NULL; + } + free(v1beta2_device_request_allocation_result); +} + +cJSON *v1beta2_device_request_allocation_result_convertToJSON(v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_request_allocation_result->admin_access + if(v1beta2_device_request_allocation_result->admin_access) { + if(cJSON_AddBoolToObject(item, "adminAccess", v1beta2_device_request_allocation_result->admin_access) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_device_request_allocation_result->binding_conditions + if(v1beta2_device_request_allocation_result->binding_conditions) { + cJSON *binding_conditions = cJSON_AddArrayToObject(item, "bindingConditions"); + if(binding_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_conditionsListEntry; + list_ForEach(binding_conditionsListEntry, v1beta2_device_request_allocation_result->binding_conditions) { + if(cJSON_AddStringToObject(binding_conditions, "", binding_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta2_device_request_allocation_result->binding_failure_conditions + if(v1beta2_device_request_allocation_result->binding_failure_conditions) { + cJSON *binding_failure_conditions = cJSON_AddArrayToObject(item, "bindingFailureConditions"); + if(binding_failure_conditions == NULL) { + goto fail; //primitive container + } + + listEntry_t *binding_failure_conditionsListEntry; + list_ForEach(binding_failure_conditionsListEntry, v1beta2_device_request_allocation_result->binding_failure_conditions) { + if(cJSON_AddStringToObject(binding_failure_conditions, "", binding_failure_conditionsListEntry->data) == NULL) + { + goto fail; + } + } + } + + + // v1beta2_device_request_allocation_result->consumed_capacity + if(v1beta2_device_request_allocation_result->consumed_capacity) { + cJSON *consumed_capacity = cJSON_AddObjectToObject(item, "consumedCapacity"); + if(consumed_capacity == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = consumed_capacity; + listEntry_t *consumed_capacityListEntry; + if (v1beta2_device_request_allocation_result->consumed_capacity) { + list_ForEach(consumed_capacityListEntry, v1beta2_device_request_allocation_result->consumed_capacity) { + keyValuePair_t *localKeyValue = consumed_capacityListEntry->data; + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, localKeyValue->value) == NULL) + { + goto fail; + } + } + } + } + + + // v1beta2_device_request_allocation_result->device + if (!v1beta2_device_request_allocation_result->device) { + goto fail; + } + if(cJSON_AddStringToObject(item, "device", v1beta2_device_request_allocation_result->device) == NULL) { + goto fail; //String + } + + + // v1beta2_device_request_allocation_result->driver + if (!v1beta2_device_request_allocation_result->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta2_device_request_allocation_result->driver) == NULL) { + goto fail; //String + } + + + // v1beta2_device_request_allocation_result->pool + if (!v1beta2_device_request_allocation_result->pool) { + goto fail; + } + if(cJSON_AddStringToObject(item, "pool", v1beta2_device_request_allocation_result->pool) == NULL) { + goto fail; //String + } + + + // v1beta2_device_request_allocation_result->request + if (!v1beta2_device_request_allocation_result->request) { + goto fail; + } + if(cJSON_AddStringToObject(item, "request", v1beta2_device_request_allocation_result->request) == NULL) { + goto fail; //String + } + + + // v1beta2_device_request_allocation_result->share_id + if(v1beta2_device_request_allocation_result->share_id) { + if(cJSON_AddStringToObject(item, "shareID", v1beta2_device_request_allocation_result->share_id) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_request_allocation_result->tolerations + if(v1beta2_device_request_allocation_result->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1beta2_device_request_allocation_result->tolerations) { + list_ForEach(tolerationsListEntry, v1beta2_device_request_allocation_result->tolerations) { + cJSON *itemLocal = v1beta2_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result_parseFromJSON(cJSON *v1beta2_device_request_allocation_resultJSON){ + + v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result_local_var = NULL; + + // define the local list for v1beta2_device_request_allocation_result->binding_conditions + list_t *binding_conditionsList = NULL; + + // define the local list for v1beta2_device_request_allocation_result->binding_failure_conditions + list_t *binding_failure_conditionsList = NULL; + + // define the local map for v1beta2_device_request_allocation_result->consumed_capacity + list_t *consumed_capacityList = NULL; + + // define the local list for v1beta2_device_request_allocation_result->tolerations + list_t *tolerationsList = NULL; + + // v1beta2_device_request_allocation_result->admin_access + cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "adminAccess"); + if (cJSON_IsNull(admin_access)) { + admin_access = NULL; + } + if (admin_access) { + if(!cJSON_IsBool(admin_access)) + { + goto end; //Bool + } + } + + // v1beta2_device_request_allocation_result->binding_conditions + cJSON *binding_conditions = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "bindingConditions"); + if (cJSON_IsNull(binding_conditions)) { + binding_conditions = NULL; + } + if (binding_conditions) { + cJSON *binding_conditions_local = NULL; + if(!cJSON_IsArray(binding_conditions)) { + goto end;//primitive container + } + binding_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_conditions_local, binding_conditions) + { + if(!cJSON_IsString(binding_conditions_local)) + { + goto end; + } + list_addElement(binding_conditionsList , strdup(binding_conditions_local->valuestring)); + } + } + + // v1beta2_device_request_allocation_result->binding_failure_conditions + cJSON *binding_failure_conditions = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "bindingFailureConditions"); + if (cJSON_IsNull(binding_failure_conditions)) { + binding_failure_conditions = NULL; + } + if (binding_failure_conditions) { + cJSON *binding_failure_conditions_local = NULL; + if(!cJSON_IsArray(binding_failure_conditions)) { + goto end;//primitive container + } + binding_failure_conditionsList = list_createList(); + + cJSON_ArrayForEach(binding_failure_conditions_local, binding_failure_conditions) + { + if(!cJSON_IsString(binding_failure_conditions_local)) + { + goto end; + } + list_addElement(binding_failure_conditionsList , strdup(binding_failure_conditions_local->valuestring)); + } + } + + // v1beta2_device_request_allocation_result->consumed_capacity + cJSON *consumed_capacity = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "consumedCapacity"); + if (cJSON_IsNull(consumed_capacity)) { + consumed_capacity = NULL; + } + if (consumed_capacity) { + cJSON *consumed_capacity_local_map = NULL; + if(!cJSON_IsObject(consumed_capacity) && !cJSON_IsNull(consumed_capacity)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(consumed_capacity)) + { + consumed_capacityList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(consumed_capacity_local_map, consumed_capacity) + { + cJSON *localMapObject = consumed_capacity_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(consumed_capacityList , localMapKeyPair); + } + } + } + + // v1beta2_device_request_allocation_result->device + cJSON *device = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "device"); + if (cJSON_IsNull(device)) { + device = NULL; + } + if (!device) { + goto end; + } + + + if(!cJSON_IsString(device)) + { + goto end; //String + } + + // v1beta2_device_request_allocation_result->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta2_device_request_allocation_result->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + if(!cJSON_IsString(pool)) + { + goto end; //String + } + + // v1beta2_device_request_allocation_result->request + cJSON *request = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "request"); + if (cJSON_IsNull(request)) { + request = NULL; + } + if (!request) { + goto end; + } + + + if(!cJSON_IsString(request)) + { + goto end; //String + } + + // v1beta2_device_request_allocation_result->share_id + cJSON *share_id = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "shareID"); + if (cJSON_IsNull(share_id)) { + share_id = NULL; + } + if (share_id) { + if(!cJSON_IsString(share_id) && !cJSON_IsNull(share_id)) + { + goto end; //String + } + } + + // v1beta2_device_request_allocation_result->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1beta2_device_request_allocation_resultJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1beta2_device_toleration_t *tolerationsItem = v1beta2_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1beta2_device_request_allocation_result_local_var = v1beta2_device_request_allocation_result_create_internal ( + admin_access ? admin_access->valueint : 0, + binding_conditions ? binding_conditionsList : NULL, + binding_failure_conditions ? binding_failure_conditionsList : NULL, + consumed_capacity ? consumed_capacityList : NULL, + strdup(device->valuestring), + strdup(driver->valuestring), + strdup(pool->valuestring), + strdup(request->valuestring), + share_id && !cJSON_IsNull(share_id) ? strdup(share_id->valuestring) : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1beta2_device_request_allocation_result_local_var; +end: + if (binding_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_conditionsList); + binding_conditionsList = NULL; + } + if (binding_failure_conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binding_failure_conditionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(binding_failure_conditionsList); + binding_failure_conditionsList = NULL; + } + if (consumed_capacityList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, consumed_capacityList) { + keyValuePair_t *localKeyValue = listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(consumed_capacityList); + consumed_capacityList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1beta2_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_request_allocation_result.h b/kubernetes/model/v1beta2_device_request_allocation_result.h new file mode 100644 index 00000000..2cd213e0 --- /dev/null +++ b/kubernetes/model/v1beta2_device_request_allocation_result.h @@ -0,0 +1,57 @@ +/* + * v1beta2_device_request_allocation_result.h + * + * DeviceRequestAllocationResult contains the allocation result for one request. + */ + +#ifndef _v1beta2_device_request_allocation_result_H_ +#define _v1beta2_device_request_allocation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_request_allocation_result_t v1beta2_device_request_allocation_result_t; + +#include "v1beta2_device_toleration.h" + + + +typedef struct v1beta2_device_request_allocation_result_t { + int admin_access; //boolean + list_t *binding_conditions; //primitive container + list_t *binding_failure_conditions; //primitive container + list_t* consumed_capacity; //map + char *device; // string + char *driver; // string + char *pool; // string + char *request; // string + char *share_id; // string + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_request_allocation_result_t; + +__attribute__((deprecated)) v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result_create( + int admin_access, + list_t *binding_conditions, + list_t *binding_failure_conditions, + list_t* consumed_capacity, + char *device, + char *driver, + char *pool, + char *request, + char *share_id, + list_t *tolerations +); + +void v1beta2_device_request_allocation_result_free(v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result); + +v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result_parseFromJSON(cJSON *v1beta2_device_request_allocation_resultJSON); + +cJSON *v1beta2_device_request_allocation_result_convertToJSON(v1beta2_device_request_allocation_result_t *v1beta2_device_request_allocation_result); + +#endif /* _v1beta2_device_request_allocation_result_H_ */ + diff --git a/kubernetes/model/v1beta2_device_selector.c b/kubernetes/model/v1beta2_device_selector.c new file mode 100644 index 00000000..54573fb4 --- /dev/null +++ b/kubernetes/model/v1beta2_device_selector.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1beta2_device_selector.h" + + + +static v1beta2_device_selector_t *v1beta2_device_selector_create_internal( + v1beta2_cel_device_selector_t *cel + ) { + v1beta2_device_selector_t *v1beta2_device_selector_local_var = malloc(sizeof(v1beta2_device_selector_t)); + if (!v1beta2_device_selector_local_var) { + return NULL; + } + v1beta2_device_selector_local_var->cel = cel; + + v1beta2_device_selector_local_var->_library_owned = 1; + return v1beta2_device_selector_local_var; +} + +__attribute__((deprecated)) v1beta2_device_selector_t *v1beta2_device_selector_create( + v1beta2_cel_device_selector_t *cel + ) { + return v1beta2_device_selector_create_internal ( + cel + ); +} + +void v1beta2_device_selector_free(v1beta2_device_selector_t *v1beta2_device_selector) { + if(NULL == v1beta2_device_selector){ + return ; + } + if(v1beta2_device_selector->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_selector_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_selector->cel) { + v1beta2_cel_device_selector_free(v1beta2_device_selector->cel); + v1beta2_device_selector->cel = NULL; + } + free(v1beta2_device_selector); +} + +cJSON *v1beta2_device_selector_convertToJSON(v1beta2_device_selector_t *v1beta2_device_selector) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_selector->cel + if(v1beta2_device_selector->cel) { + cJSON *cel_local_JSON = v1beta2_cel_device_selector_convertToJSON(v1beta2_device_selector->cel); + if(cel_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "cel", cel_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_selector_t *v1beta2_device_selector_parseFromJSON(cJSON *v1beta2_device_selectorJSON){ + + v1beta2_device_selector_t *v1beta2_device_selector_local_var = NULL; + + // define the local variable for v1beta2_device_selector->cel + v1beta2_cel_device_selector_t *cel_local_nonprim = NULL; + + // v1beta2_device_selector->cel + cJSON *cel = cJSON_GetObjectItemCaseSensitive(v1beta2_device_selectorJSON, "cel"); + if (cJSON_IsNull(cel)) { + cel = NULL; + } + if (cel) { + cel_local_nonprim = v1beta2_cel_device_selector_parseFromJSON(cel); //nonprimitive + } + + + v1beta2_device_selector_local_var = v1beta2_device_selector_create_internal ( + cel ? cel_local_nonprim : NULL + ); + + return v1beta2_device_selector_local_var; +end: + if (cel_local_nonprim) { + v1beta2_cel_device_selector_free(cel_local_nonprim); + cel_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_selector.h b/kubernetes/model/v1beta2_device_selector.h new file mode 100644 index 00000000..5f4934c9 --- /dev/null +++ b/kubernetes/model/v1beta2_device_selector.h @@ -0,0 +1,39 @@ +/* + * v1beta2_device_selector.h + * + * DeviceSelector must have exactly one field set. + */ + +#ifndef _v1beta2_device_selector_H_ +#define _v1beta2_device_selector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_selector_t v1beta2_device_selector_t; + +#include "v1beta2_cel_device_selector.h" + + + +typedef struct v1beta2_device_selector_t { + struct v1beta2_cel_device_selector_t *cel; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_selector_t; + +__attribute__((deprecated)) v1beta2_device_selector_t *v1beta2_device_selector_create( + v1beta2_cel_device_selector_t *cel +); + +void v1beta2_device_selector_free(v1beta2_device_selector_t *v1beta2_device_selector); + +v1beta2_device_selector_t *v1beta2_device_selector_parseFromJSON(cJSON *v1beta2_device_selectorJSON); + +cJSON *v1beta2_device_selector_convertToJSON(v1beta2_device_selector_t *v1beta2_device_selector); + +#endif /* _v1beta2_device_selector_H_ */ + diff --git a/kubernetes/model/v1beta2_device_sub_request.c b/kubernetes/model/v1beta2_device_sub_request.c new file mode 100644 index 00000000..3288764e --- /dev/null +++ b/kubernetes/model/v1beta2_device_sub_request.c @@ -0,0 +1,353 @@ +#include +#include +#include +#include "v1beta2_device_sub_request.h" + + + +static v1beta2_device_sub_request_t *v1beta2_device_sub_request_create_internal( + char *allocation_mode, + v1beta2_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + v1beta2_device_sub_request_t *v1beta2_device_sub_request_local_var = malloc(sizeof(v1beta2_device_sub_request_t)); + if (!v1beta2_device_sub_request_local_var) { + return NULL; + } + v1beta2_device_sub_request_local_var->allocation_mode = allocation_mode; + v1beta2_device_sub_request_local_var->capacity = capacity; + v1beta2_device_sub_request_local_var->count = count; + v1beta2_device_sub_request_local_var->device_class_name = device_class_name; + v1beta2_device_sub_request_local_var->name = name; + v1beta2_device_sub_request_local_var->selectors = selectors; + v1beta2_device_sub_request_local_var->tolerations = tolerations; + + v1beta2_device_sub_request_local_var->_library_owned = 1; + return v1beta2_device_sub_request_local_var; +} + +__attribute__((deprecated)) v1beta2_device_sub_request_t *v1beta2_device_sub_request_create( + char *allocation_mode, + v1beta2_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + return v1beta2_device_sub_request_create_internal ( + allocation_mode, + capacity, + count, + device_class_name, + name, + selectors, + tolerations + ); +} + +void v1beta2_device_sub_request_free(v1beta2_device_sub_request_t *v1beta2_device_sub_request) { + if(NULL == v1beta2_device_sub_request){ + return ; + } + if(v1beta2_device_sub_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_sub_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_sub_request->allocation_mode) { + free(v1beta2_device_sub_request->allocation_mode); + v1beta2_device_sub_request->allocation_mode = NULL; + } + if (v1beta2_device_sub_request->capacity) { + v1beta2_capacity_requirements_free(v1beta2_device_sub_request->capacity); + v1beta2_device_sub_request->capacity = NULL; + } + if (v1beta2_device_sub_request->device_class_name) { + free(v1beta2_device_sub_request->device_class_name); + v1beta2_device_sub_request->device_class_name = NULL; + } + if (v1beta2_device_sub_request->name) { + free(v1beta2_device_sub_request->name); + v1beta2_device_sub_request->name = NULL; + } + if (v1beta2_device_sub_request->selectors) { + list_ForEach(listEntry, v1beta2_device_sub_request->selectors) { + v1beta2_device_selector_free(listEntry->data); + } + list_freeList(v1beta2_device_sub_request->selectors); + v1beta2_device_sub_request->selectors = NULL; + } + if (v1beta2_device_sub_request->tolerations) { + list_ForEach(listEntry, v1beta2_device_sub_request->tolerations) { + v1beta2_device_toleration_free(listEntry->data); + } + list_freeList(v1beta2_device_sub_request->tolerations); + v1beta2_device_sub_request->tolerations = NULL; + } + free(v1beta2_device_sub_request); +} + +cJSON *v1beta2_device_sub_request_convertToJSON(v1beta2_device_sub_request_t *v1beta2_device_sub_request) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_sub_request->allocation_mode + if(v1beta2_device_sub_request->allocation_mode) { + if(cJSON_AddStringToObject(item, "allocationMode", v1beta2_device_sub_request->allocation_mode) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_sub_request->capacity + if(v1beta2_device_sub_request->capacity) { + cJSON *capacity_local_JSON = v1beta2_capacity_requirements_convertToJSON(v1beta2_device_sub_request->capacity); + if(capacity_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "capacity", capacity_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_device_sub_request->count + if(v1beta2_device_sub_request->count) { + if(cJSON_AddNumberToObject(item, "count", v1beta2_device_sub_request->count) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta2_device_sub_request->device_class_name + if (!v1beta2_device_sub_request->device_class_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "deviceClassName", v1beta2_device_sub_request->device_class_name) == NULL) { + goto fail; //String + } + + + // v1beta2_device_sub_request->name + if (!v1beta2_device_sub_request->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta2_device_sub_request->name) == NULL) { + goto fail; //String + } + + + // v1beta2_device_sub_request->selectors + if(v1beta2_device_sub_request->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1beta2_device_sub_request->selectors) { + list_ForEach(selectorsListEntry, v1beta2_device_sub_request->selectors) { + cJSON *itemLocal = v1beta2_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + + // v1beta2_device_sub_request->tolerations + if(v1beta2_device_sub_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1beta2_device_sub_request->tolerations) { + list_ForEach(tolerationsListEntry, v1beta2_device_sub_request->tolerations) { + cJSON *itemLocal = v1beta2_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_sub_request_t *v1beta2_device_sub_request_parseFromJSON(cJSON *v1beta2_device_sub_requestJSON){ + + v1beta2_device_sub_request_t *v1beta2_device_sub_request_local_var = NULL; + + // define the local variable for v1beta2_device_sub_request->capacity + v1beta2_capacity_requirements_t *capacity_local_nonprim = NULL; + + // define the local list for v1beta2_device_sub_request->selectors + list_t *selectorsList = NULL; + + // define the local list for v1beta2_device_sub_request->tolerations + list_t *tolerationsList = NULL; + + // v1beta2_device_sub_request->allocation_mode + cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1beta2_device_sub_requestJSON, "allocationMode"); + if (cJSON_IsNull(allocation_mode)) { + allocation_mode = NULL; + } + if (allocation_mode) { + if(!cJSON_IsString(allocation_mode) && !cJSON_IsNull(allocation_mode)) + { + goto end; //String + } + } + + // v1beta2_device_sub_request->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1beta2_device_sub_requestJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + capacity_local_nonprim = v1beta2_capacity_requirements_parseFromJSON(capacity); //nonprimitive + } + + // v1beta2_device_sub_request->count + cJSON *count = cJSON_GetObjectItemCaseSensitive(v1beta2_device_sub_requestJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } + if (count) { + if(!cJSON_IsNumber(count)) + { + goto end; //Numeric + } + } + + // v1beta2_device_sub_request->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1beta2_device_sub_requestJSON, "deviceClassName"); + if (cJSON_IsNull(device_class_name)) { + device_class_name = NULL; + } + if (!device_class_name) { + goto end; + } + + + if(!cJSON_IsString(device_class_name)) + { + goto end; //String + } + + // v1beta2_device_sub_request->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta2_device_sub_requestJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta2_device_sub_request->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1beta2_device_sub_requestJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1beta2_device_selector_t *selectorsItem = v1beta2_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + // v1beta2_device_sub_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1beta2_device_sub_requestJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1beta2_device_toleration_t *tolerationsItem = v1beta2_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1beta2_device_sub_request_local_var = v1beta2_device_sub_request_create_internal ( + allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, + capacity ? capacity_local_nonprim : NULL, + count ? count->valuedouble : 0, + strdup(device_class_name->valuestring), + strdup(name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1beta2_device_sub_request_local_var; +end: + if (capacity_local_nonprim) { + v1beta2_capacity_requirements_free(capacity_local_nonprim); + capacity_local_nonprim = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1beta2_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1beta2_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_sub_request.h b/kubernetes/model/v1beta2_device_sub_request.h new file mode 100644 index 00000000..d95c359f --- /dev/null +++ b/kubernetes/model/v1beta2_device_sub_request.h @@ -0,0 +1,53 @@ +/* + * v1beta2_device_sub_request.h + * + * DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices. DeviceSubRequest is similar to ExactDeviceRequest, but doesn't expose the AdminAccess field as that one is only supported when requesting a specific device. + */ + +#ifndef _v1beta2_device_sub_request_H_ +#define _v1beta2_device_sub_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_sub_request_t v1beta2_device_sub_request_t; + +#include "v1beta2_capacity_requirements.h" +#include "v1beta2_device_selector.h" +#include "v1beta2_device_toleration.h" + + + +typedef struct v1beta2_device_sub_request_t { + char *allocation_mode; // string + struct v1beta2_capacity_requirements_t *capacity; //model + long count; //numeric + char *device_class_name; // string + char *name; // string + list_t *selectors; //nonprimitive container + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_sub_request_t; + +__attribute__((deprecated)) v1beta2_device_sub_request_t *v1beta2_device_sub_request_create( + char *allocation_mode, + v1beta2_capacity_requirements_t *capacity, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations +); + +void v1beta2_device_sub_request_free(v1beta2_device_sub_request_t *v1beta2_device_sub_request); + +v1beta2_device_sub_request_t *v1beta2_device_sub_request_parseFromJSON(cJSON *v1beta2_device_sub_requestJSON); + +cJSON *v1beta2_device_sub_request_convertToJSON(v1beta2_device_sub_request_t *v1beta2_device_sub_request); + +#endif /* _v1beta2_device_sub_request_H_ */ + diff --git a/kubernetes/model/v1beta2_device_taint.c b/kubernetes/model/v1beta2_device_taint.c new file mode 100644 index 00000000..5776ff9b --- /dev/null +++ b/kubernetes/model/v1beta2_device_taint.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include "v1beta2_device_taint.h" + + + +static v1beta2_device_taint_t *v1beta2_device_taint_create_internal( + char *effect, + char *key, + char *time_added, + char *value + ) { + v1beta2_device_taint_t *v1beta2_device_taint_local_var = malloc(sizeof(v1beta2_device_taint_t)); + if (!v1beta2_device_taint_local_var) { + return NULL; + } + v1beta2_device_taint_local_var->effect = effect; + v1beta2_device_taint_local_var->key = key; + v1beta2_device_taint_local_var->time_added = time_added; + v1beta2_device_taint_local_var->value = value; + + v1beta2_device_taint_local_var->_library_owned = 1; + return v1beta2_device_taint_local_var; +} + +__attribute__((deprecated)) v1beta2_device_taint_t *v1beta2_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value + ) { + return v1beta2_device_taint_create_internal ( + effect, + key, + time_added, + value + ); +} + +void v1beta2_device_taint_free(v1beta2_device_taint_t *v1beta2_device_taint) { + if(NULL == v1beta2_device_taint){ + return ; + } + if(v1beta2_device_taint->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_taint_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_taint->effect) { + free(v1beta2_device_taint->effect); + v1beta2_device_taint->effect = NULL; + } + if (v1beta2_device_taint->key) { + free(v1beta2_device_taint->key); + v1beta2_device_taint->key = NULL; + } + if (v1beta2_device_taint->time_added) { + free(v1beta2_device_taint->time_added); + v1beta2_device_taint->time_added = NULL; + } + if (v1beta2_device_taint->value) { + free(v1beta2_device_taint->value); + v1beta2_device_taint->value = NULL; + } + free(v1beta2_device_taint); +} + +cJSON *v1beta2_device_taint_convertToJSON(v1beta2_device_taint_t *v1beta2_device_taint) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_taint->effect + if (!v1beta2_device_taint->effect) { + goto fail; + } + if(cJSON_AddStringToObject(item, "effect", v1beta2_device_taint->effect) == NULL) { + goto fail; //String + } + + + // v1beta2_device_taint->key + if (!v1beta2_device_taint->key) { + goto fail; + } + if(cJSON_AddStringToObject(item, "key", v1beta2_device_taint->key) == NULL) { + goto fail; //String + } + + + // v1beta2_device_taint->time_added + if(v1beta2_device_taint->time_added) { + if(cJSON_AddStringToObject(item, "timeAdded", v1beta2_device_taint->time_added) == NULL) { + goto fail; //Date-Time + } + } + + + // v1beta2_device_taint->value + if(v1beta2_device_taint->value) { + if(cJSON_AddStringToObject(item, "value", v1beta2_device_taint->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_taint_t *v1beta2_device_taint_parseFromJSON(cJSON *v1beta2_device_taintJSON){ + + v1beta2_device_taint_t *v1beta2_device_taint_local_var = NULL; + + // v1beta2_device_taint->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1beta2_device_taintJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (!effect) { + goto end; + } + + + if(!cJSON_IsString(effect)) + { + goto end; //String + } + + // v1beta2_device_taint->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1beta2_device_taintJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (!key) { + goto end; + } + + + if(!cJSON_IsString(key)) + { + goto end; //String + } + + // v1beta2_device_taint->time_added + cJSON *time_added = cJSON_GetObjectItemCaseSensitive(v1beta2_device_taintJSON, "timeAdded"); + if (cJSON_IsNull(time_added)) { + time_added = NULL; + } + if (time_added) { + if(!cJSON_IsString(time_added) && !cJSON_IsNull(time_added)) + { + goto end; //DateTime + } + } + + // v1beta2_device_taint->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta2_device_taintJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1beta2_device_taint_local_var = v1beta2_device_taint_create_internal ( + strdup(effect->valuestring), + strdup(key->valuestring), + time_added && !cJSON_IsNull(time_added) ? strdup(time_added->valuestring) : NULL, + value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL + ); + + return v1beta2_device_taint_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_taint.h b/kubernetes/model/v1beta2_device_taint.h new file mode 100644 index 00000000..3a0035d5 --- /dev/null +++ b/kubernetes/model/v1beta2_device_taint.h @@ -0,0 +1,44 @@ +/* + * v1beta2_device_taint.h + * + * The device this taint is attached to has the \"effect\" on any claim which does not tolerate the taint and, through the claim, to pods using the claim. + */ + +#ifndef _v1beta2_device_taint_H_ +#define _v1beta2_device_taint_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_taint_t v1beta2_device_taint_t; + + + + +typedef struct v1beta2_device_taint_t { + char *effect; // string + char *key; // string + char *time_added; //date time + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_taint_t; + +__attribute__((deprecated)) v1beta2_device_taint_t *v1beta2_device_taint_create( + char *effect, + char *key, + char *time_added, + char *value +); + +void v1beta2_device_taint_free(v1beta2_device_taint_t *v1beta2_device_taint); + +v1beta2_device_taint_t *v1beta2_device_taint_parseFromJSON(cJSON *v1beta2_device_taintJSON); + +cJSON *v1beta2_device_taint_convertToJSON(v1beta2_device_taint_t *v1beta2_device_taint); + +#endif /* _v1beta2_device_taint_H_ */ + diff --git a/kubernetes/model/v1beta2_device_toleration.c b/kubernetes/model/v1beta2_device_toleration.c new file mode 100644 index 00000000..1a48b407 --- /dev/null +++ b/kubernetes/model/v1beta2_device_toleration.c @@ -0,0 +1,200 @@ +#include +#include +#include +#include "v1beta2_device_toleration.h" + + + +static v1beta2_device_toleration_t *v1beta2_device_toleration_create_internal( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + v1beta2_device_toleration_t *v1beta2_device_toleration_local_var = malloc(sizeof(v1beta2_device_toleration_t)); + if (!v1beta2_device_toleration_local_var) { + return NULL; + } + v1beta2_device_toleration_local_var->effect = effect; + v1beta2_device_toleration_local_var->key = key; + v1beta2_device_toleration_local_var->_operator = _operator; + v1beta2_device_toleration_local_var->toleration_seconds = toleration_seconds; + v1beta2_device_toleration_local_var->value = value; + + v1beta2_device_toleration_local_var->_library_owned = 1; + return v1beta2_device_toleration_local_var; +} + +__attribute__((deprecated)) v1beta2_device_toleration_t *v1beta2_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + return v1beta2_device_toleration_create_internal ( + effect, + key, + _operator, + toleration_seconds, + value + ); +} + +void v1beta2_device_toleration_free(v1beta2_device_toleration_t *v1beta2_device_toleration) { + if(NULL == v1beta2_device_toleration){ + return ; + } + if(v1beta2_device_toleration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_device_toleration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_device_toleration->effect) { + free(v1beta2_device_toleration->effect); + v1beta2_device_toleration->effect = NULL; + } + if (v1beta2_device_toleration->key) { + free(v1beta2_device_toleration->key); + v1beta2_device_toleration->key = NULL; + } + if (v1beta2_device_toleration->_operator) { + free(v1beta2_device_toleration->_operator); + v1beta2_device_toleration->_operator = NULL; + } + if (v1beta2_device_toleration->value) { + free(v1beta2_device_toleration->value); + v1beta2_device_toleration->value = NULL; + } + free(v1beta2_device_toleration); +} + +cJSON *v1beta2_device_toleration_convertToJSON(v1beta2_device_toleration_t *v1beta2_device_toleration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_device_toleration->effect + if(v1beta2_device_toleration->effect) { + if(cJSON_AddStringToObject(item, "effect", v1beta2_device_toleration->effect) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_toleration->key + if(v1beta2_device_toleration->key) { + if(cJSON_AddStringToObject(item, "key", v1beta2_device_toleration->key) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_toleration->_operator + if(v1beta2_device_toleration->_operator) { + if(cJSON_AddStringToObject(item, "operator", v1beta2_device_toleration->_operator) == NULL) { + goto fail; //String + } + } + + + // v1beta2_device_toleration->toleration_seconds + if(v1beta2_device_toleration->toleration_seconds) { + if(cJSON_AddNumberToObject(item, "tolerationSeconds", v1beta2_device_toleration->toleration_seconds) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta2_device_toleration->value + if(v1beta2_device_toleration->value) { + if(cJSON_AddStringToObject(item, "value", v1beta2_device_toleration->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_device_toleration_t *v1beta2_device_toleration_parseFromJSON(cJSON *v1beta2_device_tolerationJSON){ + + v1beta2_device_toleration_t *v1beta2_device_toleration_local_var = NULL; + + // v1beta2_device_toleration->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1beta2_device_tolerationJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (effect) { + if(!cJSON_IsString(effect) && !cJSON_IsNull(effect)) + { + goto end; //String + } + } + + // v1beta2_device_toleration->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1beta2_device_tolerationJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (key) { + if(!cJSON_IsString(key) && !cJSON_IsNull(key)) + { + goto end; //String + } + } + + // v1beta2_device_toleration->_operator + cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1beta2_device_tolerationJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } + if (_operator) { + if(!cJSON_IsString(_operator) && !cJSON_IsNull(_operator)) + { + goto end; //String + } + } + + // v1beta2_device_toleration->toleration_seconds + cJSON *toleration_seconds = cJSON_GetObjectItemCaseSensitive(v1beta2_device_tolerationJSON, "tolerationSeconds"); + if (cJSON_IsNull(toleration_seconds)) { + toleration_seconds = NULL; + } + if (toleration_seconds) { + if(!cJSON_IsNumber(toleration_seconds)) + { + goto end; //Numeric + } + } + + // v1beta2_device_toleration->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1beta2_device_tolerationJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1beta2_device_toleration_local_var = v1beta2_device_toleration_create_internal ( + effect && !cJSON_IsNull(effect) ? strdup(effect->valuestring) : NULL, + key && !cJSON_IsNull(key) ? strdup(key->valuestring) : NULL, + _operator && !cJSON_IsNull(_operator) ? strdup(_operator->valuestring) : NULL, + toleration_seconds ? toleration_seconds->valuedouble : 0, + value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL + ); + + return v1beta2_device_toleration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_toleration.h b/kubernetes/model/v1beta2_device_toleration.h new file mode 100644 index 00000000..ca2a1512 --- /dev/null +++ b/kubernetes/model/v1beta2_device_toleration.h @@ -0,0 +1,46 @@ +/* + * v1beta2_device_toleration.h + * + * The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>. + */ + +#ifndef _v1beta2_device_toleration_H_ +#define _v1beta2_device_toleration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_device_toleration_t v1beta2_device_toleration_t; + + + + +typedef struct v1beta2_device_toleration_t { + char *effect; // string + char *key; // string + char *_operator; // string + long toleration_seconds; //numeric + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_device_toleration_t; + +__attribute__((deprecated)) v1beta2_device_toleration_t *v1beta2_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value +); + +void v1beta2_device_toleration_free(v1beta2_device_toleration_t *v1beta2_device_toleration); + +v1beta2_device_toleration_t *v1beta2_device_toleration_parseFromJSON(cJSON *v1beta2_device_tolerationJSON); + +cJSON *v1beta2_device_toleration_convertToJSON(v1beta2_device_toleration_t *v1beta2_device_toleration); + +#endif /* _v1beta2_device_toleration_H_ */ + diff --git a/kubernetes/model/v1beta2_exact_device_request.c b/kubernetes/model/v1beta2_exact_device_request.c new file mode 100644 index 00000000..fb67edb8 --- /dev/null +++ b/kubernetes/model/v1beta2_exact_device_request.c @@ -0,0 +1,345 @@ +#include +#include +#include +#include "v1beta2_exact_device_request.h" + + + +static v1beta2_exact_device_request_t *v1beta2_exact_device_request_create_internal( + int admin_access, + char *allocation_mode, + v1beta2_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *selectors, + list_t *tolerations + ) { + v1beta2_exact_device_request_t *v1beta2_exact_device_request_local_var = malloc(sizeof(v1beta2_exact_device_request_t)); + if (!v1beta2_exact_device_request_local_var) { + return NULL; + } + v1beta2_exact_device_request_local_var->admin_access = admin_access; + v1beta2_exact_device_request_local_var->allocation_mode = allocation_mode; + v1beta2_exact_device_request_local_var->capacity = capacity; + v1beta2_exact_device_request_local_var->count = count; + v1beta2_exact_device_request_local_var->device_class_name = device_class_name; + v1beta2_exact_device_request_local_var->selectors = selectors; + v1beta2_exact_device_request_local_var->tolerations = tolerations; + + v1beta2_exact_device_request_local_var->_library_owned = 1; + return v1beta2_exact_device_request_local_var; +} + +__attribute__((deprecated)) v1beta2_exact_device_request_t *v1beta2_exact_device_request_create( + int admin_access, + char *allocation_mode, + v1beta2_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *selectors, + list_t *tolerations + ) { + return v1beta2_exact_device_request_create_internal ( + admin_access, + allocation_mode, + capacity, + count, + device_class_name, + selectors, + tolerations + ); +} + +void v1beta2_exact_device_request_free(v1beta2_exact_device_request_t *v1beta2_exact_device_request) { + if(NULL == v1beta2_exact_device_request){ + return ; + } + if(v1beta2_exact_device_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_exact_device_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_exact_device_request->allocation_mode) { + free(v1beta2_exact_device_request->allocation_mode); + v1beta2_exact_device_request->allocation_mode = NULL; + } + if (v1beta2_exact_device_request->capacity) { + v1beta2_capacity_requirements_free(v1beta2_exact_device_request->capacity); + v1beta2_exact_device_request->capacity = NULL; + } + if (v1beta2_exact_device_request->device_class_name) { + free(v1beta2_exact_device_request->device_class_name); + v1beta2_exact_device_request->device_class_name = NULL; + } + if (v1beta2_exact_device_request->selectors) { + list_ForEach(listEntry, v1beta2_exact_device_request->selectors) { + v1beta2_device_selector_free(listEntry->data); + } + list_freeList(v1beta2_exact_device_request->selectors); + v1beta2_exact_device_request->selectors = NULL; + } + if (v1beta2_exact_device_request->tolerations) { + list_ForEach(listEntry, v1beta2_exact_device_request->tolerations) { + v1beta2_device_toleration_free(listEntry->data); + } + list_freeList(v1beta2_exact_device_request->tolerations); + v1beta2_exact_device_request->tolerations = NULL; + } + free(v1beta2_exact_device_request); +} + +cJSON *v1beta2_exact_device_request_convertToJSON(v1beta2_exact_device_request_t *v1beta2_exact_device_request) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_exact_device_request->admin_access + if(v1beta2_exact_device_request->admin_access) { + if(cJSON_AddBoolToObject(item, "adminAccess", v1beta2_exact_device_request->admin_access) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_exact_device_request->allocation_mode + if(v1beta2_exact_device_request->allocation_mode) { + if(cJSON_AddStringToObject(item, "allocationMode", v1beta2_exact_device_request->allocation_mode) == NULL) { + goto fail; //String + } + } + + + // v1beta2_exact_device_request->capacity + if(v1beta2_exact_device_request->capacity) { + cJSON *capacity_local_JSON = v1beta2_capacity_requirements_convertToJSON(v1beta2_exact_device_request->capacity); + if(capacity_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "capacity", capacity_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_exact_device_request->count + if(v1beta2_exact_device_request->count) { + if(cJSON_AddNumberToObject(item, "count", v1beta2_exact_device_request->count) == NULL) { + goto fail; //Numeric + } + } + + + // v1beta2_exact_device_request->device_class_name + if (!v1beta2_exact_device_request->device_class_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "deviceClassName", v1beta2_exact_device_request->device_class_name) == NULL) { + goto fail; //String + } + + + // v1beta2_exact_device_request->selectors + if(v1beta2_exact_device_request->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1beta2_exact_device_request->selectors) { + list_ForEach(selectorsListEntry, v1beta2_exact_device_request->selectors) { + cJSON *itemLocal = v1beta2_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + + // v1beta2_exact_device_request->tolerations + if(v1beta2_exact_device_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1beta2_exact_device_request->tolerations) { + list_ForEach(tolerationsListEntry, v1beta2_exact_device_request->tolerations) { + cJSON *itemLocal = v1beta2_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_exact_device_request_t *v1beta2_exact_device_request_parseFromJSON(cJSON *v1beta2_exact_device_requestJSON){ + + v1beta2_exact_device_request_t *v1beta2_exact_device_request_local_var = NULL; + + // define the local variable for v1beta2_exact_device_request->capacity + v1beta2_capacity_requirements_t *capacity_local_nonprim = NULL; + + // define the local list for v1beta2_exact_device_request->selectors + list_t *selectorsList = NULL; + + // define the local list for v1beta2_exact_device_request->tolerations + list_t *tolerationsList = NULL; + + // v1beta2_exact_device_request->admin_access + cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1beta2_exact_device_requestJSON, "adminAccess"); + if (cJSON_IsNull(admin_access)) { + admin_access = NULL; + } + if (admin_access) { + if(!cJSON_IsBool(admin_access)) + { + goto end; //Bool + } + } + + // v1beta2_exact_device_request->allocation_mode + cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1beta2_exact_device_requestJSON, "allocationMode"); + if (cJSON_IsNull(allocation_mode)) { + allocation_mode = NULL; + } + if (allocation_mode) { + if(!cJSON_IsString(allocation_mode) && !cJSON_IsNull(allocation_mode)) + { + goto end; //String + } + } + + // v1beta2_exact_device_request->capacity + cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1beta2_exact_device_requestJSON, "capacity"); + if (cJSON_IsNull(capacity)) { + capacity = NULL; + } + if (capacity) { + capacity_local_nonprim = v1beta2_capacity_requirements_parseFromJSON(capacity); //nonprimitive + } + + // v1beta2_exact_device_request->count + cJSON *count = cJSON_GetObjectItemCaseSensitive(v1beta2_exact_device_requestJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } + if (count) { + if(!cJSON_IsNumber(count)) + { + goto end; //Numeric + } + } + + // v1beta2_exact_device_request->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1beta2_exact_device_requestJSON, "deviceClassName"); + if (cJSON_IsNull(device_class_name)) { + device_class_name = NULL; + } + if (!device_class_name) { + goto end; + } + + + if(!cJSON_IsString(device_class_name)) + { + goto end; //String + } + + // v1beta2_exact_device_request->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1beta2_exact_device_requestJSON, "selectors"); + if (cJSON_IsNull(selectors)) { + selectors = NULL; + } + if (selectors) { + cJSON *selectors_local_nonprimitive = NULL; + if(!cJSON_IsArray(selectors)){ + goto end; //nonprimitive container + } + + selectorsList = list_createList(); + + cJSON_ArrayForEach(selectors_local_nonprimitive,selectors ) + { + if(!cJSON_IsObject(selectors_local_nonprimitive)){ + goto end; + } + v1beta2_device_selector_t *selectorsItem = v1beta2_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + // v1beta2_exact_device_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1beta2_exact_device_requestJSON, "tolerations"); + if (cJSON_IsNull(tolerations)) { + tolerations = NULL; + } + if (tolerations) { + cJSON *tolerations_local_nonprimitive = NULL; + if(!cJSON_IsArray(tolerations)){ + goto end; //nonprimitive container + } + + tolerationsList = list_createList(); + + cJSON_ArrayForEach(tolerations_local_nonprimitive,tolerations ) + { + if(!cJSON_IsObject(tolerations_local_nonprimitive)){ + goto end; + } + v1beta2_device_toleration_t *tolerationsItem = v1beta2_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1beta2_exact_device_request_local_var = v1beta2_exact_device_request_create_internal ( + admin_access ? admin_access->valueint : 0, + allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, + capacity ? capacity_local_nonprim : NULL, + count ? count->valuedouble : 0, + strdup(device_class_name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1beta2_exact_device_request_local_var; +end: + if (capacity_local_nonprim) { + v1beta2_capacity_requirements_free(capacity_local_nonprim); + capacity_local_nonprim = NULL; + } + if (selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorsList) { + v1beta2_device_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(selectorsList); + selectorsList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1beta2_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_exact_device_request.h b/kubernetes/model/v1beta2_exact_device_request.h new file mode 100644 index 00000000..538f0493 --- /dev/null +++ b/kubernetes/model/v1beta2_exact_device_request.h @@ -0,0 +1,53 @@ +/* + * v1beta2_exact_device_request.h + * + * ExactDeviceRequest is a request for one or more identical devices. + */ + +#ifndef _v1beta2_exact_device_request_H_ +#define _v1beta2_exact_device_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_exact_device_request_t v1beta2_exact_device_request_t; + +#include "v1beta2_capacity_requirements.h" +#include "v1beta2_device_selector.h" +#include "v1beta2_device_toleration.h" + + + +typedef struct v1beta2_exact_device_request_t { + int admin_access; //boolean + char *allocation_mode; // string + struct v1beta2_capacity_requirements_t *capacity; //model + long count; //numeric + char *device_class_name; // string + list_t *selectors; //nonprimitive container + list_t *tolerations; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_exact_device_request_t; + +__attribute__((deprecated)) v1beta2_exact_device_request_t *v1beta2_exact_device_request_create( + int admin_access, + char *allocation_mode, + v1beta2_capacity_requirements_t *capacity, + long count, + char *device_class_name, + list_t *selectors, + list_t *tolerations +); + +void v1beta2_exact_device_request_free(v1beta2_exact_device_request_t *v1beta2_exact_device_request); + +v1beta2_exact_device_request_t *v1beta2_exact_device_request_parseFromJSON(cJSON *v1beta2_exact_device_requestJSON); + +cJSON *v1beta2_exact_device_request_convertToJSON(v1beta2_exact_device_request_t *v1beta2_exact_device_request); + +#endif /* _v1beta2_exact_device_request_H_ */ + diff --git a/kubernetes/model/v1beta2_network_device_data.c b/kubernetes/model/v1beta2_network_device_data.c new file mode 100644 index 00000000..3c77af8a --- /dev/null +++ b/kubernetes/model/v1beta2_network_device_data.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include "v1beta2_network_device_data.h" + + + +static v1beta2_network_device_data_t *v1beta2_network_device_data_create_internal( + char *hardware_address, + char *interface_name, + list_t *ips + ) { + v1beta2_network_device_data_t *v1beta2_network_device_data_local_var = malloc(sizeof(v1beta2_network_device_data_t)); + if (!v1beta2_network_device_data_local_var) { + return NULL; + } + v1beta2_network_device_data_local_var->hardware_address = hardware_address; + v1beta2_network_device_data_local_var->interface_name = interface_name; + v1beta2_network_device_data_local_var->ips = ips; + + v1beta2_network_device_data_local_var->_library_owned = 1; + return v1beta2_network_device_data_local_var; +} + +__attribute__((deprecated)) v1beta2_network_device_data_t *v1beta2_network_device_data_create( + char *hardware_address, + char *interface_name, + list_t *ips + ) { + return v1beta2_network_device_data_create_internal ( + hardware_address, + interface_name, + ips + ); +} + +void v1beta2_network_device_data_free(v1beta2_network_device_data_t *v1beta2_network_device_data) { + if(NULL == v1beta2_network_device_data){ + return ; + } + if(v1beta2_network_device_data->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_network_device_data_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_network_device_data->hardware_address) { + free(v1beta2_network_device_data->hardware_address); + v1beta2_network_device_data->hardware_address = NULL; + } + if (v1beta2_network_device_data->interface_name) { + free(v1beta2_network_device_data->interface_name); + v1beta2_network_device_data->interface_name = NULL; + } + if (v1beta2_network_device_data->ips) { + list_ForEach(listEntry, v1beta2_network_device_data->ips) { + free(listEntry->data); + } + list_freeList(v1beta2_network_device_data->ips); + v1beta2_network_device_data->ips = NULL; + } + free(v1beta2_network_device_data); +} + +cJSON *v1beta2_network_device_data_convertToJSON(v1beta2_network_device_data_t *v1beta2_network_device_data) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_network_device_data->hardware_address + if(v1beta2_network_device_data->hardware_address) { + if(cJSON_AddStringToObject(item, "hardwareAddress", v1beta2_network_device_data->hardware_address) == NULL) { + goto fail; //String + } + } + + + // v1beta2_network_device_data->interface_name + if(v1beta2_network_device_data->interface_name) { + if(cJSON_AddStringToObject(item, "interfaceName", v1beta2_network_device_data->interface_name) == NULL) { + goto fail; //String + } + } + + + // v1beta2_network_device_data->ips + if(v1beta2_network_device_data->ips) { + cJSON *ips = cJSON_AddArrayToObject(item, "ips"); + if(ips == NULL) { + goto fail; //primitive container + } + + listEntry_t *ipsListEntry; + list_ForEach(ipsListEntry, v1beta2_network_device_data->ips) { + if(cJSON_AddStringToObject(ips, "", ipsListEntry->data) == NULL) + { + goto fail; + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_network_device_data_t *v1beta2_network_device_data_parseFromJSON(cJSON *v1beta2_network_device_dataJSON){ + + v1beta2_network_device_data_t *v1beta2_network_device_data_local_var = NULL; + + // define the local list for v1beta2_network_device_data->ips + list_t *ipsList = NULL; + + // v1beta2_network_device_data->hardware_address + cJSON *hardware_address = cJSON_GetObjectItemCaseSensitive(v1beta2_network_device_dataJSON, "hardwareAddress"); + if (cJSON_IsNull(hardware_address)) { + hardware_address = NULL; + } + if (hardware_address) { + if(!cJSON_IsString(hardware_address) && !cJSON_IsNull(hardware_address)) + { + goto end; //String + } + } + + // v1beta2_network_device_data->interface_name + cJSON *interface_name = cJSON_GetObjectItemCaseSensitive(v1beta2_network_device_dataJSON, "interfaceName"); + if (cJSON_IsNull(interface_name)) { + interface_name = NULL; + } + if (interface_name) { + if(!cJSON_IsString(interface_name) && !cJSON_IsNull(interface_name)) + { + goto end; //String + } + } + + // v1beta2_network_device_data->ips + cJSON *ips = cJSON_GetObjectItemCaseSensitive(v1beta2_network_device_dataJSON, "ips"); + if (cJSON_IsNull(ips)) { + ips = NULL; + } + if (ips) { + cJSON *ips_local = NULL; + if(!cJSON_IsArray(ips)) { + goto end;//primitive container + } + ipsList = list_createList(); + + cJSON_ArrayForEach(ips_local, ips) + { + if(!cJSON_IsString(ips_local)) + { + goto end; + } + list_addElement(ipsList , strdup(ips_local->valuestring)); + } + } + + + v1beta2_network_device_data_local_var = v1beta2_network_device_data_create_internal ( + hardware_address && !cJSON_IsNull(hardware_address) ? strdup(hardware_address->valuestring) : NULL, + interface_name && !cJSON_IsNull(interface_name) ? strdup(interface_name->valuestring) : NULL, + ips ? ipsList : NULL + ); + + return v1beta2_network_device_data_local_var; +end: + if (ipsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ipsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ipsList); + ipsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_network_device_data.h b/kubernetes/model/v1beta2_network_device_data.h new file mode 100644 index 00000000..d64de15f --- /dev/null +++ b/kubernetes/model/v1beta2_network_device_data.h @@ -0,0 +1,42 @@ +/* + * v1beta2_network_device_data.h + * + * NetworkDeviceData provides network-related details for the allocated device. This information may be filled by drivers or other components to configure or identify the device within a network context. + */ + +#ifndef _v1beta2_network_device_data_H_ +#define _v1beta2_network_device_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_network_device_data_t v1beta2_network_device_data_t; + + + + +typedef struct v1beta2_network_device_data_t { + char *hardware_address; // string + char *interface_name; // string + list_t *ips; //primitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_network_device_data_t; + +__attribute__((deprecated)) v1beta2_network_device_data_t *v1beta2_network_device_data_create( + char *hardware_address, + char *interface_name, + list_t *ips +); + +void v1beta2_network_device_data_free(v1beta2_network_device_data_t *v1beta2_network_device_data); + +v1beta2_network_device_data_t *v1beta2_network_device_data_parseFromJSON(cJSON *v1beta2_network_device_dataJSON); + +cJSON *v1beta2_network_device_data_convertToJSON(v1beta2_network_device_data_t *v1beta2_network_device_data); + +#endif /* _v1beta2_network_device_data_H_ */ + diff --git a/kubernetes/model/v1beta2_opaque_device_configuration.c b/kubernetes/model/v1beta2_opaque_device_configuration.c new file mode 100644 index 00000000..5682348b --- /dev/null +++ b/kubernetes/model/v1beta2_opaque_device_configuration.c @@ -0,0 +1,128 @@ +#include +#include +#include +#include "v1beta2_opaque_device_configuration.h" + + + +static v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration_create_internal( + char *driver, + object_t *parameters + ) { + v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration_local_var = malloc(sizeof(v1beta2_opaque_device_configuration_t)); + if (!v1beta2_opaque_device_configuration_local_var) { + return NULL; + } + v1beta2_opaque_device_configuration_local_var->driver = driver; + v1beta2_opaque_device_configuration_local_var->parameters = parameters; + + v1beta2_opaque_device_configuration_local_var->_library_owned = 1; + return v1beta2_opaque_device_configuration_local_var; +} + +__attribute__((deprecated)) v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration_create( + char *driver, + object_t *parameters + ) { + return v1beta2_opaque_device_configuration_create_internal ( + driver, + parameters + ); +} + +void v1beta2_opaque_device_configuration_free(v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration) { + if(NULL == v1beta2_opaque_device_configuration){ + return ; + } + if(v1beta2_opaque_device_configuration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_opaque_device_configuration_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_opaque_device_configuration->driver) { + free(v1beta2_opaque_device_configuration->driver); + v1beta2_opaque_device_configuration->driver = NULL; + } + if (v1beta2_opaque_device_configuration->parameters) { + object_free(v1beta2_opaque_device_configuration->parameters); + v1beta2_opaque_device_configuration->parameters = NULL; + } + free(v1beta2_opaque_device_configuration); +} + +cJSON *v1beta2_opaque_device_configuration_convertToJSON(v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_opaque_device_configuration->driver + if (!v1beta2_opaque_device_configuration->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta2_opaque_device_configuration->driver) == NULL) { + goto fail; //String + } + + + // v1beta2_opaque_device_configuration->parameters + if (!v1beta2_opaque_device_configuration->parameters) { + goto fail; + } + cJSON *parameters_object = object_convertToJSON(v1beta2_opaque_device_configuration->parameters); + if(parameters_object == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "parameters", parameters_object); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration_parseFromJSON(cJSON *v1beta2_opaque_device_configurationJSON){ + + v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration_local_var = NULL; + + // v1beta2_opaque_device_configuration->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta2_opaque_device_configurationJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta2_opaque_device_configuration->parameters + cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1beta2_opaque_device_configurationJSON, "parameters"); + if (cJSON_IsNull(parameters)) { + parameters = NULL; + } + if (!parameters) { + goto end; + } + + object_t *parameters_local_object = NULL; + + parameters_local_object = object_parseFromJSON(parameters); //object + + + v1beta2_opaque_device_configuration_local_var = v1beta2_opaque_device_configuration_create_internal ( + strdup(driver->valuestring), + parameters_local_object + ); + + return v1beta2_opaque_device_configuration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_opaque_device_configuration.h b/kubernetes/model/v1beta2_opaque_device_configuration.h new file mode 100644 index 00000000..61e1ab4c --- /dev/null +++ b/kubernetes/model/v1beta2_opaque_device_configuration.h @@ -0,0 +1,41 @@ +/* + * v1beta2_opaque_device_configuration.h + * + * OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor. + */ + +#ifndef _v1beta2_opaque_device_configuration_H_ +#define _v1beta2_opaque_device_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_opaque_device_configuration_t v1beta2_opaque_device_configuration_t; + +#include "object.h" + + + +typedef struct v1beta2_opaque_device_configuration_t { + char *driver; // string + object_t *parameters; //object + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_opaque_device_configuration_t; + +__attribute__((deprecated)) v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration_create( + char *driver, + object_t *parameters +); + +void v1beta2_opaque_device_configuration_free(v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration); + +v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration_parseFromJSON(cJSON *v1beta2_opaque_device_configurationJSON); + +cJSON *v1beta2_opaque_device_configuration_convertToJSON(v1beta2_opaque_device_configuration_t *v1beta2_opaque_device_configuration); + +#endif /* _v1beta2_opaque_device_configuration_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim.c b/kubernetes/model/v1beta2_resource_claim.c new file mode 100644 index 00000000..8585d5b8 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim.c @@ -0,0 +1,235 @@ +#include +#include +#include +#include "v1beta2_resource_claim.h" + + + +static v1beta2_resource_claim_t *v1beta2_resource_claim_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_claim_spec_t *spec, + v1beta2_resource_claim_status_t *status + ) { + v1beta2_resource_claim_t *v1beta2_resource_claim_local_var = malloc(sizeof(v1beta2_resource_claim_t)); + if (!v1beta2_resource_claim_local_var) { + return NULL; + } + v1beta2_resource_claim_local_var->api_version = api_version; + v1beta2_resource_claim_local_var->kind = kind; + v1beta2_resource_claim_local_var->metadata = metadata; + v1beta2_resource_claim_local_var->spec = spec; + v1beta2_resource_claim_local_var->status = status; + + v1beta2_resource_claim_local_var->_library_owned = 1; + return v1beta2_resource_claim_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_t *v1beta2_resource_claim_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_claim_spec_t *spec, + v1beta2_resource_claim_status_t *status + ) { + return v1beta2_resource_claim_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} + +void v1beta2_resource_claim_free(v1beta2_resource_claim_t *v1beta2_resource_claim) { + if(NULL == v1beta2_resource_claim){ + return ; + } + if(v1beta2_resource_claim->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim->api_version) { + free(v1beta2_resource_claim->api_version); + v1beta2_resource_claim->api_version = NULL; + } + if (v1beta2_resource_claim->kind) { + free(v1beta2_resource_claim->kind); + v1beta2_resource_claim->kind = NULL; + } + if (v1beta2_resource_claim->metadata) { + v1_object_meta_free(v1beta2_resource_claim->metadata); + v1beta2_resource_claim->metadata = NULL; + } + if (v1beta2_resource_claim->spec) { + v1beta2_resource_claim_spec_free(v1beta2_resource_claim->spec); + v1beta2_resource_claim->spec = NULL; + } + if (v1beta2_resource_claim->status) { + v1beta2_resource_claim_status_free(v1beta2_resource_claim->status); + v1beta2_resource_claim->status = NULL; + } + free(v1beta2_resource_claim); +} + +cJSON *v1beta2_resource_claim_convertToJSON(v1beta2_resource_claim_t *v1beta2_resource_claim) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim->api_version + if(v1beta2_resource_claim->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_resource_claim->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim->kind + if(v1beta2_resource_claim->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_resource_claim->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim->metadata + if(v1beta2_resource_claim->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta2_resource_claim->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_resource_claim->spec + if (!v1beta2_resource_claim->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta2_resource_claim_spec_convertToJSON(v1beta2_resource_claim->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + + // v1beta2_resource_claim->status + if(v1beta2_resource_claim->status) { + cJSON *status_local_JSON = v1beta2_resource_claim_status_convertToJSON(v1beta2_resource_claim->status); + if(status_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "status", status_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_t *v1beta2_resource_claim_parseFromJSON(cJSON *v1beta2_resource_claimJSON){ + + v1beta2_resource_claim_t *v1beta2_resource_claim_local_var = NULL; + + // define the local variable for v1beta2_resource_claim->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta2_resource_claim->spec + v1beta2_resource_claim_spec_t *spec_local_nonprim = NULL; + + // define the local variable for v1beta2_resource_claim->status + v1beta2_resource_claim_status_t *status_local_nonprim = NULL; + + // v1beta2_resource_claim->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claimJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_resource_claim->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claimJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_resource_claim->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claimJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta2_resource_claim->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claimJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta2_resource_claim_spec_parseFromJSON(spec); //nonprimitive + + // v1beta2_resource_claim->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claimJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } + if (status) { + status_local_nonprim = v1beta2_resource_claim_status_parseFromJSON(status); //nonprimitive + } + + + v1beta2_resource_claim_local_var = v1beta2_resource_claim_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim, + status ? status_local_nonprim : NULL + ); + + return v1beta2_resource_claim_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta2_resource_claim_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + if (status_local_nonprim) { + v1beta2_resource_claim_status_free(status_local_nonprim); + status_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim.h b/kubernetes/model/v1beta2_resource_claim.h new file mode 100644 index 00000000..43f0735a --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim.h @@ -0,0 +1,49 @@ +/* + * v1beta2_resource_claim.h + * + * ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta2_resource_claim_H_ +#define _v1beta2_resource_claim_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_t v1beta2_resource_claim_t; + +#include "v1_object_meta.h" +#include "v1beta2_resource_claim_spec.h" +#include "v1beta2_resource_claim_status.h" + + + +typedef struct v1beta2_resource_claim_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta2_resource_claim_spec_t *spec; //model + struct v1beta2_resource_claim_status_t *status; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_t; + +__attribute__((deprecated)) v1beta2_resource_claim_t *v1beta2_resource_claim_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_claim_spec_t *spec, + v1beta2_resource_claim_status_t *status +); + +void v1beta2_resource_claim_free(v1beta2_resource_claim_t *v1beta2_resource_claim); + +v1beta2_resource_claim_t *v1beta2_resource_claim_parseFromJSON(cJSON *v1beta2_resource_claimJSON); + +cJSON *v1beta2_resource_claim_convertToJSON(v1beta2_resource_claim_t *v1beta2_resource_claim); + +#endif /* _v1beta2_resource_claim_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim_consumer_reference.c b/kubernetes/model/v1beta2_resource_claim_consumer_reference.c new file mode 100644 index 00000000..73693346 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_consumer_reference.c @@ -0,0 +1,187 @@ +#include +#include +#include +#include "v1beta2_resource_claim_consumer_reference.h" + + + +static v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference_create_internal( + char *api_group, + char *name, + char *resource, + char *uid + ) { + v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference_local_var = malloc(sizeof(v1beta2_resource_claim_consumer_reference_t)); + if (!v1beta2_resource_claim_consumer_reference_local_var) { + return NULL; + } + v1beta2_resource_claim_consumer_reference_local_var->api_group = api_group; + v1beta2_resource_claim_consumer_reference_local_var->name = name; + v1beta2_resource_claim_consumer_reference_local_var->resource = resource; + v1beta2_resource_claim_consumer_reference_local_var->uid = uid; + + v1beta2_resource_claim_consumer_reference_local_var->_library_owned = 1; + return v1beta2_resource_claim_consumer_reference_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference_create( + char *api_group, + char *name, + char *resource, + char *uid + ) { + return v1beta2_resource_claim_consumer_reference_create_internal ( + api_group, + name, + resource, + uid + ); +} + +void v1beta2_resource_claim_consumer_reference_free(v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference) { + if(NULL == v1beta2_resource_claim_consumer_reference){ + return ; + } + if(v1beta2_resource_claim_consumer_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_consumer_reference_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim_consumer_reference->api_group) { + free(v1beta2_resource_claim_consumer_reference->api_group); + v1beta2_resource_claim_consumer_reference->api_group = NULL; + } + if (v1beta2_resource_claim_consumer_reference->name) { + free(v1beta2_resource_claim_consumer_reference->name); + v1beta2_resource_claim_consumer_reference->name = NULL; + } + if (v1beta2_resource_claim_consumer_reference->resource) { + free(v1beta2_resource_claim_consumer_reference->resource); + v1beta2_resource_claim_consumer_reference->resource = NULL; + } + if (v1beta2_resource_claim_consumer_reference->uid) { + free(v1beta2_resource_claim_consumer_reference->uid); + v1beta2_resource_claim_consumer_reference->uid = NULL; + } + free(v1beta2_resource_claim_consumer_reference); +} + +cJSON *v1beta2_resource_claim_consumer_reference_convertToJSON(v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim_consumer_reference->api_group + if(v1beta2_resource_claim_consumer_reference->api_group) { + if(cJSON_AddStringToObject(item, "apiGroup", v1beta2_resource_claim_consumer_reference->api_group) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim_consumer_reference->name + if (!v1beta2_resource_claim_consumer_reference->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta2_resource_claim_consumer_reference->name) == NULL) { + goto fail; //String + } + + + // v1beta2_resource_claim_consumer_reference->resource + if (!v1beta2_resource_claim_consumer_reference->resource) { + goto fail; + } + if(cJSON_AddStringToObject(item, "resource", v1beta2_resource_claim_consumer_reference->resource) == NULL) { + goto fail; //String + } + + + // v1beta2_resource_claim_consumer_reference->uid + if (!v1beta2_resource_claim_consumer_reference->uid) { + goto fail; + } + if(cJSON_AddStringToObject(item, "uid", v1beta2_resource_claim_consumer_reference->uid) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference_parseFromJSON(cJSON *v1beta2_resource_claim_consumer_referenceJSON){ + + v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference_local_var = NULL; + + // v1beta2_resource_claim_consumer_reference->api_group + cJSON *api_group = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_consumer_referenceJSON, "apiGroup"); + if (cJSON_IsNull(api_group)) { + api_group = NULL; + } + if (api_group) { + if(!cJSON_IsString(api_group) && !cJSON_IsNull(api_group)) + { + goto end; //String + } + } + + // v1beta2_resource_claim_consumer_reference->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_consumer_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta2_resource_claim_consumer_reference->resource + cJSON *resource = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_consumer_referenceJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } + if (!resource) { + goto end; + } + + + if(!cJSON_IsString(resource)) + { + goto end; //String + } + + // v1beta2_resource_claim_consumer_reference->uid + cJSON *uid = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_consumer_referenceJSON, "uid"); + if (cJSON_IsNull(uid)) { + uid = NULL; + } + if (!uid) { + goto end; + } + + + if(!cJSON_IsString(uid)) + { + goto end; //String + } + + + v1beta2_resource_claim_consumer_reference_local_var = v1beta2_resource_claim_consumer_reference_create_internal ( + api_group && !cJSON_IsNull(api_group) ? strdup(api_group->valuestring) : NULL, + strdup(name->valuestring), + strdup(resource->valuestring), + strdup(uid->valuestring) + ); + + return v1beta2_resource_claim_consumer_reference_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim_consumer_reference.h b/kubernetes/model/v1beta2_resource_claim_consumer_reference.h new file mode 100644 index 00000000..0d6e126b --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_consumer_reference.h @@ -0,0 +1,44 @@ +/* + * v1beta2_resource_claim_consumer_reference.h + * + * ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim. + */ + +#ifndef _v1beta2_resource_claim_consumer_reference_H_ +#define _v1beta2_resource_claim_consumer_reference_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_consumer_reference_t v1beta2_resource_claim_consumer_reference_t; + + + + +typedef struct v1beta2_resource_claim_consumer_reference_t { + char *api_group; // string + char *name; // string + char *resource; // string + char *uid; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_consumer_reference_t; + +__attribute__((deprecated)) v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference_create( + char *api_group, + char *name, + char *resource, + char *uid +); + +void v1beta2_resource_claim_consumer_reference_free(v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference); + +v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference_parseFromJSON(cJSON *v1beta2_resource_claim_consumer_referenceJSON); + +cJSON *v1beta2_resource_claim_consumer_reference_convertToJSON(v1beta2_resource_claim_consumer_reference_t *v1beta2_resource_claim_consumer_reference); + +#endif /* _v1beta2_resource_claim_consumer_reference_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim_list.c b/kubernetes/model/v1beta2_resource_claim_list.c new file mode 100644 index 00000000..ead3b46a --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta2_resource_claim_list.h" + + + +static v1beta2_resource_claim_list_t *v1beta2_resource_claim_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta2_resource_claim_list_t *v1beta2_resource_claim_list_local_var = malloc(sizeof(v1beta2_resource_claim_list_t)); + if (!v1beta2_resource_claim_list_local_var) { + return NULL; + } + v1beta2_resource_claim_list_local_var->api_version = api_version; + v1beta2_resource_claim_list_local_var->items = items; + v1beta2_resource_claim_list_local_var->kind = kind; + v1beta2_resource_claim_list_local_var->metadata = metadata; + + v1beta2_resource_claim_list_local_var->_library_owned = 1; + return v1beta2_resource_claim_list_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_list_t *v1beta2_resource_claim_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta2_resource_claim_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta2_resource_claim_list_free(v1beta2_resource_claim_list_t *v1beta2_resource_claim_list) { + if(NULL == v1beta2_resource_claim_list){ + return ; + } + if(v1beta2_resource_claim_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim_list->api_version) { + free(v1beta2_resource_claim_list->api_version); + v1beta2_resource_claim_list->api_version = NULL; + } + if (v1beta2_resource_claim_list->items) { + list_ForEach(listEntry, v1beta2_resource_claim_list->items) { + v1beta2_resource_claim_free(listEntry->data); + } + list_freeList(v1beta2_resource_claim_list->items); + v1beta2_resource_claim_list->items = NULL; + } + if (v1beta2_resource_claim_list->kind) { + free(v1beta2_resource_claim_list->kind); + v1beta2_resource_claim_list->kind = NULL; + } + if (v1beta2_resource_claim_list->metadata) { + v1_list_meta_free(v1beta2_resource_claim_list->metadata); + v1beta2_resource_claim_list->metadata = NULL; + } + free(v1beta2_resource_claim_list); +} + +cJSON *v1beta2_resource_claim_list_convertToJSON(v1beta2_resource_claim_list_t *v1beta2_resource_claim_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim_list->api_version + if(v1beta2_resource_claim_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_resource_claim_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim_list->items + if (!v1beta2_resource_claim_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta2_resource_claim_list->items) { + list_ForEach(itemsListEntry, v1beta2_resource_claim_list->items) { + cJSON *itemLocal = v1beta2_resource_claim_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta2_resource_claim_list->kind + if(v1beta2_resource_claim_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_resource_claim_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim_list->metadata + if(v1beta2_resource_claim_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta2_resource_claim_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_list_t *v1beta2_resource_claim_list_parseFromJSON(cJSON *v1beta2_resource_claim_listJSON){ + + v1beta2_resource_claim_list_t *v1beta2_resource_claim_list_local_var = NULL; + + // define the local list for v1beta2_resource_claim_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta2_resource_claim_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta2_resource_claim_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_resource_claim_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta2_resource_claim_t *itemsItem = v1beta2_resource_claim_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta2_resource_claim_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_resource_claim_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta2_resource_claim_list_local_var = v1beta2_resource_claim_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta2_resource_claim_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta2_resource_claim_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim_list.h b/kubernetes/model/v1beta2_resource_claim_list.h new file mode 100644 index 00000000..a5c68ab6 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_list.h @@ -0,0 +1,46 @@ +/* + * v1beta2_resource_claim_list.h + * + * ResourceClaimList is a collection of claims. + */ + +#ifndef _v1beta2_resource_claim_list_H_ +#define _v1beta2_resource_claim_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_list_t v1beta2_resource_claim_list_t; + +#include "v1_list_meta.h" +#include "v1beta2_resource_claim.h" + + + +typedef struct v1beta2_resource_claim_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_list_t; + +__attribute__((deprecated)) v1beta2_resource_claim_list_t *v1beta2_resource_claim_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta2_resource_claim_list_free(v1beta2_resource_claim_list_t *v1beta2_resource_claim_list); + +v1beta2_resource_claim_list_t *v1beta2_resource_claim_list_parseFromJSON(cJSON *v1beta2_resource_claim_listJSON); + +cJSON *v1beta2_resource_claim_list_convertToJSON(v1beta2_resource_claim_list_t *v1beta2_resource_claim_list); + +#endif /* _v1beta2_resource_claim_list_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim_spec.c b/kubernetes/model/v1beta2_resource_claim_spec.c new file mode 100644 index 00000000..d17170aa --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_spec.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include "v1beta2_resource_claim_spec.h" + + + +static v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec_create_internal( + v1beta2_device_claim_t *devices + ) { + v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec_local_var = malloc(sizeof(v1beta2_resource_claim_spec_t)); + if (!v1beta2_resource_claim_spec_local_var) { + return NULL; + } + v1beta2_resource_claim_spec_local_var->devices = devices; + + v1beta2_resource_claim_spec_local_var->_library_owned = 1; + return v1beta2_resource_claim_spec_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec_create( + v1beta2_device_claim_t *devices + ) { + return v1beta2_resource_claim_spec_create_internal ( + devices + ); +} + +void v1beta2_resource_claim_spec_free(v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec) { + if(NULL == v1beta2_resource_claim_spec){ + return ; + } + if(v1beta2_resource_claim_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim_spec->devices) { + v1beta2_device_claim_free(v1beta2_resource_claim_spec->devices); + v1beta2_resource_claim_spec->devices = NULL; + } + free(v1beta2_resource_claim_spec); +} + +cJSON *v1beta2_resource_claim_spec_convertToJSON(v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim_spec->devices + if(v1beta2_resource_claim_spec->devices) { + cJSON *devices_local_JSON = v1beta2_device_claim_convertToJSON(v1beta2_resource_claim_spec->devices); + if(devices_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "devices", devices_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec_parseFromJSON(cJSON *v1beta2_resource_claim_specJSON){ + + v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec_local_var = NULL; + + // define the local variable for v1beta2_resource_claim_spec->devices + v1beta2_device_claim_t *devices_local_nonprim = NULL; + + // v1beta2_resource_claim_spec->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_specJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + devices_local_nonprim = v1beta2_device_claim_parseFromJSON(devices); //nonprimitive + } + + + v1beta2_resource_claim_spec_local_var = v1beta2_resource_claim_spec_create_internal ( + devices ? devices_local_nonprim : NULL + ); + + return v1beta2_resource_claim_spec_local_var; +end: + if (devices_local_nonprim) { + v1beta2_device_claim_free(devices_local_nonprim); + devices_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim_spec.h b/kubernetes/model/v1beta2_resource_claim_spec.h new file mode 100644 index 00000000..b9415de1 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_spec.h @@ -0,0 +1,39 @@ +/* + * v1beta2_resource_claim_spec.h + * + * ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it. + */ + +#ifndef _v1beta2_resource_claim_spec_H_ +#define _v1beta2_resource_claim_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_spec_t v1beta2_resource_claim_spec_t; + +#include "v1beta2_device_claim.h" + + + +typedef struct v1beta2_resource_claim_spec_t { + struct v1beta2_device_claim_t *devices; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_spec_t; + +__attribute__((deprecated)) v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec_create( + v1beta2_device_claim_t *devices +); + +void v1beta2_resource_claim_spec_free(v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec); + +v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec_parseFromJSON(cJSON *v1beta2_resource_claim_specJSON); + +cJSON *v1beta2_resource_claim_spec_convertToJSON(v1beta2_resource_claim_spec_t *v1beta2_resource_claim_spec); + +#endif /* _v1beta2_resource_claim_spec_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim_status.c b/kubernetes/model/v1beta2_resource_claim_status.c new file mode 100644 index 00000000..897801e5 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_status.c @@ -0,0 +1,233 @@ +#include +#include +#include +#include "v1beta2_resource_claim_status.h" + + + +static v1beta2_resource_claim_status_t *v1beta2_resource_claim_status_create_internal( + v1beta2_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for + ) { + v1beta2_resource_claim_status_t *v1beta2_resource_claim_status_local_var = malloc(sizeof(v1beta2_resource_claim_status_t)); + if (!v1beta2_resource_claim_status_local_var) { + return NULL; + } + v1beta2_resource_claim_status_local_var->allocation = allocation; + v1beta2_resource_claim_status_local_var->devices = devices; + v1beta2_resource_claim_status_local_var->reserved_for = reserved_for; + + v1beta2_resource_claim_status_local_var->_library_owned = 1; + return v1beta2_resource_claim_status_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_status_t *v1beta2_resource_claim_status_create( + v1beta2_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for + ) { + return v1beta2_resource_claim_status_create_internal ( + allocation, + devices, + reserved_for + ); +} + +void v1beta2_resource_claim_status_free(v1beta2_resource_claim_status_t *v1beta2_resource_claim_status) { + if(NULL == v1beta2_resource_claim_status){ + return ; + } + if(v1beta2_resource_claim_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_status_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim_status->allocation) { + v1beta2_allocation_result_free(v1beta2_resource_claim_status->allocation); + v1beta2_resource_claim_status->allocation = NULL; + } + if (v1beta2_resource_claim_status->devices) { + list_ForEach(listEntry, v1beta2_resource_claim_status->devices) { + v1beta2_allocated_device_status_free(listEntry->data); + } + list_freeList(v1beta2_resource_claim_status->devices); + v1beta2_resource_claim_status->devices = NULL; + } + if (v1beta2_resource_claim_status->reserved_for) { + list_ForEach(listEntry, v1beta2_resource_claim_status->reserved_for) { + v1beta2_resource_claim_consumer_reference_free(listEntry->data); + } + list_freeList(v1beta2_resource_claim_status->reserved_for); + v1beta2_resource_claim_status->reserved_for = NULL; + } + free(v1beta2_resource_claim_status); +} + +cJSON *v1beta2_resource_claim_status_convertToJSON(v1beta2_resource_claim_status_t *v1beta2_resource_claim_status) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim_status->allocation + if(v1beta2_resource_claim_status->allocation) { + cJSON *allocation_local_JSON = v1beta2_allocation_result_convertToJSON(v1beta2_resource_claim_status->allocation); + if(allocation_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "allocation", allocation_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_resource_claim_status->devices + if(v1beta2_resource_claim_status->devices) { + cJSON *devices = cJSON_AddArrayToObject(item, "devices"); + if(devices == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *devicesListEntry; + if (v1beta2_resource_claim_status->devices) { + list_ForEach(devicesListEntry, v1beta2_resource_claim_status->devices) { + cJSON *itemLocal = v1beta2_allocated_device_status_convertToJSON(devicesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(devices, itemLocal); + } + } + } + + + // v1beta2_resource_claim_status->reserved_for + if(v1beta2_resource_claim_status->reserved_for) { + cJSON *reserved_for = cJSON_AddArrayToObject(item, "reservedFor"); + if(reserved_for == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *reserved_forListEntry; + if (v1beta2_resource_claim_status->reserved_for) { + list_ForEach(reserved_forListEntry, v1beta2_resource_claim_status->reserved_for) { + cJSON *itemLocal = v1beta2_resource_claim_consumer_reference_convertToJSON(reserved_forListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(reserved_for, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_status_t *v1beta2_resource_claim_status_parseFromJSON(cJSON *v1beta2_resource_claim_statusJSON){ + + v1beta2_resource_claim_status_t *v1beta2_resource_claim_status_local_var = NULL; + + // define the local variable for v1beta2_resource_claim_status->allocation + v1beta2_allocation_result_t *allocation_local_nonprim = NULL; + + // define the local list for v1beta2_resource_claim_status->devices + list_t *devicesList = NULL; + + // define the local list for v1beta2_resource_claim_status->reserved_for + list_t *reserved_forList = NULL; + + // v1beta2_resource_claim_status->allocation + cJSON *allocation = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_statusJSON, "allocation"); + if (cJSON_IsNull(allocation)) { + allocation = NULL; + } + if (allocation) { + allocation_local_nonprim = v1beta2_allocation_result_parseFromJSON(allocation); //nonprimitive + } + + // v1beta2_resource_claim_status->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_statusJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + cJSON *devices_local_nonprimitive = NULL; + if(!cJSON_IsArray(devices)){ + goto end; //nonprimitive container + } + + devicesList = list_createList(); + + cJSON_ArrayForEach(devices_local_nonprimitive,devices ) + { + if(!cJSON_IsObject(devices_local_nonprimitive)){ + goto end; + } + v1beta2_allocated_device_status_t *devicesItem = v1beta2_allocated_device_status_parseFromJSON(devices_local_nonprimitive); + + list_addElement(devicesList, devicesItem); + } + } + + // v1beta2_resource_claim_status->reserved_for + cJSON *reserved_for = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_statusJSON, "reservedFor"); + if (cJSON_IsNull(reserved_for)) { + reserved_for = NULL; + } + if (reserved_for) { + cJSON *reserved_for_local_nonprimitive = NULL; + if(!cJSON_IsArray(reserved_for)){ + goto end; //nonprimitive container + } + + reserved_forList = list_createList(); + + cJSON_ArrayForEach(reserved_for_local_nonprimitive,reserved_for ) + { + if(!cJSON_IsObject(reserved_for_local_nonprimitive)){ + goto end; + } + v1beta2_resource_claim_consumer_reference_t *reserved_forItem = v1beta2_resource_claim_consumer_reference_parseFromJSON(reserved_for_local_nonprimitive); + + list_addElement(reserved_forList, reserved_forItem); + } + } + + + v1beta2_resource_claim_status_local_var = v1beta2_resource_claim_status_create_internal ( + allocation ? allocation_local_nonprim : NULL, + devices ? devicesList : NULL, + reserved_for ? reserved_forList : NULL + ); + + return v1beta2_resource_claim_status_local_var; +end: + if (allocation_local_nonprim) { + v1beta2_allocation_result_free(allocation_local_nonprim); + allocation_local_nonprim = NULL; + } + if (devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, devicesList) { + v1beta2_allocated_device_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(devicesList); + devicesList = NULL; + } + if (reserved_forList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, reserved_forList) { + v1beta2_resource_claim_consumer_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(reserved_forList); + reserved_forList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim_status.h b/kubernetes/model/v1beta2_resource_claim_status.h new file mode 100644 index 00000000..f77bdc26 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_status.h @@ -0,0 +1,45 @@ +/* + * v1beta2_resource_claim_status.h + * + * ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was. + */ + +#ifndef _v1beta2_resource_claim_status_H_ +#define _v1beta2_resource_claim_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_status_t v1beta2_resource_claim_status_t; + +#include "v1beta2_allocated_device_status.h" +#include "v1beta2_allocation_result.h" +#include "v1beta2_resource_claim_consumer_reference.h" + + + +typedef struct v1beta2_resource_claim_status_t { + struct v1beta2_allocation_result_t *allocation; //model + list_t *devices; //nonprimitive container + list_t *reserved_for; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_status_t; + +__attribute__((deprecated)) v1beta2_resource_claim_status_t *v1beta2_resource_claim_status_create( + v1beta2_allocation_result_t *allocation, + list_t *devices, + list_t *reserved_for +); + +void v1beta2_resource_claim_status_free(v1beta2_resource_claim_status_t *v1beta2_resource_claim_status); + +v1beta2_resource_claim_status_t *v1beta2_resource_claim_status_parseFromJSON(cJSON *v1beta2_resource_claim_statusJSON); + +cJSON *v1beta2_resource_claim_status_convertToJSON(v1beta2_resource_claim_status_t *v1beta2_resource_claim_status); + +#endif /* _v1beta2_resource_claim_status_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim_template.c b/kubernetes/model/v1beta2_resource_claim_template.c new file mode 100644 index 00000000..ddc8c510 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_template.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1beta2_resource_claim_template.h" + + + +static v1beta2_resource_claim_template_t *v1beta2_resource_claim_template_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_claim_template_spec_t *spec + ) { + v1beta2_resource_claim_template_t *v1beta2_resource_claim_template_local_var = malloc(sizeof(v1beta2_resource_claim_template_t)); + if (!v1beta2_resource_claim_template_local_var) { + return NULL; + } + v1beta2_resource_claim_template_local_var->api_version = api_version; + v1beta2_resource_claim_template_local_var->kind = kind; + v1beta2_resource_claim_template_local_var->metadata = metadata; + v1beta2_resource_claim_template_local_var->spec = spec; + + v1beta2_resource_claim_template_local_var->_library_owned = 1; + return v1beta2_resource_claim_template_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_template_t *v1beta2_resource_claim_template_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_claim_template_spec_t *spec + ) { + return v1beta2_resource_claim_template_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta2_resource_claim_template_free(v1beta2_resource_claim_template_t *v1beta2_resource_claim_template) { + if(NULL == v1beta2_resource_claim_template){ + return ; + } + if(v1beta2_resource_claim_template->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_template_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim_template->api_version) { + free(v1beta2_resource_claim_template->api_version); + v1beta2_resource_claim_template->api_version = NULL; + } + if (v1beta2_resource_claim_template->kind) { + free(v1beta2_resource_claim_template->kind); + v1beta2_resource_claim_template->kind = NULL; + } + if (v1beta2_resource_claim_template->metadata) { + v1_object_meta_free(v1beta2_resource_claim_template->metadata); + v1beta2_resource_claim_template->metadata = NULL; + } + if (v1beta2_resource_claim_template->spec) { + v1beta2_resource_claim_template_spec_free(v1beta2_resource_claim_template->spec); + v1beta2_resource_claim_template->spec = NULL; + } + free(v1beta2_resource_claim_template); +} + +cJSON *v1beta2_resource_claim_template_convertToJSON(v1beta2_resource_claim_template_t *v1beta2_resource_claim_template) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim_template->api_version + if(v1beta2_resource_claim_template->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_resource_claim_template->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim_template->kind + if(v1beta2_resource_claim_template->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_resource_claim_template->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim_template->metadata + if(v1beta2_resource_claim_template->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta2_resource_claim_template->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_resource_claim_template->spec + if (!v1beta2_resource_claim_template->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta2_resource_claim_template_spec_convertToJSON(v1beta2_resource_claim_template->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_template_t *v1beta2_resource_claim_template_parseFromJSON(cJSON *v1beta2_resource_claim_templateJSON){ + + v1beta2_resource_claim_template_t *v1beta2_resource_claim_template_local_var = NULL; + + // define the local variable for v1beta2_resource_claim_template->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta2_resource_claim_template->spec + v1beta2_resource_claim_template_spec_t *spec_local_nonprim = NULL; + + // v1beta2_resource_claim_template->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_templateJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_resource_claim_template->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_templateJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_resource_claim_template->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_templateJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta2_resource_claim_template->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_templateJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta2_resource_claim_template_spec_parseFromJSON(spec); //nonprimitive + + + v1beta2_resource_claim_template_local_var = v1beta2_resource_claim_template_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta2_resource_claim_template_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta2_resource_claim_template_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim_template.h b/kubernetes/model/v1beta2_resource_claim_template.h new file mode 100644 index 00000000..9837a973 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_template.h @@ -0,0 +1,46 @@ +/* + * v1beta2_resource_claim_template.h + * + * ResourceClaimTemplate is used to produce ResourceClaim objects. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta2_resource_claim_template_H_ +#define _v1beta2_resource_claim_template_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_template_t v1beta2_resource_claim_template_t; + +#include "v1_object_meta.h" +#include "v1beta2_resource_claim_template_spec.h" + + + +typedef struct v1beta2_resource_claim_template_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta2_resource_claim_template_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_template_t; + +__attribute__((deprecated)) v1beta2_resource_claim_template_t *v1beta2_resource_claim_template_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_claim_template_spec_t *spec +); + +void v1beta2_resource_claim_template_free(v1beta2_resource_claim_template_t *v1beta2_resource_claim_template); + +v1beta2_resource_claim_template_t *v1beta2_resource_claim_template_parseFromJSON(cJSON *v1beta2_resource_claim_templateJSON); + +cJSON *v1beta2_resource_claim_template_convertToJSON(v1beta2_resource_claim_template_t *v1beta2_resource_claim_template); + +#endif /* _v1beta2_resource_claim_template_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim_template_list.c b/kubernetes/model/v1beta2_resource_claim_template_list.c new file mode 100644 index 00000000..69c366ce --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_template_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta2_resource_claim_template_list.h" + + + +static v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list_local_var = malloc(sizeof(v1beta2_resource_claim_template_list_t)); + if (!v1beta2_resource_claim_template_list_local_var) { + return NULL; + } + v1beta2_resource_claim_template_list_local_var->api_version = api_version; + v1beta2_resource_claim_template_list_local_var->items = items; + v1beta2_resource_claim_template_list_local_var->kind = kind; + v1beta2_resource_claim_template_list_local_var->metadata = metadata; + + v1beta2_resource_claim_template_list_local_var->_library_owned = 1; + return v1beta2_resource_claim_template_list_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta2_resource_claim_template_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta2_resource_claim_template_list_free(v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list) { + if(NULL == v1beta2_resource_claim_template_list){ + return ; + } + if(v1beta2_resource_claim_template_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_template_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim_template_list->api_version) { + free(v1beta2_resource_claim_template_list->api_version); + v1beta2_resource_claim_template_list->api_version = NULL; + } + if (v1beta2_resource_claim_template_list->items) { + list_ForEach(listEntry, v1beta2_resource_claim_template_list->items) { + v1beta2_resource_claim_template_free(listEntry->data); + } + list_freeList(v1beta2_resource_claim_template_list->items); + v1beta2_resource_claim_template_list->items = NULL; + } + if (v1beta2_resource_claim_template_list->kind) { + free(v1beta2_resource_claim_template_list->kind); + v1beta2_resource_claim_template_list->kind = NULL; + } + if (v1beta2_resource_claim_template_list->metadata) { + v1_list_meta_free(v1beta2_resource_claim_template_list->metadata); + v1beta2_resource_claim_template_list->metadata = NULL; + } + free(v1beta2_resource_claim_template_list); +} + +cJSON *v1beta2_resource_claim_template_list_convertToJSON(v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim_template_list->api_version + if(v1beta2_resource_claim_template_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_resource_claim_template_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim_template_list->items + if (!v1beta2_resource_claim_template_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta2_resource_claim_template_list->items) { + list_ForEach(itemsListEntry, v1beta2_resource_claim_template_list->items) { + cJSON *itemLocal = v1beta2_resource_claim_template_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta2_resource_claim_template_list->kind + if(v1beta2_resource_claim_template_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_resource_claim_template_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_claim_template_list->metadata + if(v1beta2_resource_claim_template_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta2_resource_claim_template_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list_parseFromJSON(cJSON *v1beta2_resource_claim_template_listJSON){ + + v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list_local_var = NULL; + + // define the local list for v1beta2_resource_claim_template_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta2_resource_claim_template_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta2_resource_claim_template_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_template_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_resource_claim_template_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_template_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta2_resource_claim_template_t *itemsItem = v1beta2_resource_claim_template_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta2_resource_claim_template_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_template_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_resource_claim_template_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_template_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta2_resource_claim_template_list_local_var = v1beta2_resource_claim_template_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta2_resource_claim_template_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta2_resource_claim_template_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim_template_list.h b/kubernetes/model/v1beta2_resource_claim_template_list.h new file mode 100644 index 00000000..aad489b2 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_template_list.h @@ -0,0 +1,46 @@ +/* + * v1beta2_resource_claim_template_list.h + * + * ResourceClaimTemplateList is a collection of claim templates. + */ + +#ifndef _v1beta2_resource_claim_template_list_H_ +#define _v1beta2_resource_claim_template_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_template_list_t v1beta2_resource_claim_template_list_t; + +#include "v1_list_meta.h" +#include "v1beta2_resource_claim_template.h" + + + +typedef struct v1beta2_resource_claim_template_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_template_list_t; + +__attribute__((deprecated)) v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta2_resource_claim_template_list_free(v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list); + +v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list_parseFromJSON(cJSON *v1beta2_resource_claim_template_listJSON); + +cJSON *v1beta2_resource_claim_template_list_convertToJSON(v1beta2_resource_claim_template_list_t *v1beta2_resource_claim_template_list); + +#endif /* _v1beta2_resource_claim_template_list_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_claim_template_spec.c b/kubernetes/model/v1beta2_resource_claim_template_spec.c new file mode 100644 index 00000000..6ae54177 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_template_spec.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include "v1beta2_resource_claim_template_spec.h" + + + +static v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec_create_internal( + v1_object_meta_t *metadata, + v1beta2_resource_claim_spec_t *spec + ) { + v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec_local_var = malloc(sizeof(v1beta2_resource_claim_template_spec_t)); + if (!v1beta2_resource_claim_template_spec_local_var) { + return NULL; + } + v1beta2_resource_claim_template_spec_local_var->metadata = metadata; + v1beta2_resource_claim_template_spec_local_var->spec = spec; + + v1beta2_resource_claim_template_spec_local_var->_library_owned = 1; + return v1beta2_resource_claim_template_spec_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec_create( + v1_object_meta_t *metadata, + v1beta2_resource_claim_spec_t *spec + ) { + return v1beta2_resource_claim_template_spec_create_internal ( + metadata, + spec + ); +} + +void v1beta2_resource_claim_template_spec_free(v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec) { + if(NULL == v1beta2_resource_claim_template_spec){ + return ; + } + if(v1beta2_resource_claim_template_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_claim_template_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_claim_template_spec->metadata) { + v1_object_meta_free(v1beta2_resource_claim_template_spec->metadata); + v1beta2_resource_claim_template_spec->metadata = NULL; + } + if (v1beta2_resource_claim_template_spec->spec) { + v1beta2_resource_claim_spec_free(v1beta2_resource_claim_template_spec->spec); + v1beta2_resource_claim_template_spec->spec = NULL; + } + free(v1beta2_resource_claim_template_spec); +} + +cJSON *v1beta2_resource_claim_template_spec_convertToJSON(v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_claim_template_spec->metadata + if(v1beta2_resource_claim_template_spec->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta2_resource_claim_template_spec->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_resource_claim_template_spec->spec + if (!v1beta2_resource_claim_template_spec->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta2_resource_claim_spec_convertToJSON(v1beta2_resource_claim_template_spec->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec_parseFromJSON(cJSON *v1beta2_resource_claim_template_specJSON){ + + v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec_local_var = NULL; + + // define the local variable for v1beta2_resource_claim_template_spec->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta2_resource_claim_template_spec->spec + v1beta2_resource_claim_spec_t *spec_local_nonprim = NULL; + + // v1beta2_resource_claim_template_spec->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_template_specJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta2_resource_claim_template_spec->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_claim_template_specJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta2_resource_claim_spec_parseFromJSON(spec); //nonprimitive + + + v1beta2_resource_claim_template_spec_local_var = v1beta2_resource_claim_template_spec_create_internal ( + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta2_resource_claim_template_spec_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta2_resource_claim_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_claim_template_spec.h b/kubernetes/model/v1beta2_resource_claim_template_spec.h new file mode 100644 index 00000000..e1faceeb --- /dev/null +++ b/kubernetes/model/v1beta2_resource_claim_template_spec.h @@ -0,0 +1,42 @@ +/* + * v1beta2_resource_claim_template_spec.h + * + * ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. + */ + +#ifndef _v1beta2_resource_claim_template_spec_H_ +#define _v1beta2_resource_claim_template_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_claim_template_spec_t v1beta2_resource_claim_template_spec_t; + +#include "v1_object_meta.h" +#include "v1beta2_resource_claim_spec.h" + + + +typedef struct v1beta2_resource_claim_template_spec_t { + struct v1_object_meta_t *metadata; //model + struct v1beta2_resource_claim_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_claim_template_spec_t; + +__attribute__((deprecated)) v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec_create( + v1_object_meta_t *metadata, + v1beta2_resource_claim_spec_t *spec +); + +void v1beta2_resource_claim_template_spec_free(v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec); + +v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec_parseFromJSON(cJSON *v1beta2_resource_claim_template_specJSON); + +cJSON *v1beta2_resource_claim_template_spec_convertToJSON(v1beta2_resource_claim_template_spec_t *v1beta2_resource_claim_template_spec); + +#endif /* _v1beta2_resource_claim_template_spec_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_pool.c b/kubernetes/model/v1beta2_resource_pool.c new file mode 100644 index 00000000..36782cbf --- /dev/null +++ b/kubernetes/model/v1beta2_resource_pool.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include "v1beta2_resource_pool.h" + + + +static v1beta2_resource_pool_t *v1beta2_resource_pool_create_internal( + long generation, + char *name, + long resource_slice_count + ) { + v1beta2_resource_pool_t *v1beta2_resource_pool_local_var = malloc(sizeof(v1beta2_resource_pool_t)); + if (!v1beta2_resource_pool_local_var) { + return NULL; + } + v1beta2_resource_pool_local_var->generation = generation; + v1beta2_resource_pool_local_var->name = name; + v1beta2_resource_pool_local_var->resource_slice_count = resource_slice_count; + + v1beta2_resource_pool_local_var->_library_owned = 1; + return v1beta2_resource_pool_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_pool_t *v1beta2_resource_pool_create( + long generation, + char *name, + long resource_slice_count + ) { + return v1beta2_resource_pool_create_internal ( + generation, + name, + resource_slice_count + ); +} + +void v1beta2_resource_pool_free(v1beta2_resource_pool_t *v1beta2_resource_pool) { + if(NULL == v1beta2_resource_pool){ + return ; + } + if(v1beta2_resource_pool->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_pool_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_pool->name) { + free(v1beta2_resource_pool->name); + v1beta2_resource_pool->name = NULL; + } + free(v1beta2_resource_pool); +} + +cJSON *v1beta2_resource_pool_convertToJSON(v1beta2_resource_pool_t *v1beta2_resource_pool) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_pool->generation + if (!v1beta2_resource_pool->generation) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "generation", v1beta2_resource_pool->generation) == NULL) { + goto fail; //Numeric + } + + + // v1beta2_resource_pool->name + if (!v1beta2_resource_pool->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1beta2_resource_pool->name) == NULL) { + goto fail; //String + } + + + // v1beta2_resource_pool->resource_slice_count + if (!v1beta2_resource_pool->resource_slice_count) { + goto fail; + } + if(cJSON_AddNumberToObject(item, "resourceSliceCount", v1beta2_resource_pool->resource_slice_count) == NULL) { + goto fail; //Numeric + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_pool_t *v1beta2_resource_pool_parseFromJSON(cJSON *v1beta2_resource_poolJSON){ + + v1beta2_resource_pool_t *v1beta2_resource_pool_local_var = NULL; + + // v1beta2_resource_pool->generation + cJSON *generation = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_poolJSON, "generation"); + if (cJSON_IsNull(generation)) { + generation = NULL; + } + if (!generation) { + goto end; + } + + + if(!cJSON_IsNumber(generation)) + { + goto end; //Numeric + } + + // v1beta2_resource_pool->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_poolJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1beta2_resource_pool->resource_slice_count + cJSON *resource_slice_count = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_poolJSON, "resourceSliceCount"); + if (cJSON_IsNull(resource_slice_count)) { + resource_slice_count = NULL; + } + if (!resource_slice_count) { + goto end; + } + + + if(!cJSON_IsNumber(resource_slice_count)) + { + goto end; //Numeric + } + + + v1beta2_resource_pool_local_var = v1beta2_resource_pool_create_internal ( + generation->valuedouble, + strdup(name->valuestring), + resource_slice_count->valuedouble + ); + + return v1beta2_resource_pool_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_pool.h b/kubernetes/model/v1beta2_resource_pool.h new file mode 100644 index 00000000..2c47267f --- /dev/null +++ b/kubernetes/model/v1beta2_resource_pool.h @@ -0,0 +1,42 @@ +/* + * v1beta2_resource_pool.h + * + * ResourcePool describes the pool that ResourceSlices belong to. + */ + +#ifndef _v1beta2_resource_pool_H_ +#define _v1beta2_resource_pool_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_pool_t v1beta2_resource_pool_t; + + + + +typedef struct v1beta2_resource_pool_t { + long generation; //numeric + char *name; // string + long resource_slice_count; //numeric + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_pool_t; + +__attribute__((deprecated)) v1beta2_resource_pool_t *v1beta2_resource_pool_create( + long generation, + char *name, + long resource_slice_count +); + +void v1beta2_resource_pool_free(v1beta2_resource_pool_t *v1beta2_resource_pool); + +v1beta2_resource_pool_t *v1beta2_resource_pool_parseFromJSON(cJSON *v1beta2_resource_poolJSON); + +cJSON *v1beta2_resource_pool_convertToJSON(v1beta2_resource_pool_t *v1beta2_resource_pool); + +#endif /* _v1beta2_resource_pool_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_slice.c b/kubernetes/model/v1beta2_resource_slice.c new file mode 100644 index 00000000..a12897dc --- /dev/null +++ b/kubernetes/model/v1beta2_resource_slice.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include "v1beta2_resource_slice.h" + + + +static v1beta2_resource_slice_t *v1beta2_resource_slice_create_internal( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_slice_spec_t *spec + ) { + v1beta2_resource_slice_t *v1beta2_resource_slice_local_var = malloc(sizeof(v1beta2_resource_slice_t)); + if (!v1beta2_resource_slice_local_var) { + return NULL; + } + v1beta2_resource_slice_local_var->api_version = api_version; + v1beta2_resource_slice_local_var->kind = kind; + v1beta2_resource_slice_local_var->metadata = metadata; + v1beta2_resource_slice_local_var->spec = spec; + + v1beta2_resource_slice_local_var->_library_owned = 1; + return v1beta2_resource_slice_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_slice_t *v1beta2_resource_slice_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_slice_spec_t *spec + ) { + return v1beta2_resource_slice_create_internal ( + api_version, + kind, + metadata, + spec + ); +} + +void v1beta2_resource_slice_free(v1beta2_resource_slice_t *v1beta2_resource_slice) { + if(NULL == v1beta2_resource_slice){ + return ; + } + if(v1beta2_resource_slice->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_slice_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_slice->api_version) { + free(v1beta2_resource_slice->api_version); + v1beta2_resource_slice->api_version = NULL; + } + if (v1beta2_resource_slice->kind) { + free(v1beta2_resource_slice->kind); + v1beta2_resource_slice->kind = NULL; + } + if (v1beta2_resource_slice->metadata) { + v1_object_meta_free(v1beta2_resource_slice->metadata); + v1beta2_resource_slice->metadata = NULL; + } + if (v1beta2_resource_slice->spec) { + v1beta2_resource_slice_spec_free(v1beta2_resource_slice->spec); + v1beta2_resource_slice->spec = NULL; + } + free(v1beta2_resource_slice); +} + +cJSON *v1beta2_resource_slice_convertToJSON(v1beta2_resource_slice_t *v1beta2_resource_slice) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_slice->api_version + if(v1beta2_resource_slice->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_resource_slice->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_slice->kind + if(v1beta2_resource_slice->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_resource_slice->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_slice->metadata + if(v1beta2_resource_slice->metadata) { + cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta2_resource_slice->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_resource_slice->spec + if (!v1beta2_resource_slice->spec) { + goto fail; + } + cJSON *spec_local_JSON = v1beta2_resource_slice_spec_convertToJSON(v1beta2_resource_slice->spec); + if(spec_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "spec", spec_local_JSON); + if(item->child == NULL) { + goto fail; + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_slice_t *v1beta2_resource_slice_parseFromJSON(cJSON *v1beta2_resource_sliceJSON){ + + v1beta2_resource_slice_t *v1beta2_resource_slice_local_var = NULL; + + // define the local variable for v1beta2_resource_slice->metadata + v1_object_meta_t *metadata_local_nonprim = NULL; + + // define the local variable for v1beta2_resource_slice->spec + v1beta2_resource_slice_spec_t *spec_local_nonprim = NULL; + + // v1beta2_resource_slice->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_sliceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_resource_slice->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_sliceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_resource_slice->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_sliceJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive + } + + // v1beta2_resource_slice->spec + cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_sliceJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } + if (!spec) { + goto end; + } + + + spec_local_nonprim = v1beta2_resource_slice_spec_parseFromJSON(spec); //nonprimitive + + + v1beta2_resource_slice_local_var = v1beta2_resource_slice_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL, + spec_local_nonprim + ); + + return v1beta2_resource_slice_local_var; +end: + if (metadata_local_nonprim) { + v1_object_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + if (spec_local_nonprim) { + v1beta2_resource_slice_spec_free(spec_local_nonprim); + spec_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_slice.h b/kubernetes/model/v1beta2_resource_slice.h new file mode 100644 index 00000000..525850fd --- /dev/null +++ b/kubernetes/model/v1beta2_resource_slice.h @@ -0,0 +1,46 @@ +/* + * v1beta2_resource_slice.h + * + * ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver. At the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple <driver name>, <pool name>, <device name>. Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others. When allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool. For resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available. This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. + */ + +#ifndef _v1beta2_resource_slice_H_ +#define _v1beta2_resource_slice_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_slice_t v1beta2_resource_slice_t; + +#include "v1_object_meta.h" +#include "v1beta2_resource_slice_spec.h" + + + +typedef struct v1beta2_resource_slice_t { + char *api_version; // string + char *kind; // string + struct v1_object_meta_t *metadata; //model + struct v1beta2_resource_slice_spec_t *spec; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_slice_t; + +__attribute__((deprecated)) v1beta2_resource_slice_t *v1beta2_resource_slice_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v1beta2_resource_slice_spec_t *spec +); + +void v1beta2_resource_slice_free(v1beta2_resource_slice_t *v1beta2_resource_slice); + +v1beta2_resource_slice_t *v1beta2_resource_slice_parseFromJSON(cJSON *v1beta2_resource_sliceJSON); + +cJSON *v1beta2_resource_slice_convertToJSON(v1beta2_resource_slice_t *v1beta2_resource_slice); + +#endif /* _v1beta2_resource_slice_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_slice_list.c b/kubernetes/model/v1beta2_resource_slice_list.c new file mode 100644 index 00000000..2faafd5b --- /dev/null +++ b/kubernetes/model/v1beta2_resource_slice_list.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include "v1beta2_resource_slice_list.h" + + + +static v1beta2_resource_slice_list_t *v1beta2_resource_slice_list_create_internal( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + v1beta2_resource_slice_list_t *v1beta2_resource_slice_list_local_var = malloc(sizeof(v1beta2_resource_slice_list_t)); + if (!v1beta2_resource_slice_list_local_var) { + return NULL; + } + v1beta2_resource_slice_list_local_var->api_version = api_version; + v1beta2_resource_slice_list_local_var->items = items; + v1beta2_resource_slice_list_local_var->kind = kind; + v1beta2_resource_slice_list_local_var->metadata = metadata; + + v1beta2_resource_slice_list_local_var->_library_owned = 1; + return v1beta2_resource_slice_list_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_slice_list_t *v1beta2_resource_slice_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v1beta2_resource_slice_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} + +void v1beta2_resource_slice_list_free(v1beta2_resource_slice_list_t *v1beta2_resource_slice_list) { + if(NULL == v1beta2_resource_slice_list){ + return ; + } + if(v1beta2_resource_slice_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_slice_list_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_slice_list->api_version) { + free(v1beta2_resource_slice_list->api_version); + v1beta2_resource_slice_list->api_version = NULL; + } + if (v1beta2_resource_slice_list->items) { + list_ForEach(listEntry, v1beta2_resource_slice_list->items) { + v1beta2_resource_slice_free(listEntry->data); + } + list_freeList(v1beta2_resource_slice_list->items); + v1beta2_resource_slice_list->items = NULL; + } + if (v1beta2_resource_slice_list->kind) { + free(v1beta2_resource_slice_list->kind); + v1beta2_resource_slice_list->kind = NULL; + } + if (v1beta2_resource_slice_list->metadata) { + v1_list_meta_free(v1beta2_resource_slice_list->metadata); + v1beta2_resource_slice_list->metadata = NULL; + } + free(v1beta2_resource_slice_list); +} + +cJSON *v1beta2_resource_slice_list_convertToJSON(v1beta2_resource_slice_list_t *v1beta2_resource_slice_list) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_slice_list->api_version + if(v1beta2_resource_slice_list->api_version) { + if(cJSON_AddStringToObject(item, "apiVersion", v1beta2_resource_slice_list->api_version) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_slice_list->items + if (!v1beta2_resource_slice_list->items) { + goto fail; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if(items == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *itemsListEntry; + if (v1beta2_resource_slice_list->items) { + list_ForEach(itemsListEntry, v1beta2_resource_slice_list->items) { + cJSON *itemLocal = v1beta2_resource_slice_convertToJSON(itemsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(items, itemLocal); + } + } + + + // v1beta2_resource_slice_list->kind + if(v1beta2_resource_slice_list->kind) { + if(cJSON_AddStringToObject(item, "kind", v1beta2_resource_slice_list->kind) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_slice_list->metadata + if(v1beta2_resource_slice_list->metadata) { + cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta2_resource_slice_list->metadata); + if(metadata_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_slice_list_t *v1beta2_resource_slice_list_parseFromJSON(cJSON *v1beta2_resource_slice_listJSON){ + + v1beta2_resource_slice_list_t *v1beta2_resource_slice_list_local_var = NULL; + + // define the local list for v1beta2_resource_slice_list->items + list_t *itemsList = NULL; + + // define the local variable for v1beta2_resource_slice_list->metadata + v1_list_meta_t *metadata_local_nonprim = NULL; + + // v1beta2_resource_slice_list->api_version + cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } + if (api_version) { + if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) + { + goto end; //String + } + } + + // v1beta2_resource_slice_list->items + cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } + if (!items) { + goto end; + } + + + cJSON *items_local_nonprimitive = NULL; + if(!cJSON_IsArray(items)){ + goto end; //nonprimitive container + } + + itemsList = list_createList(); + + cJSON_ArrayForEach(items_local_nonprimitive,items ) + { + if(!cJSON_IsObject(items_local_nonprimitive)){ + goto end; + } + v1beta2_resource_slice_t *itemsItem = v1beta2_resource_slice_parseFromJSON(items_local_nonprimitive); + + list_addElement(itemsList, itemsItem); + } + + // v1beta2_resource_slice_list->kind + cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } + if (kind) { + if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) + { + goto end; //String + } + } + + // v1beta2_resource_slice_list->metadata + cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } + if (metadata) { + metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive + } + + + v1beta2_resource_slice_list_local_var = v1beta2_resource_slice_list_create_internal ( + api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, + itemsList, + kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, + metadata ? metadata_local_nonprim : NULL + ); + + return v1beta2_resource_slice_list_local_var; +end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta2_resource_slice_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } + if (metadata_local_nonprim) { + v1_list_meta_free(metadata_local_nonprim); + metadata_local_nonprim = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_slice_list.h b/kubernetes/model/v1beta2_resource_slice_list.h new file mode 100644 index 00000000..77247bd2 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_slice_list.h @@ -0,0 +1,46 @@ +/* + * v1beta2_resource_slice_list.h + * + * ResourceSliceList is a collection of ResourceSlices. + */ + +#ifndef _v1beta2_resource_slice_list_H_ +#define _v1beta2_resource_slice_list_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_slice_list_t v1beta2_resource_slice_list_t; + +#include "v1_list_meta.h" +#include "v1beta2_resource_slice.h" + + + +typedef struct v1beta2_resource_slice_list_t { + char *api_version; // string + list_t *items; //nonprimitive container + char *kind; // string + struct v1_list_meta_t *metadata; //model + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_slice_list_t; + +__attribute__((deprecated)) v1beta2_resource_slice_list_t *v1beta2_resource_slice_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata +); + +void v1beta2_resource_slice_list_free(v1beta2_resource_slice_list_t *v1beta2_resource_slice_list); + +v1beta2_resource_slice_list_t *v1beta2_resource_slice_list_parseFromJSON(cJSON *v1beta2_resource_slice_listJSON); + +cJSON *v1beta2_resource_slice_list_convertToJSON(v1beta2_resource_slice_list_t *v1beta2_resource_slice_list); + +#endif /* _v1beta2_resource_slice_list_H_ */ + diff --git a/kubernetes/model/v1beta2_resource_slice_spec.c b/kubernetes/model/v1beta2_resource_slice_spec.c new file mode 100644 index 00000000..84b3b9e4 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_slice_spec.c @@ -0,0 +1,387 @@ +#include +#include +#include +#include "v1beta2_resource_slice_spec.h" + + + +static v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec_create_internal( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1beta2_resource_pool_t *pool, + list_t *shared_counters + ) { + v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec_local_var = malloc(sizeof(v1beta2_resource_slice_spec_t)); + if (!v1beta2_resource_slice_spec_local_var) { + return NULL; + } + v1beta2_resource_slice_spec_local_var->all_nodes = all_nodes; + v1beta2_resource_slice_spec_local_var->devices = devices; + v1beta2_resource_slice_spec_local_var->driver = driver; + v1beta2_resource_slice_spec_local_var->node_name = node_name; + v1beta2_resource_slice_spec_local_var->node_selector = node_selector; + v1beta2_resource_slice_spec_local_var->per_device_node_selection = per_device_node_selection; + v1beta2_resource_slice_spec_local_var->pool = pool; + v1beta2_resource_slice_spec_local_var->shared_counters = shared_counters; + + v1beta2_resource_slice_spec_local_var->_library_owned = 1; + return v1beta2_resource_slice_spec_local_var; +} + +__attribute__((deprecated)) v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec_create( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1beta2_resource_pool_t *pool, + list_t *shared_counters + ) { + return v1beta2_resource_slice_spec_create_internal ( + all_nodes, + devices, + driver, + node_name, + node_selector, + per_device_node_selection, + pool, + shared_counters + ); +} + +void v1beta2_resource_slice_spec_free(v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec) { + if(NULL == v1beta2_resource_slice_spec){ + return ; + } + if(v1beta2_resource_slice_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta2_resource_slice_spec_free"); + return ; + } + listEntry_t *listEntry; + if (v1beta2_resource_slice_spec->devices) { + list_ForEach(listEntry, v1beta2_resource_slice_spec->devices) { + v1beta2_device_free(listEntry->data); + } + list_freeList(v1beta2_resource_slice_spec->devices); + v1beta2_resource_slice_spec->devices = NULL; + } + if (v1beta2_resource_slice_spec->driver) { + free(v1beta2_resource_slice_spec->driver); + v1beta2_resource_slice_spec->driver = NULL; + } + if (v1beta2_resource_slice_spec->node_name) { + free(v1beta2_resource_slice_spec->node_name); + v1beta2_resource_slice_spec->node_name = NULL; + } + if (v1beta2_resource_slice_spec->node_selector) { + v1_node_selector_free(v1beta2_resource_slice_spec->node_selector); + v1beta2_resource_slice_spec->node_selector = NULL; + } + if (v1beta2_resource_slice_spec->pool) { + v1beta2_resource_pool_free(v1beta2_resource_slice_spec->pool); + v1beta2_resource_slice_spec->pool = NULL; + } + if (v1beta2_resource_slice_spec->shared_counters) { + list_ForEach(listEntry, v1beta2_resource_slice_spec->shared_counters) { + v1beta2_counter_set_free(listEntry->data); + } + list_freeList(v1beta2_resource_slice_spec->shared_counters); + v1beta2_resource_slice_spec->shared_counters = NULL; + } + free(v1beta2_resource_slice_spec); +} + +cJSON *v1beta2_resource_slice_spec_convertToJSON(v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec) { + cJSON *item = cJSON_CreateObject(); + + // v1beta2_resource_slice_spec->all_nodes + if(v1beta2_resource_slice_spec->all_nodes) { + if(cJSON_AddBoolToObject(item, "allNodes", v1beta2_resource_slice_spec->all_nodes) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_resource_slice_spec->devices + if(v1beta2_resource_slice_spec->devices) { + cJSON *devices = cJSON_AddArrayToObject(item, "devices"); + if(devices == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *devicesListEntry; + if (v1beta2_resource_slice_spec->devices) { + list_ForEach(devicesListEntry, v1beta2_resource_slice_spec->devices) { + cJSON *itemLocal = v1beta2_device_convertToJSON(devicesListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(devices, itemLocal); + } + } + } + + + // v1beta2_resource_slice_spec->driver + if (!v1beta2_resource_slice_spec->driver) { + goto fail; + } + if(cJSON_AddStringToObject(item, "driver", v1beta2_resource_slice_spec->driver) == NULL) { + goto fail; //String + } + + + // v1beta2_resource_slice_spec->node_name + if(v1beta2_resource_slice_spec->node_name) { + if(cJSON_AddStringToObject(item, "nodeName", v1beta2_resource_slice_spec->node_name) == NULL) { + goto fail; //String + } + } + + + // v1beta2_resource_slice_spec->node_selector + if(v1beta2_resource_slice_spec->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1beta2_resource_slice_spec->node_selector); + if(node_selector_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "nodeSelector", node_selector_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + + + // v1beta2_resource_slice_spec->per_device_node_selection + if(v1beta2_resource_slice_spec->per_device_node_selection) { + if(cJSON_AddBoolToObject(item, "perDeviceNodeSelection", v1beta2_resource_slice_spec->per_device_node_selection) == NULL) { + goto fail; //Bool + } + } + + + // v1beta2_resource_slice_spec->pool + if (!v1beta2_resource_slice_spec->pool) { + goto fail; + } + cJSON *pool_local_JSON = v1beta2_resource_pool_convertToJSON(v1beta2_resource_slice_spec->pool); + if(pool_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "pool", pool_local_JSON); + if(item->child == NULL) { + goto fail; + } + + + // v1beta2_resource_slice_spec->shared_counters + if(v1beta2_resource_slice_spec->shared_counters) { + cJSON *shared_counters = cJSON_AddArrayToObject(item, "sharedCounters"); + if(shared_counters == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *shared_countersListEntry; + if (v1beta2_resource_slice_spec->shared_counters) { + list_ForEach(shared_countersListEntry, v1beta2_resource_slice_spec->shared_counters) { + cJSON *itemLocal = v1beta2_counter_set_convertToJSON(shared_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(shared_counters, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec_parseFromJSON(cJSON *v1beta2_resource_slice_specJSON){ + + v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec_local_var = NULL; + + // define the local list for v1beta2_resource_slice_spec->devices + list_t *devicesList = NULL; + + // define the local variable for v1beta2_resource_slice_spec->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // define the local variable for v1beta2_resource_slice_spec->pool + v1beta2_resource_pool_t *pool_local_nonprim = NULL; + + // define the local list for v1beta2_resource_slice_spec->shared_counters + list_t *shared_countersList = NULL; + + // v1beta2_resource_slice_spec->all_nodes + cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "allNodes"); + if (cJSON_IsNull(all_nodes)) { + all_nodes = NULL; + } + if (all_nodes) { + if(!cJSON_IsBool(all_nodes)) + { + goto end; //Bool + } + } + + // v1beta2_resource_slice_spec->devices + cJSON *devices = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "devices"); + if (cJSON_IsNull(devices)) { + devices = NULL; + } + if (devices) { + cJSON *devices_local_nonprimitive = NULL; + if(!cJSON_IsArray(devices)){ + goto end; //nonprimitive container + } + + devicesList = list_createList(); + + cJSON_ArrayForEach(devices_local_nonprimitive,devices ) + { + if(!cJSON_IsObject(devices_local_nonprimitive)){ + goto end; + } + v1beta2_device_t *devicesItem = v1beta2_device_parseFromJSON(devices_local_nonprimitive); + + list_addElement(devicesList, devicesItem); + } + } + + // v1beta2_resource_slice_spec->driver + cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "driver"); + if (cJSON_IsNull(driver)) { + driver = NULL; + } + if (!driver) { + goto end; + } + + + if(!cJSON_IsString(driver)) + { + goto end; //String + } + + // v1beta2_resource_slice_spec->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "nodeName"); + if (cJSON_IsNull(node_name)) { + node_name = NULL; + } + if (node_name) { + if(!cJSON_IsString(node_name) && !cJSON_IsNull(node_name)) + { + goto end; //String + } + } + + // v1beta2_resource_slice_spec->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "nodeSelector"); + if (cJSON_IsNull(node_selector)) { + node_selector = NULL; + } + if (node_selector) { + node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive + } + + // v1beta2_resource_slice_spec->per_device_node_selection + cJSON *per_device_node_selection = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "perDeviceNodeSelection"); + if (cJSON_IsNull(per_device_node_selection)) { + per_device_node_selection = NULL; + } + if (per_device_node_selection) { + if(!cJSON_IsBool(per_device_node_selection)) + { + goto end; //Bool + } + } + + // v1beta2_resource_slice_spec->pool + cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "pool"); + if (cJSON_IsNull(pool)) { + pool = NULL; + } + if (!pool) { + goto end; + } + + + pool_local_nonprim = v1beta2_resource_pool_parseFromJSON(pool); //nonprimitive + + // v1beta2_resource_slice_spec->shared_counters + cJSON *shared_counters = cJSON_GetObjectItemCaseSensitive(v1beta2_resource_slice_specJSON, "sharedCounters"); + if (cJSON_IsNull(shared_counters)) { + shared_counters = NULL; + } + if (shared_counters) { + cJSON *shared_counters_local_nonprimitive = NULL; + if(!cJSON_IsArray(shared_counters)){ + goto end; //nonprimitive container + } + + shared_countersList = list_createList(); + + cJSON_ArrayForEach(shared_counters_local_nonprimitive,shared_counters ) + { + if(!cJSON_IsObject(shared_counters_local_nonprimitive)){ + goto end; + } + v1beta2_counter_set_t *shared_countersItem = v1beta2_counter_set_parseFromJSON(shared_counters_local_nonprimitive); + + list_addElement(shared_countersList, shared_countersItem); + } + } + + + v1beta2_resource_slice_spec_local_var = v1beta2_resource_slice_spec_create_internal ( + all_nodes ? all_nodes->valueint : 0, + devices ? devicesList : NULL, + strdup(driver->valuestring), + node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, + node_selector ? node_selector_local_nonprim : NULL, + per_device_node_selection ? per_device_node_selection->valueint : 0, + pool_local_nonprim, + shared_counters ? shared_countersList : NULL + ); + + return v1beta2_resource_slice_spec_local_var; +end: + if (devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, devicesList) { + v1beta2_device_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(devicesList); + devicesList = NULL; + } + if (node_selector_local_nonprim) { + v1_node_selector_free(node_selector_local_nonprim); + node_selector_local_nonprim = NULL; + } + if (pool_local_nonprim) { + v1beta2_resource_pool_free(pool_local_nonprim); + pool_local_nonprim = NULL; + } + if (shared_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, shared_countersList) { + v1beta2_counter_set_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(shared_countersList); + shared_countersList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1beta2_resource_slice_spec.h b/kubernetes/model/v1beta2_resource_slice_spec.h new file mode 100644 index 00000000..4185ef92 --- /dev/null +++ b/kubernetes/model/v1beta2_resource_slice_spec.h @@ -0,0 +1,56 @@ +/* + * v1beta2_resource_slice_spec.h + * + * ResourceSliceSpec contains the information published by the driver in one ResourceSlice. + */ + +#ifndef _v1beta2_resource_slice_spec_H_ +#define _v1beta2_resource_slice_spec_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1beta2_resource_slice_spec_t v1beta2_resource_slice_spec_t; + +#include "v1_node_selector.h" +#include "v1beta2_counter_set.h" +#include "v1beta2_device.h" +#include "v1beta2_resource_pool.h" + + + +typedef struct v1beta2_resource_slice_spec_t { + int all_nodes; //boolean + list_t *devices; //nonprimitive container + char *driver; // string + char *node_name; // string + struct v1_node_selector_t *node_selector; //model + int per_device_node_selection; //boolean + struct v1beta2_resource_pool_t *pool; //model + list_t *shared_counters; //nonprimitive container + + int _library_owned; // Is the library responsible for freeing this object? +} v1beta2_resource_slice_spec_t; + +__attribute__((deprecated)) v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec_create( + int all_nodes, + list_t *devices, + char *driver, + char *node_name, + v1_node_selector_t *node_selector, + int per_device_node_selection, + v1beta2_resource_pool_t *pool, + list_t *shared_counters +); + +void v1beta2_resource_slice_spec_free(v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec); + +v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec_parseFromJSON(cJSON *v1beta2_resource_slice_specJSON); + +cJSON *v1beta2_resource_slice_spec_convertToJSON(v1beta2_resource_slice_spec_t *v1beta2_resource_slice_spec); + +#endif /* _v1beta2_resource_slice_spec_H_ */ + diff --git a/kubernetes/model/v1beta3_exempt_priority_level_configuration.c b/kubernetes/model/v1beta3_exempt_priority_level_configuration.c deleted file mode 100644 index a3061a0c..00000000 --- a/kubernetes/model/v1beta3_exempt_priority_level_configuration.c +++ /dev/null @@ -1,89 +0,0 @@ -#include -#include -#include -#include "v1beta3_exempt_priority_level_configuration.h" - - - -v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration_create( - int lendable_percent, - int nominal_concurrency_shares - ) { - v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration_local_var = malloc(sizeof(v1beta3_exempt_priority_level_configuration_t)); - if (!v1beta3_exempt_priority_level_configuration_local_var) { - return NULL; - } - v1beta3_exempt_priority_level_configuration_local_var->lendable_percent = lendable_percent; - v1beta3_exempt_priority_level_configuration_local_var->nominal_concurrency_shares = nominal_concurrency_shares; - - return v1beta3_exempt_priority_level_configuration_local_var; -} - - -void v1beta3_exempt_priority_level_configuration_free(v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration) { - if(NULL == v1beta3_exempt_priority_level_configuration){ - return ; - } - listEntry_t *listEntry; - free(v1beta3_exempt_priority_level_configuration); -} - -cJSON *v1beta3_exempt_priority_level_configuration_convertToJSON(v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_exempt_priority_level_configuration->lendable_percent - if(v1beta3_exempt_priority_level_configuration->lendable_percent) { - if(cJSON_AddNumberToObject(item, "lendablePercent", v1beta3_exempt_priority_level_configuration->lendable_percent) == NULL) { - goto fail; //Numeric - } - } - - - // v1beta3_exempt_priority_level_configuration->nominal_concurrency_shares - if(v1beta3_exempt_priority_level_configuration->nominal_concurrency_shares) { - if(cJSON_AddNumberToObject(item, "nominalConcurrencyShares", v1beta3_exempt_priority_level_configuration->nominal_concurrency_shares) == NULL) { - goto fail; //Numeric - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration_parseFromJSON(cJSON *v1beta3_exempt_priority_level_configurationJSON){ - - v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration_local_var = NULL; - - // v1beta3_exempt_priority_level_configuration->lendable_percent - cJSON *lendable_percent = cJSON_GetObjectItemCaseSensitive(v1beta3_exempt_priority_level_configurationJSON, "lendablePercent"); - if (lendable_percent) { - if(!cJSON_IsNumber(lendable_percent)) - { - goto end; //Numeric - } - } - - // v1beta3_exempt_priority_level_configuration->nominal_concurrency_shares - cJSON *nominal_concurrency_shares = cJSON_GetObjectItemCaseSensitive(v1beta3_exempt_priority_level_configurationJSON, "nominalConcurrencyShares"); - if (nominal_concurrency_shares) { - if(!cJSON_IsNumber(nominal_concurrency_shares)) - { - goto end; //Numeric - } - } - - - v1beta3_exempt_priority_level_configuration_local_var = v1beta3_exempt_priority_level_configuration_create ( - lendable_percent ? lendable_percent->valuedouble : 0, - nominal_concurrency_shares ? nominal_concurrency_shares->valuedouble : 0 - ); - - return v1beta3_exempt_priority_level_configuration_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_exempt_priority_level_configuration.h b/kubernetes/model/v1beta3_exempt_priority_level_configuration.h deleted file mode 100644 index 5e0d4044..00000000 --- a/kubernetes/model/v1beta3_exempt_priority_level_configuration.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1beta3_exempt_priority_level_configuration.h - * - * ExemptPriorityLevelConfiguration describes the configurable aspects of the handling of exempt requests. In the mandatory exempt configuration object the values in the fields here can be modified by authorized users, unlike the rest of the `spec`. - */ - -#ifndef _v1beta3_exempt_priority_level_configuration_H_ -#define _v1beta3_exempt_priority_level_configuration_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_exempt_priority_level_configuration_t v1beta3_exempt_priority_level_configuration_t; - - - - -typedef struct v1beta3_exempt_priority_level_configuration_t { - int lendable_percent; //numeric - int nominal_concurrency_shares; //numeric - -} v1beta3_exempt_priority_level_configuration_t; - -v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration_create( - int lendable_percent, - int nominal_concurrency_shares -); - -void v1beta3_exempt_priority_level_configuration_free(v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration); - -v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration_parseFromJSON(cJSON *v1beta3_exempt_priority_level_configurationJSON); - -cJSON *v1beta3_exempt_priority_level_configuration_convertToJSON(v1beta3_exempt_priority_level_configuration_t *v1beta3_exempt_priority_level_configuration); - -#endif /* _v1beta3_exempt_priority_level_configuration_H_ */ - diff --git a/kubernetes/model/v1beta3_flow_distinguisher_method.c b/kubernetes/model/v1beta3_flow_distinguisher_method.c deleted file mode 100644 index f4923714..00000000 --- a/kubernetes/model/v1beta3_flow_distinguisher_method.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1beta3_flow_distinguisher_method.h" - - - -v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method_create( - char *type - ) { - v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method_local_var = malloc(sizeof(v1beta3_flow_distinguisher_method_t)); - if (!v1beta3_flow_distinguisher_method_local_var) { - return NULL; - } - v1beta3_flow_distinguisher_method_local_var->type = type; - - return v1beta3_flow_distinguisher_method_local_var; -} - - -void v1beta3_flow_distinguisher_method_free(v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method) { - if(NULL == v1beta3_flow_distinguisher_method){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_flow_distinguisher_method->type) { - free(v1beta3_flow_distinguisher_method->type); - v1beta3_flow_distinguisher_method->type = NULL; - } - free(v1beta3_flow_distinguisher_method); -} - -cJSON *v1beta3_flow_distinguisher_method_convertToJSON(v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_flow_distinguisher_method->type - if (!v1beta3_flow_distinguisher_method->type) { - goto fail; - } - if(cJSON_AddStringToObject(item, "type", v1beta3_flow_distinguisher_method->type) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method_parseFromJSON(cJSON *v1beta3_flow_distinguisher_methodJSON){ - - v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method_local_var = NULL; - - // v1beta3_flow_distinguisher_method->type - cJSON *type = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_distinguisher_methodJSON, "type"); - if (!type) { - goto end; - } - - - if(!cJSON_IsString(type)) - { - goto end; //String - } - - - v1beta3_flow_distinguisher_method_local_var = v1beta3_flow_distinguisher_method_create ( - strdup(type->valuestring) - ); - - return v1beta3_flow_distinguisher_method_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_flow_distinguisher_method.h b/kubernetes/model/v1beta3_flow_distinguisher_method.h deleted file mode 100644 index 0abb026c..00000000 --- a/kubernetes/model/v1beta3_flow_distinguisher_method.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1beta3_flow_distinguisher_method.h - * - * FlowDistinguisherMethod specifies the method of a flow distinguisher. - */ - -#ifndef _v1beta3_flow_distinguisher_method_H_ -#define _v1beta3_flow_distinguisher_method_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_flow_distinguisher_method_t v1beta3_flow_distinguisher_method_t; - - - - -typedef struct v1beta3_flow_distinguisher_method_t { - char *type; // string - -} v1beta3_flow_distinguisher_method_t; - -v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method_create( - char *type -); - -void v1beta3_flow_distinguisher_method_free(v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method); - -v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method_parseFromJSON(cJSON *v1beta3_flow_distinguisher_methodJSON); - -cJSON *v1beta3_flow_distinguisher_method_convertToJSON(v1beta3_flow_distinguisher_method_t *v1beta3_flow_distinguisher_method); - -#endif /* _v1beta3_flow_distinguisher_method_H_ */ - diff --git a/kubernetes/model/v1beta3_flow_schema.c b/kubernetes/model/v1beta3_flow_schema.c deleted file mode 100644 index 4e00747b..00000000 --- a/kubernetes/model/v1beta3_flow_schema.c +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include -#include -#include "v1beta3_flow_schema.h" - - - -v1beta3_flow_schema_t *v1beta3_flow_schema_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta3_flow_schema_spec_t *spec, - v1beta3_flow_schema_status_t *status - ) { - v1beta3_flow_schema_t *v1beta3_flow_schema_local_var = malloc(sizeof(v1beta3_flow_schema_t)); - if (!v1beta3_flow_schema_local_var) { - return NULL; - } - v1beta3_flow_schema_local_var->api_version = api_version; - v1beta3_flow_schema_local_var->kind = kind; - v1beta3_flow_schema_local_var->metadata = metadata; - v1beta3_flow_schema_local_var->spec = spec; - v1beta3_flow_schema_local_var->status = status; - - return v1beta3_flow_schema_local_var; -} - - -void v1beta3_flow_schema_free(v1beta3_flow_schema_t *v1beta3_flow_schema) { - if(NULL == v1beta3_flow_schema){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_flow_schema->api_version) { - free(v1beta3_flow_schema->api_version); - v1beta3_flow_schema->api_version = NULL; - } - if (v1beta3_flow_schema->kind) { - free(v1beta3_flow_schema->kind); - v1beta3_flow_schema->kind = NULL; - } - if (v1beta3_flow_schema->metadata) { - v1_object_meta_free(v1beta3_flow_schema->metadata); - v1beta3_flow_schema->metadata = NULL; - } - if (v1beta3_flow_schema->spec) { - v1beta3_flow_schema_spec_free(v1beta3_flow_schema->spec); - v1beta3_flow_schema->spec = NULL; - } - if (v1beta3_flow_schema->status) { - v1beta3_flow_schema_status_free(v1beta3_flow_schema->status); - v1beta3_flow_schema->status = NULL; - } - free(v1beta3_flow_schema); -} - -cJSON *v1beta3_flow_schema_convertToJSON(v1beta3_flow_schema_t *v1beta3_flow_schema) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_flow_schema->api_version - if(v1beta3_flow_schema->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta3_flow_schema->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta3_flow_schema->kind - if(v1beta3_flow_schema->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta3_flow_schema->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta3_flow_schema->metadata - if(v1beta3_flow_schema->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta3_flow_schema->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_flow_schema->spec - if(v1beta3_flow_schema->spec) { - cJSON *spec_local_JSON = v1beta3_flow_schema_spec_convertToJSON(v1beta3_flow_schema->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_flow_schema->status - if(v1beta3_flow_schema->status) { - cJSON *status_local_JSON = v1beta3_flow_schema_status_convertToJSON(v1beta3_flow_schema->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_flow_schema_t *v1beta3_flow_schema_parseFromJSON(cJSON *v1beta3_flow_schemaJSON){ - - v1beta3_flow_schema_t *v1beta3_flow_schema_local_var = NULL; - - // define the local variable for v1beta3_flow_schema->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1beta3_flow_schema->spec - v1beta3_flow_schema_spec_t *spec_local_nonprim = NULL; - - // define the local variable for v1beta3_flow_schema->status - v1beta3_flow_schema_status_t *status_local_nonprim = NULL; - - // v1beta3_flow_schema->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schemaJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta3_flow_schema->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schemaJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta3_flow_schema->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schemaJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1beta3_flow_schema->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schemaJSON, "spec"); - if (spec) { - spec_local_nonprim = v1beta3_flow_schema_spec_parseFromJSON(spec); //nonprimitive - } - - // v1beta3_flow_schema->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schemaJSON, "status"); - if (status) { - status_local_nonprim = v1beta3_flow_schema_status_parseFromJSON(status); //nonprimitive - } - - - v1beta3_flow_schema_local_var = v1beta3_flow_schema_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL, - status ? status_local_nonprim : NULL - ); - - return v1beta3_flow_schema_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1beta3_flow_schema_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1beta3_flow_schema_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_flow_schema.h b/kubernetes/model/v1beta3_flow_schema.h deleted file mode 100644 index b8200966..00000000 --- a/kubernetes/model/v1beta3_flow_schema.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * v1beta3_flow_schema.h - * - * FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \"flow distinguisher\". - */ - -#ifndef _v1beta3_flow_schema_H_ -#define _v1beta3_flow_schema_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_flow_schema_t v1beta3_flow_schema_t; - -#include "v1_object_meta.h" -#include "v1beta3_flow_schema_spec.h" -#include "v1beta3_flow_schema_status.h" - - - -typedef struct v1beta3_flow_schema_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1beta3_flow_schema_spec_t *spec; //model - struct v1beta3_flow_schema_status_t *status; //model - -} v1beta3_flow_schema_t; - -v1beta3_flow_schema_t *v1beta3_flow_schema_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta3_flow_schema_spec_t *spec, - v1beta3_flow_schema_status_t *status -); - -void v1beta3_flow_schema_free(v1beta3_flow_schema_t *v1beta3_flow_schema); - -v1beta3_flow_schema_t *v1beta3_flow_schema_parseFromJSON(cJSON *v1beta3_flow_schemaJSON); - -cJSON *v1beta3_flow_schema_convertToJSON(v1beta3_flow_schema_t *v1beta3_flow_schema); - -#endif /* _v1beta3_flow_schema_H_ */ - diff --git a/kubernetes/model/v1beta3_flow_schema_condition.c b/kubernetes/model/v1beta3_flow_schema_condition.c deleted file mode 100644 index c42cb652..00000000 --- a/kubernetes/model/v1beta3_flow_schema_condition.c +++ /dev/null @@ -1,169 +0,0 @@ -#include -#include -#include -#include "v1beta3_flow_schema_condition.h" - - - -v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition_create( - char *last_transition_time, - char *message, - char *reason, - char *status, - char *type - ) { - v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition_local_var = malloc(sizeof(v1beta3_flow_schema_condition_t)); - if (!v1beta3_flow_schema_condition_local_var) { - return NULL; - } - v1beta3_flow_schema_condition_local_var->last_transition_time = last_transition_time; - v1beta3_flow_schema_condition_local_var->message = message; - v1beta3_flow_schema_condition_local_var->reason = reason; - v1beta3_flow_schema_condition_local_var->status = status; - v1beta3_flow_schema_condition_local_var->type = type; - - return v1beta3_flow_schema_condition_local_var; -} - - -void v1beta3_flow_schema_condition_free(v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition) { - if(NULL == v1beta3_flow_schema_condition){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_flow_schema_condition->last_transition_time) { - free(v1beta3_flow_schema_condition->last_transition_time); - v1beta3_flow_schema_condition->last_transition_time = NULL; - } - if (v1beta3_flow_schema_condition->message) { - free(v1beta3_flow_schema_condition->message); - v1beta3_flow_schema_condition->message = NULL; - } - if (v1beta3_flow_schema_condition->reason) { - free(v1beta3_flow_schema_condition->reason); - v1beta3_flow_schema_condition->reason = NULL; - } - if (v1beta3_flow_schema_condition->status) { - free(v1beta3_flow_schema_condition->status); - v1beta3_flow_schema_condition->status = NULL; - } - if (v1beta3_flow_schema_condition->type) { - free(v1beta3_flow_schema_condition->type); - v1beta3_flow_schema_condition->type = NULL; - } - free(v1beta3_flow_schema_condition); -} - -cJSON *v1beta3_flow_schema_condition_convertToJSON(v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_flow_schema_condition->last_transition_time - if(v1beta3_flow_schema_condition->last_transition_time) { - if(cJSON_AddStringToObject(item, "lastTransitionTime", v1beta3_flow_schema_condition->last_transition_time) == NULL) { - goto fail; //Date-Time - } - } - - - // v1beta3_flow_schema_condition->message - if(v1beta3_flow_schema_condition->message) { - if(cJSON_AddStringToObject(item, "message", v1beta3_flow_schema_condition->message) == NULL) { - goto fail; //String - } - } - - - // v1beta3_flow_schema_condition->reason - if(v1beta3_flow_schema_condition->reason) { - if(cJSON_AddStringToObject(item, "reason", v1beta3_flow_schema_condition->reason) == NULL) { - goto fail; //String - } - } - - - // v1beta3_flow_schema_condition->status - if(v1beta3_flow_schema_condition->status) { - if(cJSON_AddStringToObject(item, "status", v1beta3_flow_schema_condition->status) == NULL) { - goto fail; //String - } - } - - - // v1beta3_flow_schema_condition->type - if(v1beta3_flow_schema_condition->type) { - if(cJSON_AddStringToObject(item, "type", v1beta3_flow_schema_condition->type) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition_parseFromJSON(cJSON *v1beta3_flow_schema_conditionJSON){ - - v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition_local_var = NULL; - - // v1beta3_flow_schema_condition->last_transition_time - cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_conditionJSON, "lastTransitionTime"); - if (last_transition_time) { - if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) - { - goto end; //DateTime - } - } - - // v1beta3_flow_schema_condition->message - cJSON *message = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_conditionJSON, "message"); - if (message) { - if(!cJSON_IsString(message) && !cJSON_IsNull(message)) - { - goto end; //String - } - } - - // v1beta3_flow_schema_condition->reason - cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_conditionJSON, "reason"); - if (reason) { - if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) - { - goto end; //String - } - } - - // v1beta3_flow_schema_condition->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_conditionJSON, "status"); - if (status) { - if(!cJSON_IsString(status) && !cJSON_IsNull(status)) - { - goto end; //String - } - } - - // v1beta3_flow_schema_condition->type - cJSON *type = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_conditionJSON, "type"); - if (type) { - if(!cJSON_IsString(type) && !cJSON_IsNull(type)) - { - goto end; //String - } - } - - - v1beta3_flow_schema_condition_local_var = v1beta3_flow_schema_condition_create ( - last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, - message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, - reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, - status && !cJSON_IsNull(status) ? strdup(status->valuestring) : NULL, - type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL - ); - - return v1beta3_flow_schema_condition_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_flow_schema_condition.h b/kubernetes/model/v1beta3_flow_schema_condition.h deleted file mode 100644 index 35da31ce..00000000 --- a/kubernetes/model/v1beta3_flow_schema_condition.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta3_flow_schema_condition.h - * - * FlowSchemaCondition describes conditions for a FlowSchema. - */ - -#ifndef _v1beta3_flow_schema_condition_H_ -#define _v1beta3_flow_schema_condition_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_flow_schema_condition_t v1beta3_flow_schema_condition_t; - - - - -typedef struct v1beta3_flow_schema_condition_t { - char *last_transition_time; //date time - char *message; // string - char *reason; // string - char *status; // string - char *type; // string - -} v1beta3_flow_schema_condition_t; - -v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition_create( - char *last_transition_time, - char *message, - char *reason, - char *status, - char *type -); - -void v1beta3_flow_schema_condition_free(v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition); - -v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition_parseFromJSON(cJSON *v1beta3_flow_schema_conditionJSON); - -cJSON *v1beta3_flow_schema_condition_convertToJSON(v1beta3_flow_schema_condition_t *v1beta3_flow_schema_condition); - -#endif /* _v1beta3_flow_schema_condition_H_ */ - diff --git a/kubernetes/model/v1beta3_flow_schema_list.c b/kubernetes/model/v1beta3_flow_schema_list.c deleted file mode 100644 index 70569ab3..00000000 --- a/kubernetes/model/v1beta3_flow_schema_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1beta3_flow_schema_list.h" - - - -v1beta3_flow_schema_list_t *v1beta3_flow_schema_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1beta3_flow_schema_list_t *v1beta3_flow_schema_list_local_var = malloc(sizeof(v1beta3_flow_schema_list_t)); - if (!v1beta3_flow_schema_list_local_var) { - return NULL; - } - v1beta3_flow_schema_list_local_var->api_version = api_version; - v1beta3_flow_schema_list_local_var->items = items; - v1beta3_flow_schema_list_local_var->kind = kind; - v1beta3_flow_schema_list_local_var->metadata = metadata; - - return v1beta3_flow_schema_list_local_var; -} - - -void v1beta3_flow_schema_list_free(v1beta3_flow_schema_list_t *v1beta3_flow_schema_list) { - if(NULL == v1beta3_flow_schema_list){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_flow_schema_list->api_version) { - free(v1beta3_flow_schema_list->api_version); - v1beta3_flow_schema_list->api_version = NULL; - } - if (v1beta3_flow_schema_list->items) { - list_ForEach(listEntry, v1beta3_flow_schema_list->items) { - v1beta3_flow_schema_free(listEntry->data); - } - list_freeList(v1beta3_flow_schema_list->items); - v1beta3_flow_schema_list->items = NULL; - } - if (v1beta3_flow_schema_list->kind) { - free(v1beta3_flow_schema_list->kind); - v1beta3_flow_schema_list->kind = NULL; - } - if (v1beta3_flow_schema_list->metadata) { - v1_list_meta_free(v1beta3_flow_schema_list->metadata); - v1beta3_flow_schema_list->metadata = NULL; - } - free(v1beta3_flow_schema_list); -} - -cJSON *v1beta3_flow_schema_list_convertToJSON(v1beta3_flow_schema_list_t *v1beta3_flow_schema_list) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_flow_schema_list->api_version - if(v1beta3_flow_schema_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta3_flow_schema_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta3_flow_schema_list->items - if (!v1beta3_flow_schema_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1beta3_flow_schema_list->items) { - list_ForEach(itemsListEntry, v1beta3_flow_schema_list->items) { - cJSON *itemLocal = v1beta3_flow_schema_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1beta3_flow_schema_list->kind - if(v1beta3_flow_schema_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta3_flow_schema_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta3_flow_schema_list->metadata - if(v1beta3_flow_schema_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta3_flow_schema_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_flow_schema_list_t *v1beta3_flow_schema_list_parseFromJSON(cJSON *v1beta3_flow_schema_listJSON){ - - v1beta3_flow_schema_list_t *v1beta3_flow_schema_list_local_var = NULL; - - // define the local list for v1beta3_flow_schema_list->items - list_t *itemsList = NULL; - - // define the local variable for v1beta3_flow_schema_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1beta3_flow_schema_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta3_flow_schema_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1beta3_flow_schema_t *itemsItem = v1beta3_flow_schema_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1beta3_flow_schema_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta3_flow_schema_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1beta3_flow_schema_list_local_var = v1beta3_flow_schema_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1beta3_flow_schema_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1beta3_flow_schema_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_flow_schema_list.h b/kubernetes/model/v1beta3_flow_schema_list.h deleted file mode 100644 index 4ecb0bbc..00000000 --- a/kubernetes/model/v1beta3_flow_schema_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta3_flow_schema_list.h - * - * FlowSchemaList is a list of FlowSchema objects. - */ - -#ifndef _v1beta3_flow_schema_list_H_ -#define _v1beta3_flow_schema_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_flow_schema_list_t v1beta3_flow_schema_list_t; - -#include "v1_list_meta.h" -#include "v1beta3_flow_schema.h" - - - -typedef struct v1beta3_flow_schema_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1beta3_flow_schema_list_t; - -v1beta3_flow_schema_list_t *v1beta3_flow_schema_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1beta3_flow_schema_list_free(v1beta3_flow_schema_list_t *v1beta3_flow_schema_list); - -v1beta3_flow_schema_list_t *v1beta3_flow_schema_list_parseFromJSON(cJSON *v1beta3_flow_schema_listJSON); - -cJSON *v1beta3_flow_schema_list_convertToJSON(v1beta3_flow_schema_list_t *v1beta3_flow_schema_list); - -#endif /* _v1beta3_flow_schema_list_H_ */ - diff --git a/kubernetes/model/v1beta3_flow_schema_spec.c b/kubernetes/model/v1beta3_flow_schema_spec.c deleted file mode 100644 index 70e72d59..00000000 --- a/kubernetes/model/v1beta3_flow_schema_spec.c +++ /dev/null @@ -1,202 +0,0 @@ -#include -#include -#include -#include "v1beta3_flow_schema_spec.h" - - - -v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec_create( - v1beta3_flow_distinguisher_method_t *distinguisher_method, - int matching_precedence, - v1beta3_priority_level_configuration_reference_t *priority_level_configuration, - list_t *rules - ) { - v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec_local_var = malloc(sizeof(v1beta3_flow_schema_spec_t)); - if (!v1beta3_flow_schema_spec_local_var) { - return NULL; - } - v1beta3_flow_schema_spec_local_var->distinguisher_method = distinguisher_method; - v1beta3_flow_schema_spec_local_var->matching_precedence = matching_precedence; - v1beta3_flow_schema_spec_local_var->priority_level_configuration = priority_level_configuration; - v1beta3_flow_schema_spec_local_var->rules = rules; - - return v1beta3_flow_schema_spec_local_var; -} - - -void v1beta3_flow_schema_spec_free(v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec) { - if(NULL == v1beta3_flow_schema_spec){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_flow_schema_spec->distinguisher_method) { - v1beta3_flow_distinguisher_method_free(v1beta3_flow_schema_spec->distinguisher_method); - v1beta3_flow_schema_spec->distinguisher_method = NULL; - } - if (v1beta3_flow_schema_spec->priority_level_configuration) { - v1beta3_priority_level_configuration_reference_free(v1beta3_flow_schema_spec->priority_level_configuration); - v1beta3_flow_schema_spec->priority_level_configuration = NULL; - } - if (v1beta3_flow_schema_spec->rules) { - list_ForEach(listEntry, v1beta3_flow_schema_spec->rules) { - v1beta3_policy_rules_with_subjects_free(listEntry->data); - } - list_freeList(v1beta3_flow_schema_spec->rules); - v1beta3_flow_schema_spec->rules = NULL; - } - free(v1beta3_flow_schema_spec); -} - -cJSON *v1beta3_flow_schema_spec_convertToJSON(v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_flow_schema_spec->distinguisher_method - if(v1beta3_flow_schema_spec->distinguisher_method) { - cJSON *distinguisher_method_local_JSON = v1beta3_flow_distinguisher_method_convertToJSON(v1beta3_flow_schema_spec->distinguisher_method); - if(distinguisher_method_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "distinguisherMethod", distinguisher_method_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_flow_schema_spec->matching_precedence - if(v1beta3_flow_schema_spec->matching_precedence) { - if(cJSON_AddNumberToObject(item, "matchingPrecedence", v1beta3_flow_schema_spec->matching_precedence) == NULL) { - goto fail; //Numeric - } - } - - - // v1beta3_flow_schema_spec->priority_level_configuration - if (!v1beta3_flow_schema_spec->priority_level_configuration) { - goto fail; - } - cJSON *priority_level_configuration_local_JSON = v1beta3_priority_level_configuration_reference_convertToJSON(v1beta3_flow_schema_spec->priority_level_configuration); - if(priority_level_configuration_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "priorityLevelConfiguration", priority_level_configuration_local_JSON); - if(item->child == NULL) { - goto fail; - } - - - // v1beta3_flow_schema_spec->rules - if(v1beta3_flow_schema_spec->rules) { - cJSON *rules = cJSON_AddArrayToObject(item, "rules"); - if(rules == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *rulesListEntry; - if (v1beta3_flow_schema_spec->rules) { - list_ForEach(rulesListEntry, v1beta3_flow_schema_spec->rules) { - cJSON *itemLocal = v1beta3_policy_rules_with_subjects_convertToJSON(rulesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(rules, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec_parseFromJSON(cJSON *v1beta3_flow_schema_specJSON){ - - v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec_local_var = NULL; - - // define the local variable for v1beta3_flow_schema_spec->distinguisher_method - v1beta3_flow_distinguisher_method_t *distinguisher_method_local_nonprim = NULL; - - // define the local variable for v1beta3_flow_schema_spec->priority_level_configuration - v1beta3_priority_level_configuration_reference_t *priority_level_configuration_local_nonprim = NULL; - - // define the local list for v1beta3_flow_schema_spec->rules - list_t *rulesList = NULL; - - // v1beta3_flow_schema_spec->distinguisher_method - cJSON *distinguisher_method = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_specJSON, "distinguisherMethod"); - if (distinguisher_method) { - distinguisher_method_local_nonprim = v1beta3_flow_distinguisher_method_parseFromJSON(distinguisher_method); //nonprimitive - } - - // v1beta3_flow_schema_spec->matching_precedence - cJSON *matching_precedence = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_specJSON, "matchingPrecedence"); - if (matching_precedence) { - if(!cJSON_IsNumber(matching_precedence)) - { - goto end; //Numeric - } - } - - // v1beta3_flow_schema_spec->priority_level_configuration - cJSON *priority_level_configuration = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_specJSON, "priorityLevelConfiguration"); - if (!priority_level_configuration) { - goto end; - } - - - priority_level_configuration_local_nonprim = v1beta3_priority_level_configuration_reference_parseFromJSON(priority_level_configuration); //nonprimitive - - // v1beta3_flow_schema_spec->rules - cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_specJSON, "rules"); - if (rules) { - cJSON *rules_local_nonprimitive = NULL; - if(!cJSON_IsArray(rules)){ - goto end; //nonprimitive container - } - - rulesList = list_createList(); - - cJSON_ArrayForEach(rules_local_nonprimitive,rules ) - { - if(!cJSON_IsObject(rules_local_nonprimitive)){ - goto end; - } - v1beta3_policy_rules_with_subjects_t *rulesItem = v1beta3_policy_rules_with_subjects_parseFromJSON(rules_local_nonprimitive); - - list_addElement(rulesList, rulesItem); - } - } - - - v1beta3_flow_schema_spec_local_var = v1beta3_flow_schema_spec_create ( - distinguisher_method ? distinguisher_method_local_nonprim : NULL, - matching_precedence ? matching_precedence->valuedouble : 0, - priority_level_configuration_local_nonprim, - rules ? rulesList : NULL - ); - - return v1beta3_flow_schema_spec_local_var; -end: - if (distinguisher_method_local_nonprim) { - v1beta3_flow_distinguisher_method_free(distinguisher_method_local_nonprim); - distinguisher_method_local_nonprim = NULL; - } - if (priority_level_configuration_local_nonprim) { - v1beta3_priority_level_configuration_reference_free(priority_level_configuration_local_nonprim); - priority_level_configuration_local_nonprim = NULL; - } - if (rulesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, rulesList) { - v1beta3_policy_rules_with_subjects_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(rulesList); - rulesList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_flow_schema_spec.h b/kubernetes/model/v1beta3_flow_schema_spec.h deleted file mode 100644 index aa1d8714..00000000 --- a/kubernetes/model/v1beta3_flow_schema_spec.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * v1beta3_flow_schema_spec.h - * - * FlowSchemaSpec describes how the FlowSchema's specification looks like. - */ - -#ifndef _v1beta3_flow_schema_spec_H_ -#define _v1beta3_flow_schema_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_flow_schema_spec_t v1beta3_flow_schema_spec_t; - -#include "v1beta3_flow_distinguisher_method.h" -#include "v1beta3_policy_rules_with_subjects.h" -#include "v1beta3_priority_level_configuration_reference.h" - - - -typedef struct v1beta3_flow_schema_spec_t { - struct v1beta3_flow_distinguisher_method_t *distinguisher_method; //model - int matching_precedence; //numeric - struct v1beta3_priority_level_configuration_reference_t *priority_level_configuration; //model - list_t *rules; //nonprimitive container - -} v1beta3_flow_schema_spec_t; - -v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec_create( - v1beta3_flow_distinguisher_method_t *distinguisher_method, - int matching_precedence, - v1beta3_priority_level_configuration_reference_t *priority_level_configuration, - list_t *rules -); - -void v1beta3_flow_schema_spec_free(v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec); - -v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec_parseFromJSON(cJSON *v1beta3_flow_schema_specJSON); - -cJSON *v1beta3_flow_schema_spec_convertToJSON(v1beta3_flow_schema_spec_t *v1beta3_flow_schema_spec); - -#endif /* _v1beta3_flow_schema_spec_H_ */ - diff --git a/kubernetes/model/v1beta3_flow_schema_status.c b/kubernetes/model/v1beta3_flow_schema_status.c deleted file mode 100644 index 0df50929..00000000 --- a/kubernetes/model/v1beta3_flow_schema_status.c +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include "v1beta3_flow_schema_status.h" - - - -v1beta3_flow_schema_status_t *v1beta3_flow_schema_status_create( - list_t *conditions - ) { - v1beta3_flow_schema_status_t *v1beta3_flow_schema_status_local_var = malloc(sizeof(v1beta3_flow_schema_status_t)); - if (!v1beta3_flow_schema_status_local_var) { - return NULL; - } - v1beta3_flow_schema_status_local_var->conditions = conditions; - - return v1beta3_flow_schema_status_local_var; -} - - -void v1beta3_flow_schema_status_free(v1beta3_flow_schema_status_t *v1beta3_flow_schema_status) { - if(NULL == v1beta3_flow_schema_status){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_flow_schema_status->conditions) { - list_ForEach(listEntry, v1beta3_flow_schema_status->conditions) { - v1beta3_flow_schema_condition_free(listEntry->data); - } - list_freeList(v1beta3_flow_schema_status->conditions); - v1beta3_flow_schema_status->conditions = NULL; - } - free(v1beta3_flow_schema_status); -} - -cJSON *v1beta3_flow_schema_status_convertToJSON(v1beta3_flow_schema_status_t *v1beta3_flow_schema_status) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_flow_schema_status->conditions - if(v1beta3_flow_schema_status->conditions) { - cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); - if(conditions == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *conditionsListEntry; - if (v1beta3_flow_schema_status->conditions) { - list_ForEach(conditionsListEntry, v1beta3_flow_schema_status->conditions) { - cJSON *itemLocal = v1beta3_flow_schema_condition_convertToJSON(conditionsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(conditions, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_flow_schema_status_t *v1beta3_flow_schema_status_parseFromJSON(cJSON *v1beta3_flow_schema_statusJSON){ - - v1beta3_flow_schema_status_t *v1beta3_flow_schema_status_local_var = NULL; - - // define the local list for v1beta3_flow_schema_status->conditions - list_t *conditionsList = NULL; - - // v1beta3_flow_schema_status->conditions - cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta3_flow_schema_statusJSON, "conditions"); - if (conditions) { - cJSON *conditions_local_nonprimitive = NULL; - if(!cJSON_IsArray(conditions)){ - goto end; //nonprimitive container - } - - conditionsList = list_createList(); - - cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) - { - if(!cJSON_IsObject(conditions_local_nonprimitive)){ - goto end; - } - v1beta3_flow_schema_condition_t *conditionsItem = v1beta3_flow_schema_condition_parseFromJSON(conditions_local_nonprimitive); - - list_addElement(conditionsList, conditionsItem); - } - } - - - v1beta3_flow_schema_status_local_var = v1beta3_flow_schema_status_create ( - conditions ? conditionsList : NULL - ); - - return v1beta3_flow_schema_status_local_var; -end: - if (conditionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, conditionsList) { - v1beta3_flow_schema_condition_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(conditionsList); - conditionsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_flow_schema_status.h b/kubernetes/model/v1beta3_flow_schema_status.h deleted file mode 100644 index 3f6cd7ab..00000000 --- a/kubernetes/model/v1beta3_flow_schema_status.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1beta3_flow_schema_status.h - * - * FlowSchemaStatus represents the current state of a FlowSchema. - */ - -#ifndef _v1beta3_flow_schema_status_H_ -#define _v1beta3_flow_schema_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_flow_schema_status_t v1beta3_flow_schema_status_t; - -#include "v1beta3_flow_schema_condition.h" - - - -typedef struct v1beta3_flow_schema_status_t { - list_t *conditions; //nonprimitive container - -} v1beta3_flow_schema_status_t; - -v1beta3_flow_schema_status_t *v1beta3_flow_schema_status_create( - list_t *conditions -); - -void v1beta3_flow_schema_status_free(v1beta3_flow_schema_status_t *v1beta3_flow_schema_status); - -v1beta3_flow_schema_status_t *v1beta3_flow_schema_status_parseFromJSON(cJSON *v1beta3_flow_schema_statusJSON); - -cJSON *v1beta3_flow_schema_status_convertToJSON(v1beta3_flow_schema_status_t *v1beta3_flow_schema_status); - -#endif /* _v1beta3_flow_schema_status_H_ */ - diff --git a/kubernetes/model/v1beta3_group_subject.c b/kubernetes/model/v1beta3_group_subject.c deleted file mode 100644 index a877be7e..00000000 --- a/kubernetes/model/v1beta3_group_subject.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1beta3_group_subject.h" - - - -v1beta3_group_subject_t *v1beta3_group_subject_create( - char *name - ) { - v1beta3_group_subject_t *v1beta3_group_subject_local_var = malloc(sizeof(v1beta3_group_subject_t)); - if (!v1beta3_group_subject_local_var) { - return NULL; - } - v1beta3_group_subject_local_var->name = name; - - return v1beta3_group_subject_local_var; -} - - -void v1beta3_group_subject_free(v1beta3_group_subject_t *v1beta3_group_subject) { - if(NULL == v1beta3_group_subject){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_group_subject->name) { - free(v1beta3_group_subject->name); - v1beta3_group_subject->name = NULL; - } - free(v1beta3_group_subject); -} - -cJSON *v1beta3_group_subject_convertToJSON(v1beta3_group_subject_t *v1beta3_group_subject) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_group_subject->name - if (!v1beta3_group_subject->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1beta3_group_subject->name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_group_subject_t *v1beta3_group_subject_parseFromJSON(cJSON *v1beta3_group_subjectJSON){ - - v1beta3_group_subject_t *v1beta3_group_subject_local_var = NULL; - - // v1beta3_group_subject->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta3_group_subjectJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - - v1beta3_group_subject_local_var = v1beta3_group_subject_create ( - strdup(name->valuestring) - ); - - return v1beta3_group_subject_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_group_subject.h b/kubernetes/model/v1beta3_group_subject.h deleted file mode 100644 index 1fd87d1c..00000000 --- a/kubernetes/model/v1beta3_group_subject.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1beta3_group_subject.h - * - * GroupSubject holds detailed information for group-kind subject. - */ - -#ifndef _v1beta3_group_subject_H_ -#define _v1beta3_group_subject_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_group_subject_t v1beta3_group_subject_t; - - - - -typedef struct v1beta3_group_subject_t { - char *name; // string - -} v1beta3_group_subject_t; - -v1beta3_group_subject_t *v1beta3_group_subject_create( - char *name -); - -void v1beta3_group_subject_free(v1beta3_group_subject_t *v1beta3_group_subject); - -v1beta3_group_subject_t *v1beta3_group_subject_parseFromJSON(cJSON *v1beta3_group_subjectJSON); - -cJSON *v1beta3_group_subject_convertToJSON(v1beta3_group_subject_t *v1beta3_group_subject); - -#endif /* _v1beta3_group_subject_H_ */ - diff --git a/kubernetes/model/v1beta3_limit_response.c b/kubernetes/model/v1beta3_limit_response.c deleted file mode 100644 index f2020916..00000000 --- a/kubernetes/model/v1beta3_limit_response.c +++ /dev/null @@ -1,110 +0,0 @@ -#include -#include -#include -#include "v1beta3_limit_response.h" - - - -v1beta3_limit_response_t *v1beta3_limit_response_create( - v1beta3_queuing_configuration_t *queuing, - char *type - ) { - v1beta3_limit_response_t *v1beta3_limit_response_local_var = malloc(sizeof(v1beta3_limit_response_t)); - if (!v1beta3_limit_response_local_var) { - return NULL; - } - v1beta3_limit_response_local_var->queuing = queuing; - v1beta3_limit_response_local_var->type = type; - - return v1beta3_limit_response_local_var; -} - - -void v1beta3_limit_response_free(v1beta3_limit_response_t *v1beta3_limit_response) { - if(NULL == v1beta3_limit_response){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_limit_response->queuing) { - v1beta3_queuing_configuration_free(v1beta3_limit_response->queuing); - v1beta3_limit_response->queuing = NULL; - } - if (v1beta3_limit_response->type) { - free(v1beta3_limit_response->type); - v1beta3_limit_response->type = NULL; - } - free(v1beta3_limit_response); -} - -cJSON *v1beta3_limit_response_convertToJSON(v1beta3_limit_response_t *v1beta3_limit_response) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_limit_response->queuing - if(v1beta3_limit_response->queuing) { - cJSON *queuing_local_JSON = v1beta3_queuing_configuration_convertToJSON(v1beta3_limit_response->queuing); - if(queuing_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "queuing", queuing_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_limit_response->type - if (!v1beta3_limit_response->type) { - goto fail; - } - if(cJSON_AddStringToObject(item, "type", v1beta3_limit_response->type) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_limit_response_t *v1beta3_limit_response_parseFromJSON(cJSON *v1beta3_limit_responseJSON){ - - v1beta3_limit_response_t *v1beta3_limit_response_local_var = NULL; - - // define the local variable for v1beta3_limit_response->queuing - v1beta3_queuing_configuration_t *queuing_local_nonprim = NULL; - - // v1beta3_limit_response->queuing - cJSON *queuing = cJSON_GetObjectItemCaseSensitive(v1beta3_limit_responseJSON, "queuing"); - if (queuing) { - queuing_local_nonprim = v1beta3_queuing_configuration_parseFromJSON(queuing); //nonprimitive - } - - // v1beta3_limit_response->type - cJSON *type = cJSON_GetObjectItemCaseSensitive(v1beta3_limit_responseJSON, "type"); - if (!type) { - goto end; - } - - - if(!cJSON_IsString(type)) - { - goto end; //String - } - - - v1beta3_limit_response_local_var = v1beta3_limit_response_create ( - queuing ? queuing_local_nonprim : NULL, - strdup(type->valuestring) - ); - - return v1beta3_limit_response_local_var; -end: - if (queuing_local_nonprim) { - v1beta3_queuing_configuration_free(queuing_local_nonprim); - queuing_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_limit_response.h b/kubernetes/model/v1beta3_limit_response.h deleted file mode 100644 index 6a3e3b8e..00000000 --- a/kubernetes/model/v1beta3_limit_response.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * v1beta3_limit_response.h - * - * LimitResponse defines how to handle requests that can not be executed right now. - */ - -#ifndef _v1beta3_limit_response_H_ -#define _v1beta3_limit_response_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_limit_response_t v1beta3_limit_response_t; - -#include "v1beta3_queuing_configuration.h" - - - -typedef struct v1beta3_limit_response_t { - struct v1beta3_queuing_configuration_t *queuing; //model - char *type; // string - -} v1beta3_limit_response_t; - -v1beta3_limit_response_t *v1beta3_limit_response_create( - v1beta3_queuing_configuration_t *queuing, - char *type -); - -void v1beta3_limit_response_free(v1beta3_limit_response_t *v1beta3_limit_response); - -v1beta3_limit_response_t *v1beta3_limit_response_parseFromJSON(cJSON *v1beta3_limit_responseJSON); - -cJSON *v1beta3_limit_response_convertToJSON(v1beta3_limit_response_t *v1beta3_limit_response); - -#endif /* _v1beta3_limit_response_H_ */ - diff --git a/kubernetes/model/v1beta3_limited_priority_level_configuration.c b/kubernetes/model/v1beta3_limited_priority_level_configuration.c deleted file mode 100644 index f1701c81..00000000 --- a/kubernetes/model/v1beta3_limited_priority_level_configuration.c +++ /dev/null @@ -1,142 +0,0 @@ -#include -#include -#include -#include "v1beta3_limited_priority_level_configuration.h" - - - -v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration_create( - int borrowing_limit_percent, - int lendable_percent, - v1beta3_limit_response_t *limit_response, - int nominal_concurrency_shares - ) { - v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration_local_var = malloc(sizeof(v1beta3_limited_priority_level_configuration_t)); - if (!v1beta3_limited_priority_level_configuration_local_var) { - return NULL; - } - v1beta3_limited_priority_level_configuration_local_var->borrowing_limit_percent = borrowing_limit_percent; - v1beta3_limited_priority_level_configuration_local_var->lendable_percent = lendable_percent; - v1beta3_limited_priority_level_configuration_local_var->limit_response = limit_response; - v1beta3_limited_priority_level_configuration_local_var->nominal_concurrency_shares = nominal_concurrency_shares; - - return v1beta3_limited_priority_level_configuration_local_var; -} - - -void v1beta3_limited_priority_level_configuration_free(v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration) { - if(NULL == v1beta3_limited_priority_level_configuration){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_limited_priority_level_configuration->limit_response) { - v1beta3_limit_response_free(v1beta3_limited_priority_level_configuration->limit_response); - v1beta3_limited_priority_level_configuration->limit_response = NULL; - } - free(v1beta3_limited_priority_level_configuration); -} - -cJSON *v1beta3_limited_priority_level_configuration_convertToJSON(v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_limited_priority_level_configuration->borrowing_limit_percent - if(v1beta3_limited_priority_level_configuration->borrowing_limit_percent) { - if(cJSON_AddNumberToObject(item, "borrowingLimitPercent", v1beta3_limited_priority_level_configuration->borrowing_limit_percent) == NULL) { - goto fail; //Numeric - } - } - - - // v1beta3_limited_priority_level_configuration->lendable_percent - if(v1beta3_limited_priority_level_configuration->lendable_percent) { - if(cJSON_AddNumberToObject(item, "lendablePercent", v1beta3_limited_priority_level_configuration->lendable_percent) == NULL) { - goto fail; //Numeric - } - } - - - // v1beta3_limited_priority_level_configuration->limit_response - if(v1beta3_limited_priority_level_configuration->limit_response) { - cJSON *limit_response_local_JSON = v1beta3_limit_response_convertToJSON(v1beta3_limited_priority_level_configuration->limit_response); - if(limit_response_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "limitResponse", limit_response_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_limited_priority_level_configuration->nominal_concurrency_shares - if(v1beta3_limited_priority_level_configuration->nominal_concurrency_shares) { - if(cJSON_AddNumberToObject(item, "nominalConcurrencyShares", v1beta3_limited_priority_level_configuration->nominal_concurrency_shares) == NULL) { - goto fail; //Numeric - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration_parseFromJSON(cJSON *v1beta3_limited_priority_level_configurationJSON){ - - v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration_local_var = NULL; - - // define the local variable for v1beta3_limited_priority_level_configuration->limit_response - v1beta3_limit_response_t *limit_response_local_nonprim = NULL; - - // v1beta3_limited_priority_level_configuration->borrowing_limit_percent - cJSON *borrowing_limit_percent = cJSON_GetObjectItemCaseSensitive(v1beta3_limited_priority_level_configurationJSON, "borrowingLimitPercent"); - if (borrowing_limit_percent) { - if(!cJSON_IsNumber(borrowing_limit_percent)) - { - goto end; //Numeric - } - } - - // v1beta3_limited_priority_level_configuration->lendable_percent - cJSON *lendable_percent = cJSON_GetObjectItemCaseSensitive(v1beta3_limited_priority_level_configurationJSON, "lendablePercent"); - if (lendable_percent) { - if(!cJSON_IsNumber(lendable_percent)) - { - goto end; //Numeric - } - } - - // v1beta3_limited_priority_level_configuration->limit_response - cJSON *limit_response = cJSON_GetObjectItemCaseSensitive(v1beta3_limited_priority_level_configurationJSON, "limitResponse"); - if (limit_response) { - limit_response_local_nonprim = v1beta3_limit_response_parseFromJSON(limit_response); //nonprimitive - } - - // v1beta3_limited_priority_level_configuration->nominal_concurrency_shares - cJSON *nominal_concurrency_shares = cJSON_GetObjectItemCaseSensitive(v1beta3_limited_priority_level_configurationJSON, "nominalConcurrencyShares"); - if (nominal_concurrency_shares) { - if(!cJSON_IsNumber(nominal_concurrency_shares)) - { - goto end; //Numeric - } - } - - - v1beta3_limited_priority_level_configuration_local_var = v1beta3_limited_priority_level_configuration_create ( - borrowing_limit_percent ? borrowing_limit_percent->valuedouble : 0, - lendable_percent ? lendable_percent->valuedouble : 0, - limit_response ? limit_response_local_nonprim : NULL, - nominal_concurrency_shares ? nominal_concurrency_shares->valuedouble : 0 - ); - - return v1beta3_limited_priority_level_configuration_local_var; -end: - if (limit_response_local_nonprim) { - v1beta3_limit_response_free(limit_response_local_nonprim); - limit_response_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_limited_priority_level_configuration.h b/kubernetes/model/v1beta3_limited_priority_level_configuration.h deleted file mode 100644 index 5ae3f652..00000000 --- a/kubernetes/model/v1beta3_limited_priority_level_configuration.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * v1beta3_limited_priority_level_configuration.h - * - * LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues: - How are requests for this priority level limited? - What should be done with requests that exceed the limit? - */ - -#ifndef _v1beta3_limited_priority_level_configuration_H_ -#define _v1beta3_limited_priority_level_configuration_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_limited_priority_level_configuration_t v1beta3_limited_priority_level_configuration_t; - -#include "v1beta3_limit_response.h" - - - -typedef struct v1beta3_limited_priority_level_configuration_t { - int borrowing_limit_percent; //numeric - int lendable_percent; //numeric - struct v1beta3_limit_response_t *limit_response; //model - int nominal_concurrency_shares; //numeric - -} v1beta3_limited_priority_level_configuration_t; - -v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration_create( - int borrowing_limit_percent, - int lendable_percent, - v1beta3_limit_response_t *limit_response, - int nominal_concurrency_shares -); - -void v1beta3_limited_priority_level_configuration_free(v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration); - -v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration_parseFromJSON(cJSON *v1beta3_limited_priority_level_configurationJSON); - -cJSON *v1beta3_limited_priority_level_configuration_convertToJSON(v1beta3_limited_priority_level_configuration_t *v1beta3_limited_priority_level_configuration); - -#endif /* _v1beta3_limited_priority_level_configuration_H_ */ - diff --git a/kubernetes/model/v1beta3_non_resource_policy_rule.c b/kubernetes/model/v1beta3_non_resource_policy_rule.c deleted file mode 100644 index 5366f118..00000000 --- a/kubernetes/model/v1beta3_non_resource_policy_rule.c +++ /dev/null @@ -1,173 +0,0 @@ -#include -#include -#include -#include "v1beta3_non_resource_policy_rule.h" - - - -v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule_create( - list_t *non_resource_urls, - list_t *verbs - ) { - v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule_local_var = malloc(sizeof(v1beta3_non_resource_policy_rule_t)); - if (!v1beta3_non_resource_policy_rule_local_var) { - return NULL; - } - v1beta3_non_resource_policy_rule_local_var->non_resource_urls = non_resource_urls; - v1beta3_non_resource_policy_rule_local_var->verbs = verbs; - - return v1beta3_non_resource_policy_rule_local_var; -} - - -void v1beta3_non_resource_policy_rule_free(v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule) { - if(NULL == v1beta3_non_resource_policy_rule){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_non_resource_policy_rule->non_resource_urls) { - list_ForEach(listEntry, v1beta3_non_resource_policy_rule->non_resource_urls) { - free(listEntry->data); - } - list_freeList(v1beta3_non_resource_policy_rule->non_resource_urls); - v1beta3_non_resource_policy_rule->non_resource_urls = NULL; - } - if (v1beta3_non_resource_policy_rule->verbs) { - list_ForEach(listEntry, v1beta3_non_resource_policy_rule->verbs) { - free(listEntry->data); - } - list_freeList(v1beta3_non_resource_policy_rule->verbs); - v1beta3_non_resource_policy_rule->verbs = NULL; - } - free(v1beta3_non_resource_policy_rule); -} - -cJSON *v1beta3_non_resource_policy_rule_convertToJSON(v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_non_resource_policy_rule->non_resource_urls - if (!v1beta3_non_resource_policy_rule->non_resource_urls) { - goto fail; - } - cJSON *non_resource_urls = cJSON_AddArrayToObject(item, "nonResourceURLs"); - if(non_resource_urls == NULL) { - goto fail; //primitive container - } - - listEntry_t *non_resource_urlsListEntry; - list_ForEach(non_resource_urlsListEntry, v1beta3_non_resource_policy_rule->non_resource_urls) { - if(cJSON_AddStringToObject(non_resource_urls, "", (char*)non_resource_urlsListEntry->data) == NULL) - { - goto fail; - } - } - - - // v1beta3_non_resource_policy_rule->verbs - if (!v1beta3_non_resource_policy_rule->verbs) { - goto fail; - } - cJSON *verbs = cJSON_AddArrayToObject(item, "verbs"); - if(verbs == NULL) { - goto fail; //primitive container - } - - listEntry_t *verbsListEntry; - list_ForEach(verbsListEntry, v1beta3_non_resource_policy_rule->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) - { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule_parseFromJSON(cJSON *v1beta3_non_resource_policy_ruleJSON){ - - v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule_local_var = NULL; - - // define the local list for v1beta3_non_resource_policy_rule->non_resource_urls - list_t *non_resource_urlsList = NULL; - - // define the local list for v1beta3_non_resource_policy_rule->verbs - list_t *verbsList = NULL; - - // v1beta3_non_resource_policy_rule->non_resource_urls - cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1beta3_non_resource_policy_ruleJSON, "nonResourceURLs"); - if (!non_resource_urls) { - goto end; - } - - - cJSON *non_resource_urls_local = NULL; - if(!cJSON_IsArray(non_resource_urls)) { - goto end;//primitive container - } - non_resource_urlsList = list_createList(); - - cJSON_ArrayForEach(non_resource_urls_local, non_resource_urls) - { - if(!cJSON_IsString(non_resource_urls_local)) - { - goto end; - } - list_addElement(non_resource_urlsList , strdup(non_resource_urls_local->valuestring)); - } - - // v1beta3_non_resource_policy_rule->verbs - cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1beta3_non_resource_policy_ruleJSON, "verbs"); - if (!verbs) { - goto end; - } - - - cJSON *verbs_local = NULL; - if(!cJSON_IsArray(verbs)) { - goto end;//primitive container - } - verbsList = list_createList(); - - cJSON_ArrayForEach(verbs_local, verbs) - { - if(!cJSON_IsString(verbs_local)) - { - goto end; - } - list_addElement(verbsList , strdup(verbs_local->valuestring)); - } - - - v1beta3_non_resource_policy_rule_local_var = v1beta3_non_resource_policy_rule_create ( - non_resource_urlsList, - verbsList - ); - - return v1beta3_non_resource_policy_rule_local_var; -end: - if (non_resource_urlsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, non_resource_urlsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(non_resource_urlsList); - non_resource_urlsList = NULL; - } - if (verbsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, verbsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(verbsList); - verbsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_non_resource_policy_rule.h b/kubernetes/model/v1beta3_non_resource_policy_rule.h deleted file mode 100644 index 7ed6327e..00000000 --- a/kubernetes/model/v1beta3_non_resource_policy_rule.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1beta3_non_resource_policy_rule.h - * - * NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request. - */ - -#ifndef _v1beta3_non_resource_policy_rule_H_ -#define _v1beta3_non_resource_policy_rule_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_non_resource_policy_rule_t v1beta3_non_resource_policy_rule_t; - - - - -typedef struct v1beta3_non_resource_policy_rule_t { - list_t *non_resource_urls; //primitive container - list_t *verbs; //primitive container - -} v1beta3_non_resource_policy_rule_t; - -v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule_create( - list_t *non_resource_urls, - list_t *verbs -); - -void v1beta3_non_resource_policy_rule_free(v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule); - -v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule_parseFromJSON(cJSON *v1beta3_non_resource_policy_ruleJSON); - -cJSON *v1beta3_non_resource_policy_rule_convertToJSON(v1beta3_non_resource_policy_rule_t *v1beta3_non_resource_policy_rule); - -#endif /* _v1beta3_non_resource_policy_rule_H_ */ - diff --git a/kubernetes/model/v1beta3_policy_rules_with_subjects.c b/kubernetes/model/v1beta3_policy_rules_with_subjects.c deleted file mode 100644 index dbd8b7a3..00000000 --- a/kubernetes/model/v1beta3_policy_rules_with_subjects.c +++ /dev/null @@ -1,242 +0,0 @@ -#include -#include -#include -#include "v1beta3_policy_rules_with_subjects.h" - - - -v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects_create( - list_t *non_resource_rules, - list_t *resource_rules, - list_t *subjects - ) { - v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects_local_var = malloc(sizeof(v1beta3_policy_rules_with_subjects_t)); - if (!v1beta3_policy_rules_with_subjects_local_var) { - return NULL; - } - v1beta3_policy_rules_with_subjects_local_var->non_resource_rules = non_resource_rules; - v1beta3_policy_rules_with_subjects_local_var->resource_rules = resource_rules; - v1beta3_policy_rules_with_subjects_local_var->subjects = subjects; - - return v1beta3_policy_rules_with_subjects_local_var; -} - - -void v1beta3_policy_rules_with_subjects_free(v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects) { - if(NULL == v1beta3_policy_rules_with_subjects){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_policy_rules_with_subjects->non_resource_rules) { - list_ForEach(listEntry, v1beta3_policy_rules_with_subjects->non_resource_rules) { - v1beta3_non_resource_policy_rule_free(listEntry->data); - } - list_freeList(v1beta3_policy_rules_with_subjects->non_resource_rules); - v1beta3_policy_rules_with_subjects->non_resource_rules = NULL; - } - if (v1beta3_policy_rules_with_subjects->resource_rules) { - list_ForEach(listEntry, v1beta3_policy_rules_with_subjects->resource_rules) { - v1beta3_resource_policy_rule_free(listEntry->data); - } - list_freeList(v1beta3_policy_rules_with_subjects->resource_rules); - v1beta3_policy_rules_with_subjects->resource_rules = NULL; - } - if (v1beta3_policy_rules_with_subjects->subjects) { - list_ForEach(listEntry, v1beta3_policy_rules_with_subjects->subjects) { - v1beta3_subject_free(listEntry->data); - } - list_freeList(v1beta3_policy_rules_with_subjects->subjects); - v1beta3_policy_rules_with_subjects->subjects = NULL; - } - free(v1beta3_policy_rules_with_subjects); -} - -cJSON *v1beta3_policy_rules_with_subjects_convertToJSON(v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_policy_rules_with_subjects->non_resource_rules - if(v1beta3_policy_rules_with_subjects->non_resource_rules) { - cJSON *non_resource_rules = cJSON_AddArrayToObject(item, "nonResourceRules"); - if(non_resource_rules == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *non_resource_rulesListEntry; - if (v1beta3_policy_rules_with_subjects->non_resource_rules) { - list_ForEach(non_resource_rulesListEntry, v1beta3_policy_rules_with_subjects->non_resource_rules) { - cJSON *itemLocal = v1beta3_non_resource_policy_rule_convertToJSON(non_resource_rulesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(non_resource_rules, itemLocal); - } - } - } - - - // v1beta3_policy_rules_with_subjects->resource_rules - if(v1beta3_policy_rules_with_subjects->resource_rules) { - cJSON *resource_rules = cJSON_AddArrayToObject(item, "resourceRules"); - if(resource_rules == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *resource_rulesListEntry; - if (v1beta3_policy_rules_with_subjects->resource_rules) { - list_ForEach(resource_rulesListEntry, v1beta3_policy_rules_with_subjects->resource_rules) { - cJSON *itemLocal = v1beta3_resource_policy_rule_convertToJSON(resource_rulesListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(resource_rules, itemLocal); - } - } - } - - - // v1beta3_policy_rules_with_subjects->subjects - if (!v1beta3_policy_rules_with_subjects->subjects) { - goto fail; - } - cJSON *subjects = cJSON_AddArrayToObject(item, "subjects"); - if(subjects == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *subjectsListEntry; - if (v1beta3_policy_rules_with_subjects->subjects) { - list_ForEach(subjectsListEntry, v1beta3_policy_rules_with_subjects->subjects) { - cJSON *itemLocal = v1beta3_subject_convertToJSON(subjectsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(subjects, itemLocal); - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects_parseFromJSON(cJSON *v1beta3_policy_rules_with_subjectsJSON){ - - v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects_local_var = NULL; - - // define the local list for v1beta3_policy_rules_with_subjects->non_resource_rules - list_t *non_resource_rulesList = NULL; - - // define the local list for v1beta3_policy_rules_with_subjects->resource_rules - list_t *resource_rulesList = NULL; - - // define the local list for v1beta3_policy_rules_with_subjects->subjects - list_t *subjectsList = NULL; - - // v1beta3_policy_rules_with_subjects->non_resource_rules - cJSON *non_resource_rules = cJSON_GetObjectItemCaseSensitive(v1beta3_policy_rules_with_subjectsJSON, "nonResourceRules"); - if (non_resource_rules) { - cJSON *non_resource_rules_local_nonprimitive = NULL; - if(!cJSON_IsArray(non_resource_rules)){ - goto end; //nonprimitive container - } - - non_resource_rulesList = list_createList(); - - cJSON_ArrayForEach(non_resource_rules_local_nonprimitive,non_resource_rules ) - { - if(!cJSON_IsObject(non_resource_rules_local_nonprimitive)){ - goto end; - } - v1beta3_non_resource_policy_rule_t *non_resource_rulesItem = v1beta3_non_resource_policy_rule_parseFromJSON(non_resource_rules_local_nonprimitive); - - list_addElement(non_resource_rulesList, non_resource_rulesItem); - } - } - - // v1beta3_policy_rules_with_subjects->resource_rules - cJSON *resource_rules = cJSON_GetObjectItemCaseSensitive(v1beta3_policy_rules_with_subjectsJSON, "resourceRules"); - if (resource_rules) { - cJSON *resource_rules_local_nonprimitive = NULL; - if(!cJSON_IsArray(resource_rules)){ - goto end; //nonprimitive container - } - - resource_rulesList = list_createList(); - - cJSON_ArrayForEach(resource_rules_local_nonprimitive,resource_rules ) - { - if(!cJSON_IsObject(resource_rules_local_nonprimitive)){ - goto end; - } - v1beta3_resource_policy_rule_t *resource_rulesItem = v1beta3_resource_policy_rule_parseFromJSON(resource_rules_local_nonprimitive); - - list_addElement(resource_rulesList, resource_rulesItem); - } - } - - // v1beta3_policy_rules_with_subjects->subjects - cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1beta3_policy_rules_with_subjectsJSON, "subjects"); - if (!subjects) { - goto end; - } - - - cJSON *subjects_local_nonprimitive = NULL; - if(!cJSON_IsArray(subjects)){ - goto end; //nonprimitive container - } - - subjectsList = list_createList(); - - cJSON_ArrayForEach(subjects_local_nonprimitive,subjects ) - { - if(!cJSON_IsObject(subjects_local_nonprimitive)){ - goto end; - } - v1beta3_subject_t *subjectsItem = v1beta3_subject_parseFromJSON(subjects_local_nonprimitive); - - list_addElement(subjectsList, subjectsItem); - } - - - v1beta3_policy_rules_with_subjects_local_var = v1beta3_policy_rules_with_subjects_create ( - non_resource_rules ? non_resource_rulesList : NULL, - resource_rules ? resource_rulesList : NULL, - subjectsList - ); - - return v1beta3_policy_rules_with_subjects_local_var; -end: - if (non_resource_rulesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, non_resource_rulesList) { - v1beta3_non_resource_policy_rule_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(non_resource_rulesList); - non_resource_rulesList = NULL; - } - if (resource_rulesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, resource_rulesList) { - v1beta3_resource_policy_rule_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(resource_rulesList); - resource_rulesList = NULL; - } - if (subjectsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, subjectsList) { - v1beta3_subject_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(subjectsList); - subjectsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_policy_rules_with_subjects.h b/kubernetes/model/v1beta3_policy_rules_with_subjects.h deleted file mode 100644 index d9fd811a..00000000 --- a/kubernetes/model/v1beta3_policy_rules_with_subjects.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * v1beta3_policy_rules_with_subjects.h - * - * PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request. - */ - -#ifndef _v1beta3_policy_rules_with_subjects_H_ -#define _v1beta3_policy_rules_with_subjects_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_policy_rules_with_subjects_t v1beta3_policy_rules_with_subjects_t; - -#include "v1beta3_non_resource_policy_rule.h" -#include "v1beta3_resource_policy_rule.h" -#include "v1beta3_subject.h" - - - -typedef struct v1beta3_policy_rules_with_subjects_t { - list_t *non_resource_rules; //nonprimitive container - list_t *resource_rules; //nonprimitive container - list_t *subjects; //nonprimitive container - -} v1beta3_policy_rules_with_subjects_t; - -v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects_create( - list_t *non_resource_rules, - list_t *resource_rules, - list_t *subjects -); - -void v1beta3_policy_rules_with_subjects_free(v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects); - -v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects_parseFromJSON(cJSON *v1beta3_policy_rules_with_subjectsJSON); - -cJSON *v1beta3_policy_rules_with_subjects_convertToJSON(v1beta3_policy_rules_with_subjects_t *v1beta3_policy_rules_with_subjects); - -#endif /* _v1beta3_policy_rules_with_subjects_H_ */ - diff --git a/kubernetes/model/v1beta3_priority_level_configuration.c b/kubernetes/model/v1beta3_priority_level_configuration.c deleted file mode 100644 index 1429a866..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration.c +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include -#include -#include "v1beta3_priority_level_configuration.h" - - - -v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta3_priority_level_configuration_spec_t *spec, - v1beta3_priority_level_configuration_status_t *status - ) { - v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration_local_var = malloc(sizeof(v1beta3_priority_level_configuration_t)); - if (!v1beta3_priority_level_configuration_local_var) { - return NULL; - } - v1beta3_priority_level_configuration_local_var->api_version = api_version; - v1beta3_priority_level_configuration_local_var->kind = kind; - v1beta3_priority_level_configuration_local_var->metadata = metadata; - v1beta3_priority_level_configuration_local_var->spec = spec; - v1beta3_priority_level_configuration_local_var->status = status; - - return v1beta3_priority_level_configuration_local_var; -} - - -void v1beta3_priority_level_configuration_free(v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration) { - if(NULL == v1beta3_priority_level_configuration){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_priority_level_configuration->api_version) { - free(v1beta3_priority_level_configuration->api_version); - v1beta3_priority_level_configuration->api_version = NULL; - } - if (v1beta3_priority_level_configuration->kind) { - free(v1beta3_priority_level_configuration->kind); - v1beta3_priority_level_configuration->kind = NULL; - } - if (v1beta3_priority_level_configuration->metadata) { - v1_object_meta_free(v1beta3_priority_level_configuration->metadata); - v1beta3_priority_level_configuration->metadata = NULL; - } - if (v1beta3_priority_level_configuration->spec) { - v1beta3_priority_level_configuration_spec_free(v1beta3_priority_level_configuration->spec); - v1beta3_priority_level_configuration->spec = NULL; - } - if (v1beta3_priority_level_configuration->status) { - v1beta3_priority_level_configuration_status_free(v1beta3_priority_level_configuration->status); - v1beta3_priority_level_configuration->status = NULL; - } - free(v1beta3_priority_level_configuration); -} - -cJSON *v1beta3_priority_level_configuration_convertToJSON(v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_priority_level_configuration->api_version - if(v1beta3_priority_level_configuration->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta3_priority_level_configuration->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta3_priority_level_configuration->kind - if(v1beta3_priority_level_configuration->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta3_priority_level_configuration->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta3_priority_level_configuration->metadata - if(v1beta3_priority_level_configuration->metadata) { - cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v1beta3_priority_level_configuration->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_priority_level_configuration->spec - if(v1beta3_priority_level_configuration->spec) { - cJSON *spec_local_JSON = v1beta3_priority_level_configuration_spec_convertToJSON(v1beta3_priority_level_configuration->spec); - if(spec_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "spec", spec_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_priority_level_configuration->status - if(v1beta3_priority_level_configuration->status) { - cJSON *status_local_JSON = v1beta3_priority_level_configuration_status_convertToJSON(v1beta3_priority_level_configuration->status); - if(status_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "status", status_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration_parseFromJSON(cJSON *v1beta3_priority_level_configurationJSON){ - - v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration_local_var = NULL; - - // define the local variable for v1beta3_priority_level_configuration->metadata - v1_object_meta_t *metadata_local_nonprim = NULL; - - // define the local variable for v1beta3_priority_level_configuration->spec - v1beta3_priority_level_configuration_spec_t *spec_local_nonprim = NULL; - - // define the local variable for v1beta3_priority_level_configuration->status - v1beta3_priority_level_configuration_status_t *status_local_nonprim = NULL; - - // v1beta3_priority_level_configuration->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configurationJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta3_priority_level_configuration->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configurationJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta3_priority_level_configuration->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configurationJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive - } - - // v1beta3_priority_level_configuration->spec - cJSON *spec = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configurationJSON, "spec"); - if (spec) { - spec_local_nonprim = v1beta3_priority_level_configuration_spec_parseFromJSON(spec); //nonprimitive - } - - // v1beta3_priority_level_configuration->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configurationJSON, "status"); - if (status) { - status_local_nonprim = v1beta3_priority_level_configuration_status_parseFromJSON(status); //nonprimitive - } - - - v1beta3_priority_level_configuration_local_var = v1beta3_priority_level_configuration_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL, - spec ? spec_local_nonprim : NULL, - status ? status_local_nonprim : NULL - ); - - return v1beta3_priority_level_configuration_local_var; -end: - if (metadata_local_nonprim) { - v1_object_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - if (spec_local_nonprim) { - v1beta3_priority_level_configuration_spec_free(spec_local_nonprim); - spec_local_nonprim = NULL; - } - if (status_local_nonprim) { - v1beta3_priority_level_configuration_status_free(status_local_nonprim); - status_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_priority_level_configuration.h b/kubernetes/model/v1beta3_priority_level_configuration.h deleted file mode 100644 index 6890420c..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * v1beta3_priority_level_configuration.h - * - * PriorityLevelConfiguration represents the configuration of a priority level. - */ - -#ifndef _v1beta3_priority_level_configuration_H_ -#define _v1beta3_priority_level_configuration_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_priority_level_configuration_t v1beta3_priority_level_configuration_t; - -#include "v1_object_meta.h" -#include "v1beta3_priority_level_configuration_spec.h" -#include "v1beta3_priority_level_configuration_status.h" - - - -typedef struct v1beta3_priority_level_configuration_t { - char *api_version; // string - char *kind; // string - struct v1_object_meta_t *metadata; //model - struct v1beta3_priority_level_configuration_spec_t *spec; //model - struct v1beta3_priority_level_configuration_status_t *status; //model - -} v1beta3_priority_level_configuration_t; - -v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration_create( - char *api_version, - char *kind, - v1_object_meta_t *metadata, - v1beta3_priority_level_configuration_spec_t *spec, - v1beta3_priority_level_configuration_status_t *status -); - -void v1beta3_priority_level_configuration_free(v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration); - -v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration_parseFromJSON(cJSON *v1beta3_priority_level_configurationJSON); - -cJSON *v1beta3_priority_level_configuration_convertToJSON(v1beta3_priority_level_configuration_t *v1beta3_priority_level_configuration); - -#endif /* _v1beta3_priority_level_configuration_H_ */ - diff --git a/kubernetes/model/v1beta3_priority_level_configuration_condition.c b/kubernetes/model/v1beta3_priority_level_configuration_condition.c deleted file mode 100644 index 1b2c62eb..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_condition.c +++ /dev/null @@ -1,169 +0,0 @@ -#include -#include -#include -#include "v1beta3_priority_level_configuration_condition.h" - - - -v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition_create( - char *last_transition_time, - char *message, - char *reason, - char *status, - char *type - ) { - v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition_local_var = malloc(sizeof(v1beta3_priority_level_configuration_condition_t)); - if (!v1beta3_priority_level_configuration_condition_local_var) { - return NULL; - } - v1beta3_priority_level_configuration_condition_local_var->last_transition_time = last_transition_time; - v1beta3_priority_level_configuration_condition_local_var->message = message; - v1beta3_priority_level_configuration_condition_local_var->reason = reason; - v1beta3_priority_level_configuration_condition_local_var->status = status; - v1beta3_priority_level_configuration_condition_local_var->type = type; - - return v1beta3_priority_level_configuration_condition_local_var; -} - - -void v1beta3_priority_level_configuration_condition_free(v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition) { - if(NULL == v1beta3_priority_level_configuration_condition){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_priority_level_configuration_condition->last_transition_time) { - free(v1beta3_priority_level_configuration_condition->last_transition_time); - v1beta3_priority_level_configuration_condition->last_transition_time = NULL; - } - if (v1beta3_priority_level_configuration_condition->message) { - free(v1beta3_priority_level_configuration_condition->message); - v1beta3_priority_level_configuration_condition->message = NULL; - } - if (v1beta3_priority_level_configuration_condition->reason) { - free(v1beta3_priority_level_configuration_condition->reason); - v1beta3_priority_level_configuration_condition->reason = NULL; - } - if (v1beta3_priority_level_configuration_condition->status) { - free(v1beta3_priority_level_configuration_condition->status); - v1beta3_priority_level_configuration_condition->status = NULL; - } - if (v1beta3_priority_level_configuration_condition->type) { - free(v1beta3_priority_level_configuration_condition->type); - v1beta3_priority_level_configuration_condition->type = NULL; - } - free(v1beta3_priority_level_configuration_condition); -} - -cJSON *v1beta3_priority_level_configuration_condition_convertToJSON(v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_priority_level_configuration_condition->last_transition_time - if(v1beta3_priority_level_configuration_condition->last_transition_time) { - if(cJSON_AddStringToObject(item, "lastTransitionTime", v1beta3_priority_level_configuration_condition->last_transition_time) == NULL) { - goto fail; //Date-Time - } - } - - - // v1beta3_priority_level_configuration_condition->message - if(v1beta3_priority_level_configuration_condition->message) { - if(cJSON_AddStringToObject(item, "message", v1beta3_priority_level_configuration_condition->message) == NULL) { - goto fail; //String - } - } - - - // v1beta3_priority_level_configuration_condition->reason - if(v1beta3_priority_level_configuration_condition->reason) { - if(cJSON_AddStringToObject(item, "reason", v1beta3_priority_level_configuration_condition->reason) == NULL) { - goto fail; //String - } - } - - - // v1beta3_priority_level_configuration_condition->status - if(v1beta3_priority_level_configuration_condition->status) { - if(cJSON_AddStringToObject(item, "status", v1beta3_priority_level_configuration_condition->status) == NULL) { - goto fail; //String - } - } - - - // v1beta3_priority_level_configuration_condition->type - if(v1beta3_priority_level_configuration_condition->type) { - if(cJSON_AddStringToObject(item, "type", v1beta3_priority_level_configuration_condition->type) == NULL) { - goto fail; //String - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition_parseFromJSON(cJSON *v1beta3_priority_level_configuration_conditionJSON){ - - v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition_local_var = NULL; - - // v1beta3_priority_level_configuration_condition->last_transition_time - cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_conditionJSON, "lastTransitionTime"); - if (last_transition_time) { - if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) - { - goto end; //DateTime - } - } - - // v1beta3_priority_level_configuration_condition->message - cJSON *message = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_conditionJSON, "message"); - if (message) { - if(!cJSON_IsString(message) && !cJSON_IsNull(message)) - { - goto end; //String - } - } - - // v1beta3_priority_level_configuration_condition->reason - cJSON *reason = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_conditionJSON, "reason"); - if (reason) { - if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) - { - goto end; //String - } - } - - // v1beta3_priority_level_configuration_condition->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_conditionJSON, "status"); - if (status) { - if(!cJSON_IsString(status) && !cJSON_IsNull(status)) - { - goto end; //String - } - } - - // v1beta3_priority_level_configuration_condition->type - cJSON *type = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_conditionJSON, "type"); - if (type) { - if(!cJSON_IsString(type) && !cJSON_IsNull(type)) - { - goto end; //String - } - } - - - v1beta3_priority_level_configuration_condition_local_var = v1beta3_priority_level_configuration_condition_create ( - last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, - message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, - reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, - status && !cJSON_IsNull(status) ? strdup(status->valuestring) : NULL, - type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL - ); - - return v1beta3_priority_level_configuration_condition_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_priority_level_configuration_condition.h b/kubernetes/model/v1beta3_priority_level_configuration_condition.h deleted file mode 100644 index ae63f55a..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_condition.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta3_priority_level_configuration_condition.h - * - * PriorityLevelConfigurationCondition defines the condition of priority level. - */ - -#ifndef _v1beta3_priority_level_configuration_condition_H_ -#define _v1beta3_priority_level_configuration_condition_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_priority_level_configuration_condition_t v1beta3_priority_level_configuration_condition_t; - - - - -typedef struct v1beta3_priority_level_configuration_condition_t { - char *last_transition_time; //date time - char *message; // string - char *reason; // string - char *status; // string - char *type; // string - -} v1beta3_priority_level_configuration_condition_t; - -v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition_create( - char *last_transition_time, - char *message, - char *reason, - char *status, - char *type -); - -void v1beta3_priority_level_configuration_condition_free(v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition); - -v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition_parseFromJSON(cJSON *v1beta3_priority_level_configuration_conditionJSON); - -cJSON *v1beta3_priority_level_configuration_condition_convertToJSON(v1beta3_priority_level_configuration_condition_t *v1beta3_priority_level_configuration_condition); - -#endif /* _v1beta3_priority_level_configuration_condition_H_ */ - diff --git a/kubernetes/model/v1beta3_priority_level_configuration_list.c b/kubernetes/model/v1beta3_priority_level_configuration_list.c deleted file mode 100644 index 4f4c86a2..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_list.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include "v1beta3_priority_level_configuration_list.h" - - - -v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata - ) { - v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list_local_var = malloc(sizeof(v1beta3_priority_level_configuration_list_t)); - if (!v1beta3_priority_level_configuration_list_local_var) { - return NULL; - } - v1beta3_priority_level_configuration_list_local_var->api_version = api_version; - v1beta3_priority_level_configuration_list_local_var->items = items; - v1beta3_priority_level_configuration_list_local_var->kind = kind; - v1beta3_priority_level_configuration_list_local_var->metadata = metadata; - - return v1beta3_priority_level_configuration_list_local_var; -} - - -void v1beta3_priority_level_configuration_list_free(v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list) { - if(NULL == v1beta3_priority_level_configuration_list){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_priority_level_configuration_list->api_version) { - free(v1beta3_priority_level_configuration_list->api_version); - v1beta3_priority_level_configuration_list->api_version = NULL; - } - if (v1beta3_priority_level_configuration_list->items) { - list_ForEach(listEntry, v1beta3_priority_level_configuration_list->items) { - v1beta3_priority_level_configuration_free(listEntry->data); - } - list_freeList(v1beta3_priority_level_configuration_list->items); - v1beta3_priority_level_configuration_list->items = NULL; - } - if (v1beta3_priority_level_configuration_list->kind) { - free(v1beta3_priority_level_configuration_list->kind); - v1beta3_priority_level_configuration_list->kind = NULL; - } - if (v1beta3_priority_level_configuration_list->metadata) { - v1_list_meta_free(v1beta3_priority_level_configuration_list->metadata); - v1beta3_priority_level_configuration_list->metadata = NULL; - } - free(v1beta3_priority_level_configuration_list); -} - -cJSON *v1beta3_priority_level_configuration_list_convertToJSON(v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_priority_level_configuration_list->api_version - if(v1beta3_priority_level_configuration_list->api_version) { - if(cJSON_AddStringToObject(item, "apiVersion", v1beta3_priority_level_configuration_list->api_version) == NULL) { - goto fail; //String - } - } - - - // v1beta3_priority_level_configuration_list->items - if (!v1beta3_priority_level_configuration_list->items) { - goto fail; - } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if(items == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *itemsListEntry; - if (v1beta3_priority_level_configuration_list->items) { - list_ForEach(itemsListEntry, v1beta3_priority_level_configuration_list->items) { - cJSON *itemLocal = v1beta3_priority_level_configuration_convertToJSON(itemsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(items, itemLocal); - } - } - - - // v1beta3_priority_level_configuration_list->kind - if(v1beta3_priority_level_configuration_list->kind) { - if(cJSON_AddStringToObject(item, "kind", v1beta3_priority_level_configuration_list->kind) == NULL) { - goto fail; //String - } - } - - - // v1beta3_priority_level_configuration_list->metadata - if(v1beta3_priority_level_configuration_list->metadata) { - cJSON *metadata_local_JSON = v1_list_meta_convertToJSON(v1beta3_priority_level_configuration_list->metadata); - if(metadata_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list_parseFromJSON(cJSON *v1beta3_priority_level_configuration_listJSON){ - - v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list_local_var = NULL; - - // define the local list for v1beta3_priority_level_configuration_list->items - list_t *itemsList = NULL; - - // define the local variable for v1beta3_priority_level_configuration_list->metadata - v1_list_meta_t *metadata_local_nonprim = NULL; - - // v1beta3_priority_level_configuration_list->api_version - cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_listJSON, "apiVersion"); - if (api_version) { - if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) - { - goto end; //String - } - } - - // v1beta3_priority_level_configuration_list->items - cJSON *items = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_listJSON, "items"); - if (!items) { - goto end; - } - - - cJSON *items_local_nonprimitive = NULL; - if(!cJSON_IsArray(items)){ - goto end; //nonprimitive container - } - - itemsList = list_createList(); - - cJSON_ArrayForEach(items_local_nonprimitive,items ) - { - if(!cJSON_IsObject(items_local_nonprimitive)){ - goto end; - } - v1beta3_priority_level_configuration_t *itemsItem = v1beta3_priority_level_configuration_parseFromJSON(items_local_nonprimitive); - - list_addElement(itemsList, itemsItem); - } - - // v1beta3_priority_level_configuration_list->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_listJSON, "kind"); - if (kind) { - if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) - { - goto end; //String - } - } - - // v1beta3_priority_level_configuration_list->metadata - cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_listJSON, "metadata"); - if (metadata) { - metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive - } - - - v1beta3_priority_level_configuration_list_local_var = v1beta3_priority_level_configuration_list_create ( - api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, - itemsList, - kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, - metadata ? metadata_local_nonprim : NULL - ); - - return v1beta3_priority_level_configuration_list_local_var; -end: - if (itemsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, itemsList) { - v1beta3_priority_level_configuration_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(itemsList); - itemsList = NULL; - } - if (metadata_local_nonprim) { - v1_list_meta_free(metadata_local_nonprim); - metadata_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_priority_level_configuration_list.h b/kubernetes/model/v1beta3_priority_level_configuration_list.h deleted file mode 100644 index 4e3a28a1..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_list.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta3_priority_level_configuration_list.h - * - * PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. - */ - -#ifndef _v1beta3_priority_level_configuration_list_H_ -#define _v1beta3_priority_level_configuration_list_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_priority_level_configuration_list_t v1beta3_priority_level_configuration_list_t; - -#include "v1_list_meta.h" -#include "v1beta3_priority_level_configuration.h" - - - -typedef struct v1beta3_priority_level_configuration_list_t { - char *api_version; // string - list_t *items; //nonprimitive container - char *kind; // string - struct v1_list_meta_t *metadata; //model - -} v1beta3_priority_level_configuration_list_t; - -v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list_create( - char *api_version, - list_t *items, - char *kind, - v1_list_meta_t *metadata -); - -void v1beta3_priority_level_configuration_list_free(v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list); - -v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list_parseFromJSON(cJSON *v1beta3_priority_level_configuration_listJSON); - -cJSON *v1beta3_priority_level_configuration_list_convertToJSON(v1beta3_priority_level_configuration_list_t *v1beta3_priority_level_configuration_list); - -#endif /* _v1beta3_priority_level_configuration_list_H_ */ - diff --git a/kubernetes/model/v1beta3_priority_level_configuration_reference.c b/kubernetes/model/v1beta3_priority_level_configuration_reference.c deleted file mode 100644 index 6323ee8c..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_reference.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1beta3_priority_level_configuration_reference.h" - - - -v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference_create( - char *name - ) { - v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference_local_var = malloc(sizeof(v1beta3_priority_level_configuration_reference_t)); - if (!v1beta3_priority_level_configuration_reference_local_var) { - return NULL; - } - v1beta3_priority_level_configuration_reference_local_var->name = name; - - return v1beta3_priority_level_configuration_reference_local_var; -} - - -void v1beta3_priority_level_configuration_reference_free(v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference) { - if(NULL == v1beta3_priority_level_configuration_reference){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_priority_level_configuration_reference->name) { - free(v1beta3_priority_level_configuration_reference->name); - v1beta3_priority_level_configuration_reference->name = NULL; - } - free(v1beta3_priority_level_configuration_reference); -} - -cJSON *v1beta3_priority_level_configuration_reference_convertToJSON(v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_priority_level_configuration_reference->name - if (!v1beta3_priority_level_configuration_reference->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1beta3_priority_level_configuration_reference->name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference_parseFromJSON(cJSON *v1beta3_priority_level_configuration_referenceJSON){ - - v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference_local_var = NULL; - - // v1beta3_priority_level_configuration_reference->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_referenceJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - - v1beta3_priority_level_configuration_reference_local_var = v1beta3_priority_level_configuration_reference_create ( - strdup(name->valuestring) - ); - - return v1beta3_priority_level_configuration_reference_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_priority_level_configuration_reference.h b/kubernetes/model/v1beta3_priority_level_configuration_reference.h deleted file mode 100644 index 599c95f8..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_reference.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1beta3_priority_level_configuration_reference.h - * - * PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used. - */ - -#ifndef _v1beta3_priority_level_configuration_reference_H_ -#define _v1beta3_priority_level_configuration_reference_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_priority_level_configuration_reference_t v1beta3_priority_level_configuration_reference_t; - - - - -typedef struct v1beta3_priority_level_configuration_reference_t { - char *name; // string - -} v1beta3_priority_level_configuration_reference_t; - -v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference_create( - char *name -); - -void v1beta3_priority_level_configuration_reference_free(v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference); - -v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference_parseFromJSON(cJSON *v1beta3_priority_level_configuration_referenceJSON); - -cJSON *v1beta3_priority_level_configuration_reference_convertToJSON(v1beta3_priority_level_configuration_reference_t *v1beta3_priority_level_configuration_reference); - -#endif /* _v1beta3_priority_level_configuration_reference_H_ */ - diff --git a/kubernetes/model/v1beta3_priority_level_configuration_spec.c b/kubernetes/model/v1beta3_priority_level_configuration_spec.c deleted file mode 100644 index bb8a1ed6..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_spec.c +++ /dev/null @@ -1,143 +0,0 @@ -#include -#include -#include -#include "v1beta3_priority_level_configuration_spec.h" - - - -v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec_create( - v1beta3_exempt_priority_level_configuration_t *exempt, - v1beta3_limited_priority_level_configuration_t *limited, - char *type - ) { - v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec_local_var = malloc(sizeof(v1beta3_priority_level_configuration_spec_t)); - if (!v1beta3_priority_level_configuration_spec_local_var) { - return NULL; - } - v1beta3_priority_level_configuration_spec_local_var->exempt = exempt; - v1beta3_priority_level_configuration_spec_local_var->limited = limited; - v1beta3_priority_level_configuration_spec_local_var->type = type; - - return v1beta3_priority_level_configuration_spec_local_var; -} - - -void v1beta3_priority_level_configuration_spec_free(v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec) { - if(NULL == v1beta3_priority_level_configuration_spec){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_priority_level_configuration_spec->exempt) { - v1beta3_exempt_priority_level_configuration_free(v1beta3_priority_level_configuration_spec->exempt); - v1beta3_priority_level_configuration_spec->exempt = NULL; - } - if (v1beta3_priority_level_configuration_spec->limited) { - v1beta3_limited_priority_level_configuration_free(v1beta3_priority_level_configuration_spec->limited); - v1beta3_priority_level_configuration_spec->limited = NULL; - } - if (v1beta3_priority_level_configuration_spec->type) { - free(v1beta3_priority_level_configuration_spec->type); - v1beta3_priority_level_configuration_spec->type = NULL; - } - free(v1beta3_priority_level_configuration_spec); -} - -cJSON *v1beta3_priority_level_configuration_spec_convertToJSON(v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_priority_level_configuration_spec->exempt - if(v1beta3_priority_level_configuration_spec->exempt) { - cJSON *exempt_local_JSON = v1beta3_exempt_priority_level_configuration_convertToJSON(v1beta3_priority_level_configuration_spec->exempt); - if(exempt_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "exempt", exempt_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_priority_level_configuration_spec->limited - if(v1beta3_priority_level_configuration_spec->limited) { - cJSON *limited_local_JSON = v1beta3_limited_priority_level_configuration_convertToJSON(v1beta3_priority_level_configuration_spec->limited); - if(limited_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "limited", limited_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_priority_level_configuration_spec->type - if (!v1beta3_priority_level_configuration_spec->type) { - goto fail; - } - if(cJSON_AddStringToObject(item, "type", v1beta3_priority_level_configuration_spec->type) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec_parseFromJSON(cJSON *v1beta3_priority_level_configuration_specJSON){ - - v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec_local_var = NULL; - - // define the local variable for v1beta3_priority_level_configuration_spec->exempt - v1beta3_exempt_priority_level_configuration_t *exempt_local_nonprim = NULL; - - // define the local variable for v1beta3_priority_level_configuration_spec->limited - v1beta3_limited_priority_level_configuration_t *limited_local_nonprim = NULL; - - // v1beta3_priority_level_configuration_spec->exempt - cJSON *exempt = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_specJSON, "exempt"); - if (exempt) { - exempt_local_nonprim = v1beta3_exempt_priority_level_configuration_parseFromJSON(exempt); //nonprimitive - } - - // v1beta3_priority_level_configuration_spec->limited - cJSON *limited = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_specJSON, "limited"); - if (limited) { - limited_local_nonprim = v1beta3_limited_priority_level_configuration_parseFromJSON(limited); //nonprimitive - } - - // v1beta3_priority_level_configuration_spec->type - cJSON *type = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_specJSON, "type"); - if (!type) { - goto end; - } - - - if(!cJSON_IsString(type)) - { - goto end; //String - } - - - v1beta3_priority_level_configuration_spec_local_var = v1beta3_priority_level_configuration_spec_create ( - exempt ? exempt_local_nonprim : NULL, - limited ? limited_local_nonprim : NULL, - strdup(type->valuestring) - ); - - return v1beta3_priority_level_configuration_spec_local_var; -end: - if (exempt_local_nonprim) { - v1beta3_exempt_priority_level_configuration_free(exempt_local_nonprim); - exempt_local_nonprim = NULL; - } - if (limited_local_nonprim) { - v1beta3_limited_priority_level_configuration_free(limited_local_nonprim); - limited_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_priority_level_configuration_spec.h b/kubernetes/model/v1beta3_priority_level_configuration_spec.h deleted file mode 100644 index 5a5b6b38..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_spec.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * v1beta3_priority_level_configuration_spec.h - * - * PriorityLevelConfigurationSpec specifies the configuration of a priority level. - */ - -#ifndef _v1beta3_priority_level_configuration_spec_H_ -#define _v1beta3_priority_level_configuration_spec_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_priority_level_configuration_spec_t v1beta3_priority_level_configuration_spec_t; - -#include "v1beta3_exempt_priority_level_configuration.h" -#include "v1beta3_limited_priority_level_configuration.h" - - - -typedef struct v1beta3_priority_level_configuration_spec_t { - struct v1beta3_exempt_priority_level_configuration_t *exempt; //model - struct v1beta3_limited_priority_level_configuration_t *limited; //model - char *type; // string - -} v1beta3_priority_level_configuration_spec_t; - -v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec_create( - v1beta3_exempt_priority_level_configuration_t *exempt, - v1beta3_limited_priority_level_configuration_t *limited, - char *type -); - -void v1beta3_priority_level_configuration_spec_free(v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec); - -v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec_parseFromJSON(cJSON *v1beta3_priority_level_configuration_specJSON); - -cJSON *v1beta3_priority_level_configuration_spec_convertToJSON(v1beta3_priority_level_configuration_spec_t *v1beta3_priority_level_configuration_spec); - -#endif /* _v1beta3_priority_level_configuration_spec_H_ */ - diff --git a/kubernetes/model/v1beta3_priority_level_configuration_status.c b/kubernetes/model/v1beta3_priority_level_configuration_status.c deleted file mode 100644 index 9fe6a263..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_status.c +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include "v1beta3_priority_level_configuration_status.h" - - - -v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status_create( - list_t *conditions - ) { - v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status_local_var = malloc(sizeof(v1beta3_priority_level_configuration_status_t)); - if (!v1beta3_priority_level_configuration_status_local_var) { - return NULL; - } - v1beta3_priority_level_configuration_status_local_var->conditions = conditions; - - return v1beta3_priority_level_configuration_status_local_var; -} - - -void v1beta3_priority_level_configuration_status_free(v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status) { - if(NULL == v1beta3_priority_level_configuration_status){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_priority_level_configuration_status->conditions) { - list_ForEach(listEntry, v1beta3_priority_level_configuration_status->conditions) { - v1beta3_priority_level_configuration_condition_free(listEntry->data); - } - list_freeList(v1beta3_priority_level_configuration_status->conditions); - v1beta3_priority_level_configuration_status->conditions = NULL; - } - free(v1beta3_priority_level_configuration_status); -} - -cJSON *v1beta3_priority_level_configuration_status_convertToJSON(v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_priority_level_configuration_status->conditions - if(v1beta3_priority_level_configuration_status->conditions) { - cJSON *conditions = cJSON_AddArrayToObject(item, "conditions"); - if(conditions == NULL) { - goto fail; //nonprimitive container - } - - listEntry_t *conditionsListEntry; - if (v1beta3_priority_level_configuration_status->conditions) { - list_ForEach(conditionsListEntry, v1beta3_priority_level_configuration_status->conditions) { - cJSON *itemLocal = v1beta3_priority_level_configuration_condition_convertToJSON(conditionsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(conditions, itemLocal); - } - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status_parseFromJSON(cJSON *v1beta3_priority_level_configuration_statusJSON){ - - v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status_local_var = NULL; - - // define the local list for v1beta3_priority_level_configuration_status->conditions - list_t *conditionsList = NULL; - - // v1beta3_priority_level_configuration_status->conditions - cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta3_priority_level_configuration_statusJSON, "conditions"); - if (conditions) { - cJSON *conditions_local_nonprimitive = NULL; - if(!cJSON_IsArray(conditions)){ - goto end; //nonprimitive container - } - - conditionsList = list_createList(); - - cJSON_ArrayForEach(conditions_local_nonprimitive,conditions ) - { - if(!cJSON_IsObject(conditions_local_nonprimitive)){ - goto end; - } - v1beta3_priority_level_configuration_condition_t *conditionsItem = v1beta3_priority_level_configuration_condition_parseFromJSON(conditions_local_nonprimitive); - - list_addElement(conditionsList, conditionsItem); - } - } - - - v1beta3_priority_level_configuration_status_local_var = v1beta3_priority_level_configuration_status_create ( - conditions ? conditionsList : NULL - ); - - return v1beta3_priority_level_configuration_status_local_var; -end: - if (conditionsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, conditionsList) { - v1beta3_priority_level_configuration_condition_free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(conditionsList); - conditionsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_priority_level_configuration_status.h b/kubernetes/model/v1beta3_priority_level_configuration_status.h deleted file mode 100644 index 5e231e96..00000000 --- a/kubernetes/model/v1beta3_priority_level_configuration_status.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * v1beta3_priority_level_configuration_status.h - * - * PriorityLevelConfigurationStatus represents the current state of a \"request-priority\". - */ - -#ifndef _v1beta3_priority_level_configuration_status_H_ -#define _v1beta3_priority_level_configuration_status_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_priority_level_configuration_status_t v1beta3_priority_level_configuration_status_t; - -#include "v1beta3_priority_level_configuration_condition.h" - - - -typedef struct v1beta3_priority_level_configuration_status_t { - list_t *conditions; //nonprimitive container - -} v1beta3_priority_level_configuration_status_t; - -v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status_create( - list_t *conditions -); - -void v1beta3_priority_level_configuration_status_free(v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status); - -v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status_parseFromJSON(cJSON *v1beta3_priority_level_configuration_statusJSON); - -cJSON *v1beta3_priority_level_configuration_status_convertToJSON(v1beta3_priority_level_configuration_status_t *v1beta3_priority_level_configuration_status); - -#endif /* _v1beta3_priority_level_configuration_status_H_ */ - diff --git a/kubernetes/model/v1beta3_queuing_configuration.c b/kubernetes/model/v1beta3_queuing_configuration.c deleted file mode 100644 index 187835ce..00000000 --- a/kubernetes/model/v1beta3_queuing_configuration.c +++ /dev/null @@ -1,109 +0,0 @@ -#include -#include -#include -#include "v1beta3_queuing_configuration.h" - - - -v1beta3_queuing_configuration_t *v1beta3_queuing_configuration_create( - int hand_size, - int queue_length_limit, - int queues - ) { - v1beta3_queuing_configuration_t *v1beta3_queuing_configuration_local_var = malloc(sizeof(v1beta3_queuing_configuration_t)); - if (!v1beta3_queuing_configuration_local_var) { - return NULL; - } - v1beta3_queuing_configuration_local_var->hand_size = hand_size; - v1beta3_queuing_configuration_local_var->queue_length_limit = queue_length_limit; - v1beta3_queuing_configuration_local_var->queues = queues; - - return v1beta3_queuing_configuration_local_var; -} - - -void v1beta3_queuing_configuration_free(v1beta3_queuing_configuration_t *v1beta3_queuing_configuration) { - if(NULL == v1beta3_queuing_configuration){ - return ; - } - listEntry_t *listEntry; - free(v1beta3_queuing_configuration); -} - -cJSON *v1beta3_queuing_configuration_convertToJSON(v1beta3_queuing_configuration_t *v1beta3_queuing_configuration) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_queuing_configuration->hand_size - if(v1beta3_queuing_configuration->hand_size) { - if(cJSON_AddNumberToObject(item, "handSize", v1beta3_queuing_configuration->hand_size) == NULL) { - goto fail; //Numeric - } - } - - - // v1beta3_queuing_configuration->queue_length_limit - if(v1beta3_queuing_configuration->queue_length_limit) { - if(cJSON_AddNumberToObject(item, "queueLengthLimit", v1beta3_queuing_configuration->queue_length_limit) == NULL) { - goto fail; //Numeric - } - } - - - // v1beta3_queuing_configuration->queues - if(v1beta3_queuing_configuration->queues) { - if(cJSON_AddNumberToObject(item, "queues", v1beta3_queuing_configuration->queues) == NULL) { - goto fail; //Numeric - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_queuing_configuration_t *v1beta3_queuing_configuration_parseFromJSON(cJSON *v1beta3_queuing_configurationJSON){ - - v1beta3_queuing_configuration_t *v1beta3_queuing_configuration_local_var = NULL; - - // v1beta3_queuing_configuration->hand_size - cJSON *hand_size = cJSON_GetObjectItemCaseSensitive(v1beta3_queuing_configurationJSON, "handSize"); - if (hand_size) { - if(!cJSON_IsNumber(hand_size)) - { - goto end; //Numeric - } - } - - // v1beta3_queuing_configuration->queue_length_limit - cJSON *queue_length_limit = cJSON_GetObjectItemCaseSensitive(v1beta3_queuing_configurationJSON, "queueLengthLimit"); - if (queue_length_limit) { - if(!cJSON_IsNumber(queue_length_limit)) - { - goto end; //Numeric - } - } - - // v1beta3_queuing_configuration->queues - cJSON *queues = cJSON_GetObjectItemCaseSensitive(v1beta3_queuing_configurationJSON, "queues"); - if (queues) { - if(!cJSON_IsNumber(queues)) - { - goto end; //Numeric - } - } - - - v1beta3_queuing_configuration_local_var = v1beta3_queuing_configuration_create ( - hand_size ? hand_size->valuedouble : 0, - queue_length_limit ? queue_length_limit->valuedouble : 0, - queues ? queues->valuedouble : 0 - ); - - return v1beta3_queuing_configuration_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_queuing_configuration.h b/kubernetes/model/v1beta3_queuing_configuration.h deleted file mode 100644 index 925146ff..00000000 --- a/kubernetes/model/v1beta3_queuing_configuration.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * v1beta3_queuing_configuration.h - * - * QueuingConfiguration holds the configuration parameters for queuing - */ - -#ifndef _v1beta3_queuing_configuration_H_ -#define _v1beta3_queuing_configuration_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_queuing_configuration_t v1beta3_queuing_configuration_t; - - - - -typedef struct v1beta3_queuing_configuration_t { - int hand_size; //numeric - int queue_length_limit; //numeric - int queues; //numeric - -} v1beta3_queuing_configuration_t; - -v1beta3_queuing_configuration_t *v1beta3_queuing_configuration_create( - int hand_size, - int queue_length_limit, - int queues -); - -void v1beta3_queuing_configuration_free(v1beta3_queuing_configuration_t *v1beta3_queuing_configuration); - -v1beta3_queuing_configuration_t *v1beta3_queuing_configuration_parseFromJSON(cJSON *v1beta3_queuing_configurationJSON); - -cJSON *v1beta3_queuing_configuration_convertToJSON(v1beta3_queuing_configuration_t *v1beta3_queuing_configuration); - -#endif /* _v1beta3_queuing_configuration_H_ */ - diff --git a/kubernetes/model/v1beta3_resource_policy_rule.c b/kubernetes/model/v1beta3_resource_policy_rule.c deleted file mode 100644 index d1868dcd..00000000 --- a/kubernetes/model/v1beta3_resource_policy_rule.c +++ /dev/null @@ -1,313 +0,0 @@ -#include -#include -#include -#include "v1beta3_resource_policy_rule.h" - - - -v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule_create( - list_t *api_groups, - int cluster_scope, - list_t *namespaces, - list_t *resources, - list_t *verbs - ) { - v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule_local_var = malloc(sizeof(v1beta3_resource_policy_rule_t)); - if (!v1beta3_resource_policy_rule_local_var) { - return NULL; - } - v1beta3_resource_policy_rule_local_var->api_groups = api_groups; - v1beta3_resource_policy_rule_local_var->cluster_scope = cluster_scope; - v1beta3_resource_policy_rule_local_var->namespaces = namespaces; - v1beta3_resource_policy_rule_local_var->resources = resources; - v1beta3_resource_policy_rule_local_var->verbs = verbs; - - return v1beta3_resource_policy_rule_local_var; -} - - -void v1beta3_resource_policy_rule_free(v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule) { - if(NULL == v1beta3_resource_policy_rule){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_resource_policy_rule->api_groups) { - list_ForEach(listEntry, v1beta3_resource_policy_rule->api_groups) { - free(listEntry->data); - } - list_freeList(v1beta3_resource_policy_rule->api_groups); - v1beta3_resource_policy_rule->api_groups = NULL; - } - if (v1beta3_resource_policy_rule->namespaces) { - list_ForEach(listEntry, v1beta3_resource_policy_rule->namespaces) { - free(listEntry->data); - } - list_freeList(v1beta3_resource_policy_rule->namespaces); - v1beta3_resource_policy_rule->namespaces = NULL; - } - if (v1beta3_resource_policy_rule->resources) { - list_ForEach(listEntry, v1beta3_resource_policy_rule->resources) { - free(listEntry->data); - } - list_freeList(v1beta3_resource_policy_rule->resources); - v1beta3_resource_policy_rule->resources = NULL; - } - if (v1beta3_resource_policy_rule->verbs) { - list_ForEach(listEntry, v1beta3_resource_policy_rule->verbs) { - free(listEntry->data); - } - list_freeList(v1beta3_resource_policy_rule->verbs); - v1beta3_resource_policy_rule->verbs = NULL; - } - free(v1beta3_resource_policy_rule); -} - -cJSON *v1beta3_resource_policy_rule_convertToJSON(v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_resource_policy_rule->api_groups - if (!v1beta3_resource_policy_rule->api_groups) { - goto fail; - } - cJSON *api_groups = cJSON_AddArrayToObject(item, "apiGroups"); - if(api_groups == NULL) { - goto fail; //primitive container - } - - listEntry_t *api_groupsListEntry; - list_ForEach(api_groupsListEntry, v1beta3_resource_policy_rule->api_groups) { - if(cJSON_AddStringToObject(api_groups, "", (char*)api_groupsListEntry->data) == NULL) - { - goto fail; - } - } - - - // v1beta3_resource_policy_rule->cluster_scope - if(v1beta3_resource_policy_rule->cluster_scope) { - if(cJSON_AddBoolToObject(item, "clusterScope", v1beta3_resource_policy_rule->cluster_scope) == NULL) { - goto fail; //Bool - } - } - - - // v1beta3_resource_policy_rule->namespaces - if(v1beta3_resource_policy_rule->namespaces) { - cJSON *namespaces = cJSON_AddArrayToObject(item, "namespaces"); - if(namespaces == NULL) { - goto fail; //primitive container - } - - listEntry_t *namespacesListEntry; - list_ForEach(namespacesListEntry, v1beta3_resource_policy_rule->namespaces) { - if(cJSON_AddStringToObject(namespaces, "", (char*)namespacesListEntry->data) == NULL) - { - goto fail; - } - } - } - - - // v1beta3_resource_policy_rule->resources - if (!v1beta3_resource_policy_rule->resources) { - goto fail; - } - cJSON *resources = cJSON_AddArrayToObject(item, "resources"); - if(resources == NULL) { - goto fail; //primitive container - } - - listEntry_t *resourcesListEntry; - list_ForEach(resourcesListEntry, v1beta3_resource_policy_rule->resources) { - if(cJSON_AddStringToObject(resources, "", (char*)resourcesListEntry->data) == NULL) - { - goto fail; - } - } - - - // v1beta3_resource_policy_rule->verbs - if (!v1beta3_resource_policy_rule->verbs) { - goto fail; - } - cJSON *verbs = cJSON_AddArrayToObject(item, "verbs"); - if(verbs == NULL) { - goto fail; //primitive container - } - - listEntry_t *verbsListEntry; - list_ForEach(verbsListEntry, v1beta3_resource_policy_rule->verbs) { - if(cJSON_AddStringToObject(verbs, "", (char*)verbsListEntry->data) == NULL) - { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule_parseFromJSON(cJSON *v1beta3_resource_policy_ruleJSON){ - - v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule_local_var = NULL; - - // define the local list for v1beta3_resource_policy_rule->api_groups - list_t *api_groupsList = NULL; - - // define the local list for v1beta3_resource_policy_rule->namespaces - list_t *namespacesList = NULL; - - // define the local list for v1beta3_resource_policy_rule->resources - list_t *resourcesList = NULL; - - // define the local list for v1beta3_resource_policy_rule->verbs - list_t *verbsList = NULL; - - // v1beta3_resource_policy_rule->api_groups - cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1beta3_resource_policy_ruleJSON, "apiGroups"); - if (!api_groups) { - goto end; - } - - - cJSON *api_groups_local = NULL; - if(!cJSON_IsArray(api_groups)) { - goto end;//primitive container - } - api_groupsList = list_createList(); - - cJSON_ArrayForEach(api_groups_local, api_groups) - { - if(!cJSON_IsString(api_groups_local)) - { - goto end; - } - list_addElement(api_groupsList , strdup(api_groups_local->valuestring)); - } - - // v1beta3_resource_policy_rule->cluster_scope - cJSON *cluster_scope = cJSON_GetObjectItemCaseSensitive(v1beta3_resource_policy_ruleJSON, "clusterScope"); - if (cluster_scope) { - if(!cJSON_IsBool(cluster_scope)) - { - goto end; //Bool - } - } - - // v1beta3_resource_policy_rule->namespaces - cJSON *namespaces = cJSON_GetObjectItemCaseSensitive(v1beta3_resource_policy_ruleJSON, "namespaces"); - if (namespaces) { - cJSON *namespaces_local = NULL; - if(!cJSON_IsArray(namespaces)) { - goto end;//primitive container - } - namespacesList = list_createList(); - - cJSON_ArrayForEach(namespaces_local, namespaces) - { - if(!cJSON_IsString(namespaces_local)) - { - goto end; - } - list_addElement(namespacesList , strdup(namespaces_local->valuestring)); - } - } - - // v1beta3_resource_policy_rule->resources - cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1beta3_resource_policy_ruleJSON, "resources"); - if (!resources) { - goto end; - } - - - cJSON *resources_local = NULL; - if(!cJSON_IsArray(resources)) { - goto end;//primitive container - } - resourcesList = list_createList(); - - cJSON_ArrayForEach(resources_local, resources) - { - if(!cJSON_IsString(resources_local)) - { - goto end; - } - list_addElement(resourcesList , strdup(resources_local->valuestring)); - } - - // v1beta3_resource_policy_rule->verbs - cJSON *verbs = cJSON_GetObjectItemCaseSensitive(v1beta3_resource_policy_ruleJSON, "verbs"); - if (!verbs) { - goto end; - } - - - cJSON *verbs_local = NULL; - if(!cJSON_IsArray(verbs)) { - goto end;//primitive container - } - verbsList = list_createList(); - - cJSON_ArrayForEach(verbs_local, verbs) - { - if(!cJSON_IsString(verbs_local)) - { - goto end; - } - list_addElement(verbsList , strdup(verbs_local->valuestring)); - } - - - v1beta3_resource_policy_rule_local_var = v1beta3_resource_policy_rule_create ( - api_groupsList, - cluster_scope ? cluster_scope->valueint : 0, - namespaces ? namespacesList : NULL, - resourcesList, - verbsList - ); - - return v1beta3_resource_policy_rule_local_var; -end: - if (api_groupsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, api_groupsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(api_groupsList); - api_groupsList = NULL; - } - if (namespacesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, namespacesList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(namespacesList); - namespacesList = NULL; - } - if (resourcesList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, resourcesList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(resourcesList); - resourcesList = NULL; - } - if (verbsList) { - listEntry_t *listEntry = NULL; - list_ForEach(listEntry, verbsList) { - free(listEntry->data); - listEntry->data = NULL; - } - list_freeList(verbsList); - verbsList = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_resource_policy_rule.h b/kubernetes/model/v1beta3_resource_policy_rule.h deleted file mode 100644 index 926941f7..00000000 --- a/kubernetes/model/v1beta3_resource_policy_rule.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * v1beta3_resource_policy_rule.h - * - * ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) either (d1) the request does not specify a namespace (i.e., `Namespace==\"\"`) and clusterScope is true or (d2) the request specifies a namespace and least one member of namespaces matches the request's namespace. - */ - -#ifndef _v1beta3_resource_policy_rule_H_ -#define _v1beta3_resource_policy_rule_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_resource_policy_rule_t v1beta3_resource_policy_rule_t; - - - - -typedef struct v1beta3_resource_policy_rule_t { - list_t *api_groups; //primitive container - int cluster_scope; //boolean - list_t *namespaces; //primitive container - list_t *resources; //primitive container - list_t *verbs; //primitive container - -} v1beta3_resource_policy_rule_t; - -v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule_create( - list_t *api_groups, - int cluster_scope, - list_t *namespaces, - list_t *resources, - list_t *verbs -); - -void v1beta3_resource_policy_rule_free(v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule); - -v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule_parseFromJSON(cJSON *v1beta3_resource_policy_ruleJSON); - -cJSON *v1beta3_resource_policy_rule_convertToJSON(v1beta3_resource_policy_rule_t *v1beta3_resource_policy_rule); - -#endif /* _v1beta3_resource_policy_rule_H_ */ - diff --git a/kubernetes/model/v1beta3_service_account_subject.c b/kubernetes/model/v1beta3_service_account_subject.c deleted file mode 100644 index 92b8318e..00000000 --- a/kubernetes/model/v1beta3_service_account_subject.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include "v1beta3_service_account_subject.h" - - - -v1beta3_service_account_subject_t *v1beta3_service_account_subject_create( - char *name, - char *_namespace - ) { - v1beta3_service_account_subject_t *v1beta3_service_account_subject_local_var = malloc(sizeof(v1beta3_service_account_subject_t)); - if (!v1beta3_service_account_subject_local_var) { - return NULL; - } - v1beta3_service_account_subject_local_var->name = name; - v1beta3_service_account_subject_local_var->_namespace = _namespace; - - return v1beta3_service_account_subject_local_var; -} - - -void v1beta3_service_account_subject_free(v1beta3_service_account_subject_t *v1beta3_service_account_subject) { - if(NULL == v1beta3_service_account_subject){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_service_account_subject->name) { - free(v1beta3_service_account_subject->name); - v1beta3_service_account_subject->name = NULL; - } - if (v1beta3_service_account_subject->_namespace) { - free(v1beta3_service_account_subject->_namespace); - v1beta3_service_account_subject->_namespace = NULL; - } - free(v1beta3_service_account_subject); -} - -cJSON *v1beta3_service_account_subject_convertToJSON(v1beta3_service_account_subject_t *v1beta3_service_account_subject) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_service_account_subject->name - if (!v1beta3_service_account_subject->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1beta3_service_account_subject->name) == NULL) { - goto fail; //String - } - - - // v1beta3_service_account_subject->_namespace - if (!v1beta3_service_account_subject->_namespace) { - goto fail; - } - if(cJSON_AddStringToObject(item, "namespace", v1beta3_service_account_subject->_namespace) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_service_account_subject_t *v1beta3_service_account_subject_parseFromJSON(cJSON *v1beta3_service_account_subjectJSON){ - - v1beta3_service_account_subject_t *v1beta3_service_account_subject_local_var = NULL; - - // v1beta3_service_account_subject->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta3_service_account_subjectJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - // v1beta3_service_account_subject->_namespace - cJSON *_namespace = cJSON_GetObjectItemCaseSensitive(v1beta3_service_account_subjectJSON, "namespace"); - if (!_namespace) { - goto end; - } - - - if(!cJSON_IsString(_namespace)) - { - goto end; //String - } - - - v1beta3_service_account_subject_local_var = v1beta3_service_account_subject_create ( - strdup(name->valuestring), - strdup(_namespace->valuestring) - ); - - return v1beta3_service_account_subject_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_service_account_subject.h b/kubernetes/model/v1beta3_service_account_subject.h deleted file mode 100644 index b0804530..00000000 --- a/kubernetes/model/v1beta3_service_account_subject.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * v1beta3_service_account_subject.h - * - * ServiceAccountSubject holds detailed information for service-account-kind subject. - */ - -#ifndef _v1beta3_service_account_subject_H_ -#define _v1beta3_service_account_subject_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_service_account_subject_t v1beta3_service_account_subject_t; - - - - -typedef struct v1beta3_service_account_subject_t { - char *name; // string - char *_namespace; // string - -} v1beta3_service_account_subject_t; - -v1beta3_service_account_subject_t *v1beta3_service_account_subject_create( - char *name, - char *_namespace -); - -void v1beta3_service_account_subject_free(v1beta3_service_account_subject_t *v1beta3_service_account_subject); - -v1beta3_service_account_subject_t *v1beta3_service_account_subject_parseFromJSON(cJSON *v1beta3_service_account_subjectJSON); - -cJSON *v1beta3_service_account_subject_convertToJSON(v1beta3_service_account_subject_t *v1beta3_service_account_subject); - -#endif /* _v1beta3_service_account_subject_H_ */ - diff --git a/kubernetes/model/v1beta3_subject.c b/kubernetes/model/v1beta3_subject.c deleted file mode 100644 index 3fb2f915..00000000 --- a/kubernetes/model/v1beta3_subject.c +++ /dev/null @@ -1,176 +0,0 @@ -#include -#include -#include -#include "v1beta3_subject.h" - - - -v1beta3_subject_t *v1beta3_subject_create( - v1beta3_group_subject_t *group, - char *kind, - v1beta3_service_account_subject_t *service_account, - v1beta3_user_subject_t *user - ) { - v1beta3_subject_t *v1beta3_subject_local_var = malloc(sizeof(v1beta3_subject_t)); - if (!v1beta3_subject_local_var) { - return NULL; - } - v1beta3_subject_local_var->group = group; - v1beta3_subject_local_var->kind = kind; - v1beta3_subject_local_var->service_account = service_account; - v1beta3_subject_local_var->user = user; - - return v1beta3_subject_local_var; -} - - -void v1beta3_subject_free(v1beta3_subject_t *v1beta3_subject) { - if(NULL == v1beta3_subject){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_subject->group) { - v1beta3_group_subject_free(v1beta3_subject->group); - v1beta3_subject->group = NULL; - } - if (v1beta3_subject->kind) { - free(v1beta3_subject->kind); - v1beta3_subject->kind = NULL; - } - if (v1beta3_subject->service_account) { - v1beta3_service_account_subject_free(v1beta3_subject->service_account); - v1beta3_subject->service_account = NULL; - } - if (v1beta3_subject->user) { - v1beta3_user_subject_free(v1beta3_subject->user); - v1beta3_subject->user = NULL; - } - free(v1beta3_subject); -} - -cJSON *v1beta3_subject_convertToJSON(v1beta3_subject_t *v1beta3_subject) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_subject->group - if(v1beta3_subject->group) { - cJSON *group_local_JSON = v1beta3_group_subject_convertToJSON(v1beta3_subject->group); - if(group_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "group", group_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_subject->kind - if (!v1beta3_subject->kind) { - goto fail; - } - if(cJSON_AddStringToObject(item, "kind", v1beta3_subject->kind) == NULL) { - goto fail; //String - } - - - // v1beta3_subject->service_account - if(v1beta3_subject->service_account) { - cJSON *service_account_local_JSON = v1beta3_service_account_subject_convertToJSON(v1beta3_subject->service_account); - if(service_account_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "serviceAccount", service_account_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - - // v1beta3_subject->user - if(v1beta3_subject->user) { - cJSON *user_local_JSON = v1beta3_user_subject_convertToJSON(v1beta3_subject->user); - if(user_local_JSON == NULL) { - goto fail; //model - } - cJSON_AddItemToObject(item, "user", user_local_JSON); - if(item->child == NULL) { - goto fail; - } - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_subject_t *v1beta3_subject_parseFromJSON(cJSON *v1beta3_subjectJSON){ - - v1beta3_subject_t *v1beta3_subject_local_var = NULL; - - // define the local variable for v1beta3_subject->group - v1beta3_group_subject_t *group_local_nonprim = NULL; - - // define the local variable for v1beta3_subject->service_account - v1beta3_service_account_subject_t *service_account_local_nonprim = NULL; - - // define the local variable for v1beta3_subject->user - v1beta3_user_subject_t *user_local_nonprim = NULL; - - // v1beta3_subject->group - cJSON *group = cJSON_GetObjectItemCaseSensitive(v1beta3_subjectJSON, "group"); - if (group) { - group_local_nonprim = v1beta3_group_subject_parseFromJSON(group); //nonprimitive - } - - // v1beta3_subject->kind - cJSON *kind = cJSON_GetObjectItemCaseSensitive(v1beta3_subjectJSON, "kind"); - if (!kind) { - goto end; - } - - - if(!cJSON_IsString(kind)) - { - goto end; //String - } - - // v1beta3_subject->service_account - cJSON *service_account = cJSON_GetObjectItemCaseSensitive(v1beta3_subjectJSON, "serviceAccount"); - if (service_account) { - service_account_local_nonprim = v1beta3_service_account_subject_parseFromJSON(service_account); //nonprimitive - } - - // v1beta3_subject->user - cJSON *user = cJSON_GetObjectItemCaseSensitive(v1beta3_subjectJSON, "user"); - if (user) { - user_local_nonprim = v1beta3_user_subject_parseFromJSON(user); //nonprimitive - } - - - v1beta3_subject_local_var = v1beta3_subject_create ( - group ? group_local_nonprim : NULL, - strdup(kind->valuestring), - service_account ? service_account_local_nonprim : NULL, - user ? user_local_nonprim : NULL - ); - - return v1beta3_subject_local_var; -end: - if (group_local_nonprim) { - v1beta3_group_subject_free(group_local_nonprim); - group_local_nonprim = NULL; - } - if (service_account_local_nonprim) { - v1beta3_service_account_subject_free(service_account_local_nonprim); - service_account_local_nonprim = NULL; - } - if (user_local_nonprim) { - v1beta3_user_subject_free(user_local_nonprim); - user_local_nonprim = NULL; - } - return NULL; - -} diff --git a/kubernetes/model/v1beta3_subject.h b/kubernetes/model/v1beta3_subject.h deleted file mode 100644 index dacf0691..00000000 --- a/kubernetes/model/v1beta3_subject.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * v1beta3_subject.h - * - * Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account. - */ - -#ifndef _v1beta3_subject_H_ -#define _v1beta3_subject_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_subject_t v1beta3_subject_t; - -#include "v1beta3_group_subject.h" -#include "v1beta3_service_account_subject.h" -#include "v1beta3_user_subject.h" - - - -typedef struct v1beta3_subject_t { - struct v1beta3_group_subject_t *group; //model - char *kind; // string - struct v1beta3_service_account_subject_t *service_account; //model - struct v1beta3_user_subject_t *user; //model - -} v1beta3_subject_t; - -v1beta3_subject_t *v1beta3_subject_create( - v1beta3_group_subject_t *group, - char *kind, - v1beta3_service_account_subject_t *service_account, - v1beta3_user_subject_t *user -); - -void v1beta3_subject_free(v1beta3_subject_t *v1beta3_subject); - -v1beta3_subject_t *v1beta3_subject_parseFromJSON(cJSON *v1beta3_subjectJSON); - -cJSON *v1beta3_subject_convertToJSON(v1beta3_subject_t *v1beta3_subject); - -#endif /* _v1beta3_subject_H_ */ - diff --git a/kubernetes/model/v1beta3_user_subject.c b/kubernetes/model/v1beta3_user_subject.c deleted file mode 100644 index bccf7d7a..00000000 --- a/kubernetes/model/v1beta3_user_subject.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "v1beta3_user_subject.h" - - - -v1beta3_user_subject_t *v1beta3_user_subject_create( - char *name - ) { - v1beta3_user_subject_t *v1beta3_user_subject_local_var = malloc(sizeof(v1beta3_user_subject_t)); - if (!v1beta3_user_subject_local_var) { - return NULL; - } - v1beta3_user_subject_local_var->name = name; - - return v1beta3_user_subject_local_var; -} - - -void v1beta3_user_subject_free(v1beta3_user_subject_t *v1beta3_user_subject) { - if(NULL == v1beta3_user_subject){ - return ; - } - listEntry_t *listEntry; - if (v1beta3_user_subject->name) { - free(v1beta3_user_subject->name); - v1beta3_user_subject->name = NULL; - } - free(v1beta3_user_subject); -} - -cJSON *v1beta3_user_subject_convertToJSON(v1beta3_user_subject_t *v1beta3_user_subject) { - cJSON *item = cJSON_CreateObject(); - - // v1beta3_user_subject->name - if (!v1beta3_user_subject->name) { - goto fail; - } - if(cJSON_AddStringToObject(item, "name", v1beta3_user_subject->name) == NULL) { - goto fail; //String - } - - return item; -fail: - if (item) { - cJSON_Delete(item); - } - return NULL; -} - -v1beta3_user_subject_t *v1beta3_user_subject_parseFromJSON(cJSON *v1beta3_user_subjectJSON){ - - v1beta3_user_subject_t *v1beta3_user_subject_local_var = NULL; - - // v1beta3_user_subject->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(v1beta3_user_subjectJSON, "name"); - if (!name) { - goto end; - } - - - if(!cJSON_IsString(name)) - { - goto end; //String - } - - - v1beta3_user_subject_local_var = v1beta3_user_subject_create ( - strdup(name->valuestring) - ); - - return v1beta3_user_subject_local_var; -end: - return NULL; - -} diff --git a/kubernetes/model/v1beta3_user_subject.h b/kubernetes/model/v1beta3_user_subject.h deleted file mode 100644 index 5150900a..00000000 --- a/kubernetes/model/v1beta3_user_subject.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * v1beta3_user_subject.h - * - * UserSubject holds detailed information for user-kind subject. - */ - -#ifndef _v1beta3_user_subject_H_ -#define _v1beta3_user_subject_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" - -typedef struct v1beta3_user_subject_t v1beta3_user_subject_t; - - - - -typedef struct v1beta3_user_subject_t { - char *name; // string - -} v1beta3_user_subject_t; - -v1beta3_user_subject_t *v1beta3_user_subject_create( - char *name -); - -void v1beta3_user_subject_free(v1beta3_user_subject_t *v1beta3_user_subject); - -v1beta3_user_subject_t *v1beta3_user_subject_parseFromJSON(cJSON *v1beta3_user_subjectJSON); - -cJSON *v1beta3_user_subject_convertToJSON(v1beta3_user_subject_t *v1beta3_user_subject); - -#endif /* _v1beta3_user_subject_H_ */ - diff --git a/kubernetes/model/v2_container_resource_metric_source.c b/kubernetes/model/v2_container_resource_metric_source.c index 6aaf4b8c..b4243095 100644 --- a/kubernetes/model/v2_container_resource_metric_source.c +++ b/kubernetes/model/v2_container_resource_metric_source.c @@ -5,7 +5,7 @@ -v2_container_resource_metric_source_t *v2_container_resource_metric_source_create( +static v2_container_resource_metric_source_t *v2_container_resource_metric_source_create_internal( char *container, char *name, v2_metric_target_t *target @@ -18,14 +18,30 @@ v2_container_resource_metric_source_t *v2_container_resource_metric_source_creat v2_container_resource_metric_source_local_var->name = name; v2_container_resource_metric_source_local_var->target = target; + v2_container_resource_metric_source_local_var->_library_owned = 1; return v2_container_resource_metric_source_local_var; } +__attribute__((deprecated)) v2_container_resource_metric_source_t *v2_container_resource_metric_source_create( + char *container, + char *name, + v2_metric_target_t *target + ) { + return v2_container_resource_metric_source_create_internal ( + container, + name, + target + ); +} void v2_container_resource_metric_source_free(v2_container_resource_metric_source_t *v2_container_resource_metric_source) { if(NULL == v2_container_resource_metric_source){ return ; } + if(v2_container_resource_metric_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_container_resource_metric_source_free"); + return ; + } listEntry_t *listEntry; if (v2_container_resource_metric_source->container) { free(v2_container_resource_metric_source->container); @@ -93,6 +109,9 @@ v2_container_resource_metric_source_t *v2_container_resource_metric_source_parse // v2_container_resource_metric_source->container cJSON *container = cJSON_GetObjectItemCaseSensitive(v2_container_resource_metric_sourceJSON, "container"); + if (cJSON_IsNull(container)) { + container = NULL; + } if (!container) { goto end; } @@ -105,6 +124,9 @@ v2_container_resource_metric_source_t *v2_container_resource_metric_source_parse // v2_container_resource_metric_source->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v2_container_resource_metric_sourceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -117,6 +139,9 @@ v2_container_resource_metric_source_t *v2_container_resource_metric_source_parse // v2_container_resource_metric_source->target cJSON *target = cJSON_GetObjectItemCaseSensitive(v2_container_resource_metric_sourceJSON, "target"); + if (cJSON_IsNull(target)) { + target = NULL; + } if (!target) { goto end; } @@ -125,7 +150,7 @@ v2_container_resource_metric_source_t *v2_container_resource_metric_source_parse target_local_nonprim = v2_metric_target_parseFromJSON(target); //nonprimitive - v2_container_resource_metric_source_local_var = v2_container_resource_metric_source_create ( + v2_container_resource_metric_source_local_var = v2_container_resource_metric_source_create_internal ( strdup(container->valuestring), strdup(name->valuestring), target_local_nonprim diff --git a/kubernetes/model/v2_container_resource_metric_source.h b/kubernetes/model/v2_container_resource_metric_source.h index efae7e69..5ca3a49d 100644 --- a/kubernetes/model/v2_container_resource_metric_source.h +++ b/kubernetes/model/v2_container_resource_metric_source.h @@ -24,9 +24,10 @@ typedef struct v2_container_resource_metric_source_t { char *name; // string struct v2_metric_target_t *target; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_container_resource_metric_source_t; -v2_container_resource_metric_source_t *v2_container_resource_metric_source_create( +__attribute__((deprecated)) v2_container_resource_metric_source_t *v2_container_resource_metric_source_create( char *container, char *name, v2_metric_target_t *target diff --git a/kubernetes/model/v2_container_resource_metric_status.c b/kubernetes/model/v2_container_resource_metric_status.c index 15ca0fba..81168e58 100644 --- a/kubernetes/model/v2_container_resource_metric_status.c +++ b/kubernetes/model/v2_container_resource_metric_status.c @@ -5,7 +5,7 @@ -v2_container_resource_metric_status_t *v2_container_resource_metric_status_create( +static v2_container_resource_metric_status_t *v2_container_resource_metric_status_create_internal( char *container, v2_metric_value_status_t *current, char *name @@ -18,14 +18,30 @@ v2_container_resource_metric_status_t *v2_container_resource_metric_status_creat v2_container_resource_metric_status_local_var->current = current; v2_container_resource_metric_status_local_var->name = name; + v2_container_resource_metric_status_local_var->_library_owned = 1; return v2_container_resource_metric_status_local_var; } +__attribute__((deprecated)) v2_container_resource_metric_status_t *v2_container_resource_metric_status_create( + char *container, + v2_metric_value_status_t *current, + char *name + ) { + return v2_container_resource_metric_status_create_internal ( + container, + current, + name + ); +} void v2_container_resource_metric_status_free(v2_container_resource_metric_status_t *v2_container_resource_metric_status) { if(NULL == v2_container_resource_metric_status){ return ; } + if(v2_container_resource_metric_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_container_resource_metric_status_free"); + return ; + } listEntry_t *listEntry; if (v2_container_resource_metric_status->container) { free(v2_container_resource_metric_status->container); @@ -93,6 +109,9 @@ v2_container_resource_metric_status_t *v2_container_resource_metric_status_parse // v2_container_resource_metric_status->container cJSON *container = cJSON_GetObjectItemCaseSensitive(v2_container_resource_metric_statusJSON, "container"); + if (cJSON_IsNull(container)) { + container = NULL; + } if (!container) { goto end; } @@ -105,6 +124,9 @@ v2_container_resource_metric_status_t *v2_container_resource_metric_status_parse // v2_container_resource_metric_status->current cJSON *current = cJSON_GetObjectItemCaseSensitive(v2_container_resource_metric_statusJSON, "current"); + if (cJSON_IsNull(current)) { + current = NULL; + } if (!current) { goto end; } @@ -114,6 +136,9 @@ v2_container_resource_metric_status_t *v2_container_resource_metric_status_parse // v2_container_resource_metric_status->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v2_container_resource_metric_statusJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -125,7 +150,7 @@ v2_container_resource_metric_status_t *v2_container_resource_metric_status_parse } - v2_container_resource_metric_status_local_var = v2_container_resource_metric_status_create ( + v2_container_resource_metric_status_local_var = v2_container_resource_metric_status_create_internal ( strdup(container->valuestring), current_local_nonprim, strdup(name->valuestring) diff --git a/kubernetes/model/v2_container_resource_metric_status.h b/kubernetes/model/v2_container_resource_metric_status.h index 86bf6007..54be72dc 100644 --- a/kubernetes/model/v2_container_resource_metric_status.h +++ b/kubernetes/model/v2_container_resource_metric_status.h @@ -24,9 +24,10 @@ typedef struct v2_container_resource_metric_status_t { struct v2_metric_value_status_t *current; //model char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_container_resource_metric_status_t; -v2_container_resource_metric_status_t *v2_container_resource_metric_status_create( +__attribute__((deprecated)) v2_container_resource_metric_status_t *v2_container_resource_metric_status_create( char *container, v2_metric_value_status_t *current, char *name diff --git a/kubernetes/model/v2_cross_version_object_reference.c b/kubernetes/model/v2_cross_version_object_reference.c index 4ac2a0f5..4c858d07 100644 --- a/kubernetes/model/v2_cross_version_object_reference.c +++ b/kubernetes/model/v2_cross_version_object_reference.c @@ -5,7 +5,7 @@ -v2_cross_version_object_reference_t *v2_cross_version_object_reference_create( +static v2_cross_version_object_reference_t *v2_cross_version_object_reference_create_internal( char *api_version, char *kind, char *name @@ -18,14 +18,30 @@ v2_cross_version_object_reference_t *v2_cross_version_object_reference_create( v2_cross_version_object_reference_local_var->kind = kind; v2_cross_version_object_reference_local_var->name = name; + v2_cross_version_object_reference_local_var->_library_owned = 1; return v2_cross_version_object_reference_local_var; } +__attribute__((deprecated)) v2_cross_version_object_reference_t *v2_cross_version_object_reference_create( + char *api_version, + char *kind, + char *name + ) { + return v2_cross_version_object_reference_create_internal ( + api_version, + kind, + name + ); +} void v2_cross_version_object_reference_free(v2_cross_version_object_reference_t *v2_cross_version_object_reference) { if(NULL == v2_cross_version_object_reference){ return ; } + if(v2_cross_version_object_reference->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_cross_version_object_reference_free"); + return ; + } listEntry_t *listEntry; if (v2_cross_version_object_reference->api_version) { free(v2_cross_version_object_reference->api_version); @@ -84,6 +100,9 @@ v2_cross_version_object_reference_t *v2_cross_version_object_reference_parseFrom // v2_cross_version_object_reference->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v2_cross_version_object_referenceJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -93,6 +112,9 @@ v2_cross_version_object_reference_t *v2_cross_version_object_reference_parseFrom // v2_cross_version_object_reference->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v2_cross_version_object_referenceJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (!kind) { goto end; } @@ -105,6 +127,9 @@ v2_cross_version_object_reference_t *v2_cross_version_object_reference_parseFrom // v2_cross_version_object_reference->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v2_cross_version_object_referenceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -116,7 +141,7 @@ v2_cross_version_object_reference_t *v2_cross_version_object_reference_parseFrom } - v2_cross_version_object_reference_local_var = v2_cross_version_object_reference_create ( + v2_cross_version_object_reference_local_var = v2_cross_version_object_reference_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, strdup(kind->valuestring), strdup(name->valuestring) diff --git a/kubernetes/model/v2_cross_version_object_reference.h b/kubernetes/model/v2_cross_version_object_reference.h index f5fb561c..36a69872 100644 --- a/kubernetes/model/v2_cross_version_object_reference.h +++ b/kubernetes/model/v2_cross_version_object_reference.h @@ -23,9 +23,10 @@ typedef struct v2_cross_version_object_reference_t { char *kind; // string char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_cross_version_object_reference_t; -v2_cross_version_object_reference_t *v2_cross_version_object_reference_create( +__attribute__((deprecated)) v2_cross_version_object_reference_t *v2_cross_version_object_reference_create( char *api_version, char *kind, char *name diff --git a/kubernetes/model/v2_external_metric_source.c b/kubernetes/model/v2_external_metric_source.c index 56dd08b5..c6054d84 100644 --- a/kubernetes/model/v2_external_metric_source.c +++ b/kubernetes/model/v2_external_metric_source.c @@ -5,7 +5,7 @@ -v2_external_metric_source_t *v2_external_metric_source_create( +static v2_external_metric_source_t *v2_external_metric_source_create_internal( v2_metric_identifier_t *metric, v2_metric_target_t *target ) { @@ -16,14 +16,28 @@ v2_external_metric_source_t *v2_external_metric_source_create( v2_external_metric_source_local_var->metric = metric; v2_external_metric_source_local_var->target = target; + v2_external_metric_source_local_var->_library_owned = 1; return v2_external_metric_source_local_var; } +__attribute__((deprecated)) v2_external_metric_source_t *v2_external_metric_source_create( + v2_metric_identifier_t *metric, + v2_metric_target_t *target + ) { + return v2_external_metric_source_create_internal ( + metric, + target + ); +} void v2_external_metric_source_free(v2_external_metric_source_t *v2_external_metric_source) { if(NULL == v2_external_metric_source){ return ; } + if(v2_external_metric_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_external_metric_source_free"); + return ; + } listEntry_t *listEntry; if (v2_external_metric_source->metric) { v2_metric_identifier_free(v2_external_metric_source->metric); @@ -86,6 +100,9 @@ v2_external_metric_source_t *v2_external_metric_source_parseFromJSON(cJSON *v2_e // v2_external_metric_source->metric cJSON *metric = cJSON_GetObjectItemCaseSensitive(v2_external_metric_sourceJSON, "metric"); + if (cJSON_IsNull(metric)) { + metric = NULL; + } if (!metric) { goto end; } @@ -95,6 +112,9 @@ v2_external_metric_source_t *v2_external_metric_source_parseFromJSON(cJSON *v2_e // v2_external_metric_source->target cJSON *target = cJSON_GetObjectItemCaseSensitive(v2_external_metric_sourceJSON, "target"); + if (cJSON_IsNull(target)) { + target = NULL; + } if (!target) { goto end; } @@ -103,7 +123,7 @@ v2_external_metric_source_t *v2_external_metric_source_parseFromJSON(cJSON *v2_e target_local_nonprim = v2_metric_target_parseFromJSON(target); //nonprimitive - v2_external_metric_source_local_var = v2_external_metric_source_create ( + v2_external_metric_source_local_var = v2_external_metric_source_create_internal ( metric_local_nonprim, target_local_nonprim ); diff --git a/kubernetes/model/v2_external_metric_source.h b/kubernetes/model/v2_external_metric_source.h index 848043cd..22d293fb 100644 --- a/kubernetes/model/v2_external_metric_source.h +++ b/kubernetes/model/v2_external_metric_source.h @@ -24,9 +24,10 @@ typedef struct v2_external_metric_source_t { struct v2_metric_identifier_t *metric; //model struct v2_metric_target_t *target; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_external_metric_source_t; -v2_external_metric_source_t *v2_external_metric_source_create( +__attribute__((deprecated)) v2_external_metric_source_t *v2_external_metric_source_create( v2_metric_identifier_t *metric, v2_metric_target_t *target ); diff --git a/kubernetes/model/v2_external_metric_status.c b/kubernetes/model/v2_external_metric_status.c index 28431104..98504b6e 100644 --- a/kubernetes/model/v2_external_metric_status.c +++ b/kubernetes/model/v2_external_metric_status.c @@ -5,7 +5,7 @@ -v2_external_metric_status_t *v2_external_metric_status_create( +static v2_external_metric_status_t *v2_external_metric_status_create_internal( v2_metric_value_status_t *current, v2_metric_identifier_t *metric ) { @@ -16,14 +16,28 @@ v2_external_metric_status_t *v2_external_metric_status_create( v2_external_metric_status_local_var->current = current; v2_external_metric_status_local_var->metric = metric; + v2_external_metric_status_local_var->_library_owned = 1; return v2_external_metric_status_local_var; } +__attribute__((deprecated)) v2_external_metric_status_t *v2_external_metric_status_create( + v2_metric_value_status_t *current, + v2_metric_identifier_t *metric + ) { + return v2_external_metric_status_create_internal ( + current, + metric + ); +} void v2_external_metric_status_free(v2_external_metric_status_t *v2_external_metric_status) { if(NULL == v2_external_metric_status){ return ; } + if(v2_external_metric_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_external_metric_status_free"); + return ; + } listEntry_t *listEntry; if (v2_external_metric_status->current) { v2_metric_value_status_free(v2_external_metric_status->current); @@ -86,6 +100,9 @@ v2_external_metric_status_t *v2_external_metric_status_parseFromJSON(cJSON *v2_e // v2_external_metric_status->current cJSON *current = cJSON_GetObjectItemCaseSensitive(v2_external_metric_statusJSON, "current"); + if (cJSON_IsNull(current)) { + current = NULL; + } if (!current) { goto end; } @@ -95,6 +112,9 @@ v2_external_metric_status_t *v2_external_metric_status_parseFromJSON(cJSON *v2_e // v2_external_metric_status->metric cJSON *metric = cJSON_GetObjectItemCaseSensitive(v2_external_metric_statusJSON, "metric"); + if (cJSON_IsNull(metric)) { + metric = NULL; + } if (!metric) { goto end; } @@ -103,7 +123,7 @@ v2_external_metric_status_t *v2_external_metric_status_parseFromJSON(cJSON *v2_e metric_local_nonprim = v2_metric_identifier_parseFromJSON(metric); //nonprimitive - v2_external_metric_status_local_var = v2_external_metric_status_create ( + v2_external_metric_status_local_var = v2_external_metric_status_create_internal ( current_local_nonprim, metric_local_nonprim ); diff --git a/kubernetes/model/v2_external_metric_status.h b/kubernetes/model/v2_external_metric_status.h index 6555778e..b9dc8c12 100644 --- a/kubernetes/model/v2_external_metric_status.h +++ b/kubernetes/model/v2_external_metric_status.h @@ -24,9 +24,10 @@ typedef struct v2_external_metric_status_t { struct v2_metric_value_status_t *current; //model struct v2_metric_identifier_t *metric; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_external_metric_status_t; -v2_external_metric_status_t *v2_external_metric_status_create( +__attribute__((deprecated)) v2_external_metric_status_t *v2_external_metric_status_create( v2_metric_value_status_t *current, v2_metric_identifier_t *metric ); diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler.c b/kubernetes/model/v2_horizontal_pod_autoscaler.c index 08ba07bd..cbf8d5ad 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler.c +++ b/kubernetes/model/v2_horizontal_pod_autoscaler.c @@ -5,7 +5,7 @@ -v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_create( +static v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_create_internal( char *api_version, char *kind, v1_object_meta_t *metadata, @@ -22,14 +22,34 @@ v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_create( v2_horizontal_pod_autoscaler_local_var->spec = spec; v2_horizontal_pod_autoscaler_local_var->status = status; + v2_horizontal_pod_autoscaler_local_var->_library_owned = 1; return v2_horizontal_pod_autoscaler_local_var; } +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_create( + char *api_version, + char *kind, + v1_object_meta_t *metadata, + v2_horizontal_pod_autoscaler_spec_t *spec, + v2_horizontal_pod_autoscaler_status_t *status + ) { + return v2_horizontal_pod_autoscaler_create_internal ( + api_version, + kind, + metadata, + spec, + status + ); +} void v2_horizontal_pod_autoscaler_free(v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler) { if(NULL == v2_horizontal_pod_autoscaler){ return ; } + if(v2_horizontal_pod_autoscaler->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_horizontal_pod_autoscaler_free"); + return ; + } listEntry_t *listEntry; if (v2_horizontal_pod_autoscaler->api_version) { free(v2_horizontal_pod_autoscaler->api_version); @@ -134,6 +154,9 @@ v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_parseFromJSON(cJSON // v2_horizontal_pod_autoscaler->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscalerJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -143,6 +166,9 @@ v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_parseFromJSON(cJSON // v2_horizontal_pod_autoscaler->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscalerJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -152,24 +178,33 @@ v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_parseFromJSON(cJSON // v2_horizontal_pod_autoscaler->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscalerJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v2_horizontal_pod_autoscaler->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscalerJSON, "spec"); + if (cJSON_IsNull(spec)) { + spec = NULL; + } if (spec) { spec_local_nonprim = v2_horizontal_pod_autoscaler_spec_parseFromJSON(spec); //nonprimitive } // v2_horizontal_pod_autoscaler->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscalerJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (status) { status_local_nonprim = v2_horizontal_pod_autoscaler_status_parseFromJSON(status); //nonprimitive } - v2_horizontal_pod_autoscaler_local_var = v2_horizontal_pod_autoscaler_create ( + v2_horizontal_pod_autoscaler_local_var = v2_horizontal_pod_autoscaler_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, metadata ? metadata_local_nonprim : NULL, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler.h b/kubernetes/model/v2_horizontal_pod_autoscaler.h index 2732a129..13229205 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler.h +++ b/kubernetes/model/v2_horizontal_pod_autoscaler.h @@ -28,9 +28,10 @@ typedef struct v2_horizontal_pod_autoscaler_t { struct v2_horizontal_pod_autoscaler_spec_t *spec; //model struct v2_horizontal_pod_autoscaler_status_t *status; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_horizontal_pod_autoscaler_t; -v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_create( +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_t *v2_horizontal_pod_autoscaler_create( char *api_version, char *kind, v1_object_meta_t *metadata, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.c b/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.c index ba8edfcb..ce7ce2ba 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.c +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.c @@ -5,7 +5,7 @@ -v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior_create( +static v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior_create_internal( v2_hpa_scaling_rules_t *scale_down, v2_hpa_scaling_rules_t *scale_up ) { @@ -16,14 +16,28 @@ v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior_c v2_horizontal_pod_autoscaler_behavior_local_var->scale_down = scale_down; v2_horizontal_pod_autoscaler_behavior_local_var->scale_up = scale_up; + v2_horizontal_pod_autoscaler_behavior_local_var->_library_owned = 1; return v2_horizontal_pod_autoscaler_behavior_local_var; } +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior_create( + v2_hpa_scaling_rules_t *scale_down, + v2_hpa_scaling_rules_t *scale_up + ) { + return v2_horizontal_pod_autoscaler_behavior_create_internal ( + scale_down, + scale_up + ); +} void v2_horizontal_pod_autoscaler_behavior_free(v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior) { if(NULL == v2_horizontal_pod_autoscaler_behavior){ return ; } + if(v2_horizontal_pod_autoscaler_behavior->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_horizontal_pod_autoscaler_behavior_free"); + return ; + } listEntry_t *listEntry; if (v2_horizontal_pod_autoscaler_behavior->scale_down) { v2_hpa_scaling_rules_free(v2_horizontal_pod_autoscaler_behavior->scale_down); @@ -84,18 +98,24 @@ v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior_p // v2_horizontal_pod_autoscaler_behavior->scale_down cJSON *scale_down = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_behaviorJSON, "scaleDown"); + if (cJSON_IsNull(scale_down)) { + scale_down = NULL; + } if (scale_down) { scale_down_local_nonprim = v2_hpa_scaling_rules_parseFromJSON(scale_down); //nonprimitive } // v2_horizontal_pod_autoscaler_behavior->scale_up cJSON *scale_up = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_behaviorJSON, "scaleUp"); + if (cJSON_IsNull(scale_up)) { + scale_up = NULL; + } if (scale_up) { scale_up_local_nonprim = v2_hpa_scaling_rules_parseFromJSON(scale_up); //nonprimitive } - v2_horizontal_pod_autoscaler_behavior_local_var = v2_horizontal_pod_autoscaler_behavior_create ( + v2_horizontal_pod_autoscaler_behavior_local_var = v2_horizontal_pod_autoscaler_behavior_create_internal ( scale_down ? scale_down_local_nonprim : NULL, scale_up ? scale_up_local_nonprim : NULL ); diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.h b/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.h index 09590be4..7c96ca8b 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.h +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_behavior.h @@ -23,9 +23,10 @@ typedef struct v2_horizontal_pod_autoscaler_behavior_t { struct v2_hpa_scaling_rules_t *scale_down; //model struct v2_hpa_scaling_rules_t *scale_up; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_horizontal_pod_autoscaler_behavior_t; -v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior_create( +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_behavior_t *v2_horizontal_pod_autoscaler_behavior_create( v2_hpa_scaling_rules_t *scale_down, v2_hpa_scaling_rules_t *scale_up ); diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_condition.c b/kubernetes/model/v2_horizontal_pod_autoscaler_condition.c index 68abe489..c2f1dde1 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_condition.c +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_condition.c @@ -5,7 +5,7 @@ -v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition_create( +static v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition_create_internal( char *last_transition_time, char *message, char *reason, @@ -22,14 +22,34 @@ v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition v2_horizontal_pod_autoscaler_condition_local_var->status = status; v2_horizontal_pod_autoscaler_condition_local_var->type = type; + v2_horizontal_pod_autoscaler_condition_local_var->_library_owned = 1; return v2_horizontal_pod_autoscaler_condition_local_var; } +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition_create( + char *last_transition_time, + char *message, + char *reason, + char *status, + char *type + ) { + return v2_horizontal_pod_autoscaler_condition_create_internal ( + last_transition_time, + message, + reason, + status, + type + ); +} void v2_horizontal_pod_autoscaler_condition_free(v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition) { if(NULL == v2_horizontal_pod_autoscaler_condition){ return ; } + if(v2_horizontal_pod_autoscaler_condition->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_horizontal_pod_autoscaler_condition_free"); + return ; + } listEntry_t *listEntry; if (v2_horizontal_pod_autoscaler_condition->last_transition_time) { free(v2_horizontal_pod_autoscaler_condition->last_transition_time); @@ -112,6 +132,9 @@ v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition // v2_horizontal_pod_autoscaler_condition->last_transition_time cJSON *last_transition_time = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_conditionJSON, "lastTransitionTime"); + if (cJSON_IsNull(last_transition_time)) { + last_transition_time = NULL; + } if (last_transition_time) { if(!cJSON_IsString(last_transition_time) && !cJSON_IsNull(last_transition_time)) { @@ -121,6 +144,9 @@ v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition // v2_horizontal_pod_autoscaler_condition->message cJSON *message = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_conditionJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { @@ -130,6 +156,9 @@ v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition // v2_horizontal_pod_autoscaler_condition->reason cJSON *reason = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_conditionJSON, "reason"); + if (cJSON_IsNull(reason)) { + reason = NULL; + } if (reason) { if(!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { @@ -139,6 +168,9 @@ v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition // v2_horizontal_pod_autoscaler_condition->status cJSON *status = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_conditionJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } if (!status) { goto end; } @@ -151,6 +183,9 @@ v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition // v2_horizontal_pod_autoscaler_condition->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_conditionJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -162,7 +197,7 @@ v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition } - v2_horizontal_pod_autoscaler_condition_local_var = v2_horizontal_pod_autoscaler_condition_create ( + v2_horizontal_pod_autoscaler_condition_local_var = v2_horizontal_pod_autoscaler_condition_create_internal ( last_transition_time && !cJSON_IsNull(last_transition_time) ? strdup(last_transition_time->valuestring) : NULL, message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL, reason && !cJSON_IsNull(reason) ? strdup(reason->valuestring) : NULL, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_condition.h b/kubernetes/model/v2_horizontal_pod_autoscaler_condition.h index fcf31f91..c9adf856 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_condition.h +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_condition.h @@ -25,9 +25,10 @@ typedef struct v2_horizontal_pod_autoscaler_condition_t { char *status; // string char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_horizontal_pod_autoscaler_condition_t; -v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition_create( +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_condition_t *v2_horizontal_pod_autoscaler_condition_create( char *last_transition_time, char *message, char *reason, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_list.c b/kubernetes/model/v2_horizontal_pod_autoscaler_list.c index f693f0a7..a311bdb5 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_list.c +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_list.c @@ -5,7 +5,7 @@ -v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_create( +static v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_create_internal( char *api_version, list_t *items, char *kind, @@ -20,14 +20,32 @@ v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_create( v2_horizontal_pod_autoscaler_list_local_var->kind = kind; v2_horizontal_pod_autoscaler_list_local_var->metadata = metadata; + v2_horizontal_pod_autoscaler_list_local_var->_library_owned = 1; return v2_horizontal_pod_autoscaler_list_local_var; } +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_create( + char *api_version, + list_t *items, + char *kind, + v1_list_meta_t *metadata + ) { + return v2_horizontal_pod_autoscaler_list_create_internal ( + api_version, + items, + kind, + metadata + ); +} void v2_horizontal_pod_autoscaler_list_free(v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list) { if(NULL == v2_horizontal_pod_autoscaler_list){ return ; } + if(v2_horizontal_pod_autoscaler_list->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_horizontal_pod_autoscaler_list_free"); + return ; + } listEntry_t *listEntry; if (v2_horizontal_pod_autoscaler_list->api_version) { free(v2_horizontal_pod_autoscaler_list->api_version); @@ -123,6 +141,9 @@ v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_parseFrom // v2_horizontal_pod_autoscaler_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_listJSON, "apiVersion"); + if (cJSON_IsNull(api_version)) { + api_version = NULL; + } if (api_version) { if(!cJSON_IsString(api_version) && !cJSON_IsNull(api_version)) { @@ -132,6 +153,9 @@ v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_parseFrom // v2_horizontal_pod_autoscaler_list->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_listJSON, "items"); + if (cJSON_IsNull(items)) { + items = NULL; + } if (!items) { goto end; } @@ -156,6 +180,9 @@ v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_parseFrom // v2_horizontal_pod_autoscaler_list->kind cJSON *kind = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_listJSON, "kind"); + if (cJSON_IsNull(kind)) { + kind = NULL; + } if (kind) { if(!cJSON_IsString(kind) && !cJSON_IsNull(kind)) { @@ -165,12 +192,15 @@ v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_parseFrom // v2_horizontal_pod_autoscaler_list->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_listJSON, "metadata"); + if (cJSON_IsNull(metadata)) { + metadata = NULL; + } if (metadata) { metadata_local_nonprim = v1_list_meta_parseFromJSON(metadata); //nonprimitive } - v2_horizontal_pod_autoscaler_list_local_var = v2_horizontal_pod_autoscaler_list_create ( + v2_horizontal_pod_autoscaler_list_local_var = v2_horizontal_pod_autoscaler_list_create_internal ( api_version && !cJSON_IsNull(api_version) ? strdup(api_version->valuestring) : NULL, itemsList, kind && !cJSON_IsNull(kind) ? strdup(kind->valuestring) : NULL, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_list.h b/kubernetes/model/v2_horizontal_pod_autoscaler_list.h index 64dc1d16..13fbcfc7 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_list.h +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_list.h @@ -26,9 +26,10 @@ typedef struct v2_horizontal_pod_autoscaler_list_t { char *kind; // string struct v1_list_meta_t *metadata; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_horizontal_pod_autoscaler_list_t; -v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_create( +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_list_t *v2_horizontal_pod_autoscaler_list_create( char *api_version, list_t *items, char *kind, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_spec.c b/kubernetes/model/v2_horizontal_pod_autoscaler_spec.c index 9987acbd..800dcd69 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_spec.c +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_spec.c @@ -5,7 +5,7 @@ -v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_create( +static v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_create_internal( v2_horizontal_pod_autoscaler_behavior_t *behavior, int max_replicas, list_t *metrics, @@ -22,14 +22,34 @@ v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_create( v2_horizontal_pod_autoscaler_spec_local_var->min_replicas = min_replicas; v2_horizontal_pod_autoscaler_spec_local_var->scale_target_ref = scale_target_ref; + v2_horizontal_pod_autoscaler_spec_local_var->_library_owned = 1; return v2_horizontal_pod_autoscaler_spec_local_var; } +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_create( + v2_horizontal_pod_autoscaler_behavior_t *behavior, + int max_replicas, + list_t *metrics, + int min_replicas, + v2_cross_version_object_reference_t *scale_target_ref + ) { + return v2_horizontal_pod_autoscaler_spec_create_internal ( + behavior, + max_replicas, + metrics, + min_replicas, + scale_target_ref + ); +} void v2_horizontal_pod_autoscaler_spec_free(v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec) { if(NULL == v2_horizontal_pod_autoscaler_spec){ return ; } + if(v2_horizontal_pod_autoscaler_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_horizontal_pod_autoscaler_spec_free"); + return ; + } listEntry_t *listEntry; if (v2_horizontal_pod_autoscaler_spec->behavior) { v2_horizontal_pod_autoscaler_behavior_free(v2_horizontal_pod_autoscaler_spec->behavior); @@ -138,12 +158,18 @@ v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_parseFrom // v2_horizontal_pod_autoscaler_spec->behavior cJSON *behavior = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_specJSON, "behavior"); + if (cJSON_IsNull(behavior)) { + behavior = NULL; + } if (behavior) { behavior_local_nonprim = v2_horizontal_pod_autoscaler_behavior_parseFromJSON(behavior); //nonprimitive } // v2_horizontal_pod_autoscaler_spec->max_replicas cJSON *max_replicas = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_specJSON, "maxReplicas"); + if (cJSON_IsNull(max_replicas)) { + max_replicas = NULL; + } if (!max_replicas) { goto end; } @@ -156,6 +182,9 @@ v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_parseFrom // v2_horizontal_pod_autoscaler_spec->metrics cJSON *metrics = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_specJSON, "metrics"); + if (cJSON_IsNull(metrics)) { + metrics = NULL; + } if (metrics) { cJSON *metrics_local_nonprimitive = NULL; if(!cJSON_IsArray(metrics)){ @@ -177,6 +206,9 @@ v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_parseFrom // v2_horizontal_pod_autoscaler_spec->min_replicas cJSON *min_replicas = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_specJSON, "minReplicas"); + if (cJSON_IsNull(min_replicas)) { + min_replicas = NULL; + } if (min_replicas) { if(!cJSON_IsNumber(min_replicas)) { @@ -186,6 +218,9 @@ v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_parseFrom // v2_horizontal_pod_autoscaler_spec->scale_target_ref cJSON *scale_target_ref = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_specJSON, "scaleTargetRef"); + if (cJSON_IsNull(scale_target_ref)) { + scale_target_ref = NULL; + } if (!scale_target_ref) { goto end; } @@ -194,7 +229,7 @@ v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_parseFrom scale_target_ref_local_nonprim = v2_cross_version_object_reference_parseFromJSON(scale_target_ref); //nonprimitive - v2_horizontal_pod_autoscaler_spec_local_var = v2_horizontal_pod_autoscaler_spec_create ( + v2_horizontal_pod_autoscaler_spec_local_var = v2_horizontal_pod_autoscaler_spec_create_internal ( behavior ? behavior_local_nonprim : NULL, max_replicas->valuedouble, metrics ? metricsList : NULL, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_spec.h b/kubernetes/model/v2_horizontal_pod_autoscaler_spec.h index 9e2d4766..07909575 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_spec.h +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_spec.h @@ -28,9 +28,10 @@ typedef struct v2_horizontal_pod_autoscaler_spec_t { int min_replicas; //numeric struct v2_cross_version_object_reference_t *scale_target_ref; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_horizontal_pod_autoscaler_spec_t; -v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_create( +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_spec_t *v2_horizontal_pod_autoscaler_spec_create( v2_horizontal_pod_autoscaler_behavior_t *behavior, int max_replicas, list_t *metrics, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_status.c b/kubernetes/model/v2_horizontal_pod_autoscaler_status.c index 2b1e3653..80530809 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_status.c +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_status.c @@ -5,7 +5,7 @@ -v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_create( +static v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_create_internal( list_t *conditions, list_t *current_metrics, int current_replicas, @@ -24,14 +24,36 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_creat v2_horizontal_pod_autoscaler_status_local_var->last_scale_time = last_scale_time; v2_horizontal_pod_autoscaler_status_local_var->observed_generation = observed_generation; + v2_horizontal_pod_autoscaler_status_local_var->_library_owned = 1; return v2_horizontal_pod_autoscaler_status_local_var; } +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_create( + list_t *conditions, + list_t *current_metrics, + int current_replicas, + int desired_replicas, + char *last_scale_time, + long observed_generation + ) { + return v2_horizontal_pod_autoscaler_status_create_internal ( + conditions, + current_metrics, + current_replicas, + desired_replicas, + last_scale_time, + observed_generation + ); +} void v2_horizontal_pod_autoscaler_status_free(v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status) { if(NULL == v2_horizontal_pod_autoscaler_status){ return ; } + if(v2_horizontal_pod_autoscaler_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_horizontal_pod_autoscaler_status_free"); + return ; + } listEntry_t *listEntry; if (v2_horizontal_pod_autoscaler_status->conditions) { list_ForEach(listEntry, v2_horizontal_pod_autoscaler_status->conditions) { @@ -149,6 +171,9 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_parse // v2_horizontal_pod_autoscaler_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_statusJSON, "conditions"); + if (cJSON_IsNull(conditions)) { + conditions = NULL; + } if (conditions) { cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ @@ -170,6 +195,9 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_parse // v2_horizontal_pod_autoscaler_status->current_metrics cJSON *current_metrics = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_statusJSON, "currentMetrics"); + if (cJSON_IsNull(current_metrics)) { + current_metrics = NULL; + } if (current_metrics) { cJSON *current_metrics_local_nonprimitive = NULL; if(!cJSON_IsArray(current_metrics)){ @@ -191,6 +219,9 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_parse // v2_horizontal_pod_autoscaler_status->current_replicas cJSON *current_replicas = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_statusJSON, "currentReplicas"); + if (cJSON_IsNull(current_replicas)) { + current_replicas = NULL; + } if (current_replicas) { if(!cJSON_IsNumber(current_replicas)) { @@ -200,6 +231,9 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_parse // v2_horizontal_pod_autoscaler_status->desired_replicas cJSON *desired_replicas = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_statusJSON, "desiredReplicas"); + if (cJSON_IsNull(desired_replicas)) { + desired_replicas = NULL; + } if (!desired_replicas) { goto end; } @@ -212,6 +246,9 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_parse // v2_horizontal_pod_autoscaler_status->last_scale_time cJSON *last_scale_time = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_statusJSON, "lastScaleTime"); + if (cJSON_IsNull(last_scale_time)) { + last_scale_time = NULL; + } if (last_scale_time) { if(!cJSON_IsString(last_scale_time) && !cJSON_IsNull(last_scale_time)) { @@ -221,6 +258,9 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_parse // v2_horizontal_pod_autoscaler_status->observed_generation cJSON *observed_generation = cJSON_GetObjectItemCaseSensitive(v2_horizontal_pod_autoscaler_statusJSON, "observedGeneration"); + if (cJSON_IsNull(observed_generation)) { + observed_generation = NULL; + } if (observed_generation) { if(!cJSON_IsNumber(observed_generation)) { @@ -229,7 +269,7 @@ v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_parse } - v2_horizontal_pod_autoscaler_status_local_var = v2_horizontal_pod_autoscaler_status_create ( + v2_horizontal_pod_autoscaler_status_local_var = v2_horizontal_pod_autoscaler_status_create_internal ( conditions ? conditionsList : NULL, current_metrics ? current_metricsList : NULL, current_replicas ? current_replicas->valuedouble : 0, diff --git a/kubernetes/model/v2_horizontal_pod_autoscaler_status.h b/kubernetes/model/v2_horizontal_pod_autoscaler_status.h index defced0e..6e4d47ef 100644 --- a/kubernetes/model/v2_horizontal_pod_autoscaler_status.h +++ b/kubernetes/model/v2_horizontal_pod_autoscaler_status.h @@ -28,9 +28,10 @@ typedef struct v2_horizontal_pod_autoscaler_status_t { char *last_scale_time; //date time long observed_generation; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v2_horizontal_pod_autoscaler_status_t; -v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_create( +__attribute__((deprecated)) v2_horizontal_pod_autoscaler_status_t *v2_horizontal_pod_autoscaler_status_create( list_t *conditions, list_t *current_metrics, int current_replicas, diff --git a/kubernetes/model/v2_hpa_scaling_policy.c b/kubernetes/model/v2_hpa_scaling_policy.c index 3150fe3b..1a0185df 100644 --- a/kubernetes/model/v2_hpa_scaling_policy.c +++ b/kubernetes/model/v2_hpa_scaling_policy.c @@ -5,7 +5,7 @@ -v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_create( +static v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_create_internal( int period_seconds, char *type, int value @@ -18,14 +18,30 @@ v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_create( v2_hpa_scaling_policy_local_var->type = type; v2_hpa_scaling_policy_local_var->value = value; + v2_hpa_scaling_policy_local_var->_library_owned = 1; return v2_hpa_scaling_policy_local_var; } +__attribute__((deprecated)) v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_create( + int period_seconds, + char *type, + int value + ) { + return v2_hpa_scaling_policy_create_internal ( + period_seconds, + type, + value + ); +} void v2_hpa_scaling_policy_free(v2_hpa_scaling_policy_t *v2_hpa_scaling_policy) { if(NULL == v2_hpa_scaling_policy){ return ; } + if(v2_hpa_scaling_policy->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_hpa_scaling_policy_free"); + return ; + } listEntry_t *listEntry; if (v2_hpa_scaling_policy->type) { free(v2_hpa_scaling_policy->type); @@ -77,6 +93,9 @@ v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_parseFromJSON(cJSON *v2_hpa_scali // v2_hpa_scaling_policy->period_seconds cJSON *period_seconds = cJSON_GetObjectItemCaseSensitive(v2_hpa_scaling_policyJSON, "periodSeconds"); + if (cJSON_IsNull(period_seconds)) { + period_seconds = NULL; + } if (!period_seconds) { goto end; } @@ -89,6 +108,9 @@ v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_parseFromJSON(cJSON *v2_hpa_scali // v2_hpa_scaling_policy->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v2_hpa_scaling_policyJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -101,6 +123,9 @@ v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_parseFromJSON(cJSON *v2_hpa_scali // v2_hpa_scaling_policy->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v2_hpa_scaling_policyJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (!value) { goto end; } @@ -112,7 +137,7 @@ v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_parseFromJSON(cJSON *v2_hpa_scali } - v2_hpa_scaling_policy_local_var = v2_hpa_scaling_policy_create ( + v2_hpa_scaling_policy_local_var = v2_hpa_scaling_policy_create_internal ( period_seconds->valuedouble, strdup(type->valuestring), value->valuedouble diff --git a/kubernetes/model/v2_hpa_scaling_policy.h b/kubernetes/model/v2_hpa_scaling_policy.h index 6b237ef7..7d351e1c 100644 --- a/kubernetes/model/v2_hpa_scaling_policy.h +++ b/kubernetes/model/v2_hpa_scaling_policy.h @@ -23,9 +23,10 @@ typedef struct v2_hpa_scaling_policy_t { char *type; // string int value; //numeric + int _library_owned; // Is the library responsible for freeing this object? } v2_hpa_scaling_policy_t; -v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_create( +__attribute__((deprecated)) v2_hpa_scaling_policy_t *v2_hpa_scaling_policy_create( int period_seconds, char *type, int value diff --git a/kubernetes/model/v2_hpa_scaling_rules.c b/kubernetes/model/v2_hpa_scaling_rules.c index d5c62a8e..bd95daab 100644 --- a/kubernetes/model/v2_hpa_scaling_rules.c +++ b/kubernetes/model/v2_hpa_scaling_rules.c @@ -5,10 +5,11 @@ -v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create( +static v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create_internal( list_t *policies, char *select_policy, - int stabilization_window_seconds + int stabilization_window_seconds, + char *tolerance ) { v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_local_var = malloc(sizeof(v2_hpa_scaling_rules_t)); if (!v2_hpa_scaling_rules_local_var) { @@ -17,15 +18,34 @@ v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create( v2_hpa_scaling_rules_local_var->policies = policies; v2_hpa_scaling_rules_local_var->select_policy = select_policy; v2_hpa_scaling_rules_local_var->stabilization_window_seconds = stabilization_window_seconds; + v2_hpa_scaling_rules_local_var->tolerance = tolerance; + v2_hpa_scaling_rules_local_var->_library_owned = 1; return v2_hpa_scaling_rules_local_var; } +__attribute__((deprecated)) v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create( + list_t *policies, + char *select_policy, + int stabilization_window_seconds, + char *tolerance + ) { + return v2_hpa_scaling_rules_create_internal ( + policies, + select_policy, + stabilization_window_seconds, + tolerance + ); +} void v2_hpa_scaling_rules_free(v2_hpa_scaling_rules_t *v2_hpa_scaling_rules) { if(NULL == v2_hpa_scaling_rules){ return ; } + if(v2_hpa_scaling_rules->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_hpa_scaling_rules_free"); + return ; + } listEntry_t *listEntry; if (v2_hpa_scaling_rules->policies) { list_ForEach(listEntry, v2_hpa_scaling_rules->policies) { @@ -38,6 +58,10 @@ void v2_hpa_scaling_rules_free(v2_hpa_scaling_rules_t *v2_hpa_scaling_rules) { free(v2_hpa_scaling_rules->select_policy); v2_hpa_scaling_rules->select_policy = NULL; } + if (v2_hpa_scaling_rules->tolerance) { + free(v2_hpa_scaling_rules->tolerance); + v2_hpa_scaling_rules->tolerance = NULL; + } free(v2_hpa_scaling_rules); } @@ -79,6 +103,14 @@ cJSON *v2_hpa_scaling_rules_convertToJSON(v2_hpa_scaling_rules_t *v2_hpa_scaling } } + + // v2_hpa_scaling_rules->tolerance + if(v2_hpa_scaling_rules->tolerance) { + if(cJSON_AddStringToObject(item, "tolerance", v2_hpa_scaling_rules->tolerance) == NULL) { + goto fail; //String + } + } + return item; fail: if (item) { @@ -96,6 +128,9 @@ v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_parseFromJSON(cJSON *v2_hpa_scaling // v2_hpa_scaling_rules->policies cJSON *policies = cJSON_GetObjectItemCaseSensitive(v2_hpa_scaling_rulesJSON, "policies"); + if (cJSON_IsNull(policies)) { + policies = NULL; + } if (policies) { cJSON *policies_local_nonprimitive = NULL; if(!cJSON_IsArray(policies)){ @@ -117,6 +152,9 @@ v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_parseFromJSON(cJSON *v2_hpa_scaling // v2_hpa_scaling_rules->select_policy cJSON *select_policy = cJSON_GetObjectItemCaseSensitive(v2_hpa_scaling_rulesJSON, "selectPolicy"); + if (cJSON_IsNull(select_policy)) { + select_policy = NULL; + } if (select_policy) { if(!cJSON_IsString(select_policy) && !cJSON_IsNull(select_policy)) { @@ -126,6 +164,9 @@ v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_parseFromJSON(cJSON *v2_hpa_scaling // v2_hpa_scaling_rules->stabilization_window_seconds cJSON *stabilization_window_seconds = cJSON_GetObjectItemCaseSensitive(v2_hpa_scaling_rulesJSON, "stabilizationWindowSeconds"); + if (cJSON_IsNull(stabilization_window_seconds)) { + stabilization_window_seconds = NULL; + } if (stabilization_window_seconds) { if(!cJSON_IsNumber(stabilization_window_seconds)) { @@ -133,11 +174,24 @@ v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_parseFromJSON(cJSON *v2_hpa_scaling } } + // v2_hpa_scaling_rules->tolerance + cJSON *tolerance = cJSON_GetObjectItemCaseSensitive(v2_hpa_scaling_rulesJSON, "tolerance"); + if (cJSON_IsNull(tolerance)) { + tolerance = NULL; + } + if (tolerance) { + if(!cJSON_IsString(tolerance) && !cJSON_IsNull(tolerance)) + { + goto end; //String + } + } + - v2_hpa_scaling_rules_local_var = v2_hpa_scaling_rules_create ( + v2_hpa_scaling_rules_local_var = v2_hpa_scaling_rules_create_internal ( policies ? policiesList : NULL, select_policy && !cJSON_IsNull(select_policy) ? strdup(select_policy->valuestring) : NULL, - stabilization_window_seconds ? stabilization_window_seconds->valuedouble : 0 + stabilization_window_seconds ? stabilization_window_seconds->valuedouble : 0, + tolerance && !cJSON_IsNull(tolerance) ? strdup(tolerance->valuestring) : NULL ); return v2_hpa_scaling_rules_local_var; diff --git a/kubernetes/model/v2_hpa_scaling_rules.h b/kubernetes/model/v2_hpa_scaling_rules.h index 550ce7ea..54ada76a 100644 --- a/kubernetes/model/v2_hpa_scaling_rules.h +++ b/kubernetes/model/v2_hpa_scaling_rules.h @@ -1,7 +1,7 @@ /* * v2_hpa_scaling_rules.h * - * HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen. + * HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance. Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen. The tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.) */ #ifndef _v2_hpa_scaling_rules_H_ @@ -23,13 +23,16 @@ typedef struct v2_hpa_scaling_rules_t { list_t *policies; //nonprimitive container char *select_policy; // string int stabilization_window_seconds; //numeric + char *tolerance; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_hpa_scaling_rules_t; -v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create( +__attribute__((deprecated)) v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create( list_t *policies, char *select_policy, - int stabilization_window_seconds + int stabilization_window_seconds, + char *tolerance ); void v2_hpa_scaling_rules_free(v2_hpa_scaling_rules_t *v2_hpa_scaling_rules); diff --git a/kubernetes/model/v2_metric_identifier.c b/kubernetes/model/v2_metric_identifier.c index 9a2a936d..ea002a9a 100644 --- a/kubernetes/model/v2_metric_identifier.c +++ b/kubernetes/model/v2_metric_identifier.c @@ -5,7 +5,7 @@ -v2_metric_identifier_t *v2_metric_identifier_create( +static v2_metric_identifier_t *v2_metric_identifier_create_internal( char *name, v1_label_selector_t *selector ) { @@ -16,14 +16,28 @@ v2_metric_identifier_t *v2_metric_identifier_create( v2_metric_identifier_local_var->name = name; v2_metric_identifier_local_var->selector = selector; + v2_metric_identifier_local_var->_library_owned = 1; return v2_metric_identifier_local_var; } +__attribute__((deprecated)) v2_metric_identifier_t *v2_metric_identifier_create( + char *name, + v1_label_selector_t *selector + ) { + return v2_metric_identifier_create_internal ( + name, + selector + ); +} void v2_metric_identifier_free(v2_metric_identifier_t *v2_metric_identifier) { if(NULL == v2_metric_identifier){ return ; } + if(v2_metric_identifier->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_metric_identifier_free"); + return ; + } listEntry_t *listEntry; if (v2_metric_identifier->name) { free(v2_metric_identifier->name); @@ -77,6 +91,9 @@ v2_metric_identifier_t *v2_metric_identifier_parseFromJSON(cJSON *v2_metric_iden // v2_metric_identifier->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v2_metric_identifierJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -89,12 +106,15 @@ v2_metric_identifier_t *v2_metric_identifier_parseFromJSON(cJSON *v2_metric_iden // v2_metric_identifier->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v2_metric_identifierJSON, "selector"); + if (cJSON_IsNull(selector)) { + selector = NULL; + } if (selector) { selector_local_nonprim = v1_label_selector_parseFromJSON(selector); //nonprimitive } - v2_metric_identifier_local_var = v2_metric_identifier_create ( + v2_metric_identifier_local_var = v2_metric_identifier_create_internal ( strdup(name->valuestring), selector ? selector_local_nonprim : NULL ); diff --git a/kubernetes/model/v2_metric_identifier.h b/kubernetes/model/v2_metric_identifier.h index c5ae181e..20db6f23 100644 --- a/kubernetes/model/v2_metric_identifier.h +++ b/kubernetes/model/v2_metric_identifier.h @@ -23,9 +23,10 @@ typedef struct v2_metric_identifier_t { char *name; // string struct v1_label_selector_t *selector; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_metric_identifier_t; -v2_metric_identifier_t *v2_metric_identifier_create( +__attribute__((deprecated)) v2_metric_identifier_t *v2_metric_identifier_create( char *name, v1_label_selector_t *selector ); diff --git a/kubernetes/model/v2_metric_spec.c b/kubernetes/model/v2_metric_spec.c index 00a08a84..cb52276b 100644 --- a/kubernetes/model/v2_metric_spec.c +++ b/kubernetes/model/v2_metric_spec.c @@ -5,7 +5,7 @@ -v2_metric_spec_t *v2_metric_spec_create( +static v2_metric_spec_t *v2_metric_spec_create_internal( v2_container_resource_metric_source_t *container_resource, v2_external_metric_source_t *external, v2_object_metric_source_t *object, @@ -24,14 +24,36 @@ v2_metric_spec_t *v2_metric_spec_create( v2_metric_spec_local_var->resource = resource; v2_metric_spec_local_var->type = type; + v2_metric_spec_local_var->_library_owned = 1; return v2_metric_spec_local_var; } +__attribute__((deprecated)) v2_metric_spec_t *v2_metric_spec_create( + v2_container_resource_metric_source_t *container_resource, + v2_external_metric_source_t *external, + v2_object_metric_source_t *object, + v2_pods_metric_source_t *pods, + v2_resource_metric_source_t *resource, + char *type + ) { + return v2_metric_spec_create_internal ( + container_resource, + external, + object, + pods, + resource, + type + ); +} void v2_metric_spec_free(v2_metric_spec_t *v2_metric_spec) { if(NULL == v2_metric_spec){ return ; } + if(v2_metric_spec->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_metric_spec_free"); + return ; + } listEntry_t *listEntry; if (v2_metric_spec->container_resource) { v2_container_resource_metric_source_free(v2_metric_spec->container_resource); @@ -165,36 +187,54 @@ v2_metric_spec_t *v2_metric_spec_parseFromJSON(cJSON *v2_metric_specJSON){ // v2_metric_spec->container_resource cJSON *container_resource = cJSON_GetObjectItemCaseSensitive(v2_metric_specJSON, "containerResource"); + if (cJSON_IsNull(container_resource)) { + container_resource = NULL; + } if (container_resource) { container_resource_local_nonprim = v2_container_resource_metric_source_parseFromJSON(container_resource); //nonprimitive } // v2_metric_spec->external cJSON *external = cJSON_GetObjectItemCaseSensitive(v2_metric_specJSON, "external"); + if (cJSON_IsNull(external)) { + external = NULL; + } if (external) { external_local_nonprim = v2_external_metric_source_parseFromJSON(external); //nonprimitive } // v2_metric_spec->object cJSON *object = cJSON_GetObjectItemCaseSensitive(v2_metric_specJSON, "object"); + if (cJSON_IsNull(object)) { + object = NULL; + } if (object) { object_local_nonprim = v2_object_metric_source_parseFromJSON(object); //nonprimitive } // v2_metric_spec->pods cJSON *pods = cJSON_GetObjectItemCaseSensitive(v2_metric_specJSON, "pods"); + if (cJSON_IsNull(pods)) { + pods = NULL; + } if (pods) { pods_local_nonprim = v2_pods_metric_source_parseFromJSON(pods); //nonprimitive } // v2_metric_spec->resource cJSON *resource = cJSON_GetObjectItemCaseSensitive(v2_metric_specJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } if (resource) { resource_local_nonprim = v2_resource_metric_source_parseFromJSON(resource); //nonprimitive } // v2_metric_spec->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v2_metric_specJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -206,7 +246,7 @@ v2_metric_spec_t *v2_metric_spec_parseFromJSON(cJSON *v2_metric_specJSON){ } - v2_metric_spec_local_var = v2_metric_spec_create ( + v2_metric_spec_local_var = v2_metric_spec_create_internal ( container_resource ? container_resource_local_nonprim : NULL, external ? external_local_nonprim : NULL, object ? object_local_nonprim : NULL, diff --git a/kubernetes/model/v2_metric_spec.h b/kubernetes/model/v2_metric_spec.h index 1150464a..bc8d2351 100644 --- a/kubernetes/model/v2_metric_spec.h +++ b/kubernetes/model/v2_metric_spec.h @@ -31,9 +31,10 @@ typedef struct v2_metric_spec_t { struct v2_resource_metric_source_t *resource; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_metric_spec_t; -v2_metric_spec_t *v2_metric_spec_create( +__attribute__((deprecated)) v2_metric_spec_t *v2_metric_spec_create( v2_container_resource_metric_source_t *container_resource, v2_external_metric_source_t *external, v2_object_metric_source_t *object, diff --git a/kubernetes/model/v2_metric_status.c b/kubernetes/model/v2_metric_status.c index c7c4a45e..0321b27e 100644 --- a/kubernetes/model/v2_metric_status.c +++ b/kubernetes/model/v2_metric_status.c @@ -5,7 +5,7 @@ -v2_metric_status_t *v2_metric_status_create( +static v2_metric_status_t *v2_metric_status_create_internal( v2_container_resource_metric_status_t *container_resource, v2_external_metric_status_t *external, v2_object_metric_status_t *object, @@ -24,14 +24,36 @@ v2_metric_status_t *v2_metric_status_create( v2_metric_status_local_var->resource = resource; v2_metric_status_local_var->type = type; + v2_metric_status_local_var->_library_owned = 1; return v2_metric_status_local_var; } +__attribute__((deprecated)) v2_metric_status_t *v2_metric_status_create( + v2_container_resource_metric_status_t *container_resource, + v2_external_metric_status_t *external, + v2_object_metric_status_t *object, + v2_pods_metric_status_t *pods, + v2_resource_metric_status_t *resource, + char *type + ) { + return v2_metric_status_create_internal ( + container_resource, + external, + object, + pods, + resource, + type + ); +} void v2_metric_status_free(v2_metric_status_t *v2_metric_status) { if(NULL == v2_metric_status){ return ; } + if(v2_metric_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_metric_status_free"); + return ; + } listEntry_t *listEntry; if (v2_metric_status->container_resource) { v2_container_resource_metric_status_free(v2_metric_status->container_resource); @@ -165,36 +187,54 @@ v2_metric_status_t *v2_metric_status_parseFromJSON(cJSON *v2_metric_statusJSON){ // v2_metric_status->container_resource cJSON *container_resource = cJSON_GetObjectItemCaseSensitive(v2_metric_statusJSON, "containerResource"); + if (cJSON_IsNull(container_resource)) { + container_resource = NULL; + } if (container_resource) { container_resource_local_nonprim = v2_container_resource_metric_status_parseFromJSON(container_resource); //nonprimitive } // v2_metric_status->external cJSON *external = cJSON_GetObjectItemCaseSensitive(v2_metric_statusJSON, "external"); + if (cJSON_IsNull(external)) { + external = NULL; + } if (external) { external_local_nonprim = v2_external_metric_status_parseFromJSON(external); //nonprimitive } // v2_metric_status->object cJSON *object = cJSON_GetObjectItemCaseSensitive(v2_metric_statusJSON, "object"); + if (cJSON_IsNull(object)) { + object = NULL; + } if (object) { object_local_nonprim = v2_object_metric_status_parseFromJSON(object); //nonprimitive } // v2_metric_status->pods cJSON *pods = cJSON_GetObjectItemCaseSensitive(v2_metric_statusJSON, "pods"); + if (cJSON_IsNull(pods)) { + pods = NULL; + } if (pods) { pods_local_nonprim = v2_pods_metric_status_parseFromJSON(pods); //nonprimitive } // v2_metric_status->resource cJSON *resource = cJSON_GetObjectItemCaseSensitive(v2_metric_statusJSON, "resource"); + if (cJSON_IsNull(resource)) { + resource = NULL; + } if (resource) { resource_local_nonprim = v2_resource_metric_status_parseFromJSON(resource); //nonprimitive } // v2_metric_status->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v2_metric_statusJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -206,7 +246,7 @@ v2_metric_status_t *v2_metric_status_parseFromJSON(cJSON *v2_metric_statusJSON){ } - v2_metric_status_local_var = v2_metric_status_create ( + v2_metric_status_local_var = v2_metric_status_create_internal ( container_resource ? container_resource_local_nonprim : NULL, external ? external_local_nonprim : NULL, object ? object_local_nonprim : NULL, diff --git a/kubernetes/model/v2_metric_status.h b/kubernetes/model/v2_metric_status.h index 1648045b..b0237b36 100644 --- a/kubernetes/model/v2_metric_status.h +++ b/kubernetes/model/v2_metric_status.h @@ -31,9 +31,10 @@ typedef struct v2_metric_status_t { struct v2_resource_metric_status_t *resource; //model char *type; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_metric_status_t; -v2_metric_status_t *v2_metric_status_create( +__attribute__((deprecated)) v2_metric_status_t *v2_metric_status_create( v2_container_resource_metric_status_t *container_resource, v2_external_metric_status_t *external, v2_object_metric_status_t *object, diff --git a/kubernetes/model/v2_metric_target.c b/kubernetes/model/v2_metric_target.c index cf1af034..855861b8 100644 --- a/kubernetes/model/v2_metric_target.c +++ b/kubernetes/model/v2_metric_target.c @@ -5,7 +5,7 @@ -v2_metric_target_t *v2_metric_target_create( +static v2_metric_target_t *v2_metric_target_create_internal( int average_utilization, char *average_value, char *type, @@ -20,14 +20,32 @@ v2_metric_target_t *v2_metric_target_create( v2_metric_target_local_var->type = type; v2_metric_target_local_var->value = value; + v2_metric_target_local_var->_library_owned = 1; return v2_metric_target_local_var; } +__attribute__((deprecated)) v2_metric_target_t *v2_metric_target_create( + int average_utilization, + char *average_value, + char *type, + char *value + ) { + return v2_metric_target_create_internal ( + average_utilization, + average_value, + type, + value + ); +} void v2_metric_target_free(v2_metric_target_t *v2_metric_target) { if(NULL == v2_metric_target){ return ; } + if(v2_metric_target->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_metric_target_free"); + return ; + } listEntry_t *listEntry; if (v2_metric_target->average_value) { free(v2_metric_target->average_value); @@ -93,6 +111,9 @@ v2_metric_target_t *v2_metric_target_parseFromJSON(cJSON *v2_metric_targetJSON){ // v2_metric_target->average_utilization cJSON *average_utilization = cJSON_GetObjectItemCaseSensitive(v2_metric_targetJSON, "averageUtilization"); + if (cJSON_IsNull(average_utilization)) { + average_utilization = NULL; + } if (average_utilization) { if(!cJSON_IsNumber(average_utilization)) { @@ -102,6 +123,9 @@ v2_metric_target_t *v2_metric_target_parseFromJSON(cJSON *v2_metric_targetJSON){ // v2_metric_target->average_value cJSON *average_value = cJSON_GetObjectItemCaseSensitive(v2_metric_targetJSON, "averageValue"); + if (cJSON_IsNull(average_value)) { + average_value = NULL; + } if (average_value) { if(!cJSON_IsString(average_value) && !cJSON_IsNull(average_value)) { @@ -111,6 +135,9 @@ v2_metric_target_t *v2_metric_target_parseFromJSON(cJSON *v2_metric_targetJSON){ // v2_metric_target->type cJSON *type = cJSON_GetObjectItemCaseSensitive(v2_metric_targetJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (!type) { goto end; } @@ -123,6 +150,9 @@ v2_metric_target_t *v2_metric_target_parseFromJSON(cJSON *v2_metric_targetJSON){ // v2_metric_target->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v2_metric_targetJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (value) { if(!cJSON_IsString(value) && !cJSON_IsNull(value)) { @@ -131,7 +161,7 @@ v2_metric_target_t *v2_metric_target_parseFromJSON(cJSON *v2_metric_targetJSON){ } - v2_metric_target_local_var = v2_metric_target_create ( + v2_metric_target_local_var = v2_metric_target_create_internal ( average_utilization ? average_utilization->valuedouble : 0, average_value && !cJSON_IsNull(average_value) ? strdup(average_value->valuestring) : NULL, strdup(type->valuestring), diff --git a/kubernetes/model/v2_metric_target.h b/kubernetes/model/v2_metric_target.h index a00061e0..a02e3c3b 100644 --- a/kubernetes/model/v2_metric_target.h +++ b/kubernetes/model/v2_metric_target.h @@ -24,9 +24,10 @@ typedef struct v2_metric_target_t { char *type; // string char *value; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_metric_target_t; -v2_metric_target_t *v2_metric_target_create( +__attribute__((deprecated)) v2_metric_target_t *v2_metric_target_create( int average_utilization, char *average_value, char *type, diff --git a/kubernetes/model/v2_metric_value_status.c b/kubernetes/model/v2_metric_value_status.c index 5582afeb..dff9c30d 100644 --- a/kubernetes/model/v2_metric_value_status.c +++ b/kubernetes/model/v2_metric_value_status.c @@ -5,7 +5,7 @@ -v2_metric_value_status_t *v2_metric_value_status_create( +static v2_metric_value_status_t *v2_metric_value_status_create_internal( int average_utilization, char *average_value, char *value @@ -18,14 +18,30 @@ v2_metric_value_status_t *v2_metric_value_status_create( v2_metric_value_status_local_var->average_value = average_value; v2_metric_value_status_local_var->value = value; + v2_metric_value_status_local_var->_library_owned = 1; return v2_metric_value_status_local_var; } +__attribute__((deprecated)) v2_metric_value_status_t *v2_metric_value_status_create( + int average_utilization, + char *average_value, + char *value + ) { + return v2_metric_value_status_create_internal ( + average_utilization, + average_value, + value + ); +} void v2_metric_value_status_free(v2_metric_value_status_t *v2_metric_value_status) { if(NULL == v2_metric_value_status){ return ; } + if(v2_metric_value_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_metric_value_status_free"); + return ; + } listEntry_t *listEntry; if (v2_metric_value_status->average_value) { free(v2_metric_value_status->average_value); @@ -78,6 +94,9 @@ v2_metric_value_status_t *v2_metric_value_status_parseFromJSON(cJSON *v2_metric_ // v2_metric_value_status->average_utilization cJSON *average_utilization = cJSON_GetObjectItemCaseSensitive(v2_metric_value_statusJSON, "averageUtilization"); + if (cJSON_IsNull(average_utilization)) { + average_utilization = NULL; + } if (average_utilization) { if(!cJSON_IsNumber(average_utilization)) { @@ -87,6 +106,9 @@ v2_metric_value_status_t *v2_metric_value_status_parseFromJSON(cJSON *v2_metric_ // v2_metric_value_status->average_value cJSON *average_value = cJSON_GetObjectItemCaseSensitive(v2_metric_value_statusJSON, "averageValue"); + if (cJSON_IsNull(average_value)) { + average_value = NULL; + } if (average_value) { if(!cJSON_IsString(average_value) && !cJSON_IsNull(average_value)) { @@ -96,6 +118,9 @@ v2_metric_value_status_t *v2_metric_value_status_parseFromJSON(cJSON *v2_metric_ // v2_metric_value_status->value cJSON *value = cJSON_GetObjectItemCaseSensitive(v2_metric_value_statusJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } if (value) { if(!cJSON_IsString(value) && !cJSON_IsNull(value)) { @@ -104,7 +129,7 @@ v2_metric_value_status_t *v2_metric_value_status_parseFromJSON(cJSON *v2_metric_ } - v2_metric_value_status_local_var = v2_metric_value_status_create ( + v2_metric_value_status_local_var = v2_metric_value_status_create_internal ( average_utilization ? average_utilization->valuedouble : 0, average_value && !cJSON_IsNull(average_value) ? strdup(average_value->valuestring) : NULL, value && !cJSON_IsNull(value) ? strdup(value->valuestring) : NULL diff --git a/kubernetes/model/v2_metric_value_status.h b/kubernetes/model/v2_metric_value_status.h index f2f5a2ab..7030d677 100644 --- a/kubernetes/model/v2_metric_value_status.h +++ b/kubernetes/model/v2_metric_value_status.h @@ -23,9 +23,10 @@ typedef struct v2_metric_value_status_t { char *average_value; // string char *value; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_metric_value_status_t; -v2_metric_value_status_t *v2_metric_value_status_create( +__attribute__((deprecated)) v2_metric_value_status_t *v2_metric_value_status_create( int average_utilization, char *average_value, char *value diff --git a/kubernetes/model/v2_object_metric_source.c b/kubernetes/model/v2_object_metric_source.c index 102b54f2..bb702fe8 100644 --- a/kubernetes/model/v2_object_metric_source.c +++ b/kubernetes/model/v2_object_metric_source.c @@ -5,7 +5,7 @@ -v2_object_metric_source_t *v2_object_metric_source_create( +static v2_object_metric_source_t *v2_object_metric_source_create_internal( v2_cross_version_object_reference_t *described_object, v2_metric_identifier_t *metric, v2_metric_target_t *target @@ -18,14 +18,30 @@ v2_object_metric_source_t *v2_object_metric_source_create( v2_object_metric_source_local_var->metric = metric; v2_object_metric_source_local_var->target = target; + v2_object_metric_source_local_var->_library_owned = 1; return v2_object_metric_source_local_var; } +__attribute__((deprecated)) v2_object_metric_source_t *v2_object_metric_source_create( + v2_cross_version_object_reference_t *described_object, + v2_metric_identifier_t *metric, + v2_metric_target_t *target + ) { + return v2_object_metric_source_create_internal ( + described_object, + metric, + target + ); +} void v2_object_metric_source_free(v2_object_metric_source_t *v2_object_metric_source) { if(NULL == v2_object_metric_source){ return ; } + if(v2_object_metric_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_object_metric_source_free"); + return ; + } listEntry_t *listEntry; if (v2_object_metric_source->described_object) { v2_cross_version_object_reference_free(v2_object_metric_source->described_object); @@ -109,6 +125,9 @@ v2_object_metric_source_t *v2_object_metric_source_parseFromJSON(cJSON *v2_objec // v2_object_metric_source->described_object cJSON *described_object = cJSON_GetObjectItemCaseSensitive(v2_object_metric_sourceJSON, "describedObject"); + if (cJSON_IsNull(described_object)) { + described_object = NULL; + } if (!described_object) { goto end; } @@ -118,6 +137,9 @@ v2_object_metric_source_t *v2_object_metric_source_parseFromJSON(cJSON *v2_objec // v2_object_metric_source->metric cJSON *metric = cJSON_GetObjectItemCaseSensitive(v2_object_metric_sourceJSON, "metric"); + if (cJSON_IsNull(metric)) { + metric = NULL; + } if (!metric) { goto end; } @@ -127,6 +149,9 @@ v2_object_metric_source_t *v2_object_metric_source_parseFromJSON(cJSON *v2_objec // v2_object_metric_source->target cJSON *target = cJSON_GetObjectItemCaseSensitive(v2_object_metric_sourceJSON, "target"); + if (cJSON_IsNull(target)) { + target = NULL; + } if (!target) { goto end; } @@ -135,7 +160,7 @@ v2_object_metric_source_t *v2_object_metric_source_parseFromJSON(cJSON *v2_objec target_local_nonprim = v2_metric_target_parseFromJSON(target); //nonprimitive - v2_object_metric_source_local_var = v2_object_metric_source_create ( + v2_object_metric_source_local_var = v2_object_metric_source_create_internal ( described_object_local_nonprim, metric_local_nonprim, target_local_nonprim diff --git a/kubernetes/model/v2_object_metric_source.h b/kubernetes/model/v2_object_metric_source.h index f2ed8a26..bf638deb 100644 --- a/kubernetes/model/v2_object_metric_source.h +++ b/kubernetes/model/v2_object_metric_source.h @@ -26,9 +26,10 @@ typedef struct v2_object_metric_source_t { struct v2_metric_identifier_t *metric; //model struct v2_metric_target_t *target; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_object_metric_source_t; -v2_object_metric_source_t *v2_object_metric_source_create( +__attribute__((deprecated)) v2_object_metric_source_t *v2_object_metric_source_create( v2_cross_version_object_reference_t *described_object, v2_metric_identifier_t *metric, v2_metric_target_t *target diff --git a/kubernetes/model/v2_object_metric_status.c b/kubernetes/model/v2_object_metric_status.c index fb026d78..314a5b26 100644 --- a/kubernetes/model/v2_object_metric_status.c +++ b/kubernetes/model/v2_object_metric_status.c @@ -5,7 +5,7 @@ -v2_object_metric_status_t *v2_object_metric_status_create( +static v2_object_metric_status_t *v2_object_metric_status_create_internal( v2_metric_value_status_t *current, v2_cross_version_object_reference_t *described_object, v2_metric_identifier_t *metric @@ -18,14 +18,30 @@ v2_object_metric_status_t *v2_object_metric_status_create( v2_object_metric_status_local_var->described_object = described_object; v2_object_metric_status_local_var->metric = metric; + v2_object_metric_status_local_var->_library_owned = 1; return v2_object_metric_status_local_var; } +__attribute__((deprecated)) v2_object_metric_status_t *v2_object_metric_status_create( + v2_metric_value_status_t *current, + v2_cross_version_object_reference_t *described_object, + v2_metric_identifier_t *metric + ) { + return v2_object_metric_status_create_internal ( + current, + described_object, + metric + ); +} void v2_object_metric_status_free(v2_object_metric_status_t *v2_object_metric_status) { if(NULL == v2_object_metric_status){ return ; } + if(v2_object_metric_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_object_metric_status_free"); + return ; + } listEntry_t *listEntry; if (v2_object_metric_status->current) { v2_metric_value_status_free(v2_object_metric_status->current); @@ -109,6 +125,9 @@ v2_object_metric_status_t *v2_object_metric_status_parseFromJSON(cJSON *v2_objec // v2_object_metric_status->current cJSON *current = cJSON_GetObjectItemCaseSensitive(v2_object_metric_statusJSON, "current"); + if (cJSON_IsNull(current)) { + current = NULL; + } if (!current) { goto end; } @@ -118,6 +137,9 @@ v2_object_metric_status_t *v2_object_metric_status_parseFromJSON(cJSON *v2_objec // v2_object_metric_status->described_object cJSON *described_object = cJSON_GetObjectItemCaseSensitive(v2_object_metric_statusJSON, "describedObject"); + if (cJSON_IsNull(described_object)) { + described_object = NULL; + } if (!described_object) { goto end; } @@ -127,6 +149,9 @@ v2_object_metric_status_t *v2_object_metric_status_parseFromJSON(cJSON *v2_objec // v2_object_metric_status->metric cJSON *metric = cJSON_GetObjectItemCaseSensitive(v2_object_metric_statusJSON, "metric"); + if (cJSON_IsNull(metric)) { + metric = NULL; + } if (!metric) { goto end; } @@ -135,7 +160,7 @@ v2_object_metric_status_t *v2_object_metric_status_parseFromJSON(cJSON *v2_objec metric_local_nonprim = v2_metric_identifier_parseFromJSON(metric); //nonprimitive - v2_object_metric_status_local_var = v2_object_metric_status_create ( + v2_object_metric_status_local_var = v2_object_metric_status_create_internal ( current_local_nonprim, described_object_local_nonprim, metric_local_nonprim diff --git a/kubernetes/model/v2_object_metric_status.h b/kubernetes/model/v2_object_metric_status.h index 4facd930..eb5dffbe 100644 --- a/kubernetes/model/v2_object_metric_status.h +++ b/kubernetes/model/v2_object_metric_status.h @@ -26,9 +26,10 @@ typedef struct v2_object_metric_status_t { struct v2_cross_version_object_reference_t *described_object; //model struct v2_metric_identifier_t *metric; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_object_metric_status_t; -v2_object_metric_status_t *v2_object_metric_status_create( +__attribute__((deprecated)) v2_object_metric_status_t *v2_object_metric_status_create( v2_metric_value_status_t *current, v2_cross_version_object_reference_t *described_object, v2_metric_identifier_t *metric diff --git a/kubernetes/model/v2_pods_metric_source.c b/kubernetes/model/v2_pods_metric_source.c index 052da42b..b9029eb0 100644 --- a/kubernetes/model/v2_pods_metric_source.c +++ b/kubernetes/model/v2_pods_metric_source.c @@ -5,7 +5,7 @@ -v2_pods_metric_source_t *v2_pods_metric_source_create( +static v2_pods_metric_source_t *v2_pods_metric_source_create_internal( v2_metric_identifier_t *metric, v2_metric_target_t *target ) { @@ -16,14 +16,28 @@ v2_pods_metric_source_t *v2_pods_metric_source_create( v2_pods_metric_source_local_var->metric = metric; v2_pods_metric_source_local_var->target = target; + v2_pods_metric_source_local_var->_library_owned = 1; return v2_pods_metric_source_local_var; } +__attribute__((deprecated)) v2_pods_metric_source_t *v2_pods_metric_source_create( + v2_metric_identifier_t *metric, + v2_metric_target_t *target + ) { + return v2_pods_metric_source_create_internal ( + metric, + target + ); +} void v2_pods_metric_source_free(v2_pods_metric_source_t *v2_pods_metric_source) { if(NULL == v2_pods_metric_source){ return ; } + if(v2_pods_metric_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_pods_metric_source_free"); + return ; + } listEntry_t *listEntry; if (v2_pods_metric_source->metric) { v2_metric_identifier_free(v2_pods_metric_source->metric); @@ -86,6 +100,9 @@ v2_pods_metric_source_t *v2_pods_metric_source_parseFromJSON(cJSON *v2_pods_metr // v2_pods_metric_source->metric cJSON *metric = cJSON_GetObjectItemCaseSensitive(v2_pods_metric_sourceJSON, "metric"); + if (cJSON_IsNull(metric)) { + metric = NULL; + } if (!metric) { goto end; } @@ -95,6 +112,9 @@ v2_pods_metric_source_t *v2_pods_metric_source_parseFromJSON(cJSON *v2_pods_metr // v2_pods_metric_source->target cJSON *target = cJSON_GetObjectItemCaseSensitive(v2_pods_metric_sourceJSON, "target"); + if (cJSON_IsNull(target)) { + target = NULL; + } if (!target) { goto end; } @@ -103,7 +123,7 @@ v2_pods_metric_source_t *v2_pods_metric_source_parseFromJSON(cJSON *v2_pods_metr target_local_nonprim = v2_metric_target_parseFromJSON(target); //nonprimitive - v2_pods_metric_source_local_var = v2_pods_metric_source_create ( + v2_pods_metric_source_local_var = v2_pods_metric_source_create_internal ( metric_local_nonprim, target_local_nonprim ); diff --git a/kubernetes/model/v2_pods_metric_source.h b/kubernetes/model/v2_pods_metric_source.h index c87a80bc..d84d5559 100644 --- a/kubernetes/model/v2_pods_metric_source.h +++ b/kubernetes/model/v2_pods_metric_source.h @@ -24,9 +24,10 @@ typedef struct v2_pods_metric_source_t { struct v2_metric_identifier_t *metric; //model struct v2_metric_target_t *target; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_pods_metric_source_t; -v2_pods_metric_source_t *v2_pods_metric_source_create( +__attribute__((deprecated)) v2_pods_metric_source_t *v2_pods_metric_source_create( v2_metric_identifier_t *metric, v2_metric_target_t *target ); diff --git a/kubernetes/model/v2_pods_metric_status.c b/kubernetes/model/v2_pods_metric_status.c index c61bb4d9..9b67f27c 100644 --- a/kubernetes/model/v2_pods_metric_status.c +++ b/kubernetes/model/v2_pods_metric_status.c @@ -5,7 +5,7 @@ -v2_pods_metric_status_t *v2_pods_metric_status_create( +static v2_pods_metric_status_t *v2_pods_metric_status_create_internal( v2_metric_value_status_t *current, v2_metric_identifier_t *metric ) { @@ -16,14 +16,28 @@ v2_pods_metric_status_t *v2_pods_metric_status_create( v2_pods_metric_status_local_var->current = current; v2_pods_metric_status_local_var->metric = metric; + v2_pods_metric_status_local_var->_library_owned = 1; return v2_pods_metric_status_local_var; } +__attribute__((deprecated)) v2_pods_metric_status_t *v2_pods_metric_status_create( + v2_metric_value_status_t *current, + v2_metric_identifier_t *metric + ) { + return v2_pods_metric_status_create_internal ( + current, + metric + ); +} void v2_pods_metric_status_free(v2_pods_metric_status_t *v2_pods_metric_status) { if(NULL == v2_pods_metric_status){ return ; } + if(v2_pods_metric_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_pods_metric_status_free"); + return ; + } listEntry_t *listEntry; if (v2_pods_metric_status->current) { v2_metric_value_status_free(v2_pods_metric_status->current); @@ -86,6 +100,9 @@ v2_pods_metric_status_t *v2_pods_metric_status_parseFromJSON(cJSON *v2_pods_metr // v2_pods_metric_status->current cJSON *current = cJSON_GetObjectItemCaseSensitive(v2_pods_metric_statusJSON, "current"); + if (cJSON_IsNull(current)) { + current = NULL; + } if (!current) { goto end; } @@ -95,6 +112,9 @@ v2_pods_metric_status_t *v2_pods_metric_status_parseFromJSON(cJSON *v2_pods_metr // v2_pods_metric_status->metric cJSON *metric = cJSON_GetObjectItemCaseSensitive(v2_pods_metric_statusJSON, "metric"); + if (cJSON_IsNull(metric)) { + metric = NULL; + } if (!metric) { goto end; } @@ -103,7 +123,7 @@ v2_pods_metric_status_t *v2_pods_metric_status_parseFromJSON(cJSON *v2_pods_metr metric_local_nonprim = v2_metric_identifier_parseFromJSON(metric); //nonprimitive - v2_pods_metric_status_local_var = v2_pods_metric_status_create ( + v2_pods_metric_status_local_var = v2_pods_metric_status_create_internal ( current_local_nonprim, metric_local_nonprim ); diff --git a/kubernetes/model/v2_pods_metric_status.h b/kubernetes/model/v2_pods_metric_status.h index d76053cf..339abe69 100644 --- a/kubernetes/model/v2_pods_metric_status.h +++ b/kubernetes/model/v2_pods_metric_status.h @@ -24,9 +24,10 @@ typedef struct v2_pods_metric_status_t { struct v2_metric_value_status_t *current; //model struct v2_metric_identifier_t *metric; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_pods_metric_status_t; -v2_pods_metric_status_t *v2_pods_metric_status_create( +__attribute__((deprecated)) v2_pods_metric_status_t *v2_pods_metric_status_create( v2_metric_value_status_t *current, v2_metric_identifier_t *metric ); diff --git a/kubernetes/model/v2_resource_metric_source.c b/kubernetes/model/v2_resource_metric_source.c index a38afbc3..55dbcf9a 100644 --- a/kubernetes/model/v2_resource_metric_source.c +++ b/kubernetes/model/v2_resource_metric_source.c @@ -5,7 +5,7 @@ -v2_resource_metric_source_t *v2_resource_metric_source_create( +static v2_resource_metric_source_t *v2_resource_metric_source_create_internal( char *name, v2_metric_target_t *target ) { @@ -16,14 +16,28 @@ v2_resource_metric_source_t *v2_resource_metric_source_create( v2_resource_metric_source_local_var->name = name; v2_resource_metric_source_local_var->target = target; + v2_resource_metric_source_local_var->_library_owned = 1; return v2_resource_metric_source_local_var; } +__attribute__((deprecated)) v2_resource_metric_source_t *v2_resource_metric_source_create( + char *name, + v2_metric_target_t *target + ) { + return v2_resource_metric_source_create_internal ( + name, + target + ); +} void v2_resource_metric_source_free(v2_resource_metric_source_t *v2_resource_metric_source) { if(NULL == v2_resource_metric_source){ return ; } + if(v2_resource_metric_source->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_resource_metric_source_free"); + return ; + } listEntry_t *listEntry; if (v2_resource_metric_source->name) { free(v2_resource_metric_source->name); @@ -78,6 +92,9 @@ v2_resource_metric_source_t *v2_resource_metric_source_parseFromJSON(cJSON *v2_r // v2_resource_metric_source->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v2_resource_metric_sourceJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -90,6 +107,9 @@ v2_resource_metric_source_t *v2_resource_metric_source_parseFromJSON(cJSON *v2_r // v2_resource_metric_source->target cJSON *target = cJSON_GetObjectItemCaseSensitive(v2_resource_metric_sourceJSON, "target"); + if (cJSON_IsNull(target)) { + target = NULL; + } if (!target) { goto end; } @@ -98,7 +118,7 @@ v2_resource_metric_source_t *v2_resource_metric_source_parseFromJSON(cJSON *v2_r target_local_nonprim = v2_metric_target_parseFromJSON(target); //nonprimitive - v2_resource_metric_source_local_var = v2_resource_metric_source_create ( + v2_resource_metric_source_local_var = v2_resource_metric_source_create_internal ( strdup(name->valuestring), target_local_nonprim ); diff --git a/kubernetes/model/v2_resource_metric_source.h b/kubernetes/model/v2_resource_metric_source.h index a0023dcb..0dd708a0 100644 --- a/kubernetes/model/v2_resource_metric_source.h +++ b/kubernetes/model/v2_resource_metric_source.h @@ -23,9 +23,10 @@ typedef struct v2_resource_metric_source_t { char *name; // string struct v2_metric_target_t *target; //model + int _library_owned; // Is the library responsible for freeing this object? } v2_resource_metric_source_t; -v2_resource_metric_source_t *v2_resource_metric_source_create( +__attribute__((deprecated)) v2_resource_metric_source_t *v2_resource_metric_source_create( char *name, v2_metric_target_t *target ); diff --git a/kubernetes/model/v2_resource_metric_status.c b/kubernetes/model/v2_resource_metric_status.c index fc1cbbe0..c9b58aae 100644 --- a/kubernetes/model/v2_resource_metric_status.c +++ b/kubernetes/model/v2_resource_metric_status.c @@ -5,7 +5,7 @@ -v2_resource_metric_status_t *v2_resource_metric_status_create( +static v2_resource_metric_status_t *v2_resource_metric_status_create_internal( v2_metric_value_status_t *current, char *name ) { @@ -16,14 +16,28 @@ v2_resource_metric_status_t *v2_resource_metric_status_create( v2_resource_metric_status_local_var->current = current; v2_resource_metric_status_local_var->name = name; + v2_resource_metric_status_local_var->_library_owned = 1; return v2_resource_metric_status_local_var; } +__attribute__((deprecated)) v2_resource_metric_status_t *v2_resource_metric_status_create( + v2_metric_value_status_t *current, + char *name + ) { + return v2_resource_metric_status_create_internal ( + current, + name + ); +} void v2_resource_metric_status_free(v2_resource_metric_status_t *v2_resource_metric_status) { if(NULL == v2_resource_metric_status){ return ; } + if(v2_resource_metric_status->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v2_resource_metric_status_free"); + return ; + } listEntry_t *listEntry; if (v2_resource_metric_status->current) { v2_metric_value_status_free(v2_resource_metric_status->current); @@ -78,6 +92,9 @@ v2_resource_metric_status_t *v2_resource_metric_status_parseFromJSON(cJSON *v2_r // v2_resource_metric_status->current cJSON *current = cJSON_GetObjectItemCaseSensitive(v2_resource_metric_statusJSON, "current"); + if (cJSON_IsNull(current)) { + current = NULL; + } if (!current) { goto end; } @@ -87,6 +104,9 @@ v2_resource_metric_status_t *v2_resource_metric_status_parseFromJSON(cJSON *v2_r // v2_resource_metric_status->name cJSON *name = cJSON_GetObjectItemCaseSensitive(v2_resource_metric_statusJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -98,7 +118,7 @@ v2_resource_metric_status_t *v2_resource_metric_status_parseFromJSON(cJSON *v2_r } - v2_resource_metric_status_local_var = v2_resource_metric_status_create ( + v2_resource_metric_status_local_var = v2_resource_metric_status_create_internal ( current_local_nonprim, strdup(name->valuestring) ); diff --git a/kubernetes/model/v2_resource_metric_status.h b/kubernetes/model/v2_resource_metric_status.h index 884eeded..416583c7 100644 --- a/kubernetes/model/v2_resource_metric_status.h +++ b/kubernetes/model/v2_resource_metric_status.h @@ -23,9 +23,10 @@ typedef struct v2_resource_metric_status_t { struct v2_metric_value_status_t *current; //model char *name; // string + int _library_owned; // Is the library responsible for freeing this object? } v2_resource_metric_status_t; -v2_resource_metric_status_t *v2_resource_metric_status_create( +__attribute__((deprecated)) v2_resource_metric_status_t *v2_resource_metric_status_create( v2_metric_value_status_t *current, char *name ); diff --git a/kubernetes/model/version_info.c b/kubernetes/model/version_info.c index 4957fd63..337f7b31 100644 --- a/kubernetes/model/version_info.c +++ b/kubernetes/model/version_info.c @@ -5,14 +5,18 @@ -version_info_t *version_info_create( +static version_info_t *version_info_create_internal( char *build_date, char *compiler, + char *emulation_major, + char *emulation_minor, char *git_commit, char *git_tree_state, char *git_version, char *go_version, char *major, + char *min_compatibility_major, + char *min_compatibility_minor, char *minor, char *platform ) { @@ -22,22 +26,62 @@ version_info_t *version_info_create( } version_info_local_var->build_date = build_date; version_info_local_var->compiler = compiler; + version_info_local_var->emulation_major = emulation_major; + version_info_local_var->emulation_minor = emulation_minor; version_info_local_var->git_commit = git_commit; version_info_local_var->git_tree_state = git_tree_state; version_info_local_var->git_version = git_version; version_info_local_var->go_version = go_version; version_info_local_var->major = major; + version_info_local_var->min_compatibility_major = min_compatibility_major; + version_info_local_var->min_compatibility_minor = min_compatibility_minor; version_info_local_var->minor = minor; version_info_local_var->platform = platform; + version_info_local_var->_library_owned = 1; return version_info_local_var; } +__attribute__((deprecated)) version_info_t *version_info_create( + char *build_date, + char *compiler, + char *emulation_major, + char *emulation_minor, + char *git_commit, + char *git_tree_state, + char *git_version, + char *go_version, + char *major, + char *min_compatibility_major, + char *min_compatibility_minor, + char *minor, + char *platform + ) { + return version_info_create_internal ( + build_date, + compiler, + emulation_major, + emulation_minor, + git_commit, + git_tree_state, + git_version, + go_version, + major, + min_compatibility_major, + min_compatibility_minor, + minor, + platform + ); +} void version_info_free(version_info_t *version_info) { if(NULL == version_info){ return ; } + if(version_info->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "version_info_free"); + return ; + } listEntry_t *listEntry; if (version_info->build_date) { free(version_info->build_date); @@ -47,6 +91,14 @@ void version_info_free(version_info_t *version_info) { free(version_info->compiler); version_info->compiler = NULL; } + if (version_info->emulation_major) { + free(version_info->emulation_major); + version_info->emulation_major = NULL; + } + if (version_info->emulation_minor) { + free(version_info->emulation_minor); + version_info->emulation_minor = NULL; + } if (version_info->git_commit) { free(version_info->git_commit); version_info->git_commit = NULL; @@ -67,6 +119,14 @@ void version_info_free(version_info_t *version_info) { free(version_info->major); version_info->major = NULL; } + if (version_info->min_compatibility_major) { + free(version_info->min_compatibility_major); + version_info->min_compatibility_major = NULL; + } + if (version_info->min_compatibility_minor) { + free(version_info->min_compatibility_minor); + version_info->min_compatibility_minor = NULL; + } if (version_info->minor) { free(version_info->minor); version_info->minor = NULL; @@ -99,6 +159,22 @@ cJSON *version_info_convertToJSON(version_info_t *version_info) { } + // version_info->emulation_major + if(version_info->emulation_major) { + if(cJSON_AddStringToObject(item, "emulationMajor", version_info->emulation_major) == NULL) { + goto fail; //String + } + } + + + // version_info->emulation_minor + if(version_info->emulation_minor) { + if(cJSON_AddStringToObject(item, "emulationMinor", version_info->emulation_minor) == NULL) { + goto fail; //String + } + } + + // version_info->git_commit if (!version_info->git_commit) { goto fail; @@ -144,6 +220,22 @@ cJSON *version_info_convertToJSON(version_info_t *version_info) { } + // version_info->min_compatibility_major + if(version_info->min_compatibility_major) { + if(cJSON_AddStringToObject(item, "minCompatibilityMajor", version_info->min_compatibility_major) == NULL) { + goto fail; //String + } + } + + + // version_info->min_compatibility_minor + if(version_info->min_compatibility_minor) { + if(cJSON_AddStringToObject(item, "minCompatibilityMinor", version_info->min_compatibility_minor) == NULL) { + goto fail; //String + } + } + + // version_info->minor if (!version_info->minor) { goto fail; @@ -175,6 +267,9 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ // version_info->build_date cJSON *build_date = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "buildDate"); + if (cJSON_IsNull(build_date)) { + build_date = NULL; + } if (!build_date) { goto end; } @@ -187,6 +282,9 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ // version_info->compiler cJSON *compiler = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "compiler"); + if (cJSON_IsNull(compiler)) { + compiler = NULL; + } if (!compiler) { goto end; } @@ -197,8 +295,35 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ goto end; //String } + // version_info->emulation_major + cJSON *emulation_major = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "emulationMajor"); + if (cJSON_IsNull(emulation_major)) { + emulation_major = NULL; + } + if (emulation_major) { + if(!cJSON_IsString(emulation_major) && !cJSON_IsNull(emulation_major)) + { + goto end; //String + } + } + + // version_info->emulation_minor + cJSON *emulation_minor = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "emulationMinor"); + if (cJSON_IsNull(emulation_minor)) { + emulation_minor = NULL; + } + if (emulation_minor) { + if(!cJSON_IsString(emulation_minor) && !cJSON_IsNull(emulation_minor)) + { + goto end; //String + } + } + // version_info->git_commit cJSON *git_commit = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "gitCommit"); + if (cJSON_IsNull(git_commit)) { + git_commit = NULL; + } if (!git_commit) { goto end; } @@ -211,6 +336,9 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ // version_info->git_tree_state cJSON *git_tree_state = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "gitTreeState"); + if (cJSON_IsNull(git_tree_state)) { + git_tree_state = NULL; + } if (!git_tree_state) { goto end; } @@ -223,6 +351,9 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ // version_info->git_version cJSON *git_version = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "gitVersion"); + if (cJSON_IsNull(git_version)) { + git_version = NULL; + } if (!git_version) { goto end; } @@ -235,6 +366,9 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ // version_info->go_version cJSON *go_version = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "goVersion"); + if (cJSON_IsNull(go_version)) { + go_version = NULL; + } if (!go_version) { goto end; } @@ -247,6 +381,9 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ // version_info->major cJSON *major = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "major"); + if (cJSON_IsNull(major)) { + major = NULL; + } if (!major) { goto end; } @@ -257,8 +394,35 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ goto end; //String } + // version_info->min_compatibility_major + cJSON *min_compatibility_major = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "minCompatibilityMajor"); + if (cJSON_IsNull(min_compatibility_major)) { + min_compatibility_major = NULL; + } + if (min_compatibility_major) { + if(!cJSON_IsString(min_compatibility_major) && !cJSON_IsNull(min_compatibility_major)) + { + goto end; //String + } + } + + // version_info->min_compatibility_minor + cJSON *min_compatibility_minor = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "minCompatibilityMinor"); + if (cJSON_IsNull(min_compatibility_minor)) { + min_compatibility_minor = NULL; + } + if (min_compatibility_minor) { + if(!cJSON_IsString(min_compatibility_minor) && !cJSON_IsNull(min_compatibility_minor)) + { + goto end; //String + } + } + // version_info->minor cJSON *minor = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "minor"); + if (cJSON_IsNull(minor)) { + minor = NULL; + } if (!minor) { goto end; } @@ -271,6 +435,9 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ // version_info->platform cJSON *platform = cJSON_GetObjectItemCaseSensitive(version_infoJSON, "platform"); + if (cJSON_IsNull(platform)) { + platform = NULL; + } if (!platform) { goto end; } @@ -282,14 +449,18 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ } - version_info_local_var = version_info_create ( + version_info_local_var = version_info_create_internal ( strdup(build_date->valuestring), strdup(compiler->valuestring), + emulation_major && !cJSON_IsNull(emulation_major) ? strdup(emulation_major->valuestring) : NULL, + emulation_minor && !cJSON_IsNull(emulation_minor) ? strdup(emulation_minor->valuestring) : NULL, strdup(git_commit->valuestring), strdup(git_tree_state->valuestring), strdup(git_version->valuestring), strdup(go_version->valuestring), strdup(major->valuestring), + min_compatibility_major && !cJSON_IsNull(min_compatibility_major) ? strdup(min_compatibility_major->valuestring) : NULL, + min_compatibility_minor && !cJSON_IsNull(min_compatibility_minor) ? strdup(min_compatibility_minor->valuestring) : NULL, strdup(minor->valuestring), strdup(platform->valuestring) ); diff --git a/kubernetes/model/version_info.h b/kubernetes/model/version_info.h index 93393a86..2928834b 100644 --- a/kubernetes/model/version_info.h +++ b/kubernetes/model/version_info.h @@ -21,24 +21,33 @@ typedef struct version_info_t version_info_t; typedef struct version_info_t { char *build_date; // string char *compiler; // string + char *emulation_major; // string + char *emulation_minor; // string char *git_commit; // string char *git_tree_state; // string char *git_version; // string char *go_version; // string char *major; // string + char *min_compatibility_major; // string + char *min_compatibility_minor; // string char *minor; // string char *platform; // string + int _library_owned; // Is the library responsible for freeing this object? } version_info_t; -version_info_t *version_info_create( +__attribute__((deprecated)) version_info_t *version_info_create( char *build_date, char *compiler, + char *emulation_major, + char *emulation_minor, char *git_commit, char *git_tree_state, char *git_version, char *go_version, char *major, + char *min_compatibility_major, + char *min_compatibility_minor, char *minor, char *platform ); diff --git a/kubernetes/src/apiClient.c b/kubernetes/src/apiClient.c index 2c0784b9..8c54e357 100644 --- a/kubernetes/src/apiClient.c +++ b/kubernetes/src/apiClient.c @@ -10,6 +10,8 @@ apiClient_t *apiClient_create() { apiClient_t *apiClient = malloc(sizeof(apiClient_t)); apiClient->basePath = strdup("http://localhost/"); apiClient->sslConfig = NULL; + apiClient->curlConfig = NULL; + apiClient->curl_pre_invoke_func = NULL; apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; apiClient->data_callback_func = NULL; @@ -38,6 +40,13 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath apiClient->sslConfig = NULL; } + apiClient->curlConfig = malloc(sizeof(curlConfig_t)); + apiClient->curlConfig->verbose = 0; + apiClient->curlConfig->keepalive = 0; + apiClient->curlConfig->keepidle = 120; + apiClient->curlConfig->keepintvl = 60; + + apiClient->curl_pre_invoke_func = NULL; apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; apiClient->data_callback_func = NULL; @@ -80,6 +89,14 @@ void apiClient_free(apiClient_t *apiClient) { } list_freeList(apiClient->apiKeys_BearerToken); } + + if(apiClient->curlConfig) { + free(apiClient->curlConfig); + apiClient->curlConfig = NULL; + } + + apiClient->curl_pre_invoke_func = NULL; + free(apiClient); } @@ -111,17 +128,18 @@ void sslConfig_free(sslConfig_t *sslConfig) { free(sslConfig); } -void replaceSpaceWithPlus(char *stringToProcess) { - for(int i = 0; i < strlen(stringToProcess); i++) { - if(stringToProcess[i] == ' ') { - stringToProcess[i] = '+'; +static void replaceSpaceWithPlus(char *str) { + if (str) { + for (; *str; str++) { + if (*str == ' ') + *str = '+'; } } } -char *assembleTargetUrl(const char *basePath, - const char *operationParameter, - list_t *queryParameters) { +static char *assembleTargetUrl(const char *basePath, + const char *operationParameter, + list_t *queryParameters) { int neededBufferSizeForQueryParameters = 0; listEntry_t *listEntry; @@ -172,7 +190,7 @@ char *assembleTargetUrl(const char *basePath, return targetUrl; } -char *assembleHeaderField(char *key, char *value) { +static char *assembleHeaderField(char *key, char *value) { char *header = malloc(strlen(key) + strlen(value) + 3); strcpy(header, key), @@ -182,13 +200,13 @@ char *assembleHeaderField(char *key, char *value) { return header; } -void postData(CURL *handle, const char *bodyParameters) { +static void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) { curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters); curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE, - (curl_off_t)strlen(bodyParameters)); + (curl_off_t)bodyParametersLength); } -int lengthOfKeyPair(keyValuePair_t *keyPair) { +static int lengthOfKeyPair(keyValuePair_t *keyPair) { long length = 0; if((keyPair->key != NULL) && (keyPair->value != NULL) ) @@ -208,7 +226,8 @@ void apiClient_invoke(apiClient_t *apiClient, list_t *headerType, list_t *contentType, const char *bodyParameters, - const char *requestType) { + size_t bodyParametersLength, + const char *requestType) { CURL *handle = curl_easy_init(); CURLcode res; @@ -223,38 +242,26 @@ void apiClient_invoke(apiClient_t *apiClient, if(headerType != NULL) { list_ForEach(listEntry, headerType) { - if(strstr((char *) listEntry->data, - "xml") == NULL) + if(strstr(listEntry->data, "xml") == NULL) { - buffHeader = malloc(strlen( - "Accept: ") + - strlen((char *) - listEntry-> - data) + 1); - sprintf(buffHeader, "%s%s", "Accept: ", + buffHeader = malloc(sizeof("Accept: ") + + strlen(listEntry->data)); + sprintf(buffHeader, "Accept: %s", (char *) listEntry->data); - headers = curl_slist_append(headers, - buffHeader); + headers = curl_slist_append(headers, buffHeader); free(buffHeader); } } } if(contentType != NULL) { list_ForEach(listEntry, contentType) { - if(strstr((char *) listEntry->data, - "xml") == NULL) + if(strstr(listEntry->data, "xml") == NULL) { - buffContent = - malloc(strlen( - "Content-Type: ") + strlen( - (char *) - listEntry->data) + - 1); - sprintf(buffContent, "%s%s", - "Content-Type: ", + buffContent = malloc(sizeof("Content-Type: ") + + strlen(listEntry->data)); + sprintf(buffContent, "Content-Type: %s", (char *) listEntry->data); - headers = curl_slist_append(headers, - buffContent); + headers = curl_slist_append(headers, buffContent); free(buffContent); buffContent = NULL; } @@ -384,8 +391,8 @@ void apiClient_invoke(apiClient_t *apiClient, curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L); } } else { - curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L); + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L); } } @@ -426,11 +433,23 @@ void apiClient_invoke(apiClient_t *apiClient, CURLOPT_WRITEDATA, apiClient); curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable if(bodyParameters != NULL) { - postData(handle, bodyParameters); + postData(handle, bodyParameters, bodyParametersLength); + } + + if(apiClient->curlConfig != NULL) { + if(apiClient->curlConfig->keepalive == 1) { + curl_easy_setopt(handle, CURLOPT_TCP_KEEPALIVE, 1L); + curl_easy_setopt(handle, CURLOPT_TCP_KEEPIDLE, apiClient->curlConfig->keepidle); + curl_easy_setopt(handle, CURLOPT_TCP_KEEPINTVL, apiClient->curlConfig->keepintvl); + } + curl_easy_setopt(handle, CURLOPT_VERBOSE, apiClient->curlConfig->verbose); + } + + if(apiClient->curl_pre_invoke_func) { + apiClient->curl_pre_invoke_func(handle); } res = curl_easy_perform(handle); @@ -462,8 +481,8 @@ void apiClient_invoke(apiClient_t *apiClient, size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) { size_t size_this_time = nmemb * size; - apiClient_t *apiClient = (apiClient_t *)userp; - apiClient->dataReceived = (char *)realloc( apiClient->dataReceived, apiClient->dataReceivedLen + size_this_time + 1); + apiClient_t *apiClient = userp; + apiClient->dataReceived = realloc( apiClient->dataReceived, apiClient->dataReceivedLen + size_this_time + 1); memcpy((char *)apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); apiClient->dataReceivedLen += size_this_time; ((char*)apiClient->dataReceived)[apiClient->dataReceivedLen] = '\0'; // the space size of (apiClient->dataReceived) = dataReceivedLen + 1 diff --git a/kubernetes/src/generic.c b/kubernetes/src/generic.c index 08551dad..f03193be 100644 --- a/kubernetes/src/generic.c +++ b/kubernetes/src/generic.c @@ -2,6 +2,12 @@ #include "../include/generic.h" #include "../include/utils.h" +void makeNamespacedResourcePath(char* path, genericClient_t *client, const char* namespace, const char* name); +void makeResourcePath(char* path, genericClient_t *client, const char* name); +char* callInternal(genericClient_t *client, + const char *path, list_t *queryParameters, list_t *headerParameters, list_t *formParameters, list_t *headerType, list_t *contentType, const char *body, const char *method); +char *callSimplifiedInternal(genericClient_t *client, const char *path, const char *method, const char *body); + genericClient_t* genericClient_create(apiClient_t *client, const char *apiGroup, const char* apiVersion, const char* resourcePlural) { genericClient_t *result = malloc(sizeof(genericClient_t)); result->client = client; @@ -54,7 +60,11 @@ void makeResourcePath(char* path, genericClient_t *client, const char* name) { char* callInternal(genericClient_t *client, const char *path, list_t *queryParameters, list_t *headerParameters, list_t *formParameters, list_t *headerType, list_t *contentType, const char *body, const char *method) { - apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, method); + size_t len = 0; + if (body != NULL) { + len = strlen(body); + } + apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, len, method); if (client->client->response_code == 401) { return NULL; diff --git a/kubernetes/src/list.c b/kubernetes/src/list.c index 78681215..7053ff12 100644 --- a/kubernetes/src/list.c +++ b/kubernetes/src/list.c @@ -20,7 +20,7 @@ void listEntry_free(listEntry_t *listEntry, void *additionalData) { } void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { - printf("%i\n", *((int *) (listEntry->data))); + printf("%i\n", *(int *)listEntry->data); } list_t *list_createList() { @@ -176,8 +176,8 @@ char* findStrInStrList(list_t *strList, const char *str) listEntry_t* listEntry = NULL; list_ForEach(listEntry, strList) { - if (strstr((char*)listEntry->data, str) != NULL) { - return (char*)listEntry->data; + if (strstr(listEntry->data, str) != NULL) { + return listEntry->data; } } @@ -197,4 +197,4 @@ void clear_and_free_string_list(list_t *list) list_item = NULL; } list_freeList(list); -} \ No newline at end of file +} diff --git a/kubernetes/swagger.json b/kubernetes/swagger.json index 0dacb33a..4413d7bf 100644 --- a/kubernetes/swagger.json +++ b/kubernetes/swagger.json @@ -497,6 +497,9 @@ "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, + "required": [ + "items" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -522,7 +525,7 @@ "type": "string" }, "validationActions": { - "description": "validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.\n\nFailures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.\n\nvalidationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action.\n\nThe supported actions values are:\n\n\"Deny\" specifies that a validation failure results in a denied request.\n\n\"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses.\n\n\"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]\"`\n\nClients should expect to handle additional values by ignoring any values not recognized.\n\n\"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers.\n\nRequired.", + "description": "validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.\n\nFailures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.\n\nvalidationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action.\n\nThe supported actions values are:\n\n\"Deny\" specifies that a validation failure results in a denied request.\n\n\"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses.\n\n\"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\\\"message\\\": \\\"Invalid value\\\", {\\\"policy\\\": \\\"policy.example.com\\\", {\\\"binding\\\": \\\"policybinding.example.com\\\", {\\\"expressionIndex\\\": \\\"1\\\", {\\\"validationActions\\\": [\\\"Audit\\\"]}]\"`\n\nClients should expect to handle additional values by ignoring any values not recognized.\n\n\"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers.\n\nRequired.", "items": { "type": "string" }, @@ -555,6 +558,9 @@ "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, + "required": [ + "items" + ], "type": "object", "x-kubernetes-group-version-kind": [ { @@ -860,40 +866,24 @@ }, "type": "object" }, - "v1alpha1.AuditAnnotation": { - "description": "AuditAnnotation describes how to produce an audit annotation for an API request.", + "v1alpha1.ApplyConfiguration": { + "description": "ApplyConfiguration defines the desired configuration values of an object.", "properties": { - "key": { - "description": "key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.\n\nThe key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: \"{ValidatingAdmissionPolicy name}/{key}\".\n\nIf an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded.\n\nRequired.", - "type": "string" - }, - "valueExpression": { - "description": "valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb.\n\nIf multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list.\n\nRequired.", + "expression": { + "description": "expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec\n\nApply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:\n\n\tObject{\n\t spec: Object.spec{\n\t serviceAccountName: \"example\"\n\t }\n\t}\n\nApply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.\n\nCEL expressions have access to the object types needed to create apply configurations:\n\n- 'Object' - CEL type of the resource object. - 'Object.' - CEL type of object field (such as 'Object.spec') - 'Object.....` - CEL type of nested field (such as 'Object.spec.containers')\n\nCEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:\n\n- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.\n For example, a variable named 'foo' can be accessed as 'variables.foo'.\n- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\n\nThe `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.", "type": "string" } }, - "required": [ - "key", - "valueExpression" - ], "type": "object" }, - "v1alpha1.ExpressionWarning": { - "description": "ExpressionWarning is a warning information that targets a specific expression.", + "v1alpha1.JSONPatch": { + "description": "JSONPatch defines a JSON Patch.", "properties": { - "fieldRef": { - "description": "The path to the field that refers the expression. For example, the reference to the expression of the first item of validations is \"spec.validations[0].expression\"", - "type": "string" - }, - "warning": { - "description": "The content of type checking information in a human-readable form. Each line of the warning contains the type that the expression is checked against, followed by the type check error from the compiler.", + "expression": { + "description": "expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec\n\nexpression must return an array of JSONPatch values.\n\nFor example, this CEL expression returns a JSON patch to conditionally modify a value:\n\n\t [\n\t JSONPatch{op: \"test\", path: \"/spec/example\", value: \"Red\"},\n\t JSONPatch{op: \"replace\", path: \"/spec/example\", value: \"Green\"}\n\t ]\n\nTo define an object for the patch value, use Object types. For example:\n\n\t [\n\t JSONPatch{\n\t op: \"add\",\n\t path: \"/spec/selector\",\n\t value: Object.spec.selector{matchLabels: {\"environment\": \"test\"}}\n\t }\n\t ]\n\nTo use strings containing '/' and '~' as JSONPatch path keys, use \"jsonpatch.escapeKey\". For example:\n\n\t [\n\t JSONPatch{\n\t op: \"add\",\n\t path: \"/metadata/labels/\" + jsonpatch.escapeKey(\"example.com/environment\"),\n\t value: \"test\"\n\t },\n\t ]\n\nCEL expressions have access to the types needed to create JSON patches and objects:\n\n- 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.\n See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,\n integer, array, map or object. If set, the 'path' and 'from' fields must be set to a\n [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL\n function may be used to escape path keys containing '/' and '~'.\n- 'Object' - CEL type of the resource object. - 'Object.' - CEL type of object field (such as 'Object.spec') - 'Object.....` - CEL type of nested field (such as 'Object.spec.containers')\n\nCEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:\n\n- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.\n For example, a variable named 'foo' can be accessed as 'variables.foo'.\n- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\n\nCEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:\n\n- 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.", "type": "string" } }, - "required": [ - "fieldRef", - "warning" - ], "type": "object" }, "v1alpha1.MatchCondition": { @@ -917,7 +907,7 @@ "description": "MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)", "properties": { "excludeResourceRules": { - "description": "ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)", + "description": "ExcludeResourceRules describes what operations on what resources/subresources the policy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)", "items": { "$ref": "#/definitions/v1alpha1.NamedRuleWithOperations" }, @@ -925,7 +915,7 @@ "x-kubernetes-list-type": "atomic" }, "matchPolicy": { - "description": "matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.\n\nDefaults to \"Equivalent\"", + "description": "matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, the admission policy does not consider requests to apps/v1beta1 or extensions/v1beta1 API groups.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, the admission policy **does** consider requests made to apps/v1beta1 or extensions/v1beta1 API groups. The API server translates the request to a matched resource API if necessary.\n\nDefaults to \"Equivalent\"", "type": "string" }, "namespaceSelector": { @@ -934,10 +924,10 @@ }, "objectSelector": { "$ref": "#/definitions/v1.LabelSelector", - "description": "ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything." + "description": "ObjectSelector decides whether to run the policy based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the policy's expression (CEL), and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything." }, "resourceRules": { - "description": "ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.", + "description": "ResourceRules describes what operations on what resources/subresources the admission policy matches. The policy cares about an operation if it matches _any_ Rule.", "items": { "$ref": "#/definitions/v1alpha1.NamedRuleWithOperations" }, @@ -948,111 +938,8 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, - "v1alpha1.NamedRuleWithOperations": { - "description": "NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.", - "properties": { - "apiGroups": { - "description": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "apiVersions": { - "description": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "operations": { - "description": "Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "resourceNames": { - "description": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "resources": { - "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "scope": { - "description": "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", - "type": "string" - } - }, - "type": "object", - "x-kubernetes-map-type": "atomic" - }, - "v1alpha1.ParamKind": { - "description": "ParamKind is a tuple of Group Kind and Version.", - "properties": { - "apiVersion": { - "description": "APIVersion is the API group version the resources belong to. In format of \"group/version\". Required.", - "type": "string" - }, - "kind": { - "description": "Kind is the API kind the resources belong to. Required.", - "type": "string" - } - }, - "type": "object", - "x-kubernetes-map-type": "atomic" - }, - "v1alpha1.ParamRef": { - "description": "ParamRef describes how to locate the params to be used as input to expressions of rules applied by a policy binding.", - "properties": { - "name": { - "description": "`name` is the name of the resource being referenced.\n\n`name` and `selector` are mutually exclusive properties. If one is set, the other must be unset.", - "type": "string" - }, - "namespace": { - "description": "namespace is the namespace of the referenced resource. Allows limiting the search for params to a specific namespace. Applies to both `name` and `selector` fields.\n\nA per-namespace parameter may be used by specifying a namespace-scoped `paramKind` in the policy and leaving this field empty.\n\n- If `paramKind` is cluster-scoped, this field MUST be unset. Setting this field results in a configuration error.\n\n- If `paramKind` is namespace-scoped, the namespace of the object being evaluated for admission will be used when this field is left unset. Take care that if this is left empty the binding must not match any cluster-scoped resources, which will result in an error.", - "type": "string" - }, - "parameterNotFoundAction": { - "description": "`parameterNotFoundAction` controls the behavior of the binding when the resource exists, and name or selector is valid, but there are no parameters matched by the binding. If the value is set to `Allow`, then no matched parameters will be treated as successful validation by the binding. If set to `Deny`, then no matched parameters will be subject to the `failurePolicy` of the policy.\n\nAllowed values are `Allow` or `Deny` Default to `Deny`", - "type": "string" - }, - "selector": { - "$ref": "#/definitions/v1.LabelSelector", - "description": "selector can be used to match multiple param objects based on their labels. Supply selector: {} to match all resources of the ParamKind.\n\nIf multiple params are found, they are all evaluated with the policy expressions and the results are ANDed together.\n\nOne of `name` or `selector` must be set, but `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset." - } - }, - "type": "object", - "x-kubernetes-map-type": "atomic" - }, - "v1alpha1.TypeChecking": { - "description": "TypeChecking contains results of type checking the expressions in the ValidatingAdmissionPolicy", - "properties": { - "expressionWarnings": { - "description": "The type checking warnings for each expression.", - "items": { - "$ref": "#/definitions/v1alpha1.ExpressionWarning" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - } - }, - "type": "object" - }, - "v1alpha1.ValidatingAdmissionPolicy": { - "description": "ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.", + "v1alpha1.MutatingAdmissionPolicy": { + "description": "MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1067,25 +954,21 @@ "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata." }, "spec": { - "$ref": "#/definitions/v1alpha1.ValidatingAdmissionPolicySpec", - "description": "Specification of the desired behavior of the ValidatingAdmissionPolicy." - }, - "status": { - "$ref": "#/definitions/v1alpha1.ValidatingAdmissionPolicyStatus", - "description": "The status of the ValidatingAdmissionPolicy, including warnings that are useful to determine if the policy behaves in the expected way. Populated by the system. Read-only." + "$ref": "#/definitions/v1alpha1.MutatingAdmissionPolicySpec", + "description": "Specification of the desired behavior of the MutatingAdmissionPolicy." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicy", + "kind": "MutatingAdmissionPolicy", "version": "v1alpha1" } ] }, - "v1alpha1.ValidatingAdmissionPolicyBinding": { - "description": "ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.\n\nFor a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding.\n\nThe CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.", + "v1alpha1.MutatingAdmissionPolicyBinding": { + "description": "MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.\n\nFor a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).\n\nAdding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1100,21 +983,21 @@ "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata." }, "spec": { - "$ref": "#/definitions/v1alpha1.ValidatingAdmissionPolicyBindingSpec", - "description": "Specification of the desired behavior of the ValidatingAdmissionPolicyBinding." + "$ref": "#/definitions/v1alpha1.MutatingAdmissionPolicyBindingSpec", + "description": "Specification of the desired behavior of the MutatingAdmissionPolicyBinding." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicyBinding", + "kind": "MutatingAdmissionPolicyBinding", "version": "v1alpha1" } ] }, - "v1alpha1.ValidatingAdmissionPolicyBindingList": { - "description": "ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding.", + "v1alpha1.MutatingAdmissionPolicyBindingList": { + "description": "MutatingAdmissionPolicyBindingList is a list of MutatingAdmissionPolicyBinding.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1123,7 +1006,7 @@ "items": { "description": "List of PolicyBinding.", "items": { - "$ref": "#/definitions/v1alpha1.ValidatingAdmissionPolicyBinding" + "$ref": "#/definitions/v1alpha1.MutatingAdmissionPolicyBinding" }, "type": "array" }, @@ -1136,43 +1019,38 @@ "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, + "required": [ + "items" + ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicyBindingList", + "kind": "MutatingAdmissionPolicyBindingList", "version": "v1alpha1" } ] }, - "v1alpha1.ValidatingAdmissionPolicyBindingSpec": { - "description": "ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.", + "v1alpha1.MutatingAdmissionPolicyBindingSpec": { + "description": "MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.", "properties": { "matchResources": { "$ref": "#/definitions/v1alpha1.MatchResources", - "description": "MatchResources declares what resources match this binding and will be validated by it. Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this. If this is unset, all resources matched by the policy are validated by this binding When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated. Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required." + "description": "matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT." }, "paramRef": { "$ref": "#/definitions/v1alpha1.ParamRef", - "description": "paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param." + "description": "paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param." }, "policyName": { - "description": "PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.", + "description": "policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.", "type": "string" - }, - "validationActions": { - "description": "validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.\n\nFailures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.\n\nvalidationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action.\n\nThe supported actions values are:\n\n\"Deny\" specifies that a validation failure results in a denied request.\n\n\"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses.\n\n\"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]\"`\n\nClients should expect to handle additional values by ignoring any values not recognized.\n\n\"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers.\n\nRequired.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "set" } }, "type": "object" }, - "v1alpha1.ValidatingAdmissionPolicyList": { - "description": "ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy.", + "v1alpha1.MutatingAdmissionPolicyList": { + "description": "MutatingAdmissionPolicyList is a list of MutatingAdmissionPolicy.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1181,7 +1059,7 @@ "items": { "description": "List of ValidatingAdmissionPolicy.", "items": { - "$ref": "#/definitions/v1alpha1.ValidatingAdmissionPolicy" + "$ref": "#/definitions/v1alpha1.MutatingAdmissionPolicy" }, "type": "array" }, @@ -1194,32 +1072,27 @@ "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, + "required": [ + "items" + ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicyList", + "kind": "MutatingAdmissionPolicyList", "version": "v1alpha1" } ] }, - "v1alpha1.ValidatingAdmissionPolicySpec": { - "description": "ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.", + "v1alpha1.MutatingAdmissionPolicySpec": { + "description": "MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.", "properties": { - "auditAnnotations": { - "description": "auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.", - "items": { - "$ref": "#/definitions/v1alpha1.AuditAnnotation" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, "failurePolicy": { - "description": "failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.\n\nA policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.\n\nfailurePolicy does not define how validations that evaluate to false are handled.\n\nWhen failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.\n\nAllowed values are Ignore or Fail. Defaults to Fail.", + "description": "failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.\n\nA policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.\n\nfailurePolicy does not define how validations that evaluate to false are handled.\n\nAllowed values are Ignore or Fail. Defaults to Fail.", "type": "string" }, "matchConditions": { - "description": "MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.\n\nIf a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.\n\nThe exact matching logic is (in order):\n 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.\n 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.\n 3. If any matchCondition evaluates to an error (but none are FALSE):\n - If failurePolicy=Fail, reject the request\n - If failurePolicy=Ignore, the policy is skipped", + "description": "matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.\n\nIf a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.\n\nThe exact matching logic is (in order):\n 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.\n 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.\n 3. If any matchCondition evaluates to an error (but none are FALSE):\n - If failurePolicy=Fail, reject the request\n - If failurePolicy=Ignore, the policy is skipped", "items": { "$ref": "#/definitions/v1alpha1.MatchCondition" }, @@ -1233,86 +1106,144 @@ }, "matchConstraints": { "$ref": "#/definitions/v1alpha1.MatchResources", - "description": "MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required." - }, - "paramKind": { - "$ref": "#/definitions/v1alpha1.ParamKind", - "description": "ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null." + "description": "matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required." }, - "validations": { - "description": "Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.", + "mutations": { + "description": "mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.", "items": { - "$ref": "#/definitions/v1alpha1.Validation" + "$ref": "#/definitions/v1alpha1.Mutation" }, "type": "array", "x-kubernetes-list-type": "atomic" }, + "paramKind": { + "$ref": "#/definitions/v1alpha1.ParamKind", + "description": "paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null." + }, + "reinvocationPolicy": { + "description": "reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are \"Never\" and \"IfNeeded\".\n\nNever: These mutations will not be called more than once per binding in a single admission evaluation.\n\nIfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.", + "type": "string" + }, "variables": { - "description": "Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.\n\nThe expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.", + "description": "variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.\n\nThe expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.", "items": { "$ref": "#/definitions/v1alpha1.Variable" }, "type": "array", - "x-kubernetes-list-map-keys": [ - "name" - ], - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" + "x-kubernetes-list-type": "atomic" } }, "type": "object" }, - "v1alpha1.ValidatingAdmissionPolicyStatus": { - "description": "ValidatingAdmissionPolicyStatus represents the status of a ValidatingAdmissionPolicy.", + "v1alpha1.Mutation": { + "description": "Mutation specifies the CEL expression which is used to apply the Mutation.", "properties": { - "conditions": { - "description": "The conditions represent the latest available observations of a policy's current state.", + "applyConfiguration": { + "$ref": "#/definitions/v1alpha1.ApplyConfiguration", + "description": "applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration." + }, + "jsonPatch": { + "$ref": "#/definitions/v1alpha1.JSONPatch", + "description": "jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch." + }, + "patchType": { + "description": "patchType indicates the patch strategy used. Allowed values are \"ApplyConfiguration\" and \"JSONPatch\". Required.", + "type": "string" + } + }, + "required": [ + "patchType" + ], + "type": "object" + }, + "v1alpha1.NamedRuleWithOperations": { + "description": "NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.", + "properties": { + "apiGroups": { + "description": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.", "items": { - "$ref": "#/definitions/v1.Condition" + "type": "string" }, "type": "array", - "x-kubernetes-list-map-keys": [ - "type" - ], - "x-kubernetes-list-type": "map" + "x-kubernetes-list-type": "atomic" }, - "observedGeneration": { - "description": "The generation observed by the controller.", - "format": "int64", - "type": "integer" + "apiVersions": { + "description": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" }, - "typeChecking": { - "$ref": "#/definitions/v1alpha1.TypeChecking", - "description": "The results of type checking for each expression. Presence of this field indicates the completion of the type checking." + "operations": { + "description": "Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "resourceNames": { + "description": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "resources": { + "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "scope": { + "description": "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + "type": "string" } }, - "type": "object" + "type": "object", + "x-kubernetes-map-type": "atomic" }, - "v1alpha1.Validation": { - "description": "Validation specifies the CEL expression which is used to apply the validation.", + "v1alpha1.ParamKind": { + "description": "ParamKind is a tuple of Group Kind and Version.", "properties": { - "expression": { - "description": "Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:\n\n- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.\n For example, a variable named 'foo' can be accessed as 'variables.foo'.\n- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\n\nThe `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Accessible property names are escaped according to the following rules when accessed in the expression: - '__' escapes to '__underscores__' - '.' escapes to '__dot__' - '-' escapes to '__dash__' - '/' escapes to '__slash__' - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:\n\t \"true\", \"false\", \"null\", \"in\", \"as\", \"break\", \"const\", \"continue\", \"else\", \"for\", \"function\", \"if\",\n\t \"import\", \"let\", \"loop\", \"package\", \"namespace\", \"return\".\nExamples:\n - Expression accessing a property named \"namespace\": {\"Expression\": \"object.__namespace__ > 0\"}\n - Expression accessing a property named \"x-prop\": {\"Expression\": \"object.x__dash__prop > 0\"}\n - Expression accessing a property named \"redact__d\": {\"Expression\": \"object.redact__underscores__d > 0\"}\n\nEquality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1]. Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:\n - 'set': `X + Y` performs a union where the array positions of all elements in `X` are preserved and\n non-intersecting elements in `Y` are appended, retaining their partial order.\n - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values\n are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with\n non-intersecting keys are appended, retaining their partial order.\nRequired.", + "apiVersion": { + "description": "APIVersion is the API group version the resources belong to. In format of \"group/version\". Required.", "type": "string" }, - "message": { - "description": "Message represents the message displayed when validation fails. The message is required if the Expression contains line breaks. The message must not contain line breaks. If unset, the message is \"failed rule: {Rule}\". e.g. \"must be a URL with the host matching spec.host\" If the Expression contains line breaks. Message is required. The message must not contain line breaks. If unset, the message is \"failed Expression: {Expression}\".", + "kind": { + "description": "Kind is the API kind the resources belong to. Required.", + "type": "string" + } + }, + "type": "object", + "x-kubernetes-map-type": "atomic" + }, + "v1alpha1.ParamRef": { + "description": "ParamRef describes how to locate the params to be used as input to expressions of rules applied by a policy binding.", + "properties": { + "name": { + "description": "`name` is the name of the resource being referenced.\n\n`name` and `selector` are mutually exclusive properties. If one is set, the other must be unset.", "type": "string" }, - "messageExpression": { - "description": "messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails. Since messageExpression is used as a failure message, it must evaluate to a string. If both message and messageExpression are present on a validation, then messageExpression will be used if validation fails. If messageExpression results in a runtime error, the runtime error is logged, and the validation failure message is produced as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset, and the fact that messageExpression produced an empty string/string with only spaces/string with line breaks will be logged. messageExpression has access to all the same variables as the `expression` except for 'authorizer' and 'authorizer.requestResource'. Example: \"object.x must be less than max (\"+string(params.max)+\")\"", + "namespace": { + "description": "namespace is the namespace of the referenced resource. Allows limiting the search for params to a specific namespace. Applies to both `name` and `selector` fields.\n\nA per-namespace parameter may be used by specifying a namespace-scoped `paramKind` in the policy and leaving this field empty.\n\n- If `paramKind` is cluster-scoped, this field MUST be unset. Setting this field results in a configuration error.\n\n- If `paramKind` is namespace-scoped, the namespace of the object being evaluated for admission will be used when this field is left unset. Take care that if this is left empty the binding must not match any cluster-scoped resources, which will result in an error.", "type": "string" }, - "reason": { - "description": "Reason represents a machine-readable description of why this validation failed. If this is the first validation in the list to fail, this reason, as well as the corresponding HTTP response code, are used in the HTTP response to the client. The currently supported reasons are: \"Unauthorized\", \"Forbidden\", \"Invalid\", \"RequestEntityTooLarge\". If not set, StatusReasonInvalid is used in the response to the client.", + "parameterNotFoundAction": { + "description": "`parameterNotFoundAction` controls the behavior of the binding when the resource exists, and name or selector is valid, but there are no parameters matched by the binding. If the value is set to `Allow`, then no matched parameters will be treated as successful validation by the binding. If set to `Deny`, then no matched parameters will be subject to the `failurePolicy` of the policy.\n\nAllowed values are `Allow` or `Deny` Default to `Deny`", "type": "string" + }, + "selector": { + "$ref": "#/definitions/v1.LabelSelector", + "description": "selector can be used to match multiple param objects based on their labels. Supply selector: {} to match all resources of the ParamKind.\n\nIf multiple params are found, they are all evaluated with the policy expressions and the results are ANDed together.\n\nOne of `name` or `selector` must be set, but `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset." } }, - "required": [ - "expression" - ], - "type": "object" + "type": "object", + "x-kubernetes-map-type": "atomic" }, "v1alpha1.Variable": { "description": "Variable is the definition of a variable that is used for composition.", @@ -1332,40 +1263,24 @@ ], "type": "object" }, - "v1beta1.AuditAnnotation": { - "description": "AuditAnnotation describes how to produce an audit annotation for an API request.", + "v1beta1.ApplyConfiguration": { + "description": "ApplyConfiguration defines the desired configuration values of an object.", "properties": { - "key": { - "description": "key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.\n\nThe key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: \"{ValidatingAdmissionPolicy name}/{key}\".\n\nIf an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded.\n\nRequired.", - "type": "string" - }, - "valueExpression": { - "description": "valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb.\n\nIf multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list.\n\nRequired.", + "expression": { + "description": "expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec\n\nApply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:\n\n\tObject{\n\t spec: Object.spec{\n\t serviceAccountName: \"example\"\n\t }\n\t}\n\nApply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.\n\nCEL expressions have access to the object types needed to create apply configurations:\n\n- 'Object' - CEL type of the resource object. - 'Object.' - CEL type of object field (such as 'Object.spec') - 'Object.....` - CEL type of nested field (such as 'Object.spec.containers')\n\nCEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:\n\n- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.\n For example, a variable named 'foo' can be accessed as 'variables.foo'.\n- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\n\nThe `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.", "type": "string" } }, - "required": [ - "key", - "valueExpression" - ], "type": "object" }, - "v1beta1.ExpressionWarning": { - "description": "ExpressionWarning is a warning information that targets a specific expression.", + "v1beta1.JSONPatch": { + "description": "JSONPatch defines a JSON Patch.", "properties": { - "fieldRef": { - "description": "The path to the field that refers the expression. For example, the reference to the expression of the first item of validations is \"spec.validations[0].expression\"", - "type": "string" - }, - "warning": { - "description": "The content of type checking information in a human-readable form. Each line of the warning contains the type that the expression is checked against, followed by the type check error from the compiler.", + "expression": { + "description": "expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec\n\nexpression must return an array of JSONPatch values.\n\nFor example, this CEL expression returns a JSON patch to conditionally modify a value:\n\n\t [\n\t JSONPatch{op: \"test\", path: \"/spec/example\", value: \"Red\"},\n\t JSONPatch{op: \"replace\", path: \"/spec/example\", value: \"Green\"}\n\t ]\n\nTo define an object for the patch value, use Object types. For example:\n\n\t [\n\t JSONPatch{\n\t op: \"add\",\n\t path: \"/spec/selector\",\n\t value: Object.spec.selector{matchLabels: {\"environment\": \"test\"}}\n\t }\n\t ]\n\nTo use strings containing '/' and '~' as JSONPatch path keys, use \"jsonpatch.escapeKey\". For example:\n\n\t [\n\t JSONPatch{\n\t op: \"add\",\n\t path: \"/metadata/labels/\" + jsonpatch.escapeKey(\"example.com/environment\"),\n\t value: \"test\"\n\t },\n\t ]\n\nCEL expressions have access to the types needed to create JSON patches and objects:\n\n- 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.\n See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,\n integer, array, map or object. If set, the 'path' and 'from' fields must be set to a\n [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL\n function may be used to escape path keys containing '/' and '~'.\n- 'Object' - CEL type of the resource object. - 'Object.' - CEL type of object field (such as 'Object.spec') - 'Object.....` - CEL type of nested field (such as 'Object.spec.containers')\n\nCEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:\n\n- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.\n For example, a variable named 'foo' can be accessed as 'variables.foo'.\n- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\n\nCEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:\n\n- 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.", "type": "string" } }, - "required": [ - "fieldRef", - "warning" - ], "type": "object" }, "v1beta1.MatchCondition": { @@ -1421,111 +1336,8 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, - "v1beta1.NamedRuleWithOperations": { - "description": "NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.", - "properties": { - "apiGroups": { - "description": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "apiVersions": { - "description": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "operations": { - "description": "Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "resourceNames": { - "description": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "resources": { - "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "scope": { - "description": "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", - "type": "string" - } - }, - "type": "object", - "x-kubernetes-map-type": "atomic" - }, - "v1beta1.ParamKind": { - "description": "ParamKind is a tuple of Group Kind and Version.", - "properties": { - "apiVersion": { - "description": "APIVersion is the API group version the resources belong to. In format of \"group/version\". Required.", - "type": "string" - }, - "kind": { - "description": "Kind is the API kind the resources belong to. Required.", - "type": "string" - } - }, - "type": "object", - "x-kubernetes-map-type": "atomic" - }, - "v1beta1.ParamRef": { - "description": "ParamRef describes how to locate the params to be used as input to expressions of rules applied by a policy binding.", - "properties": { - "name": { - "description": "name is the name of the resource being referenced.\n\nOne of `name` or `selector` must be set, but `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset.\n\nA single parameter used for all admission requests can be configured by setting the `name` field, leaving `selector` blank, and setting namespace if `paramKind` is namespace-scoped.", - "type": "string" - }, - "namespace": { - "description": "namespace is the namespace of the referenced resource. Allows limiting the search for params to a specific namespace. Applies to both `name` and `selector` fields.\n\nA per-namespace parameter may be used by specifying a namespace-scoped `paramKind` in the policy and leaving this field empty.\n\n- If `paramKind` is cluster-scoped, this field MUST be unset. Setting this field results in a configuration error.\n\n- If `paramKind` is namespace-scoped, the namespace of the object being evaluated for admission will be used when this field is left unset. Take care that if this is left empty the binding must not match any cluster-scoped resources, which will result in an error.", - "type": "string" - }, - "parameterNotFoundAction": { - "description": "`parameterNotFoundAction` controls the behavior of the binding when the resource exists, and name or selector is valid, but there are no parameters matched by the binding. If the value is set to `Allow`, then no matched parameters will be treated as successful validation by the binding. If set to `Deny`, then no matched parameters will be subject to the `failurePolicy` of the policy.\n\nAllowed values are `Allow` or `Deny`\n\nRequired", - "type": "string" - }, - "selector": { - "$ref": "#/definitions/v1.LabelSelector", - "description": "selector can be used to match multiple param objects based on their labels. Supply selector: {} to match all resources of the ParamKind.\n\nIf multiple params are found, they are all evaluated with the policy expressions and the results are ANDed together.\n\nOne of `name` or `selector` must be set, but `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset." - } - }, - "type": "object", - "x-kubernetes-map-type": "atomic" - }, - "v1beta1.TypeChecking": { - "description": "TypeChecking contains results of type checking the expressions in the ValidatingAdmissionPolicy", - "properties": { - "expressionWarnings": { - "description": "The type checking warnings for each expression.", - "items": { - "$ref": "#/definitions/v1beta1.ExpressionWarning" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - } - }, - "type": "object" - }, - "v1beta1.ValidatingAdmissionPolicy": { - "description": "ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.", + "v1beta1.MutatingAdmissionPolicy": { + "description": "MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1540,25 +1352,21 @@ "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata." }, "spec": { - "$ref": "#/definitions/v1beta1.ValidatingAdmissionPolicySpec", - "description": "Specification of the desired behavior of the ValidatingAdmissionPolicy." - }, - "status": { - "$ref": "#/definitions/v1beta1.ValidatingAdmissionPolicyStatus", - "description": "The status of the ValidatingAdmissionPolicy, including warnings that are useful to determine if the policy behaves in the expected way. Populated by the system. Read-only." + "$ref": "#/definitions/v1beta1.MutatingAdmissionPolicySpec", + "description": "Specification of the desired behavior of the MutatingAdmissionPolicy." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicy", + "kind": "MutatingAdmissionPolicy", "version": "v1beta1" } ] }, - "v1beta1.ValidatingAdmissionPolicyBinding": { - "description": "ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.\n\nFor a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding.\n\nThe CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.", + "v1beta1.MutatingAdmissionPolicyBinding": { + "description": "MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.\n\nFor a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).\n\nAdding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1573,21 +1381,21 @@ "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata." }, "spec": { - "$ref": "#/definitions/v1beta1.ValidatingAdmissionPolicyBindingSpec", - "description": "Specification of the desired behavior of the ValidatingAdmissionPolicyBinding." + "$ref": "#/definitions/v1beta1.MutatingAdmissionPolicyBindingSpec", + "description": "Specification of the desired behavior of the MutatingAdmissionPolicyBinding." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicyBinding", + "kind": "MutatingAdmissionPolicyBinding", "version": "v1beta1" } ] }, - "v1beta1.ValidatingAdmissionPolicyBindingList": { - "description": "ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding.", + "v1beta1.MutatingAdmissionPolicyBindingList": { + "description": "MutatingAdmissionPolicyBindingList is a list of MutatingAdmissionPolicyBinding.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1596,7 +1404,7 @@ "items": { "description": "List of PolicyBinding.", "items": { - "$ref": "#/definitions/v1beta1.ValidatingAdmissionPolicyBinding" + "$ref": "#/definitions/v1beta1.MutatingAdmissionPolicyBinding" }, "type": "array" }, @@ -1609,43 +1417,38 @@ "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, + "required": [ + "items" + ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicyBindingList", + "kind": "MutatingAdmissionPolicyBindingList", "version": "v1beta1" } ] }, - "v1beta1.ValidatingAdmissionPolicyBindingSpec": { - "description": "ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.", + "v1beta1.MutatingAdmissionPolicyBindingSpec": { + "description": "MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.", "properties": { "matchResources": { "$ref": "#/definitions/v1beta1.MatchResources", - "description": "MatchResources declares what resources match this binding and will be validated by it. Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this. If this is unset, all resources matched by the policy are validated by this binding When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated. Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required." + "description": "matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT." }, "paramRef": { "$ref": "#/definitions/v1beta1.ParamRef", - "description": "paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param." + "description": "paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param." }, "policyName": { - "description": "PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.", + "description": "policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.", "type": "string" - }, - "validationActions": { - "description": "validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.\n\nFailures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according to these actions only if the FailurePolicy is set to Fail, otherwise the failures are ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.\n\nvalidationActions is declared as a set of action values. Order does not matter. validationActions may not contain duplicates of the same action.\n\nThe supported actions values are:\n\n\"Deny\" specifies that a validation failure results in a denied request.\n\n\"Warn\" specifies that a validation failure is reported to the request client in HTTP Warning headers, with a warning code of 299. Warnings can be sent both for allowed or denied admission responses.\n\n\"Audit\" specifies that a validation failure is included in the published audit event for the request. The audit event will contain a `validation.policy.admission.k8s.io/validation_failure` audit annotation with a value containing the details of the validation failures, formatted as a JSON list of objects, each with the following fields: - message: The validation failure message string - policy: The resource name of the ValidatingAdmissionPolicy - binding: The resource name of the ValidatingAdmissionPolicyBinding - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy - validationActions: The enforcement actions enacted for the validation failure Example audit annotation: `\"validation.policy.admission.k8s.io/validation_failure\": \"[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]\"`\n\nClients should expect to handle additional values by ignoring any values not recognized.\n\n\"Deny\" and \"Warn\" may not be used together since this combination needlessly duplicates the validation failure both in the API response body and the HTTP warning headers.\n\nRequired.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "set" } }, "type": "object" }, - "v1beta1.ValidatingAdmissionPolicyList": { - "description": "ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy.", + "v1beta1.MutatingAdmissionPolicyList": { + "description": "MutatingAdmissionPolicyList is a list of MutatingAdmissionPolicy.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -1654,7 +1457,7 @@ "items": { "description": "List of ValidatingAdmissionPolicy.", "items": { - "$ref": "#/definitions/v1beta1.ValidatingAdmissionPolicy" + "$ref": "#/definitions/v1beta1.MutatingAdmissionPolicy" }, "type": "array" }, @@ -1667,32 +1470,27 @@ "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, + "required": [ + "items" + ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "admissionregistration.k8s.io", - "kind": "ValidatingAdmissionPolicyList", + "kind": "MutatingAdmissionPolicyList", "version": "v1beta1" } ] }, - "v1beta1.ValidatingAdmissionPolicySpec": { - "description": "ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.", + "v1beta1.MutatingAdmissionPolicySpec": { + "description": "MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.", "properties": { - "auditAnnotations": { - "description": "auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.", - "items": { - "$ref": "#/definitions/v1beta1.AuditAnnotation" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, "failurePolicy": { - "description": "failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.\n\nA policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.\n\nfailurePolicy does not define how validations that evaluate to false are handled.\n\nWhen failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.\n\nAllowed values are Ignore or Fail. Defaults to Fail.", + "description": "failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.\n\nA policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.\n\nfailurePolicy does not define how validations that evaluate to false are handled.\n\nAllowed values are Ignore or Fail. Defaults to Fail.", "type": "string" }, "matchConditions": { - "description": "MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.\n\nIf a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.\n\nThe exact matching logic is (in order):\n 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.\n 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.\n 3. If any matchCondition evaluates to an error (but none are FALSE):\n - If failurePolicy=Fail, reject the request\n - If failurePolicy=Ignore, the policy is skipped", + "description": "matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.\n\nIf a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.\n\nThe exact matching logic is (in order):\n 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.\n 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.\n 3. If any matchCondition evaluates to an error (but none are FALSE):\n - If failurePolicy=Fail, reject the request\n - If failurePolicy=Ignore, the policy is skipped", "items": { "$ref": "#/definitions/v1beta1.MatchCondition" }, @@ -1706,86 +1504,144 @@ }, "matchConstraints": { "$ref": "#/definitions/v1beta1.MatchResources", - "description": "MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required." + "description": "matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required." }, - "paramKind": { - "$ref": "#/definitions/v1beta1.ParamKind", - "description": "ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null." - }, - "validations": { - "description": "Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.", + "mutations": { + "description": "mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.", "items": { - "$ref": "#/definitions/v1beta1.Validation" + "$ref": "#/definitions/v1beta1.Mutation" }, "type": "array", "x-kubernetes-list-type": "atomic" }, + "paramKind": { + "$ref": "#/definitions/v1beta1.ParamKind", + "description": "paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null." + }, + "reinvocationPolicy": { + "description": "reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are \"Never\" and \"IfNeeded\".\n\nNever: These mutations will not be called more than once per binding in a single admission evaluation.\n\nIfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.", + "type": "string" + }, "variables": { - "description": "Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.\n\nThe expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.", + "description": "variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.\n\nThe expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.", "items": { "$ref": "#/definitions/v1beta1.Variable" }, "type": "array", - "x-kubernetes-list-map-keys": [ - "name" - ], - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" + "x-kubernetes-list-type": "atomic" } }, "type": "object" }, - "v1beta1.ValidatingAdmissionPolicyStatus": { - "description": "ValidatingAdmissionPolicyStatus represents the status of an admission validation policy.", + "v1beta1.Mutation": { + "description": "Mutation specifies the CEL expression which is used to apply the Mutation.", "properties": { - "conditions": { - "description": "The conditions represent the latest available observations of a policy's current state.", + "applyConfiguration": { + "$ref": "#/definitions/v1beta1.ApplyConfiguration", + "description": "applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration." + }, + "jsonPatch": { + "$ref": "#/definitions/v1beta1.JSONPatch", + "description": "jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch." + }, + "patchType": { + "description": "patchType indicates the patch strategy used. Allowed values are \"ApplyConfiguration\" and \"JSONPatch\". Required.", + "type": "string" + } + }, + "required": [ + "patchType" + ], + "type": "object" + }, + "v1beta1.NamedRuleWithOperations": { + "description": "NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.", + "properties": { + "apiGroups": { + "description": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.", "items": { - "$ref": "#/definitions/v1.Condition" + "type": "string" }, "type": "array", - "x-kubernetes-list-map-keys": [ - "type" - ], - "x-kubernetes-list-type": "map" + "x-kubernetes-list-type": "atomic" }, - "observedGeneration": { - "description": "The generation observed by the controller.", - "format": "int64", - "type": "integer" + "apiVersions": { + "description": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" }, - "typeChecking": { - "$ref": "#/definitions/v1beta1.TypeChecking", - "description": "The results of type checking for each expression. Presence of this field indicates the completion of the type checking." + "operations": { + "description": "Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "resourceNames": { + "description": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "resources": { + "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "scope": { + "description": "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + "type": "string" } }, - "type": "object" + "type": "object", + "x-kubernetes-map-type": "atomic" }, - "v1beta1.Validation": { - "description": "Validation specifies the CEL expression which is used to apply the validation.", + "v1beta1.ParamKind": { + "description": "ParamKind is a tuple of Group Kind and Version.", "properties": { - "expression": { - "description": "Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:\n\n- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.\n For example, a variable named 'foo' can be accessed as 'variables.foo'.\n- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\n\nThe `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Accessible property names are escaped according to the following rules when accessed in the expression: - '__' escapes to '__underscores__' - '.' escapes to '__dot__' - '-' escapes to '__dash__' - '/' escapes to '__slash__' - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:\n\t \"true\", \"false\", \"null\", \"in\", \"as\", \"break\", \"const\", \"continue\", \"else\", \"for\", \"function\", \"if\",\n\t \"import\", \"let\", \"loop\", \"package\", \"namespace\", \"return\".\nExamples:\n - Expression accessing a property named \"namespace\": {\"Expression\": \"object.__namespace__ > 0\"}\n - Expression accessing a property named \"x-prop\": {\"Expression\": \"object.x__dash__prop > 0\"}\n - Expression accessing a property named \"redact__d\": {\"Expression\": \"object.redact__underscores__d > 0\"}\n\nEquality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1]. Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:\n - 'set': `X + Y` performs a union where the array positions of all elements in `X` are preserved and\n non-intersecting elements in `Y` are appended, retaining their partial order.\n - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values\n are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with\n non-intersecting keys are appended, retaining their partial order.\nRequired.", + "apiVersion": { + "description": "APIVersion is the API group version the resources belong to. In format of \"group/version\". Required.", "type": "string" }, - "message": { - "description": "Message represents the message displayed when validation fails. The message is required if the Expression contains line breaks. The message must not contain line breaks. If unset, the message is \"failed rule: {Rule}\". e.g. \"must be a URL with the host matching spec.host\" If the Expression contains line breaks. Message is required. The message must not contain line breaks. If unset, the message is \"failed Expression: {Expression}\".", + "kind": { + "description": "Kind is the API kind the resources belong to. Required.", + "type": "string" + } + }, + "type": "object", + "x-kubernetes-map-type": "atomic" + }, + "v1beta1.ParamRef": { + "description": "ParamRef describes how to locate the params to be used as input to expressions of rules applied by a policy binding.", + "properties": { + "name": { + "description": "name is the name of the resource being referenced.\n\nOne of `name` or `selector` must be set, but `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset.\n\nA single parameter used for all admission requests can be configured by setting the `name` field, leaving `selector` blank, and setting namespace if `paramKind` is namespace-scoped.", "type": "string" }, - "messageExpression": { - "description": "messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails. Since messageExpression is used as a failure message, it must evaluate to a string. If both message and messageExpression are present on a validation, then messageExpression will be used if validation fails. If messageExpression results in a runtime error, the runtime error is logged, and the validation failure message is produced as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset, and the fact that messageExpression produced an empty string/string with only spaces/string with line breaks will be logged. messageExpression has access to all the same variables as the `expression` except for 'authorizer' and 'authorizer.requestResource'. Example: \"object.x must be less than max (\"+string(params.max)+\")\"", + "namespace": { + "description": "namespace is the namespace of the referenced resource. Allows limiting the search for params to a specific namespace. Applies to both `name` and `selector` fields.\n\nA per-namespace parameter may be used by specifying a namespace-scoped `paramKind` in the policy and leaving this field empty.\n\n- If `paramKind` is cluster-scoped, this field MUST be unset. Setting this field results in a configuration error.\n\n- If `paramKind` is namespace-scoped, the namespace of the object being evaluated for admission will be used when this field is left unset. Take care that if this is left empty the binding must not match any cluster-scoped resources, which will result in an error.", "type": "string" }, - "reason": { - "description": "Reason represents a machine-readable description of why this validation failed. If this is the first validation in the list to fail, this reason, as well as the corresponding HTTP response code, are used in the HTTP response to the client. The currently supported reasons are: \"Unauthorized\", \"Forbidden\", \"Invalid\", \"RequestEntityTooLarge\". If not set, StatusReasonInvalid is used in the response to the client.", + "parameterNotFoundAction": { + "description": "`parameterNotFoundAction` controls the behavior of the binding when the resource exists, and name or selector is valid, but there are no parameters matched by the binding. If the value is set to `Allow`, then no matched parameters will be treated as successful validation by the binding. If set to `Deny`, then no matched parameters will be subject to the `failurePolicy` of the policy.\n\nAllowed values are `Allow` or `Deny`\n\nRequired", "type": "string" + }, + "selector": { + "$ref": "#/definitions/v1.LabelSelector", + "description": "selector can be used to match multiple param objects based on their labels. Supply selector: {} to match all resources of the ParamKind.\n\nIf multiple params are found, they are all evaluated with the policy expressions and the results are ANDed together.\n\nOne of `name` or `selector` must be set, but `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset." } }, - "required": [ - "expression" - ], - "type": "object" + "type": "object", + "x-kubernetes-map-type": "atomic" }, "v1beta1.Variable": { "description": "Variable is the definition of a variable that is used for composition. A variable is defined as a named expression.", @@ -2420,7 +2276,7 @@ "description": "DeploymentStatus is the most recently observed status of the Deployment.", "properties": { "availableReplicas": { - "description": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", + "description": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "format": "int32", "type": "integer" }, @@ -2448,12 +2304,17 @@ "type": "integer" }, "readyReplicas": { - "description": "readyReplicas is the number of pods targeted by this Deployment with a Ready Condition.", + "description": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", "format": "int32", "type": "integer" }, "replicas": { - "description": "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", + "description": "Total number of non-terminating pods targeted by this deployment (their labels match the selector).", + "format": "int32", + "type": "integer" + }, + "terminatingReplicas": { + "description": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "format": "int32", "type": "integer" }, @@ -2463,7 +2324,7 @@ "type": "integer" }, "updatedReplicas": { - "description": "Total number of non-terminated pods targeted by this deployment that have the desired template spec.", + "description": "Total number of non-terminating pods targeted by this deployment that have the desired template spec.", "format": "int32", "type": "integer" } @@ -2556,7 +2417,7 @@ "type": "string" }, "items": { - "description": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", + "description": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", "items": { "$ref": "#/definitions/v1.ReplicaSet" }, @@ -2592,7 +2453,7 @@ "type": "integer" }, "replicas": { - "description": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", + "description": "Replicas is the number of desired pods. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", "format": "int32", "type": "integer" }, @@ -2602,7 +2463,7 @@ }, "template": { "$ref": "#/definitions/v1.PodTemplateSpec", - "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template" + "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template" } }, "required": [ @@ -2614,7 +2475,7 @@ "description": "ReplicaSetStatus represents the current status of a ReplicaSet.", "properties": { "availableReplicas": { - "description": "The number of available replicas (ready for at least minReadySeconds) for this replica set.", + "description": "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", "format": "int32", "type": "integer" }, @@ -2632,7 +2493,7 @@ "x-kubernetes-patch-strategy": "merge" }, "fullyLabeledReplicas": { - "description": "The number of pods that have labels matching the labels of the pod template of the replicaset.", + "description": "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", "format": "int32", "type": "integer" }, @@ -2642,12 +2503,17 @@ "type": "integer" }, "readyReplicas": { - "description": "readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition.", + "description": "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", "format": "int32", "type": "integer" }, "replicas": { - "description": "Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", + "description": "Replicas is the most recently observed number of non-terminating pods. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", + "format": "int32", + "type": "integer" + }, + "terminatingReplicas": { + "description": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "format": "int32", "type": "integer" } @@ -2662,7 +2528,7 @@ "properties": { "maxSurge": { "$ref": "#/definitions/intstr.IntOrString", - "description": "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption." + "description": "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediately created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption." }, "maxUnavailable": { "$ref": "#/definitions/intstr.IntOrString", @@ -2834,11 +2700,11 @@ }, "ordinals": { "$ref": "#/definitions/v1.StatefulSetOrdinals", - "description": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is beta." + "description": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested." }, "persistentVolumeClaimRetentionPolicy": { "$ref": "#/definitions/v1.StatefulSetPersistentVolumeClaimRetentionPolicy", - "description": "persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent volume claims created from volumeClaimTemplates. By default, all persistent volume claims are created as needed and retained until manually deleted. This policy allows the lifecycle to be altered, for example by deleting persistent volume claims when their stateful set is deleted, or when their pod is scaled down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha. +optional" + "description": "persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent volume claims created from volumeClaimTemplates. By default, all persistent volume claims are created as needed and retained until manually deleted. This policy allows the lifecycle to be altered, for example by deleting persistent volume claims when their stateful set is deleted, or when their pod is scaled down." }, "podManagementPolicy": { "description": "podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.", @@ -2881,8 +2747,7 @@ }, "required": [ "selector", - "template", - "serviceName" + "template" ], "type": "object" }, @@ -3219,80 +3084,38 @@ }, "type": "object" }, - "v1alpha1.SelfSubjectReview": { - "description": "SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. When using impersonation, users will receive the user info of the user being impersonated. If impersonation or request header authentication is used, any extra keys will have their case ignored and returned as lowercase.", + "v1.FieldSelectorAttributes": { + "description": "FieldSelectorAttributes indicates a field limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.", "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "rawSelector": { + "description": "rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.", "type": "string" }, - "metadata": { - "$ref": "#/definitions/v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - }, - "status": { - "$ref": "#/definitions/v1alpha1.SelfSubjectReviewStatus", - "description": "Status is filled in by the server with the user attributes." - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "authentication.k8s.io", - "kind": "SelfSubjectReview", - "version": "v1alpha1" - } - ] - }, - "v1alpha1.SelfSubjectReviewStatus": { - "description": "SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user.", - "properties": { - "userInfo": { - "$ref": "#/definitions/v1.UserInfo", - "description": "User attributes of the user making this request." + "requirements": { + "description": "requirements is the parsed interpretation of a field selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.", + "items": { + "$ref": "#/definitions/v1.FieldSelectorRequirement" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "type": "object" }, - "v1beta1.SelfSubjectReview": { - "description": "SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. When using impersonation, users will receive the user info of the user being impersonated. If impersonation or request header authentication is used, any extra keys will have their case ignored and returned as lowercase.", + "v1.LabelSelectorAttributes": { + "description": "LabelSelectorAttributes indicates a label limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.", "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "rawSelector": { + "description": "rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.", "type": "string" }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - }, - "status": { - "$ref": "#/definitions/v1beta1.SelfSubjectReviewStatus", - "description": "Status is filled in by the server with the user attributes." - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "authentication.k8s.io", - "kind": "SelfSubjectReview", - "version": "v1beta1" - } - ] - }, - "v1beta1.SelfSubjectReviewStatus": { - "description": "SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user.", - "properties": { - "userInfo": { - "$ref": "#/definitions/v1.UserInfo", - "description": "User attributes of the user making this request." + "requirements": { + "description": "requirements is the parsed interpretation of a label selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.", + "items": { + "$ref": "#/definitions/v1.LabelSelectorRequirement" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "type": "object" @@ -3375,10 +3198,18 @@ "v1.ResourceAttributes": { "description": "ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface", "properties": { + "fieldSelector": { + "$ref": "#/definitions/v1.FieldSelectorAttributes", + "description": "fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it." + }, "group": { "description": "Group is the API Group of the Resource. \"*\" means all.", "type": "string" }, + "labelSelector": { + "$ref": "#/definitions/v1.LabelSelectorAttributes", + "description": "labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it." + }, "name": { "description": "Name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all.", "type": "string" @@ -4026,10 +3857,10 @@ "type": "object" }, "v2.HPAScalingRules": { - "description": "HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.", + "description": "HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.\n\nScaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.\n\nThe tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.)", "properties": { "policies": { - "description": "policies is a list of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid", + "description": "policies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.", "items": { "$ref": "#/definitions/v2.HPAScalingPolicy" }, @@ -4044,6 +3875,10 @@ "description": "stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).", "format": "int32", "type": "integer" + }, + "tolerance": { + "description": "tolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%).\n\nFor example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi.\n\nThis is an alpha field and requires enabling the HPAConfigurableTolerance feature gate.", + "type": "string" } }, "type": "object" @@ -4269,7 +4104,7 @@ "properties": { "containerResource": { "$ref": "#/definitions/v2.ContainerResourceMetricSource", - "description": "containerResource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag." + "description": "containerResource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source." }, "external": { "$ref": "#/definitions/v2.ExternalMetricSource", @@ -4288,7 +4123,7 @@ "description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source." }, "type": { - "description": "type is the type of metric source. It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled", + "description": "type is the type of metric source. It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.", "type": "string" } }, @@ -4321,7 +4156,7 @@ "description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source." }, "type": { - "description": "type is the type of metric source. It will be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled", + "description": "type is the type of metric source. It will be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.", "type": "string" } }, @@ -4743,12 +4578,12 @@ "type": "integer" }, "backoffLimit": { - "description": "Specifies the number of retries before marking this job failed. Defaults to 6", + "description": "Specifies the number of retries before marking this job failed. Defaults to 6, unless backoffLimitPerIndex (only Indexed Job) is specified. When backoffLimitPerIndex is specified, backoffLimit defaults to 2147483647.", "format": "int32", "type": "integer" }, "backoffLimitPerIndex": { - "description": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", + "description": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable.", "format": "int32", "type": "integer" }, @@ -4762,7 +4597,7 @@ "type": "integer" }, "managedBy": { - "description": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 64 characters.\n\nThis field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default).", + "description": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.\n\nThis field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default).", "type": "string" }, "manualSelector": { @@ -4770,7 +4605,7 @@ "type": "boolean" }, "maxFailedIndexes": { - "description": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", + "description": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5.", "format": "int32", "type": "integer" }, @@ -4781,10 +4616,10 @@ }, "podFailurePolicy": { "$ref": "#/definitions/v1.PodFailurePolicy", - "description": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.\n\nThis field is beta-level. It can be used when the `JobPodFailurePolicy` feature gate is enabled (enabled by default)." + "description": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure." }, "podReplacementPolicy": { - "description": "podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods\n when they are terminating (has a metadata.deletionTimestamp) or failed.\n- Failed means to wait until a previously created Pod is fully terminated (has phase\n Failed or Succeeded) before creating a replacement Pod.\n\nWhen using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle. This is on by default.", + "description": "podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods\n when they are terminating (has a metadata.deletionTimestamp) or failed.\n- Failed means to wait until a previously created Pod is fully terminated (has phase\n Failed or Succeeded) before creating a replacement Pod.\n\nWhen using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.", "type": "string" }, "selector": { @@ -4793,7 +4628,7 @@ }, "successPolicy": { "$ref": "#/definitions/v1.SuccessPolicy", - "description": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is alpha-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (disabled by default)." + "description": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated." }, "suspend": { "description": "suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.", @@ -4847,11 +4682,11 @@ "type": "integer" }, "failedIndexes": { - "description": "FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes.\n\nThis field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", + "description": "FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes.", "type": "string" }, "ready": { - "description": "The number of pods which have a Ready condition.", + "description": "The number of active pods which have a Ready condition and are not terminating (without a deletionTimestamp).", "format": "int32", "type": "integer" }, @@ -4957,7 +4792,7 @@ "description": "PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of onExitCodes and onPodConditions, but not both, can be used in each rule.", "properties": { "action": { - "description": "Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:\n\n- FailJob: indicates that the pod's job is marked as Failed and all\n running pods are terminated.\n- FailIndex: indicates that the pod's index is marked as Failed and will\n not be restarted.\n This value is beta-level. It can be used when the\n `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).\n- Ignore: indicates that the counter towards the .backoffLimit is not\n incremented and a replacement pod is created.\n- Count: indicates that the pod is handled in the default way - the\n counter towards the .backoffLimit is incremented.\nAdditional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.", + "description": "Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:\n\n- FailJob: indicates that the pod's job is marked as Failed and all\n running pods are terminated.\n- FailIndex: indicates that the pod's index is marked as Failed and will\n not be restarted.\n- Ignore: indicates that the counter towards the .backoffLimit is not\n incremented and a replacement pod is created.\n- Count: indicates that the pod is handled in the default way - the\n counter towards the .backoffLimit is incremented.\nAdditional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.", "type": "string" }, "onExitCodes": { @@ -4982,7 +4817,7 @@ "description": "SuccessPolicy describes when a Job can be declared as succeeded based on the success of some indexes.", "properties": { "rules": { - "description": "rules represents the list of alternative rules for the declaring the Jobs as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met, the \"SucceededCriteriaMet\" condition is added, and the lingering pods are removed. The terminal state for such a Job has the \"Complete\" condition. Additionally, these rules are evaluated in order; Once the Job meets one of the rules, other rules are ignored. At most 20 elements are allowed.", + "description": "rules represents the list of alternative rules for the declaring the Jobs as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met, the \"SuccessCriteriaMet\" condition is added, and the lingering pods are removed. The terminal state for such a Job has the \"Complete\" condition. Additionally, these rules are evaluated in order; Once the Job meets one of the rules, other rules are ignored. At most 20 elements are allowed.", "items": { "$ref": "#/definitions/v1.SuccessPolicyRule" }, @@ -5303,6 +5138,259 @@ ], "type": "object" }, + "v1alpha1.PodCertificateRequest": { + "description": "PodCertificateRequest encodes a pod requesting a certificate from a given signer.\n\nKubelets use this API to implement podCertificate projected volumes", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ObjectMeta", + "description": "metadata contains the object metadata." + }, + "spec": { + "$ref": "#/definitions/v1alpha1.PodCertificateRequestSpec", + "description": "spec contains the details about the certificate being requested." + }, + "status": { + "$ref": "#/definitions/v1alpha1.PodCertificateRequestStatus", + "description": "status contains the issued certificate, and a standard set of conditions." + } + }, + "required": [ + "spec" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "certificates.k8s.io", + "kind": "PodCertificateRequest", + "version": "v1alpha1" + } + ] + }, + "v1alpha1.PodCertificateRequestList": { + "description": "PodCertificateRequestList is a collection of PodCertificateRequest objects", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "items": { + "description": "items is a collection of PodCertificateRequest objects", + "items": { + "$ref": "#/definitions/v1alpha1.PodCertificateRequest" + }, + "type": "array" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ListMeta", + "description": "metadata contains the list metadata." + } + }, + "required": [ + "items" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "certificates.k8s.io", + "kind": "PodCertificateRequestList", + "version": "v1alpha1" + } + ] + }, + "v1alpha1.PodCertificateRequestSpec": { + "description": "PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation.", + "properties": { + "maxExpirationSeconds": { + "description": "maxExpirationSeconds is the maximum lifetime permitted for the certificate.\n\nIf omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days).\n\nThe signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours.", + "format": "int32", + "type": "integer" + }, + "nodeName": { + "description": "nodeName is the name of the node the pod is assigned to.", + "type": "string" + }, + "nodeUID": { + "description": "nodeUID is the UID of the node the pod is assigned to.", + "type": "string" + }, + "pkixPublicKey": { + "description": "pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to.\n\nThe key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future.\n\nSigner implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field.", + "format": "byte", + "type": "string" + }, + "podName": { + "description": "podName is the name of the pod into which the certificate will be mounted.", + "type": "string" + }, + "podUID": { + "description": "podUID is the UID of the pod into which the certificate will be mounted.", + "type": "string" + }, + "proofOfPossession": { + "description": "proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey.\n\nIt is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`.\n\nkube-apiserver validates the proof of possession during creation of the PodCertificateRequest.\n\nIf the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options).\n\nIf the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1)\n\nIf the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign).", + "format": "byte", + "type": "string" + }, + "serviceAccountName": { + "description": "serviceAccountName is the name of the service account the pod is running as.", + "type": "string" + }, + "serviceAccountUID": { + "description": "serviceAccountUID is the UID of the service account the pod is running as.", + "type": "string" + }, + "signerName": { + "description": "signerName indicates the requested signer.\n\nAll signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented.", + "type": "string" + } + }, + "required": [ + "signerName", + "podName", + "podUID", + "serviceAccountName", + "serviceAccountUID", + "nodeName", + "nodeUID", + "pkixPublicKey", + "proofOfPossession" + ], + "type": "object" + }, + "v1alpha1.PodCertificateRequestStatus": { + "description": "PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued.", + "properties": { + "beginRefreshAt": { + "description": "beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable.\n\nThis field is only a hint. Kubelet may start refreshing before or after this time if necessary.", + "format": "date-time", + "type": "string" + }, + "certificateChain": { + "description": "certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable.\n\nIf the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty.\n\nValidation requirements:\n 1. certificateChain must consist of one or more PEM-formatted certificates.\n 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as\n described in section 4 of RFC5280.\n\nIf more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers.", + "type": "string" + }, + "conditions": { + "description": "conditions applied to the request.\n\nThe types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\".\n\nIf the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field.", + "items": { + "$ref": "#/definitions/v1.Condition" + }, + "type": "array", + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "notAfter": { + "description": "notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.", + "format": "date-time", + "type": "string" + }, + "notBefore": { + "description": "notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.", + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "v1beta1.ClusterTrustBundle": { + "description": "ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).\n\nClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.\n\nIt can be optionally associated with a particular assigner, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ObjectMeta", + "description": "metadata contains the object metadata." + }, + "spec": { + "$ref": "#/definitions/v1beta1.ClusterTrustBundleSpec", + "description": "spec contains the signer (if any) and trust anchors." + } + }, + "required": [ + "spec" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "certificates.k8s.io", + "kind": "ClusterTrustBundle", + "version": "v1beta1" + } + ] + }, + "v1beta1.ClusterTrustBundleList": { + "description": "ClusterTrustBundleList is a collection of ClusterTrustBundle objects", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "items": { + "description": "items is a collection of ClusterTrustBundle objects", + "items": { + "$ref": "#/definitions/v1beta1.ClusterTrustBundle" + }, + "type": "array" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ListMeta", + "description": "metadata contains the list metadata." + } + }, + "required": [ + "items" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "certificates.k8s.io", + "kind": "ClusterTrustBundleList", + "version": "v1beta1" + } + ] + }, + "v1beta1.ClusterTrustBundleSpec": { + "description": "ClusterTrustBundleSpec contains the signer and trust anchors.", + "properties": { + "signerName": { + "description": "signerName indicates the associated signer, if any.\n\nIn order to create or update a ClusterTrustBundle that sets signerName, you must have the following cluster-scoped permission: group=certificates.k8s.io resource=signers resourceName= verb=attest.\n\nIf signerName is not empty, then the ClusterTrustBundle object must be named with the signer name as a prefix (translating slashes to colons). For example, for the signer name `example.com/foo`, valid ClusterTrustBundle object names include `example.com:foo:abc` and `example.com:foo:v1`.\n\nIf signerName is empty, then the ClusterTrustBundle object's name must not have such a prefix.\n\nList/watch requests for ClusterTrustBundles can filter on this field using a `spec.signerName=NAME` field selector.", + "type": "string" + }, + "trustBundle": { + "description": "trustBundle contains the individual X.509 trust anchors for this bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates.\n\nThe data must consist only of PEM certificate blocks that parse as valid X.509 certificates. Each certificate must include a basic constraints extension with the CA bit set. The API server will reject objects that contain duplicate certificates, or that use PEM block headers.\n\nUsers of ClusterTrustBundles, including Kubelet, are free to reorder and deduplicate certificate blocks in this file according to their own logic, as well as to drop PEM block headers and inter-block data.", + "type": "string" + } + }, + "required": [ + "trustBundle" + ], + "type": "object" + }, "v1.Lease": { "description": "Lease defines a lease concept.", "properties": { @@ -5376,11 +5464,11 @@ "type": "string" }, "holderIdentity": { - "description": "holderIdentity contains the identity of the holder of a current lease.", + "description": "holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.", "type": "string" }, "leaseDurationSeconds": { - "description": "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed renewTime.", + "description": "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime.", "format": "int32", "type": "integer" }, @@ -5389,12 +5477,222 @@ "format": "int32", "type": "integer" }, + "preferredHolder": { + "description": "PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.", + "type": "string" + }, "renewTime": { "description": "renewTime is a time when the current holder of a lease has last updated the lease.", "format": "date-time", "type": "string" + }, + "strategy": { + "description": "Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", + "type": "string" + } + }, + "type": "object" + }, + "v1alpha2.LeaseCandidate": { + "description": "LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ObjectMeta", + "description": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + }, + "spec": { + "$ref": "#/definitions/v1alpha2.LeaseCandidateSpec", + "description": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" + } + }, + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "coordination.k8s.io", + "kind": "LeaseCandidate", + "version": "v1alpha2" + } + ] + }, + "v1alpha2.LeaseCandidateList": { + "description": "LeaseCandidateList is a list of Lease objects.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "items": { + "description": "items is a list of schema objects.", + "items": { + "$ref": "#/definitions/v1alpha2.LeaseCandidate" + }, + "type": "array" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ListMeta", + "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + } + }, + "required": [ + "items" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "coordination.k8s.io", + "kind": "LeaseCandidateList", + "version": "v1alpha2" + } + ] + }, + "v1alpha2.LeaseCandidateSpec": { + "description": "LeaseCandidateSpec is a specification of a Lease.", + "properties": { + "binaryVersion": { + "description": "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", + "type": "string" + }, + "emulationVersion": { + "description": "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", + "type": "string" + }, + "leaseName": { + "description": "LeaseName is the name of the lease for which this candidate is contending. This field is immutable.", + "type": "string" + }, + "pingTime": { + "description": "PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.", + "format": "date-time", + "type": "string" + }, + "renewTime": { + "description": "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", + "format": "date-time", + "type": "string" + }, + "strategy": { + "description": "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", + "type": "string" } }, + "required": [ + "leaseName", + "binaryVersion", + "strategy" + ], + "type": "object" + }, + "v1beta1.LeaseCandidate": { + "description": "LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ObjectMeta", + "description": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + }, + "spec": { + "$ref": "#/definitions/v1beta1.LeaseCandidateSpec", + "description": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" + } + }, + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "coordination.k8s.io", + "kind": "LeaseCandidate", + "version": "v1beta1" + } + ] + }, + "v1beta1.LeaseCandidateList": { + "description": "LeaseCandidateList is a list of Lease objects.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "items": { + "description": "items is a list of schema objects.", + "items": { + "$ref": "#/definitions/v1beta1.LeaseCandidate" + }, + "type": "array" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ListMeta", + "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + } + }, + "required": [ + "items" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "coordination.k8s.io", + "kind": "LeaseCandidateList", + "version": "v1beta1" + } + ] + }, + "v1beta1.LeaseCandidateSpec": { + "description": "LeaseCandidateSpec is a specification of a Lease.", + "properties": { + "binaryVersion": { + "description": "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", + "type": "string" + }, + "emulationVersion": { + "description": "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", + "type": "string" + }, + "leaseName": { + "description": "LeaseName is the name of the lease for which this candidate is contending. The limits on this field are the same as on Lease.name. Multiple lease candidates may reference the same Lease.name. This field is immutable.", + "type": "string" + }, + "pingTime": { + "description": "PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.", + "format": "date-time", + "type": "string" + }, + "renewTime": { + "description": "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", + "format": "date-time", + "type": "string" + }, + "strategy": { + "description": "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", + "type": "string" + } + }, + "required": [ + "leaseName", + "binaryVersion", + "strategy" + ], "type": "object" }, "v1.AWSElasticBlockStoreVolumeSource": { @@ -5567,7 +5865,7 @@ "type": "object" }, "v1.Binding": { - "description": "Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead.", + "description": "Binding ties one object to another; for example, a pod is bound to a node by a scheduler.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -5599,7 +5897,7 @@ ] }, "v1.CSIPersistentVolumeSource": { - "description": "Represents storage that is managed by an external CSI volume driver (Beta feature)", + "description": "Represents storage that is managed by an external CSI volume driver", "properties": { "controllerExpandSecretRef": { "$ref": "#/definitions/v1.SecretReference", @@ -5829,20 +6127,6 @@ ], "type": "object" }, - "v1.ClaimSource": { - "description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.", - "properties": { - "resourceClaimName": { - "description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.", - "type": "string" - }, - "resourceClaimTemplateName": { - "description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", - "type": "string" - } - }, - "type": "object" - }, "v1.ClientIPConfig": { "description": "ClientIPConfig represents the configurations of Client IP based session affinity.", "properties": { @@ -6210,7 +6494,7 @@ "x-kubernetes-patch-strategy": "merge" }, "envFrom": { - "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", + "description": "List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "$ref": "#/definitions/v1.EnvFromSource" }, @@ -6268,9 +6552,17 @@ "description": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" }, "restartPolicy": { - "description": "RestartPolicy defines the restart behavior of individual containers in a pod. This field may only be set for init containers, and the only allowed value is \"Always\". For non-init containers or when this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.", + "description": "RestartPolicy defines the restart behavior of individual containers in a pod. This overrides the pod-level restart policy. When this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Additionally, setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.", "type": "string" }, + "restartPolicyRules": { + "description": "Represents a list of rules to be checked to determine if the container should be restarted on exit. The rules are evaluated in order. Once a rule matches a container exit condition, the remaining rules are ignored. If no rule matches the container exit condition, the Container-level restart policy determines the whether the container is restarted or not. Constraints on the rules: - At most 20 rules are allowed. - Rules can have the same action. - Identical rules are not forbidden in validations. When rules are specified, container MUST set RestartPolicy explicitly even it if matches the Pod's RestartPolicy.", + "items": { + "$ref": "#/definitions/v1.ContainerRestartRule" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, "securityContext": { "$ref": "#/definitions/v1.SecurityContext", "description": "SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" @@ -6335,6 +6627,29 @@ ], "type": "object" }, + "v1.ContainerExtendedResourceRequest": { + "description": "ContainerExtendedResourceRequest has the mapping of container name, extended resource name to the device request name.", + "properties": { + "containerName": { + "description": "The name of the container requesting resources.", + "type": "string" + }, + "requestName": { + "description": "The name of the request in the special ResourceClaim which corresponds to the extended resource.", + "type": "string" + }, + "resourceName": { + "description": "The name of the extended resource in that container which gets backed by DRA.", + "type": "string" + } + }, + "required": [ + "containerName", + "resourceName", + "requestName" + ], + "type": "object" + }, "v1.ContainerImage": { "description": "Describe a container image", "properties": { @@ -6403,6 +6718,45 @@ ], "type": "object" }, + "v1.ContainerRestartRule": { + "description": "ContainerRestartRule describes how a container exit is handled.", + "properties": { + "action": { + "description": "Specifies the action taken on a container exit if the requirements are satisfied. The only possible value is \"Restart\" to restart the container.", + "type": "string" + }, + "exitCodes": { + "$ref": "#/definitions/v1.ContainerRestartRuleOnExitCodes", + "description": "Represents the exit codes to check on container exits." + } + }, + "required": [ + "action" + ], + "type": "object" + }, + "v1.ContainerRestartRuleOnExitCodes": { + "description": "ContainerRestartRuleOnExitCodes describes the condition for handling an exited container based on its exit codes.", + "properties": { + "operator": { + "description": "Represents the relationship between the container exit code(s) and the specified values. Possible values are: - In: the requirement is satisfied if the container exit code is in the\n set of specified values.\n- NotIn: the requirement is satisfied if the container exit code is\n not in the set of specified values.", + "type": "string" + }, + "values": { + "description": "Specifies the set of values to check for container exit codes. At most 255 elements are allowed.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array", + "x-kubernetes-list-type": "set" + } + }, + "required": [ + "operator" + ], + "type": "object" + }, "v1.ContainerState": { "description": "ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.", "properties": { @@ -6498,6 +6852,19 @@ "description": "AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize.", "type": "object" }, + "allocatedResourcesStatus": { + "description": "AllocatedResourcesStatus represents the status of various resources allocated for this Pod.", + "items": { + "$ref": "#/definitions/v1.ResourceStatus" + }, + "type": "array", + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge" + }, "containerID": { "description": "ContainerID is the ID of the container in the format '://'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").", "type": "string" @@ -6539,6 +6906,14 @@ "$ref": "#/definitions/v1.ContainerState", "description": "State holds details about the container's current condition." }, + "stopSignal": { + "description": "StopSignal reports the effective stop signal for this container", + "type": "string" + }, + "user": { + "$ref": "#/definitions/v1.ContainerUser", + "description": "User represents user identity information initially attached to the first process of the container" + }, "volumeMounts": { "description": "Status of volume mounts.", "items": { @@ -6562,6 +6937,16 @@ ], "type": "object" }, + "v1.ContainerUser": { + "description": "ContainerUser represents user identity information", + "properties": { + "linux": { + "$ref": "#/definitions/v1.LinuxContainerUser", + "description": "Linux holds user identity information initially attached to the first process of the containers in Linux. Note that the actual running identity can be changed if the process has enough privilege to do so." + } + }, + "type": "object" + }, "v1.DaemonEndpoint": { "description": "DaemonEndpoint contains information about a single Daemon endpoint.", "properties": { @@ -6650,7 +7035,7 @@ "type": "object" }, "v1.EndpointAddress": { - "description": "EndpointAddress is a tuple that describes single IP address.", + "description": "EndpointAddress is a tuple that describes single IP address. Deprecated: This API is deprecated in v1.33+.", "properties": { "hostname": { "description": "The Hostname of this endpoint", @@ -6676,7 +7061,7 @@ "x-kubernetes-map-type": "atomic" }, "core.v1.EndpointPort": { - "description": "EndpointPort is a tuple that describes a single port.", + "description": "EndpointPort is a tuple that describes a single port. Deprecated: This API is deprecated in v1.33+.", "properties": { "appProtocol": { "description": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", @@ -6703,7 +7088,7 @@ "x-kubernetes-map-type": "atomic" }, "v1.EndpointSubset": { - "description": "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n\n\t{\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t}\n\nThe resulting set of endpoints can be viewed as:\n\n\ta: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n\tb: [ 10.10.1.1:309, 10.10.2.2:309 ]", + "description": "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n\n\t{\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t}\n\nThe resulting set of endpoints can be viewed as:\n\n\ta: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n\tb: [ 10.10.1.1:309, 10.10.2.2:309 ]\n\nDeprecated: This API is deprecated in v1.33+.", "properties": { "addresses": { "description": "IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.", @@ -6733,7 +7118,7 @@ "type": "object" }, "v1.Endpoints": { - "description": "Endpoints is a collection of endpoints that implement the actual service. Example:\n\n\t Name: \"mysvc\",\n\t Subsets: [\n\t {\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t },\n\t {\n\t Addresses: [{\"ip\": \"10.10.3.3\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n\t },\n\t]", + "description": "Endpoints is a collection of endpoints that implement the actual service. Example:\n\n\t Name: \"mysvc\",\n\t Subsets: [\n\t {\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t },\n\t {\n\t Addresses: [{\"ip\": \"10.10.3.3\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n\t },\n\t]\n\nEndpoints is a legacy API and does not contain information about all Service features. Use discoveryv1.EndpointSlice for complete information about Service endpoints.\n\nDeprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -6766,7 +7151,7 @@ ] }, "v1.EndpointsList": { - "description": "EndpointsList is a list of endpoints.", + "description": "EndpointsList is a list of endpoints. Deprecated: This API is deprecated in v1.33+.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -6801,14 +7186,14 @@ ] }, "v1.EnvFromSource": { - "description": "EnvFromSource represents the source of a set of ConfigMaps", + "description": "EnvFromSource represents the source of a set of ConfigMaps or Secrets", "properties": { "configMapRef": { "$ref": "#/definitions/v1.ConfigMapEnvSource", "description": "The ConfigMap to select from" }, "prefix": { - "description": "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", + "description": "Optional text to prepend to the name of each environment variable. May consist of any printable ASCII characters except '='.", "type": "string" }, "secretRef": { @@ -6822,7 +7207,7 @@ "description": "EnvVar represents an environment variable present in a Container.", "properties": { "name": { - "description": "Name of the environment variable. Must be a C_IDENTIFIER.", + "description": "Name of the environment variable. May consist of any printable ASCII characters except '='.", "type": "string" }, "value": { @@ -6850,6 +7235,10 @@ "$ref": "#/definitions/v1.ObjectFieldSelector", "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs." }, + "fileKeyRef": { + "$ref": "#/definitions/v1.FileKeySelector", + "description": "FileKeyRef selects a key of the env file. Requires the EnvFiles feature gate to be enabled." + }, "resourceFieldRef": { "$ref": "#/definitions/v1.ResourceFieldSelector", "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported." @@ -6894,7 +7283,7 @@ "x-kubernetes-patch-strategy": "merge" }, "envFrom": { - "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", + "description": "List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "$ref": "#/definitions/v1.EnvFromSource" }, @@ -6952,9 +7341,17 @@ "description": "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod." }, "restartPolicy": { - "description": "Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.", + "description": "Restart policy for the container to manage the restart behavior of each container within a pod. You cannot set this field on ephemeral containers.", "type": "string" }, + "restartPolicyRules": { + "description": "Represents a list of rules to be checked to determine if the container should be restarted on exit. You cannot set this field on ephemeral containers.", + "items": { + "$ref": "#/definitions/v1.ContainerRestartRule" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, "securityContext": { "$ref": "#/definitions/v1.SecurityContext", "description": "Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext." @@ -7236,6 +7633,34 @@ }, "type": "object" }, + "v1.FileKeySelector": { + "description": "FileKeySelector selects a key of the env file.", + "properties": { + "key": { + "description": "The key within the env file. An invalid key will prevent the pod from starting. The keys defined within a source may consist of any printable ASCII characters except '='. During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.", + "type": "string" + }, + "optional": { + "description": "Specify whether the file or its key must be defined. If the file or key does not exist, then the env var is not published. If optional is set to true and the specified key does not exist, the environment variable will not be set in the Pod's containers.\n\nIf optional is set to false and the specified key does not exist, an error will be returned during Pod creation.", + "type": "boolean" + }, + "path": { + "description": "The path within the volume from which to select the file. Must be relative and may not contain the '..' path or start with '..'.", + "type": "string" + }, + "volumeName": { + "description": "The name of the volume mount containing the env file.", + "type": "string" + } + }, + "required": [ + "volumeName", + "path", + "key" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" + }, "v1.FlexPersistentVolumeSource": { "description": "FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin.", "properties": { @@ -7341,6 +7766,7 @@ "type": "object" }, "v1.GRPCAction": { + "description": "GRPCAction specifies an action involving a GRPC service.", "properties": { "port": { "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", @@ -7408,7 +7834,7 @@ "description": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", "properties": { "endpoints": { - "description": "endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", + "description": "endpoints is the endpoint name that details Glusterfs topology.", "type": "string" }, "path": { @@ -7506,6 +7932,9 @@ "type": "string" } }, + "required": [ + "ip" + ], "type": "object" }, "v1.HostPathVolumeSource": { @@ -7645,6 +8074,20 @@ ], "type": "object" }, + "v1.ImageVolumeSource": { + "description": "ImageVolumeSource represents a image volume resource.", + "properties": { + "pullPolicy": { + "description": "Policy for pulling OCI objects. Possible values are: Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.", + "type": "string" + }, + "reference": { + "description": "Required: Image or artifact reference to be used. Behaves in the same way as pod.spec.containers[*].image. Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", + "type": "string" + } + }, + "type": "object" + }, "v1.KeyToPath": { "description": "Maps a string key to a path within a volume.", "properties": { @@ -7678,6 +8121,10 @@ "preStop": { "$ref": "#/definitions/v1.LifecycleHandler", "description": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" + }, + "stopSignal": { + "description": "StopSignal defines which signal will be sent to a container when it is being stopped. If not specified, the default is defined by the container runtime in use. StopSignal can only be set for Pods with a non-empty .spec.os.name", + "type": "string" } }, "type": "object" @@ -7687,19 +8134,19 @@ "properties": { "exec": { "$ref": "#/definitions/v1.ExecAction", - "description": "Exec specifies the action to take." + "description": "Exec specifies a command to execute in the container." }, "httpGet": { "$ref": "#/definitions/v1.HTTPGetAction", - "description": "HTTPGet specifies the http request to perform." + "description": "HTTPGet specifies an HTTP GET request to perform." }, "sleep": { "$ref": "#/definitions/v1.SleepAction", - "description": "Sleep represents the duration that the container should sleep before being terminated." + "description": "Sleep represents a duration that the container should sleep." }, "tcpSocket": { "$ref": "#/definitions/v1.TCPSocketAction", - "description": "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified." + "description": "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for backward compatibility. There is no validation of this field and lifecycle hooks will fail at runtime when it is specified." } }, "type": "object" @@ -7838,6 +8285,35 @@ ], "type": "object" }, + "v1.LinuxContainerUser": { + "description": "LinuxContainerUser represents user identity information in Linux containers", + "properties": { + "gid": { + "description": "GID is the primary gid initially attached to the first process in the container", + "format": "int64", + "type": "integer" + }, + "supplementalGroups": { + "description": "SupplementalGroups are the supplemental groups initially attached to the first process in the container", + "items": { + "format": "int64", + "type": "integer" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "uid": { + "description": "UID is the primary uid initially attached to the first process in the container", + "format": "int64", + "type": "integer" + } + }, + "required": [ + "uid", + "gid" + ], + "type": "object" + }, "v1.LoadBalancerIngress": { "description": "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", "properties": { @@ -7890,7 +8366,7 @@ "x-kubernetes-map-type": "atomic" }, "v1.LocalVolumeSource": { - "description": "Local represents directly-attached storage with node affinity (Beta feature)", + "description": "Local represents directly-attached storage with node affinity", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. It applies only when the Path is a block device. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default value is to auto-select a filesystem if unspecified.", @@ -7982,14 +8458,16 @@ "description": "NamespaceCondition contains details about state of namespace.", "properties": { "lastTransitionTime": { - "description": "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.", + "description": "Last time the condition transitioned from one status to another.", "format": "date-time", "type": "string" }, "message": { + "description": "Human-readable message indicating details about last transition.", "type": "string" }, "reason": { + "description": "Unique, one-word, CamelCase reason for the condition's last transition.", "type": "string" }, "status": { @@ -8226,6 +8704,16 @@ }, "type": "object" }, + "v1.NodeFeatures": { + "description": "NodeFeatures describes the set of features implemented by the CRI implementation. The features contained in the NodeFeatures should depend only on the cri implementation independent of runtime handlers.", + "properties": { + "supplementalGroupsPolicy": { + "description": "SupplementalGroupsPolicy is set to true if the runtime supports SupplementalGroupsPolicy and ContainerUser.", + "type": "boolean" + } + }, + "type": "object" + }, "v1.NodeList": { "description": "NodeList is the whole list of all Nodes which have been registered with master.", "properties": { @@ -8276,11 +8764,15 @@ "type": "object" }, "v1.NodeRuntimeHandlerFeatures": { - "description": "NodeRuntimeHandlerFeatures is a set of runtime features.", + "description": "NodeRuntimeHandlerFeatures is a set of features implemented by the runtime handler.", "properties": { "recursiveReadOnlyMounts": { "description": "RecursiveReadOnlyMounts is set to true if the runtime handler supports RecursiveReadOnlyMounts.", "type": "boolean" + }, + "userNamespaces": { + "description": "UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.", + "type": "boolean" } }, "type": "object" @@ -8399,7 +8891,7 @@ "description": "NodeStatus is information about the current status of a node.", "properties": { "addresses": { - "description": "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP).", + "description": "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/reference/node/node-status/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP).", "items": { "$ref": "#/definitions/v1.NodeAddress" }, @@ -8424,11 +8916,11 @@ "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", "type": "string" }, - "description": "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", + "description": "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/reference/node/node-status/#capacity", "type": "object" }, "conditions": { - "description": "Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition", + "description": "Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/reference/node/node-status/#condition", "items": { "$ref": "#/definitions/v1.NodeCondition" }, @@ -8448,6 +8940,10 @@ "$ref": "#/definitions/v1.NodeDaemonEndpoints", "description": "Endpoints of daemons running on the Node." }, + "features": { + "$ref": "#/definitions/v1.NodeFeatures", + "description": "Features describes the set of features implemented by the CRI implementation." + }, "images": { "description": "List of container images on this node", "items": { @@ -8458,7 +8954,7 @@ }, "nodeInfo": { "$ref": "#/definitions/v1.NodeSystemInfo", - "description": "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#info" + "description": "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/reference/node/node-status/#info" }, "phase": { "description": "NodePhase is the recently observed lifecycle phase of the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#phase The field is never populated, and now is deprecated.", @@ -8491,6 +8987,17 @@ }, "type": "object" }, + "v1.NodeSwapStatus": { + "description": "NodeSwapStatus represents swap memory information.", + "properties": { + "capacity": { + "description": "Total amount of swap memory in bytes.", + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, "v1.NodeSystemInfo": { "description": "NodeSystemInfo is a set of ids/uuids to uniquely identify the node.", "properties": { @@ -8511,7 +9018,7 @@ "type": "string" }, "kubeProxyVersion": { - "description": "KubeProxy Version reported by the node.", + "description": "Deprecated: KubeProxy Version reported by the node.", "type": "string" }, "kubeletVersion": { @@ -8530,6 +9037,10 @@ "description": "OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).", "type": "string" }, + "swap": { + "$ref": "#/definitions/v1.NodeSwapStatus", + "description": "Swap Info reported by the node." + }, "systemUUID": { "description": "SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid", "type": "string" @@ -8690,9 +9201,11 @@ "type": "string" }, "status": { + "description": "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=state%20of%20pvc-,conditions.status,-(string)%2C%20required", "type": "string" }, "type": { + "description": "Type is the type of the condition. More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=set%20to%20%27ResizeStarted%27.-,PersistentVolumeClaimCondition,-contains%20details%20about", "type": "string" } }, @@ -8769,7 +9282,7 @@ "type": "string" }, "volumeAttributesClassName": { - "description": "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.", + "description": "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string or nil value indicates that no VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, this field can be reset to its previous value (including nil) to cancel the modification. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/", "type": "string" }, "volumeMode": { @@ -8832,12 +9345,12 @@ "x-kubernetes-patch-strategy": "merge" }, "currentVolumeAttributesClassName": { - "description": "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is an alpha field and requires enabling VolumeAttributesClass feature.", + "description": "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim", "type": "string" }, "modifyVolumeStatus": { "$ref": "#/definitions/v1.ModifyVolumeStatus", - "description": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is an alpha field and requires enabling VolumeAttributesClass feature." + "description": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted." }, "phase": { "description": "phase represents the current phase of PersistentVolumeClaim.", @@ -8928,15 +9441,15 @@ }, "awsElasticBlockStore": { "$ref": "#/definitions/v1.AWSElasticBlockStoreVolumeSource", - "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Deprecated: AWSElasticBlockStore is deprecated. All operations for the in-tree awsElasticBlockStore type are redirected to the ebs.csi.aws.com CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" }, "azureDisk": { "$ref": "#/definitions/v1.AzureDiskVolumeSource", - "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod." + "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type are redirected to the disk.csi.azure.com CSI driver." }, "azureFile": { "$ref": "#/definitions/v1.AzureFilePersistentVolumeSource", - "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod." + "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod. Deprecated: AzureFile is deprecated. All operations for the in-tree azureFile type are redirected to the file.csi.azure.com CSI driver." }, "capacity": { "additionalProperties": { @@ -8948,11 +9461,11 @@ }, "cephfs": { "$ref": "#/definitions/v1.CephFSPersistentVolumeSource", - "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime" + "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime. Deprecated: CephFS is deprecated and the in-tree cephfs type is no longer supported." }, "cinder": { "$ref": "#/definitions/v1.CinderPersistentVolumeSource", - "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" + "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. Deprecated: Cinder is deprecated. All operations for the in-tree cinder type are redirected to the cinder.csi.openstack.org CSI driver. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" }, "claimRef": { "$ref": "#/definitions/v1.ObjectReference", @@ -8961,7 +9474,7 @@ }, "csi": { "$ref": "#/definitions/v1.CSIPersistentVolumeSource", - "description": "csi represents storage that is handled by an external CSI driver (Beta feature)." + "description": "csi represents storage that is handled by an external CSI driver." }, "fc": { "$ref": "#/definitions/v1.FCVolumeSource", @@ -8969,19 +9482,19 @@ }, "flexVolume": { "$ref": "#/definitions/v1.FlexPersistentVolumeSource", - "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin." + "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. Deprecated: FlexVolume is deprecated. Consider using a CSIDriver instead." }, "flocker": { "$ref": "#/definitions/v1.FlockerVolumeSource", - "description": "flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running" + "description": "flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running. Deprecated: Flocker is deprecated and the in-tree flocker type is no longer supported." }, "gcePersistentDisk": { "$ref": "#/definitions/v1.GCEPersistentDiskVolumeSource", - "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. Deprecated: GCEPersistentDisk is deprecated. All operations for the in-tree gcePersistentDisk type are redirected to the pd.csi.storage.gke.io CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" }, "glusterfs": { "$ref": "#/definitions/v1.GlusterfsPersistentVolumeSource", - "description": "glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md" + "description": "glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported. More info: https://examples.k8s.io/volumes/glusterfs/README.md" }, "hostPath": { "$ref": "#/definitions/v1.HostPathVolumeSource", @@ -9017,23 +9530,23 @@ }, "photonPersistentDisk": { "$ref": "#/definitions/v1.PhotonPersistentDiskVolumeSource", - "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" + "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported." }, "portworxVolume": { "$ref": "#/definitions/v1.PortworxVolumeSource", - "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine" + "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on." }, "quobyte": { "$ref": "#/definitions/v1.QuobyteVolumeSource", - "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime" + "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported." }, "rbd": { "$ref": "#/definitions/v1.RBDPersistentVolumeSource", - "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" + "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. More info: https://examples.k8s.io/volumes/rbd/README.md" }, "scaleIO": { "$ref": "#/definitions/v1.ScaleIOPersistentVolumeSource", - "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes." + "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported." }, "storageClassName": { "description": "storageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.", @@ -9041,10 +9554,10 @@ }, "storageos": { "$ref": "#/definitions/v1.StorageOSPersistentVolumeSource", - "description": "storageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://examples.k8s.io/volumes/storageos/README.md" + "description": "storageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod. Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported. More info: https://examples.k8s.io/volumes/storageos/README.md" }, "volumeAttributesClassName": { - "description": "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is an alpha field and requires enabling VolumeAttributesClass feature.", + "description": "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process.", "type": "string" }, "volumeMode": { @@ -9053,7 +9566,7 @@ }, "vsphereVolume": { "$ref": "#/definitions/v1.VsphereVirtualDiskVolumeSource", - "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine" + "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine. Deprecated: VsphereVolume is deprecated. All operations for the in-tree vsphereVolume type are redirected to the csi.vsphere.vmware.com CSI driver." } }, "type": "object" @@ -9062,7 +9575,7 @@ "description": "PersistentVolumeStatus is the current status of a persistent volume.", "properties": { "lastPhaseTransitionTime": { - "description": "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).", + "description": "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions.", "format": "date-time", "type": "string" }, @@ -9161,7 +9674,7 @@ "description": "A label query over a set of resources, in this case pods. If it's null, this PodAffinityTerm matches with no Pods." }, "matchLabelKeys": { - "description": "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + "description": "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set.", "items": { "type": "string" }, @@ -9169,7 +9682,7 @@ "x-kubernetes-list-type": "atomic" }, "mismatchLabelKeys": { - "description": "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + "description": "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set.", "items": { "type": "string" }, @@ -9202,7 +9715,7 @@ "description": "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { - "description": "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", + "description": "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and subtracting \"weight\" from the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", "items": { "$ref": "#/definitions/v1.WeightedPodAffinityTerm" }, @@ -9220,6 +9733,41 @@ }, "type": "object" }, + "v1.PodCertificateProjection": { + "description": "PodCertificateProjection provides a private key and X.509 certificate in the pod filesystem.", + "properties": { + "certificateChainPath": { + "description": "Write the certificate chain at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.", + "type": "string" + }, + "credentialBundlePath": { + "description": "Write the credential bundle at this path in the projected volume.\n\nThe credential bundle is a single file that contains multiple PEM blocks. The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private key.\n\nThe remaining blocks are CERTIFICATE blocks, containing the issued certificate chain from the signer (leaf and any intermediates).\n\nUsing credentialBundlePath lets your Pod's application code make a single atomic read that retrieves a consistent key and certificate chain. If you project them to separate files, your application code will need to additionally check that the leaf certificate was issued to the key.", + "type": "string" + }, + "keyPath": { + "description": "Write the key at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.", + "type": "string" + }, + "keyType": { + "description": "The type of keypair Kubelet will generate for the pod.\n\nValid values are \"RSA3072\", \"RSA4096\", \"ECDSAP256\", \"ECDSAP384\", \"ECDSAP521\", and \"ED25519\".", + "type": "string" + }, + "maxExpirationSeconds": { + "description": "maxExpirationSeconds is the maximum lifetime permitted for the certificate.\n\nKubelet copies this value verbatim into the PodCertificateRequests it generates for this projection.\n\nIf omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days).\n\nThe signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours.", + "format": "int32", + "type": "integer" + }, + "signerName": { + "description": "Kubelet's generated CSRs will be addressed to this signer.", + "type": "string" + } + }, + "required": [ + "signerName", + "keyType" + ], + "type": "object" + }, "v1.PodCondition": { "description": "PodCondition contains details for the current condition of this pod.", "properties": { @@ -9237,6 +9785,11 @@ "description": "Human-readable message indicating details about last transition.", "type": "string" }, + "observedGeneration": { + "description": "If set, this represents the .metadata.generation that the pod condition was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.", + "format": "int64", + "type": "integer" + }, "reason": { "description": "Unique, one-word, CamelCase reason for the condition's last transition.", "type": "string" @@ -9290,13 +9843,36 @@ "description": "PodDNSConfigOption defines DNS resolver options of a pod.", "properties": { "name": { - "description": "Required.", + "description": "Name is this DNS resolver option's name. Required.", "type": "string" }, "value": { + "description": "Value is this DNS resolver option's value.", + "type": "string" + } + }, + "type": "object" + }, + "v1.PodExtendedResourceClaimStatus": { + "description": "PodExtendedResourceClaimStatus is stored in the PodStatus for the extended resource requests backed by DRA. It stores the generated name for the corresponding special ResourceClaim created by the scheduler.", + "properties": { + "requestMappings": { + "description": "RequestMappings identifies the mapping of to device request in the generated ResourceClaim.", + "items": { + "$ref": "#/definitions/v1.ContainerExtendedResourceRequest" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "resourceClaimName": { + "description": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod.", "type": "string" } }, + "required": [ + "requestMappings", + "resourceClaimName" + ], "type": "object" }, "v1.PodIP": { @@ -9307,6 +9883,9 @@ "type": "string" } }, + "required": [ + "ip" + ], "type": "object" }, "v1.PodList": { @@ -9371,15 +9950,19 @@ "type": "object" }, "v1.PodResourceClaim": { - "description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", + "description": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", "properties": { "name": { "description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.", "type": "string" }, - "source": { - "$ref": "#/definitions/v1.ClaimSource", - "description": "Source describes where to find the ResourceClaim." + "resourceClaimName": { + "description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + "type": "string" + }, + "resourceClaimTemplateName": { + "description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + "type": "string" } }, "required": [ @@ -9395,7 +9978,7 @@ "type": "string" }, "resourceClaimName": { - "description": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. It this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", + "description": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", "type": "string" } }, @@ -9447,6 +10030,10 @@ "format": "int64", "type": "integer" }, + "seLinuxChangePolicy": { + "description": "seLinuxChangePolicy defines how the container's SELinux label is applied to all volumes used by the Pod. It has no effect on nodes that do not support SELinux or to volumes does not support SELinux. Valid values are \"MountOption\" and \"Recursive\".\n\n\"Recursive\" means relabeling of all files on all Pod volumes by the container runtime. This may be slow for large volumes, but allows mixing privileged and unprivileged Pods sharing the same volume on the same node.\n\n\"MountOption\" mounts all eligible Pod volumes with `-o context` mount option. This requires all Pods that share the same volume to use the same SELinux label. It is not possible to share the same volume among privileged and unprivileged Pods. Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. \"MountOption\" value is allowed only when SELinuxMount feature gate is enabled.\n\nIf not specified and SELinuxMount feature gate is enabled, \"MountOption\" is used. If not specified and SELinuxMount feature gate is disabled, \"MountOption\" is used for ReadWriteOncePod volumes and \"Recursive\" for all other volumes.\n\nThis field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers.\n\nAll Pods that use the same volume should use the same seLinuxChangePolicy, otherwise some pods can get stuck in ContainerCreating state. Note that this field cannot be set when spec.os.name is windows.", + "type": "string" + }, "seLinuxOptions": { "$ref": "#/definitions/v1.SELinuxOptions", "description": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows." @@ -9456,7 +10043,7 @@ "description": "The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows." }, "supplementalGroups": { - "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.", + "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID and fsGroup (if specified). If the SupplementalGroupsPolicy feature is enabled, the supplementalGroupsPolicy field determines whether these are in addition to or instead of any group memberships defined in the container image. If unspecified, no additional groups are added, though group memberships defined in the container image may still be used, depending on the supplementalGroupsPolicy field. Note that this field cannot be set when spec.os.name is windows.", "items": { "format": "int64", "type": "integer" @@ -9464,6 +10051,10 @@ "type": "array", "x-kubernetes-list-type": "atomic" }, + "supplementalGroupsPolicy": { + "description": "Defines how supplemental groups of the first container processes are calculated. Valid values are \"Merge\" and \"Strict\". If not specified, \"Merge\" is used. (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled and the container runtime must implement support for this feature. Note that this field cannot be set when spec.os.name is windows.", + "type": "string" + }, "sysctls": { "description": "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.", "items": { @@ -9551,7 +10142,7 @@ "type": "boolean" }, "hostNetwork": { - "description": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", + "description": "Host networking requested for this pod. Use the host's network namespace. When using HostNetwork you should specify ports so the scheduler is aware. When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`, and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`. Default to false.", "type": "boolean" }, "hostPID": { @@ -9566,6 +10157,10 @@ "description": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", "type": "string" }, + "hostnameOverride": { + "description": "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled.", + "type": "string" + }, "imagePullSecrets": { "description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", "items": { @@ -9580,7 +10175,7 @@ "x-kubernetes-patch-strategy": "merge" }, "initContainers": { - "description": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", + "description": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", "items": { "$ref": "#/definitions/v1.Container" }, @@ -9593,7 +10188,7 @@ "x-kubernetes-patch-strategy": "merge" }, "nodeName": { - "description": "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", + "description": "NodeName indicates in which node this pod is scheduled. If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. This field should not be used to express a desire for the pod to be scheduled on a specific node. https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename", "type": "string" }, "nodeSelector": { @@ -9606,7 +10201,7 @@ }, "os": { "$ref": "#/definitions/v1.PodOS", - "description": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup" + "description": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.resources - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup" }, "overhead": { "additionalProperties": { @@ -9650,6 +10245,10 @@ "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys" }, + "resources": { + "$ref": "#/definitions/v1.ResourceRequirements", + "description": "Resources is the total amount of CPU and Memory resources required by all containers in the pod. It supports specifying Requests and Limits for \"cpu\", \"memory\" and \"hugepages-\" resource names only. ResourceClaims are not supported.\n\nThis field enables fine-grained control over resource allocation for the entire pod, allowing resource sharing among containers in a pod.\n\nThis is an alpha field and requires enabling the PodLevelResources feature gate." + }, "restartPolicy": { "description": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", "type": "string" @@ -9688,7 +10287,7 @@ "type": "string" }, "setHostnameAsFQDN": { - "description": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + "description": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", "type": "boolean" }, "shareProcessNamespace": { @@ -9762,7 +10361,7 @@ "x-kubernetes-patch-strategy": "merge" }, "containerStatuses": { - "description": "The list has one entry per container in the manifest. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", + "description": "Statuses of containers in this pod. Each container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", "items": { "$ref": "#/definitions/v1.ContainerStatus" }, @@ -9770,13 +10369,17 @@ "x-kubernetes-list-type": "atomic" }, "ephemeralContainerStatuses": { - "description": "Status for any ephemeral containers that have run in this pod.", + "description": "Statuses for any ephemeral containers that have run in this pod. Each ephemeral container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", "items": { "$ref": "#/definitions/v1.ContainerStatus" }, "type": "array", "x-kubernetes-list-type": "atomic" }, + "extendedResourceClaimStatus": { + "$ref": "#/definitions/v1.PodExtendedResourceClaimStatus", + "description": "Status of extended resource claim backed by DRA." + }, "hostIP": { "description": "hostIP holds the IP address of the host to which the pod is assigned. Empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns mean that HostIP will not be updated even if there is a node is assigned to pod", "type": "string" @@ -9792,7 +10395,7 @@ "x-kubernetes-patch-strategy": "merge" }, "initContainerStatuses": { - "description": "The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", + "description": "Statuses of init containers in this pod. The most recent successful non-restartable init container will have ready = true, the most recently started container will have startTime set. Each init container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-and-container-status", "items": { "$ref": "#/definitions/v1.ContainerStatus" }, @@ -9807,6 +10410,11 @@ "description": "nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", "type": "string" }, + "observedGeneration": { + "description": "If set, this represents the .metadata.generation that the pod status was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.", + "format": "int64", + "type": "integer" + }, "phase": { "description": "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase", "type": "string" @@ -9837,7 +10445,7 @@ "type": "string" }, "resize": { - "description": "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\"", + "description": "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources.", "type": "string" }, "resourceClaimStatuses": { @@ -9940,6 +10548,7 @@ "type": "object" }, "v1.PortStatus": { + "description": "PortStatus represents the error condition of a service port", "properties": { "error": { "description": "Error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use\n CamelCase names\n- cloud provider specific error values must have names that comply with the\n format foo.example.com/CamelCase.", @@ -10006,7 +10615,7 @@ "properties": { "exec": { "$ref": "#/definitions/v1.ExecAction", - "description": "Exec specifies the action to take." + "description": "Exec specifies a command to execute in the container." }, "failureThreshold": { "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", @@ -10015,11 +10624,11 @@ }, "grpc": { "$ref": "#/definitions/v1.GRPCAction", - "description": "GRPC specifies an action involving a GRPC port." + "description": "GRPC specifies a GRPC HealthCheckRequest." }, "httpGet": { "$ref": "#/definitions/v1.HTTPGetAction", - "description": "HTTPGet specifies the http request to perform." + "description": "HTTPGet specifies an HTTP GET request to perform." }, "initialDelaySeconds": { "description": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", @@ -10038,7 +10647,7 @@ }, "tcpSocket": { "$ref": "#/definitions/v1.TCPSocketAction", - "description": "TCPSocket specifies an action involving a TCP port." + "description": "TCPSocket specifies a connection to a TCP port." }, "terminationGracePeriodSeconds": { "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", @@ -10062,7 +10671,7 @@ "type": "integer" }, "sources": { - "description": "sources is the list of volume projections", + "description": "sources is the list of volume projections. Each entry in this list handles one source.", "items": { "$ref": "#/definitions/v1.VolumeProjection" }, @@ -10372,12 +10981,16 @@ ], "type": "object" }, - "v1.ResourceClaim": { + "core.v1.ResourceClaim": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + "type": "string" } }, "required": [ @@ -10407,6 +11020,23 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, + "v1.ResourceHealth": { + "description": "ResourceHealth represents the health of a resource. It has the latest device health information. This is a part of KEP https://kep.k8s.io/4680.", + "properties": { + "health": { + "description": "Health of the resource. can be one of:\n - Healthy: operates as normal\n - Unhealthy: reported unhealthy. We consider this a temporary health issue\n since we do not have a mechanism today to distinguish\n temporary and permanent issues.\n - Unknown: The status cannot be determined.\n For example, Device Plugin got unregistered and hasn't been re-registered since.\n\nIn future we may want to introduce the PermanentlyUnhealthy Status.", + "type": "string" + }, + "resourceID": { + "description": "ResourceID is the unique identifier of the resource. See the ResourceID type for more information.", + "type": "string" + } + }, + "required": [ + "resourceID" + ], + "type": "object" + }, "v1.ResourceQuota": { "description": "ResourceQuota sets aggregate quota restrictions enforced per namespace", "properties": { @@ -10527,9 +11157,9 @@ "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { - "description": "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", + "description": "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.\n\nThis field depends on the DynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", "items": { - "$ref": "#/definitions/v1.ResourceClaim" + "$ref": "#/definitions/core.v1.ResourceClaim" }, "type": "array", "x-kubernetes-list-map-keys": [ @@ -10556,6 +11186,30 @@ }, "type": "object" }, + "v1.ResourceStatus": { + "description": "ResourceStatus represents the status of a single resource allocated to a Pod.", + "properties": { + "name": { + "description": "Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:/\". When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container.", + "type": "string" + }, + "resources": { + "description": "List of unique resources health. Each element in the list contains an unique resource ID and its health. At a minimum, for the lifetime of a Pod, resource ID must uniquely identify the resource allocated to the Pod on the Node. If other Pod on the same Node reports the status with the same resource ID, it must be the same resource they share. See ResourceID type definition for a specific format it has in various use cases.", + "items": { + "$ref": "#/definitions/v1.ResourceHealth" + }, + "type": "array", + "x-kubernetes-list-map-keys": [ + "resourceID" + ], + "x-kubernetes-list-type": "map" + } + }, + "required": [ + "name" + ], + "type": "object" + }, "v1.SELinuxOptions": { "description": "SELinuxOptions are the labels to be applied to the container", "properties": { @@ -10949,7 +11603,7 @@ "type": "boolean" }, "procMount": { - "description": "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.", + "description": "procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.", "type": "string" }, "readOnlyRootFilesystem": { @@ -11046,7 +11700,7 @@ "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "secrets": { - "description": "Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a \"kubernetes.io/enforce-mountable-secrets\" annotation set to \"true\". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret", + "description": "Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a \"kubernetes.io/enforce-mountable-secrets\" annotation set to \"true\". The \"kubernetes.io/enforce-mountable-secrets\" annotation is deprecated since v1.32. Prefer separate namespaces to isolate access to mounted secrets. This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret", "items": { "$ref": "#/definitions/v1.ObjectReference" }, @@ -11302,7 +11956,7 @@ "description": "sessionAffinityConfig contains the configurations of session affinity." }, "trafficDistribution": { - "description": "TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are topologically close (e.g., same zone). This is an alpha field and requires enabling ServiceTrafficDistribution feature.", + "description": "TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are in the same zone.", "type": "string" }, "type": { @@ -11458,7 +12112,7 @@ "type": "string" }, "timeAdded": { - "description": "TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints.", + "description": "TimeAdded represents the time at which the taint was added.", "format": "date-time", "type": "string" }, @@ -11563,11 +12217,11 @@ "type": "integer" }, "nodeAffinityPolicy": { - "description": "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", + "description": "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy.", "type": "string" }, "nodeTaintsPolicy": { - "description": "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", + "description": "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy.", "type": "string" }, "topologyKey": { @@ -11610,6 +12264,7 @@ "x-kubernetes-map-type": "atomic" }, "v1.TypedObjectReference": { + "description": "TypedObjectReference contains enough information to let you locate the typed referenced object", "properties": { "apiGroup": { "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", @@ -11639,23 +12294,23 @@ "properties": { "awsElasticBlockStore": { "$ref": "#/definitions/v1.AWSElasticBlockStoreVolumeSource", - "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Deprecated: AWSElasticBlockStore is deprecated. All operations for the in-tree awsElasticBlockStore type are redirected to the ebs.csi.aws.com CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" }, "azureDisk": { "$ref": "#/definitions/v1.AzureDiskVolumeSource", - "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod." + "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type are redirected to the disk.csi.azure.com CSI driver." }, "azureFile": { "$ref": "#/definitions/v1.AzureFileVolumeSource", - "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod." + "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod. Deprecated: AzureFile is deprecated. All operations for the in-tree azureFile type are redirected to the file.csi.azure.com CSI driver." }, "cephfs": { "$ref": "#/definitions/v1.CephFSVolumeSource", - "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime" + "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime. Deprecated: CephFS is deprecated and the in-tree cephfs type is no longer supported." }, "cinder": { "$ref": "#/definitions/v1.CinderVolumeSource", - "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" + "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. Deprecated: Cinder is deprecated. All operations for the in-tree cinder type are redirected to the cinder.csi.openstack.org CSI driver. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" }, "configMap": { "$ref": "#/definitions/v1.ConfigMapVolumeSource", @@ -11663,7 +12318,7 @@ }, "csi": { "$ref": "#/definitions/v1.CSIVolumeSource", - "description": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature)." + "description": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers." }, "downwardAPI": { "$ref": "#/definitions/v1.DownwardAPIVolumeSource", @@ -11683,31 +12338,35 @@ }, "flexVolume": { "$ref": "#/definitions/v1.FlexVolumeSource", - "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin." + "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. Deprecated: FlexVolume is deprecated. Consider using a CSIDriver instead." }, "flocker": { "$ref": "#/definitions/v1.FlockerVolumeSource", - "description": "flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running" + "description": "flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running. Deprecated: Flocker is deprecated and the in-tree flocker type is no longer supported." }, "gcePersistentDisk": { "$ref": "#/definitions/v1.GCEPersistentDiskVolumeSource", - "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Deprecated: GCEPersistentDisk is deprecated. All operations for the in-tree gcePersistentDisk type are redirected to the pd.csi.storage.gke.io CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" }, "gitRepo": { "$ref": "#/definitions/v1.GitRepoVolumeSource", - "description": "gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container." + "description": "gitRepo represents a git repository at a particular revision. Deprecated: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container." }, "glusterfs": { "$ref": "#/definitions/v1.GlusterfsVolumeSource", - "description": "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md" + "description": "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported." }, "hostPath": { "$ref": "#/definitions/v1.HostPathVolumeSource", "description": "hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" }, + "image": { + "$ref": "#/definitions/v1.ImageVolumeSource", + "description": "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type." + }, "iscsi": { "$ref": "#/definitions/v1.ISCSIVolumeSource", - "description": "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md" + "description": "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi" }, "name": { "description": "name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", @@ -11723,11 +12382,11 @@ }, "photonPersistentDisk": { "$ref": "#/definitions/v1.PhotonPersistentDiskVolumeSource", - "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" + "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported." }, "portworxVolume": { "$ref": "#/definitions/v1.PortworxVolumeSource", - "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine" + "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on." }, "projected": { "$ref": "#/definitions/v1.ProjectedVolumeSource", @@ -11735,15 +12394,15 @@ }, "quobyte": { "$ref": "#/definitions/v1.QuobyteVolumeSource", - "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime" + "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported." }, "rbd": { "$ref": "#/definitions/v1.RBDVolumeSource", - "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" + "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported." }, "scaleIO": { "$ref": "#/definitions/v1.ScaleIOVolumeSource", - "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes." + "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported." }, "secret": { "$ref": "#/definitions/v1.SecretVolumeSource", @@ -11751,11 +12410,11 @@ }, "storageos": { "$ref": "#/definitions/v1.StorageOSVolumeSource", - "description": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." + "description": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported." }, "vsphereVolume": { "$ref": "#/definitions/v1.VsphereVirtualDiskVolumeSource", - "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine" + "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine. Deprecated: VsphereVolume is deprecated. All operations for the in-tree vsphereVolume type are redirected to the csi.vsphere.vmware.com CSI driver." } }, "required": [ @@ -11856,7 +12515,7 @@ "type": "object" }, "v1.VolumeProjection": { - "description": "Projection that may be projected along with other supported volume types", + "description": "Projection that may be projected along with other supported volume types. Exactly one of these fields must be set.", "properties": { "clusterTrustBundle": { "$ref": "#/definitions/v1.ClusterTrustBundleProjection", @@ -11870,6 +12529,10 @@ "$ref": "#/definitions/v1.DownwardAPIProjection", "description": "downwardAPI information about the downwardAPI data to project" }, + "podCertificate": { + "$ref": "#/definitions/v1.PodCertificateProjection", + "description": "Projects an auto-rotating credential bundle (private key and certificate chain) that the pod can use either as a TLS client or server.\n\nKubelet generates a private key and uses it to send a PodCertificateRequest to the named signer. Once the signer approves the request and issues a certificate chain, Kubelet writes the key and certificate chain to the pod filesystem. The pod does not start until certificates have been issued for each podCertificate projected volume source in its spec.\n\nKubelet will begin trying to rotate the certificate at the time indicated by the signer using the PodCertificateRequest.Status.BeginRefreshAt timestamp.\n\nKubelet can write a single file, indicated by the credentialBundlePath field, or separate files, indicated by the keyPath and certificateChainPath fields.\n\nThe credential bundle is a single file in PEM format. The first PEM entry is the private key (in PKCS#8 format), and the remaining PEM entries are the certificate chain issued by the signer (typically, signers will return their certificate chain in leaf-to-root order).\n\nPrefer using the credential bundle format, since your application code can read it atomically. If you use keyPath and certificateChainPath, your application must make two separate file reads. If these coincide with a certificate rotation, it is possible that the private key and leaf certificate you read may not correspond to each other. Your application will need to check for this condition, and re-read until they are consistent.\n\nThe named signer controls chooses the format of the certificate it issues; consult the signer implementation's documentation to learn how to use the certificates it issues." + }, "secret": { "$ref": "#/definitions/v1.SecretProjection", "description": "secret information about the secret data to project" @@ -11973,7 +12636,7 @@ "description": "Endpoint represents a single logical \"backend\" implementing a service.", "properties": { "addresses": { - "description": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267", + "description": "addresses of this endpoint. For EndpointSlices of addressType \"IPv4\" or \"IPv6\", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.", "items": { "type": "string" }, @@ -12021,15 +12684,15 @@ "description": "EndpointConditions represents the current condition of an endpoint.", "properties": { "ready": { - "description": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag.", + "description": "ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as \"true\". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.", "type": "boolean" }, "serving": { - "description": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", + "description": "serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as \"true\".", "type": "boolean" }, "terminating": { - "description": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", + "description": "terminating indicates that this endpoint is terminating. A nil value should be interpreted as \"false\".", "type": "boolean" } }, @@ -12038,8 +12701,16 @@ "v1.EndpointHints": { "description": "EndpointHints provides hints describing how an endpoint should be consumed.", "properties": { + "forNodes": { + "description": "forNodes indicates the node(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries. This is an Alpha feature and is only used when the PreferSameTrafficDistribution feature gate is enabled.", + "items": { + "$ref": "#/definitions/v1.ForNode" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, "forZones": { - "description": "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing.", + "description": "forZones indicates the zone(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries.", "items": { "$ref": "#/definitions/v1.ForZone" }, @@ -12061,7 +12732,7 @@ "type": "string" }, "port": { - "description": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.", + "description": "port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.", "format": "int32", "type": "integer" }, @@ -12074,10 +12745,10 @@ "x-kubernetes-map-type": "atomic" }, "v1.EndpointSlice": { - "description": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.", + "description": "EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.", "properties": { "addressType": { - "description": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.", + "description": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.", "type": "string" }, "apiVersion": { @@ -12101,7 +12772,7 @@ "description": "Standard object's metadata." }, "ports": { - "description": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.", + "description": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.", "items": { "$ref": "#/definitions/discovery.v1.EndpointPort" }, @@ -12157,6 +12828,19 @@ } ] }, + "v1.ForNode": { + "description": "ForNode provides information about which nodes should consume this endpoint.", + "properties": { + "name": { + "description": "name represents the name of the node.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, "v1.ForZone": { "description": "ForZone provides information about which zones should consume this endpoint.", "properties": { @@ -12899,37 +13583,47 @@ ], "type": "object" }, - "v1beta3.ExemptPriorityLevelConfiguration": { - "description": "ExemptPriorityLevelConfiguration describes the configurable aspects of the handling of exempt requests. In the mandatory exempt configuration object the values in the fields here can be modified by authorized users, unlike the rest of the `spec`.", + "v1.HTTPIngressPath": { + "description": "HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend.", "properties": { - "lendablePercent": { - "description": "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. This value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", - "format": "int32", - "type": "integer" + "backend": { + "$ref": "#/definitions/v1.IngressBackend", + "description": "backend defines the referenced service endpoint to which the traffic will be forwarded to." }, - "nominalConcurrencyShares": { - "description": "`nominalConcurrencyShares` (NCS) contributes to the computation of the NominalConcurrencyLimit (NominalCL) of this level. This is the number of execution seats nominally reserved for this priority level. This DOES NOT limit the dispatching from this priority level but affects the other priority levels through the borrowing mechanism. The server's concurrency limit (ServerCL) is divided among all the priority levels in proportion to their NCS values:\n\nNominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)\n\nBigger numbers mean a larger nominal concurrency limit, at the expense of every other priority level. This field has a default value of zero.", - "format": "int32", - "type": "integer" + "path": { + "description": "path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/' and must be present when using PathType with value \"Exact\" or \"Prefix\".", + "type": "string" + }, + "pathType": { + "description": "pathType determines the interpretation of the path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is\n done on a path element by element basis. A path element refers is the\n list of labels in the path split by the '/' separator. A request is a\n match for path p if every p is an element-wise prefix of p of the\n request path. Note that if the last element of the path is a substring\n of the last element in request path, it is not a match (e.g. /foo/bar\n matches /foo/bar/baz, but does not match /foo/barbaz).\n* ImplementationSpecific: Interpretation of the Path matching is up to\n the IngressClass. Implementations can treat this as a separate PathType\n or treat it identically to Prefix or Exact path types.\nImplementations are required to support all path types.", + "type": "string" } }, + "required": [ + "pathType", + "backend" + ], "type": "object" }, - "v1beta3.FlowDistinguisherMethod": { - "description": "FlowDistinguisherMethod specifies the method of a flow distinguisher.", + "v1.HTTPIngressRuleValue": { + "description": "HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.", "properties": { - "type": { - "description": "`type` is the type of flow distinguisher method The supported types are \"ByUser\" and \"ByNamespace\". Required.", - "type": "string" + "paths": { + "description": "paths is a collection of paths that map requests to backends.", + "items": { + "$ref": "#/definitions/v1.HTTPIngressPath" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "required": [ - "type" + "paths" ], "type": "object" }, - "v1beta3.FlowSchema": { - "description": "FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \"flow distinguisher\".", + "v1.IPAddress": { + "description": "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -12941,64 +13635,33 @@ }, "metadata": { "$ref": "#/definitions/v1.ObjectMeta", - "description": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { - "$ref": "#/definitions/v1beta3.FlowSchemaSpec", - "description": "`spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" - }, - "status": { - "$ref": "#/definitions/v1beta3.FlowSchemaStatus", - "description": "`status` is the current status of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" + "$ref": "#/definitions/v1.IPAddressSpec", + "description": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { - "group": "flowcontrol.apiserver.k8s.io", - "kind": "FlowSchema", - "version": "v1beta3" + "group": "networking.k8s.io", + "kind": "IPAddress", + "version": "v1" } ] }, - "v1beta3.FlowSchemaCondition": { - "description": "FlowSchemaCondition describes conditions for a FlowSchema.", - "properties": { - "lastTransitionTime": { - "description": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", - "format": "date-time", - "type": "string" - }, - "message": { - "description": "`message` is a human-readable message indicating details about last transition.", - "type": "string" - }, - "reason": { - "description": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", - "type": "string" - }, - "status": { - "description": "`status` is the status of the condition. Can be True, False, Unknown. Required.", - "type": "string" - }, - "type": { - "description": "`type` is the type of the condition. Required.", - "type": "string" - } - }, - "type": "object" - }, - "v1beta3.FlowSchemaList": { - "description": "FlowSchemaList is a list of FlowSchema objects.", + "v1.IPAddressList": { + "description": "IPAddressList contains a list of IPAddress.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { - "description": "`items` is a list of FlowSchemas.", + "description": "items is the list of IPAddresses.", "items": { - "$ref": "#/definitions/v1beta3.FlowSchema" + "$ref": "#/definitions/v1.IPAddress" }, "type": "array" }, @@ -13008,7 +13671,7 @@ }, "metadata": { "$ref": "#/definitions/v1.ListMeta", - "description": "`metadata` is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "required": [ @@ -13017,185 +13680,48 @@ "type": "object", "x-kubernetes-group-version-kind": [ { - "group": "flowcontrol.apiserver.k8s.io", - "kind": "FlowSchemaList", - "version": "v1beta3" + "group": "networking.k8s.io", + "kind": "IPAddressList", + "version": "v1" } ] }, - "v1beta3.FlowSchemaSpec": { - "description": "FlowSchemaSpec describes how the FlowSchema's specification looks like.", - "properties": { - "distinguisherMethod": { - "$ref": "#/definitions/v1beta3.FlowDistinguisherMethod", - "description": "`distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string." - }, - "matchingPrecedence": { - "description": "`matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000]. Note that if the precedence is not specified, it will be set to 1000 as default.", - "format": "int32", - "type": "integer" - }, - "priorityLevelConfiguration": { - "$ref": "#/definitions/v1beta3.PriorityLevelConfigurationReference", - "description": "`priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required." - }, - "rules": { - "description": "`rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.", - "items": { - "$ref": "#/definitions/v1beta3.PolicyRulesWithSubjects" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - } - }, - "required": [ - "priorityLevelConfiguration" - ], - "type": "object" - }, - "v1beta3.FlowSchemaStatus": { - "description": "FlowSchemaStatus represents the current state of a FlowSchema.", - "properties": { - "conditions": { - "description": "`conditions` is a list of the current states of FlowSchema.", - "items": { - "$ref": "#/definitions/v1beta3.FlowSchemaCondition" - }, - "type": "array", - "x-kubernetes-list-map-keys": [ - "type" - ], - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge" - } - }, - "type": "object" - }, - "v1beta3.GroupSubject": { - "description": "GroupSubject holds detailed information for group-kind subject.", + "v1.IPAddressSpec": { + "description": "IPAddressSpec describe the attributes in an IP Address.", "properties": { - "name": { - "description": "name is the user group that matches, or \"*\" to match all user groups. See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some well-known group names. Required.", - "type": "string" + "parentRef": { + "$ref": "#/definitions/v1.ParentReference", + "description": "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object." } }, "required": [ - "name" + "parentRef" ], "type": "object" }, - "v1beta3.LimitResponse": { - "description": "LimitResponse defines how to handle requests that can not be executed right now.", + "v1.IPBlock": { + "description": "IPBlock describes a particular CIDR (Ex. \"192.168.1.0/24\",\"2001:db8::/64\") that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should not be included within this rule.", "properties": { - "queuing": { - "$ref": "#/definitions/v1beta3.QueuingConfiguration", - "description": "`queuing` holds the configuration parameters for queuing. This field may be non-empty only if `type` is `\"Queue\"`." - }, - "type": { - "description": "`type` is \"Queue\" or \"Reject\". \"Queue\" means that requests that can not be executed upon arrival are held in a queue until they can be executed or a queuing limit is reached. \"Reject\" means that requests that can not be executed upon arrival are rejected. Required.", + "cidr": { + "description": "cidr is a string representing the IPBlock Valid examples are \"192.168.1.0/24\" or \"2001:db8::/64\"", "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object", - "x-kubernetes-unions": [ - { - "discriminator": "type", - "fields-to-discriminateBy": { - "queuing": "Queuing" - } - } - ] - }, - "v1beta3.LimitedPriorityLevelConfiguration": { - "description": "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n - How are requests for this priority level limited?\n - What should be done with requests that exceed the limit?", - "properties": { - "borrowingLimitPercent": { - "description": "`borrowingLimitPercent`, if present, configures a limit on how many seats this priority level can borrow from other priority levels. The limit is known as this level's BorrowingConcurrencyLimit (BorrowingCL) and is a limit on the total number of seats that this level may borrow at any one time. This field holds the ratio of that limit to the level's nominal concurrency limit. When this field is non-nil, it must hold a non-negative integer and the limit is calculated as follows.\n\nBorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )\n\nThe value of this field can be more than 100, implying that this priority level can borrow a number of seats that is greater than its own nominal concurrency limit (NominalCL). When this field is left `nil`, the limit is effectively infinite.", - "format": "int32", - "type": "integer" - }, - "lendablePercent": { - "description": "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. The value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", - "format": "int32", - "type": "integer" - }, - "limitResponse": { - "$ref": "#/definitions/v1beta3.LimitResponse", - "description": "`limitResponse` indicates what to do with requests that can not be executed right now" - }, - "nominalConcurrencyShares": { - "description": "`nominalConcurrencyShares` (NCS) contributes to the computation of the NominalConcurrencyLimit (NominalCL) of this level. This is the number of execution seats available at this priority level. This is used both for requests dispatched from this priority level as well as requests dispatched from other priority levels borrowing seats from this level. The server's concurrency limit (ServerCL) is divided among the Limited priority levels in proportion to their NCS values:\n\nNominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)\n\nBigger numbers mean a larger nominal concurrency limit, at the expense of every other priority level. This field has a default value of 30.", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - }, - "v1beta3.NonResourcePolicyRule": { - "description": "NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.", - "properties": { - "nonResourceURLs": { - "description": "`nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. For example:\n - \"/healthz\" is legal\n - \"/hea*\" is illegal\n - \"/hea\" is legal but matches nothing\n - \"/hea/*\" also matches nothing\n - \"/healthz/*\" matches all per-component health checks.\n\"*\" matches all non-resource urls. if it is present, it must be the only entry. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "set" }, - "verbs": { - "description": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs. If it is present, it must be the only entry. Required.", + "except": { + "description": "except is a slice of CIDRs that should not be included within an IPBlock Valid examples are \"192.168.1.0/24\" or \"2001:db8::/64\" Except values will be rejected if they are outside the cidr range", "items": { "type": "string" }, "type": "array", - "x-kubernetes-list-type": "set" - } - }, - "required": [ - "verbs", - "nonResourceURLs" - ], - "type": "object" - }, - "v1beta3.PolicyRulesWithSubjects": { - "description": "PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request.", - "properties": { - "nonResourceRules": { - "description": "`nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.", - "items": { - "$ref": "#/definitions/v1beta3.NonResourcePolicyRule" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "resourceRules": { - "description": "`resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.", - "items": { - "$ref": "#/definitions/v1beta3.ResourcePolicyRule" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "subjects": { - "description": "subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.", - "items": { - "$ref": "#/definitions/v1beta3.Subject" - }, - "type": "array", "x-kubernetes-list-type": "atomic" } }, "required": [ - "subjects" + "cidr" ], "type": "object" }, - "v1beta3.PriorityLevelConfiguration": { - "description": "PriorityLevelConfiguration represents the configuration of a priority level.", + "v1.Ingress": { + "description": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -13207,64 +13733,80 @@ }, "metadata": { "$ref": "#/definitions/v1.ObjectMeta", - "description": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { - "$ref": "#/definitions/v1beta3.PriorityLevelConfigurationSpec", - "description": "`spec` is the specification of the desired behavior of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" + "$ref": "#/definitions/v1.IngressSpec", + "description": "spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { - "$ref": "#/definitions/v1beta3.PriorityLevelConfigurationStatus", - "description": "`status` is the current status of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" + "$ref": "#/definitions/v1.IngressStatus", + "description": "status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { - "group": "flowcontrol.apiserver.k8s.io", - "kind": "PriorityLevelConfiguration", - "version": "v1beta3" + "group": "networking.k8s.io", + "kind": "Ingress", + "version": "v1" } ] }, - "v1beta3.PriorityLevelConfigurationCondition": { - "description": "PriorityLevelConfigurationCondition defines the condition of priority level.", + "v1.IngressBackend": { + "description": "IngressBackend describes all endpoints for a given service and port.", "properties": { - "lastTransitionTime": { - "description": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", - "format": "date-time", - "type": "string" + "resource": { + "$ref": "#/definitions/v1.TypedLocalObjectReference", + "description": "resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a service.Name and service.Port must not be specified. This is a mutually exclusive setting with \"Service\"." }, - "message": { - "description": "`message` is a human-readable message indicating details about last transition.", + "service": { + "$ref": "#/definitions/v1.IngressServiceBackend", + "description": "service references a service as a backend. This is a mutually exclusive setting with \"Resource\"." + } + }, + "type": "object" + }, + "v1.IngressClass": { + "description": "IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, - "reason": { - "description": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, - "status": { - "description": "`status` is the status of the condition. Can be True, False, Unknown. Required.", - "type": "string" + "metadata": { + "$ref": "#/definitions/v1.ObjectMeta", + "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, - "type": { - "description": "`type` is the type of the condition. Required.", - "type": "string" + "spec": { + "$ref": "#/definitions/v1.IngressClassSpec", + "description": "spec is the desired state of the IngressClass. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, - "type": "object" + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "networking.k8s.io", + "kind": "IngressClass", + "version": "v1" + } + ] }, - "v1beta3.PriorityLevelConfigurationList": { - "description": "PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.", + "v1.IngressClassList": { + "description": "IngressClassList is a collection of IngressClasses.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { - "description": "`items` is a list of request-priorities.", + "description": "items is the list of IngressClasses.", "items": { - "$ref": "#/definitions/v1beta3.PriorityLevelConfiguration" + "$ref": "#/definitions/v1.IngressClass" }, "type": "array" }, @@ -13274,7 +13816,7 @@ }, "metadata": { "$ref": "#/definitions/v1.ListMeta", - "description": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + "description": "Standard list metadata." } }, "required": [ @@ -13283,411 +13825,44 @@ "type": "object", "x-kubernetes-group-version-kind": [ { - "group": "flowcontrol.apiserver.k8s.io", - "kind": "PriorityLevelConfigurationList", - "version": "v1beta3" + "group": "networking.k8s.io", + "kind": "IngressClassList", + "version": "v1" } ] }, - "v1beta3.PriorityLevelConfigurationReference": { - "description": "PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used.", + "v1.IngressClassParametersReference": { + "description": "IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.", "properties": { + "apiGroup": { + "description": "apiGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "type": "string" + }, + "kind": { + "description": "kind is the type of resource being referenced.", + "type": "string" + }, "name": { - "description": "`name` is the name of the priority level configuration being referenced Required.", + "description": "name is the name of resource being referenced.", + "type": "string" + }, + "namespace": { + "description": "namespace is the namespace of the resource being referenced. This field is required when scope is set to \"Namespace\" and must be unset when scope is set to \"Cluster\".", + "type": "string" + }, + "scope": { + "description": "scope represents if this refers to a cluster or namespace scoped resource. This may be set to \"Cluster\" (default) or \"Namespace\".", "type": "string" } }, "required": [ + "kind", "name" ], "type": "object" }, - "v1beta3.PriorityLevelConfigurationSpec": { - "description": "PriorityLevelConfigurationSpec specifies the configuration of a priority level.", - "properties": { - "exempt": { - "$ref": "#/definitions/v1beta3.ExemptPriorityLevelConfiguration", - "description": "`exempt` specifies how requests are handled for an exempt priority level. This field MUST be empty if `type` is `\"Limited\"`. This field MAY be non-empty if `type` is `\"Exempt\"`. If empty and `type` is `\"Exempt\"` then the default values for `ExemptPriorityLevelConfiguration` apply." - }, - "limited": { - "$ref": "#/definitions/v1beta3.LimitedPriorityLevelConfiguration", - "description": "`limited` specifies how requests are handled for a Limited priority level. This field must be non-empty if and only if `type` is `\"Limited\"`." - }, - "type": { - "description": "`type` indicates whether this priority level is subject to limitation on request execution. A value of `\"Exempt\"` means that requests of this priority level are not subject to a limit (and thus are never queued) and do not detract from the capacity made available to other priority levels. A value of `\"Limited\"` means that (a) requests of this priority level _are_ subject to limits and (b) some of the server's limited capacity is made available exclusively to this priority level. Required.", - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object", - "x-kubernetes-unions": [ - { - "discriminator": "type", - "fields-to-discriminateBy": { - "exempt": "Exempt", - "limited": "Limited" - } - } - ] - }, - "v1beta3.PriorityLevelConfigurationStatus": { - "description": "PriorityLevelConfigurationStatus represents the current state of a \"request-priority\".", - "properties": { - "conditions": { - "description": "`conditions` is the current state of \"request-priority\".", - "items": { - "$ref": "#/definitions/v1beta3.PriorityLevelConfigurationCondition" - }, - "type": "array", - "x-kubernetes-list-map-keys": [ - "type" - ], - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge" - } - }, - "type": "object" - }, - "v1beta3.QueuingConfiguration": { - "description": "QueuingConfiguration holds the configuration parameters for queuing", - "properties": { - "handSize": { - "description": "`handSize` is a small positive number that configures the shuffle sharding of requests into queues. When enqueuing a request at this priority level the request's flow identifier (a string pair) is hashed and the hash value is used to shuffle the list of queues and deal a hand of the size specified here. The request is put into one of the shortest queues in that hand. `handSize` must be no larger than `queues`, and should be significantly smaller (so that a few heavy flows do not saturate most of the queues). See the user-facing documentation for more extensive guidance on setting this field. This field has a default value of 8.", - "format": "int32", - "type": "integer" - }, - "queueLengthLimit": { - "description": "`queueLengthLimit` is the maximum number of requests allowed to be waiting in a given queue of this priority level at a time; excess requests are rejected. This value must be positive. If not specified, it will be defaulted to 50.", - "format": "int32", - "type": "integer" - }, - "queues": { - "description": "`queues` is the number of queues for this priority level. The queues exist independently at each apiserver. The value must be positive. Setting it to 1 effectively precludes shufflesharding and thus makes the distinguisher method of associated flow schemas irrelevant. This field has a default value of 64.", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - }, - "v1beta3.ResourcePolicyRule": { - "description": "ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) either (d1) the request does not specify a namespace (i.e., `Namespace==\"\"`) and clusterScope is true or (d2) the request specifies a namespace and least one member of namespaces matches the request's namespace.", - "properties": { - "apiGroups": { - "description": "`apiGroups` is a list of matching API groups and may not be empty. \"*\" matches all API groups and, if present, must be the only entry. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "set" - }, - "clusterScope": { - "description": "`clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.", - "type": "boolean" - }, - "namespaces": { - "description": "`namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains \"*\". Note that \"*\" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "set" - }, - "resources": { - "description": "`resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ \"services\", \"nodes/status\" ]. This list may not be empty. \"*\" matches all resources and, if present, must be the only entry. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "set" - }, - "verbs": { - "description": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs and, if present, must be the only entry. Required.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "set" - } - }, - "required": [ - "verbs", - "apiGroups", - "resources" - ], - "type": "object" - }, - "v1beta3.ServiceAccountSubject": { - "description": "ServiceAccountSubject holds detailed information for service-account-kind subject.", - "properties": { - "name": { - "description": "`name` is the name of matching ServiceAccount objects, or \"*\" to match regardless of name. Required.", - "type": "string" - }, - "namespace": { - "description": "`namespace` is the namespace of matching ServiceAccount objects. Required.", - "type": "string" - } - }, - "required": [ - "namespace", - "name" - ], - "type": "object" - }, - "v1beta3.Subject": { - "description": "Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account.", - "properties": { - "group": { - "$ref": "#/definitions/v1beta3.GroupSubject", - "description": "`group` matches based on user group name." - }, - "kind": { - "description": "`kind` indicates which one of the other fields is non-empty. Required", - "type": "string" - }, - "serviceAccount": { - "$ref": "#/definitions/v1beta3.ServiceAccountSubject", - "description": "`serviceAccount` matches ServiceAccounts." - }, - "user": { - "$ref": "#/definitions/v1beta3.UserSubject", - "description": "`user` matches based on username." - } - }, - "required": [ - "kind" - ], - "type": "object", - "x-kubernetes-unions": [ - { - "discriminator": "kind", - "fields-to-discriminateBy": { - "group": "Group", - "serviceAccount": "ServiceAccount", - "user": "User" - } - } - ] - }, - "v1beta3.UserSubject": { - "description": "UserSubject holds detailed information for user-kind subject.", - "properties": { - "name": { - "description": "`name` is the username that matches, or \"*\" to match all usernames. Required.", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "v1.HTTPIngressPath": { - "description": "HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend.", - "properties": { - "backend": { - "$ref": "#/definitions/v1.IngressBackend", - "description": "backend defines the referenced service endpoint to which the traffic will be forwarded to." - }, - "path": { - "description": "path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/' and must be present when using PathType with value \"Exact\" or \"Prefix\".", - "type": "string" - }, - "pathType": { - "description": "pathType determines the interpretation of the path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is\n done on a path element by element basis. A path element refers is the\n list of labels in the path split by the '/' separator. A request is a\n match for path p if every p is an element-wise prefix of p of the\n request path. Note that if the last element of the path is a substring\n of the last element in request path, it is not a match (e.g. /foo/bar\n matches /foo/bar/baz, but does not match /foo/barbaz).\n* ImplementationSpecific: Interpretation of the Path matching is up to\n the IngressClass. Implementations can treat this as a separate PathType\n or treat it identically to Prefix or Exact path types.\nImplementations are required to support all path types.", - "type": "string" - } - }, - "required": [ - "pathType", - "backend" - ], - "type": "object" - }, - "v1.HTTPIngressRuleValue": { - "description": "HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.", - "properties": { - "paths": { - "description": "paths is a collection of paths that map requests to backends.", - "items": { - "$ref": "#/definitions/v1.HTTPIngressPath" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - } - }, - "required": [ - "paths" - ], - "type": "object" - }, - "v1.IPBlock": { - "description": "IPBlock describes a particular CIDR (Ex. \"192.168.1.0/24\",\"2001:db8::/64\") that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should not be included within this rule.", - "properties": { - "cidr": { - "description": "cidr is a string representing the IPBlock Valid examples are \"192.168.1.0/24\" or \"2001:db8::/64\"", - "type": "string" - }, - "except": { - "description": "except is a slice of CIDRs that should not be included within an IPBlock Valid examples are \"192.168.1.0/24\" or \"2001:db8::/64\" Except values will be rejected if they are outside the cidr range", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - } - }, - "required": [ - "cidr" - ], - "type": "object" - }, - "v1.Ingress": { - "description": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - }, - "spec": { - "$ref": "#/definitions/v1.IngressSpec", - "description": "spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" - }, - "status": { - "$ref": "#/definitions/v1.IngressStatus", - "description": "status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "networking.k8s.io", - "kind": "Ingress", - "version": "v1" - } - ] - }, - "v1.IngressBackend": { - "description": "IngressBackend describes all endpoints for a given service and port.", - "properties": { - "resource": { - "$ref": "#/definitions/v1.TypedLocalObjectReference", - "description": "resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a service.Name and service.Port must not be specified. This is a mutually exclusive setting with \"Service\"." - }, - "service": { - "$ref": "#/definitions/v1.IngressServiceBackend", - "description": "service references a service as a backend. This is a mutually exclusive setting with \"Resource\"." - } - }, - "type": "object" - }, - "v1.IngressClass": { - "description": "IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - }, - "spec": { - "$ref": "#/definitions/v1.IngressClassSpec", - "description": "spec is the desired state of the IngressClass. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "networking.k8s.io", - "kind": "IngressClass", - "version": "v1" - } - ] - }, - "v1.IngressClassList": { - "description": "IngressClassList is a collection of IngressClasses.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "items is the list of IngressClasses.", - "items": { - "$ref": "#/definitions/v1.IngressClass" - }, - "type": "array" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/v1.ListMeta", - "description": "Standard list metadata." - } - }, - "required": [ - "items" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "networking.k8s.io", - "kind": "IngressClassList", - "version": "v1" - } - ] - }, - "v1.IngressClassParametersReference": { - "description": "IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.", - "properties": { - "apiGroup": { - "description": "apiGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", - "type": "string" - }, - "kind": { - "description": "kind is the type of resource being referenced.", - "type": "string" - }, - "name": { - "description": "name is the name of resource being referenced.", - "type": "string" - }, - "namespace": { - "description": "namespace is the namespace of the resource being referenced. This field is required when scope is set to \"Namespace\" and must be unset when scope is set to \"Cluster\".", - "type": "string" - }, - "scope": { - "description": "scope represents if this refers to a cluster or namespace scoped resource. This may be set to \"Cluster\" (default) or \"Namespace\".", - "type": "string" - } - }, - "required": [ - "kind", - "name" - ], - "type": "object" - }, - "v1.IngressClassSpec": { - "description": "IngressClassSpec provides information about the class of an Ingress.", + "v1.IngressClassSpec": { + "description": "IngressClassSpec provides information about the class of an Ingress.", "properties": { "controller": { "description": "controller refers to the name of the controller that should handle this class. This allows for different \"flavors\" that are controlled by the same controller. For example, you may have different parameters for the same implementing controller. This should be specified as a domain-prefixed path no more than 250 characters in length, e.g. \"acme.io/ingress-controller\". This field is immutable.", @@ -14048,7 +14223,7 @@ }, "podSelector": { "$ref": "#/definitions/v1.LabelSelector", - "description": "podSelector selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace." + "description": "podSelector selects the pods to which this NetworkPolicy object applies. The array of rules is applied to any pods selected by this field. An empty selector matches all pods in the policy's namespace. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is optional. If it is not specified, it defaults to an empty selector." }, "policyTypes": { "description": "policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are [\"Ingress\"], [\"Egress\"], or [\"Ingress\", \"Egress\"]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ \"Egress\" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include \"Egress\" (since such a policy would not include an egress section and would otherwise default to just [ \"Ingress\" ]). This field is beta-level in 1.8", @@ -14059,8 +14234,31 @@ "x-kubernetes-list-type": "atomic" } }, + "type": "object" + }, + "v1.ParentReference": { + "description": "ParentReference describes a reference to a parent object.", + "properties": { + "group": { + "description": "Group is the group of the object being referenced.", + "type": "string" + }, + "name": { + "description": "Name is the name of the object being referenced.", + "type": "string" + }, + "namespace": { + "description": "Namespace is the namespace of the object being referenced.", + "type": "string" + }, + "resource": { + "description": "Resource is the resource of the object being referenced.", + "type": "string" + } + }, "required": [ - "podSelector" + "resource", + "name" ], "type": "object" }, @@ -14077,9 +14275,111 @@ "type": "integer" } }, + "type": "object", + "x-kubernetes-map-type": "atomic" + }, + "v1.ServiceCIDR": { + "description": "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ObjectMeta", + "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + }, + "spec": { + "$ref": "#/definitions/v1.ServiceCIDRSpec", + "description": "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" + }, + "status": { + "$ref": "#/definitions/v1.ServiceCIDRStatus", + "description": "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" + } + }, + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "networking.k8s.io", + "kind": "ServiceCIDR", + "version": "v1" + } + ] + }, + "v1.ServiceCIDRList": { + "description": "ServiceCIDRList contains a list of ServiceCIDR objects.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "items": { + "description": "items is the list of ServiceCIDRs.", + "items": { + "$ref": "#/definitions/v1.ServiceCIDR" + }, + "type": "array" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1.ListMeta", + "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + } + }, + "required": [ + "items" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "networking.k8s.io", + "kind": "ServiceCIDRList", + "version": "v1" + } + ] + }, + "v1.ServiceCIDRSpec": { + "description": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.", + "properties": { + "cidrs": { + "description": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "type": "object" + }, + "v1.ServiceCIDRStatus": { + "description": "ServiceCIDRStatus describes the current state of the ServiceCIDR.", + "properties": { + "conditions": { + "description": "conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. Current service state", + "items": { + "$ref": "#/definitions/v1.Condition" + }, + "type": "array", + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + } + }, "type": "object" }, - "v1alpha1.IPAddress": { + "v1beta1.IPAddress": { "description": "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1", "properties": { "apiVersion": { @@ -14095,7 +14395,7 @@ "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { - "$ref": "#/definitions/v1alpha1.IPAddressSpec", + "$ref": "#/definitions/v1beta1.IPAddressSpec", "description": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, @@ -14104,11 +14404,11 @@ { "group": "networking.k8s.io", "kind": "IPAddress", - "version": "v1alpha1" + "version": "v1beta1" } ] }, - "v1alpha1.IPAddressList": { + "v1beta1.IPAddressList": { "description": "IPAddressList contains a list of IPAddress.", "properties": { "apiVersion": { @@ -14118,7 +14418,7 @@ "items": { "description": "items is the list of IPAddresses.", "items": { - "$ref": "#/definitions/v1alpha1.IPAddress" + "$ref": "#/definitions/v1beta1.IPAddress" }, "type": "array" }, @@ -14139,15 +14439,15 @@ { "group": "networking.k8s.io", "kind": "IPAddressList", - "version": "v1alpha1" + "version": "v1beta1" } ] }, - "v1alpha1.IPAddressSpec": { + "v1beta1.IPAddressSpec": { "description": "IPAddressSpec describe the attributes in an IP Address.", "properties": { "parentRef": { - "$ref": "#/definitions/v1alpha1.ParentReference", + "$ref": "#/definitions/v1beta1.ParentReference", "description": "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object." } }, @@ -14156,7 +14456,7 @@ ], "type": "object" }, - "v1alpha1.ParentReference": { + "v1beta1.ParentReference": { "description": "ParentReference describes a reference to a parent object.", "properties": { "group": { @@ -14182,7 +14482,7 @@ ], "type": "object" }, - "v1alpha1.ServiceCIDR": { + "v1beta1.ServiceCIDR": { "description": "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.", "properties": { "apiVersion": { @@ -14198,11 +14498,11 @@ "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { - "$ref": "#/definitions/v1alpha1.ServiceCIDRSpec", + "$ref": "#/definitions/v1beta1.ServiceCIDRSpec", "description": "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { - "$ref": "#/definitions/v1alpha1.ServiceCIDRStatus", + "$ref": "#/definitions/v1beta1.ServiceCIDRStatus", "description": "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, @@ -14211,11 +14511,11 @@ { "group": "networking.k8s.io", "kind": "ServiceCIDR", - "version": "v1alpha1" + "version": "v1beta1" } ] }, - "v1alpha1.ServiceCIDRList": { + "v1beta1.ServiceCIDRList": { "description": "ServiceCIDRList contains a list of ServiceCIDR objects.", "properties": { "apiVersion": { @@ -14225,7 +14525,7 @@ "items": { "description": "items is the list of ServiceCIDRs.", "items": { - "$ref": "#/definitions/v1alpha1.ServiceCIDR" + "$ref": "#/definitions/v1beta1.ServiceCIDR" }, "type": "array" }, @@ -14246,11 +14546,11 @@ { "group": "networking.k8s.io", "kind": "ServiceCIDRList", - "version": "v1alpha1" + "version": "v1beta1" } ] }, - "v1alpha1.ServiceCIDRSpec": { + "v1beta1.ServiceCIDRSpec": { "description": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.", "properties": { "cidrs": { @@ -14264,7 +14564,7 @@ }, "type": "object" }, - "v1alpha1.ServiceCIDRStatus": { + "v1beta1.ServiceCIDRStatus": { "description": "ServiceCIDRStatus describes the current state of the ServiceCIDR.", "properties": { "conditions": { @@ -14508,7 +14808,7 @@ "x-kubernetes-patch-strategy": "replace" }, "unhealthyPodEvictionPolicy": { - "description": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.\n\nThis field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).", + "description": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.", "type": "string" } }, @@ -14977,112 +15277,248 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, - "v1alpha2.AllocationResult": { - "description": "AllocationResult contains attributes of an allocated resource.", + "v1.AllocatedDeviceStatus": { + "description": "AllocatedDeviceStatus contains the status of an allocated device, if the driver chooses to report it. This may include driver-specific information.\n\nThe combination of Driver, Pool, Device, and ShareID must match the corresponding key in Status.Allocation.Devices.", "properties": { - "availableOnNodes": { - "$ref": "#/definitions/v1.NodeSelector", - "description": "This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere." - }, - "resourceHandles": { - "description": "ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nSetting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.", + "conditions": { + "description": "Conditions contains the latest observation of the device's state. If the device has been configured according to the class and claim config references, the `Ready` condition should be True.\n\nMust not contain more than 8 entries.", "items": { - "$ref": "#/definitions/v1alpha2.ResourceHandle" + "$ref": "#/definitions/v1.Condition" }, "type": "array", - "x-kubernetes-list-type": "atomic" + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map" }, - "shareable": { - "description": "Shareable determines whether the resource supports more than one consumer at a time.", - "type": "boolean" + "data": { + "description": "Data contains arbitrary driver-specific data.\n\nThe length of the raw data must be smaller or equal to 10 Ki.", + "type": "object" + }, + "device": { + "description": "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.", + "type": "string" + }, + "driver": { + "description": "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + "type": "string" + }, + "networkData": { + "$ref": "#/definitions/v1.NetworkDeviceData", + "description": "NetworkData contains network-related information specific to the device." + }, + "pool": { + "description": "This name together with the driver name and the device name field identify which device was allocated (`//`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.", + "type": "string" + }, + "shareID": { + "description": "ShareID uniquely identifies an individual allocation share of the device.", + "type": "string" } }, + "required": [ + "driver", + "pool", + "device" + ], "type": "object" }, - "v1alpha2.DriverAllocationResult": { - "description": "DriverAllocationResult contains vendor parameters and the allocation result for one request.", + "v1.AllocationResult": { + "description": "AllocationResult contains attributes of an allocated resource.", "properties": { - "namedResources": { - "$ref": "#/definitions/v1alpha2.NamedResourcesAllocationResult", - "description": "NamedResources describes the allocation result when using the named resources model." + "allocationTimestamp": { + "description": "AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate.", + "format": "date-time", + "type": "string" }, - "vendorRequestParameters": { - "description": "VendorRequestParameters are the per-request configuration parameters from the time that the claim was allocated.", - "type": "object" + "devices": { + "$ref": "#/definitions/v1.DeviceAllocationResult", + "description": "Devices is the result of allocating devices." + }, + "nodeSelector": { + "$ref": "#/definitions/v1.NodeSelector", + "description": "NodeSelector defines where the allocated resources are available. If unset, they are available everywhere." } }, "type": "object" }, - "v1alpha2.DriverRequests": { - "description": "DriverRequests describes all resources that are needed from one particular driver.", + "v1.CELDeviceSelector": { + "description": "CELDeviceSelector contains a CEL expression for selecting a device.", "properties": { - "driverName": { - "description": "DriverName is the name used by the DRA driver kubelet plugin.", + "expression": { + "description": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", + "type": "string" + } + }, + "required": [ + "expression" + ], + "type": "object" + }, + "v1.CapacityRequestPolicy": { + "description": "CapacityRequestPolicy defines how requests consume device capacity.\n\nMust not set more than one ValidRequestValues.", + "properties": { + "default": { + "description": "Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity.", "type": "string" }, - "requests": { - "description": "Requests describes all resources that are needed from the driver.", + "validRange": { + "$ref": "#/definitions/v1.CapacityRequestPolicyRange", + "description": "ValidRange defines an acceptable quantity value range in consuming requests.\n\nIf this field is set, Default must be defined and it must fall within the defined ValidRange.\n\nIf the requested amount does not fall within the defined range, the request violates the policy, and this device cannot be allocated.\n\nIf the request doesn't contain this capacity entry, Default value is used." + }, + "validValues": { + "description": "ValidValues defines a set of acceptable quantity values in consuming requests.\n\nMust not contain more than 10 entries. Must be sorted in ascending order.\n\nIf this field is set, Default must be defined and it must be included in ValidValues list.\n\nIf the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) \u2208 validValues), where requestedValue \u2264 max(validValues).\n\nIf the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated.", "items": { - "$ref": "#/definitions/v1alpha2.ResourceRequest" + "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", + "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" + } + }, + "type": "object" + }, + "v1.CapacityRequestPolicyRange": { + "description": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\n - If the requested amount is less than Min, it is rounded up to the Min value.\n - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n it will be rounded up to the next value equal to Min + (n * Step).\n - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n and the device cannot be allocated.", + "properties": { + "max": { + "description": "Max defines the upper limit for capacity that can be requested.\n\nMax must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum.", + "type": "string" + }, + "min": { + "description": "Min specifies the minimum capacity allowed for a consumption request.\n\nMin must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum.", + "type": "string" }, - "vendorParameters": { - "description": "VendorParameters are arbitrary setup parameters for all requests of the claim. They are ignored while allocating the claim.", + "step": { + "description": "Step defines the step size between valid capacity amounts within the range.\n\nMax (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value.", + "type": "string" + } + }, + "required": [ + "min" + ], + "type": "object" + }, + "v1.CapacityRequirements": { + "description": "CapacityRequirements defines the capacity requirements for a specific device request.", + "properties": { + "requests": { + "additionalProperties": { + "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", + "type": "string" + }, + "description": "Requests represent individual device resource requests for distinct resources, all of which must be provided by the device.\n\nThis value is used as an additional filtering condition against the available capacity on the device. This is semantically equivalent to a CEL selector with `device.capacity[]..compareTo(quantity()) >= 0`. For example, device.capacity['test-driver.cdi.k8s.io'].counters.compareTo(quantity('2')) >= 0.\n\nWhen a requestPolicy is defined, the requested amount is adjusted upward to the nearest valid value based on the policy. If the requested amount cannot be adjusted to a valid value\u2014because it exceeds what the requestPolicy allows\u2014 the device is considered ineligible for allocation.\n\nFor any capacity that is not explicitly requested: - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity\n (i.e., the whole device is claimed).\n- If a requestPolicy is set, the default consumed capacity is determined according to that policy.\n\nIf the device allows multiple allocation, the aggregated amount across all requests must not exceed the capacity value. The consumed capacity, which may be adjusted based on the requestPolicy if defined, is recorded in the resource claim\u2019s status.devices[*].consumedCapacity field.", "type": "object" } }, "type": "object" }, - "v1alpha2.NamedResourcesAllocationResult": { - "description": "NamedResourcesAllocationResult is used in AllocationResultModel.", + "v1.Counter": { + "description": "Counter describes a quantity associated with a device.", + "properties": { + "value": { + "description": "Value defines how much of a certain device counter is available.", + "type": "string" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "v1.CounterSet": { + "description": "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.", "properties": { + "counters": { + "additionalProperties": { + "$ref": "#/definitions/v1.Counter" + }, + "description": "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nThe maximum number of counters in all sets is 32.", + "type": "object" + }, "name": { - "description": "Name is the name of the selected resource instance.", + "description": "Name defines the name of the counter set. It must be a DNS label.", "type": "string" } }, "required": [ - "name" + "name", + "counters" ], "type": "object" }, - "v1alpha2.NamedResourcesAttribute": { - "description": "NamedResourcesAttribute is a combination of an attribute name and its value.", + "v1.Device": { + "description": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.", "properties": { - "bool": { - "description": "BoolValue is a true/false value.", + "allNodes": { + "description": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", "type": "boolean" }, - "int": { - "description": "IntValue is a 64-bit integer.", - "format": "int64", - "type": "integer" + "allowMultipleAllocations": { + "description": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.", + "type": "boolean" + }, + "attributes": { + "additionalProperties": { + "$ref": "#/definitions/v1.DeviceAttribute" + }, + "description": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "type": "object" }, - "intSlice": { - "$ref": "#/definitions/v1alpha2.NamedResourcesIntSlice", - "description": "IntSliceValue is an array of 64-bit integers." + "bindingConditions": { + "description": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" }, - "name": { - "description": "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", - "type": "string" + "bindingFailureConditions": { + "description": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" }, - "quantity": { - "description": "QuantityValue is a quantity.", + "bindsToNode": { + "description": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "type": "boolean" + }, + "capacity": { + "additionalProperties": { + "$ref": "#/definitions/v1.DeviceCapacity" + }, + "description": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "type": "object" + }, + "consumesCounters": { + "description": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe total number of device counter consumption entries must be <= 32. In addition, the total number in the entire ResourceSlice must be <= 1024 (for example, 64 devices with 16 counters each).", + "items": { + "$ref": "#/definitions/v1.DeviceCounterConsumption" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "name": { + "description": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", "type": "string" }, - "string": { - "description": "StringValue is a string.", + "nodeName": { + "description": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", "type": "string" }, - "stringSlice": { - "$ref": "#/definitions/v1alpha2.NamedResourcesStringSlice", - "description": "StringSliceValue is an array of strings." + "nodeSelector": { + "$ref": "#/definitions/v1.NodeSelector", + "description": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set." }, - "version": { - "description": "VersionValue is a semantic version according to semver.org spec 2.0.0.", - "type": "string" + "taints": { + "description": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 4.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.", + "items": { + "$ref": "#/definitions/v1.DeviceTaint" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "required": [ @@ -15090,93 +15526,132 @@ ], "type": "object" }, - "v1alpha2.NamedResourcesFilter": { - "description": "NamedResourcesFilter is used in ResourceFilterModel.", + "v1.DeviceAllocationConfiguration": { + "description": "DeviceAllocationConfiguration gets embedded in an AllocationResult.", "properties": { - "selector": { - "description": "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type NamedResourcesin AttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", + "opaque": { + "$ref": "#/definitions/v1.OpaqueDeviceConfiguration", + "description": "Opaque provides driver-specific configuration parameters." + }, + "requests": { + "description": "Requests lists the names of requests where the configuration applies. If empty, its applies to all requests.\n\nReferences to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the configuration applies to all subrequests.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "source": { + "description": "Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim.", "type": "string" } }, "required": [ - "selector" + "source" ], "type": "object" }, - "v1alpha2.NamedResourcesInstance": { - "description": "NamedResourcesInstance represents one individual hardware instance that can be selected based on its attributes.", + "v1.DeviceAllocationResult": { + "description": "DeviceAllocationResult is the result of allocating devices.", "properties": { - "attributes": { - "description": "Attributes defines the attributes of this resource instance. The name of each attribute must be unique.", + "config": { + "description": "This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag.\n\nThis includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters.", "items": { - "$ref": "#/definitions/v1alpha2.NamedResourcesAttribute" + "$ref": "#/definitions/v1.DeviceAllocationConfiguration" }, "type": "array", "x-kubernetes-list-type": "atomic" }, - "name": { - "description": "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", - "type": "string" + "results": { + "description": "Results lists all allocated devices.", + "items": { + "$ref": "#/definitions/v1.DeviceRequestAllocationResult" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, - "required": [ - "name" - ], "type": "object" }, - "v1alpha2.NamedResourcesIntSlice": { - "description": "NamedResourcesIntSlice contains a slice of 64-bit integers.", + "v1.DeviceAttribute": { + "description": "DeviceAttribute must have exactly one field set.", "properties": { - "ints": { - "description": "Ints is the slice of 64-bit integers.", - "items": { - "format": "int64", - "type": "integer" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "bool": { + "description": "BoolValue is a true/false value.", + "type": "boolean" + }, + "int": { + "description": "IntValue is a number.", + "format": "int64", + "type": "integer" + }, + "string": { + "description": "StringValue is a string. Must not be longer than 64 characters.", + "type": "string" + }, + "version": { + "description": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.", + "type": "string" } }, - "required": [ - "ints" - ], "type": "object" }, - "v1alpha2.NamedResourcesRequest": { - "description": "NamedResourcesRequest is used in ResourceRequestModel.", + "v1.DeviceCapacity": { + "description": "DeviceCapacity describes a quantity associated with a device.", "properties": { - "selector": { - "description": "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type NamedResourcesin AttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", + "requestPolicy": { + "$ref": "#/definitions/v1.CapacityRequestPolicy", + "description": "RequestPolicy defines how this DeviceCapacity must be consumed when the device is allowed to be shared by multiple allocations.\n\nThe Device must have allowMultipleAllocations set to true in order to set a requestPolicy.\n\nIf unset, capacity requests are unconstrained: requests can consume any amount of capacity, as long as the total consumed across all allocations does not exceed the device's defined capacity. If request is also unset, default is the full capacity value." + }, + "value": { + "description": "Value defines how much of a certain capacity that device has.\n\nThis field reflects the fixed total capacity and does not change. The consumed amount is tracked separately by scheduler and does not affect this value.", "type": "string" } }, "required": [ - "selector" + "value" ], "type": "object" }, - "v1alpha2.NamedResourcesResources": { - "description": "NamedResourcesResources is used in ResourceModel.", + "v1.DeviceClaim": { + "description": "DeviceClaim defines how to request devices with a ResourceClaim.", "properties": { - "instances": { - "description": "The list of all individual resources instances currently available.", + "config": { + "description": "This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim.", + "items": { + "$ref": "#/definitions/v1.DeviceClaimConfiguration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "constraints": { + "description": "These constraints must be satisfied by the set of devices that get allocated for the claim.", + "items": { + "$ref": "#/definitions/v1.DeviceConstraint" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "requests": { + "description": "Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated.", "items": { - "$ref": "#/definitions/v1alpha2.NamedResourcesInstance" + "$ref": "#/definitions/v1.DeviceRequest" }, "type": "array", "x-kubernetes-list-type": "atomic" } }, - "required": [ - "instances" - ], "type": "object" }, - "v1alpha2.NamedResourcesStringSlice": { - "description": "NamedResourcesStringSlice contains a slice of strings.", + "v1.DeviceClaimConfiguration": { + "description": "DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.", "properties": { - "strings": { - "description": "Strings is the slice of strings.", + "opaque": { + "$ref": "#/definitions/v1.OpaqueDeviceConfiguration", + "description": "Opaque provides driver-specific configuration parameters." + }, + "requests": { + "description": "Requests lists the names of requests where the configuration applies. If empty, it applies to all requests.\n\nReferences to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the configuration applies to all subrequests.", "items": { "type": "string" }, @@ -15184,13 +15659,10 @@ "x-kubernetes-list-type": "atomic" } }, - "required": [ - "strings" - ], "type": "object" }, - "v1alpha2.PodSchedulingContext": { - "description": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "v1.DeviceClass": { + "description": "DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -15205,12 +15677,8 @@ "description": "Standard object metadata" }, "spec": { - "$ref": "#/definitions/v1alpha2.PodSchedulingContextSpec", - "description": "Spec describes where resources for the Pod are needed." - }, - "status": { - "$ref": "#/definitions/v1alpha2.PodSchedulingContextStatus", - "description": "Status describes where resources for the Pod can be allocated." + "$ref": "#/definitions/v1.DeviceClassSpec", + "description": "Spec defines what can be allocated and how to configure it.\n\nThis is mutable. Consumers have to be prepared for classes changing at any time, either because they get updated or replaced. Claim allocations are done once based on whatever was set in classes at the time of allocation.\n\nChanging the spec automatically increments the metadata.generation number." } }, "required": [ @@ -15220,22 +15688,32 @@ "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1" } ] }, - "v1alpha2.PodSchedulingContextList": { - "description": "PodSchedulingContextList is a collection of Pod scheduling objects.", + "v1.DeviceClassConfiguration": { + "description": "DeviceClassConfiguration is used in DeviceClass.", + "properties": { + "opaque": { + "$ref": "#/definitions/v1.OpaqueDeviceConfiguration", + "description": "Opaque provides driver-specific configuration parameters." + } + }, + "type": "object" + }, + "v1.DeviceClassList": { + "description": "DeviceClassList is a collection of classes.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { - "description": "Items is the list of PodSchedulingContext objects.", + "description": "Items is the list of resource classes.", "items": { - "$ref": "#/definitions/v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/v1.DeviceClass" }, "type": "array" }, @@ -15255,48 +15733,372 @@ "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "PodSchedulingContextList", - "version": "v1alpha2" + "kind": "DeviceClassList", + "version": "v1" } ] }, - "v1alpha2.PodSchedulingContextSpec": { - "description": "PodSchedulingContextSpec describes where resources for the Pod are needed.", + "v1.DeviceClassSpec": { + "description": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.", + "properties": { + "config": { + "description": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", + "items": { + "$ref": "#/definitions/v1.DeviceClassConfiguration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "extendedResourceName": { + "description": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is an alpha field.", + "type": "string" + }, + "selectors": { + "description": "Each selector must be satisfied by a device which is claimed via this class.", + "items": { + "$ref": "#/definitions/v1.DeviceSelector" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "type": "object" + }, + "v1.DeviceConstraint": { + "description": "DeviceConstraint must have exactly one field set besides Requests.", + "properties": { + "distinctAttribute": { + "description": "DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices.\n\nThis acts as the inverse of MatchAttribute.\n\nThis constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation.\n\nThis is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs.", + "type": "string" + }, + "matchAttribute": { + "description": "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nMust include the domain qualifier.", + "type": "string" + }, + "requests": { + "description": "Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim.\n\nReferences to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the constraint applies to all subrequests.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "type": "object" + }, + "v1.DeviceCounterConsumption": { + "description": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", + "properties": { + "counterSet": { + "description": "CounterSet is the name of the set from which the counters defined will be consumed.", + "type": "string" + }, + "counters": { + "additionalProperties": { + "$ref": "#/definitions/v1.Counter" + }, + "description": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number counters in a device is 32. In addition, the maximum number of all counters in all devices is 1024 (for example, 64 devices with 16 counters each).", + "type": "object" + } + }, + "required": [ + "counterSet", + "counters" + ], + "type": "object" + }, + "v1.DeviceRequest": { + "description": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices. With FirstAvailable it is also possible to provide a prioritized list of requests.", + "properties": { + "exactly": { + "$ref": "#/definitions/v1.ExactDeviceRequest", + "description": "Exactly specifies the details for a single request that must be met exactly for the request to be satisfied.\n\nOne of Exactly or FirstAvailable must be set." + }, + "firstAvailable": { + "description": "FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used.\n\nDRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later.", + "items": { + "$ref": "#/definitions/v1.DeviceSubRequest" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "name": { + "description": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nReferences using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler.\n\nMust be a DNS label.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "v1.DeviceRequestAllocationResult": { + "description": "DeviceRequestAllocationResult contains the allocation result for one request.", "properties": { - "potentialNodes": { - "description": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.", + "adminAccess": { + "description": "AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode.\n\nThis is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled.", + "type": "boolean" + }, + "bindingConditions": { + "description": "BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "bindingFailureConditions": { + "description": "BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, - "selectedNode": { - "description": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.", + "consumedCapacity": { + "additionalProperties": { + "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", + "type": "string" + }, + "description": "ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device\u2019s requestPolicy if applicable (i.e., may not be less than the requested amount).\n\nThe total consumed capacity for each device must not exceed the DeviceCapacity's Value.\n\nThis field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero.", + "type": "object" + }, + "device": { + "description": "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.", + "type": "string" + }, + "driver": { + "description": "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + "type": "string" + }, + "pool": { + "description": "This name together with the driver name and the device name field identify which device was allocated (`//`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.", + "type": "string" + }, + "request": { + "description": "Request is the name of the request in the claim which caused this device to be allocated. If it references a subrequest in the firstAvailable list on a DeviceRequest, this field must include both the name of the main request and the subrequest using the format
/.\n\nMultiple devices may have been allocated per request.", + "type": "string" + }, + "shareID": { + "description": "ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device.", "type": "string" + }, + "tolerations": { + "description": "A copy of all tolerations specified in the request at the time when the device got allocated.\n\nThe maximum number of tolerations is 16.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.", + "items": { + "$ref": "#/definitions/v1.DeviceToleration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, + "required": [ + "request", + "driver", + "pool", + "device" + ], "type": "object" }, - "v1alpha2.PodSchedulingContextStatus": { - "description": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", + "v1.DeviceSelector": { + "description": "DeviceSelector must have exactly one field set.", "properties": { - "resourceClaims": { - "description": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", + "cel": { + "$ref": "#/definitions/v1.CELDeviceSelector", + "description": "CEL contains a CEL expression for selecting a device." + } + }, + "type": "object" + }, + "v1.DeviceSubRequest": { + "description": "DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nDeviceSubRequest is similar to ExactDeviceRequest, but doesn't expose the AdminAccess field as that one is only supported when requesting a specific device.", + "properties": { + "allocationMode": { + "description": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "type": "string" + }, + "capacity": { + "$ref": "#/definitions/v1.CapacityRequirements", + "description": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request." + }, + "count": { + "description": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", + "format": "int64", + "type": "integer" + }, + "deviceClassName": { + "description": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "type": "string" + }, + "name": { + "description": "Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/.\n\nMust be a DNS label.", + "type": "string" + }, + "selectors": { + "description": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.", "items": { - "$ref": "#/definitions/v1alpha2.ResourceClaimSchedulingStatus" + "$ref": "#/definitions/v1.DeviceSelector" }, "type": "array", - "x-kubernetes-list-map-keys": [ - "name" - ], - "x-kubernetes-list-type": "map" + "x-kubernetes-list-type": "atomic" + }, + "tolerations": { + "description": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.", + "items": { + "$ref": "#/definitions/v1.DeviceToleration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "required": [ + "name", + "deviceClassName" + ], + "type": "object" + }, + "v1.DeviceTaint": { + "description": "The device this taint is attached to has the \"effect\" on any claim which does not tolerate the taint and, through the claim, to pods using the claim.", + "properties": { + "effect": { + "description": "The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here.", + "type": "string" + }, + "key": { + "description": "The taint key to be applied to a device. Must be a label name.", + "type": "string" + }, + "timeAdded": { + "description": "TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set.", + "format": "date-time", + "type": "string" + }, + "value": { + "description": "The taint value corresponding to the taint key. Must be a label value.", + "type": "string" + } + }, + "required": [ + "key", + "effect" + ], + "type": "object" + }, + "v1.DeviceToleration": { + "description": "The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches the triple using the matching operator .", + "properties": { + "effect": { + "description": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule and NoExecute.", + "type": "string" + }, + "key": { + "description": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name.", + "type": "string" + }, + "operator": { + "description": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a ResourceClaim can tolerate all taints of a particular category.", + "type": "string" + }, + "tolerationSeconds": { + "description": "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. If larger than zero, the time when the pod needs to be evicted is calculated as